diff --git a/Build/AtlasCMake/modules/scripts/setup.sh.in b/Build/AtlasCMake/modules/scripts/setup.sh.in index 7ad0e1eaa9fbe56de081d7018a08ea230be739db..7eacdaa29eb39a917afe46ebb2b895cc6bd87ba8 100644 --- a/Build/AtlasCMake/modules/scripts/setup.sh.in +++ b/Build/AtlasCMake/modules/scripts/setup.sh.in @@ -1,4 +1,4 @@ -# $Id: setup.sh.in 769400 2016-08-23 08:33:18Z krasznaa $ +# $Id: setup.sh.in 791444 2017-01-06 14:17:10Z krasznaa $ # # Script providing a functional build and runtime environment for project # @CMAKE_PROJECT_NAME@ when sourced from either BASH or ZSH. @@ -38,20 +38,12 @@ remove_duplicates() { while [ -n "${temp}" ]; do # Take the first element of the remaining list: x=${temp%%:*} - # Only consider it if it's an existing directory: - if [ -d $x ] && [ -r $x ] && [ -x $x ] && [ "$x" != "" ]; then - # Get the absolute path name: - x=`cd $x; pwd` - # Get the current value of the environment variable: - eval "envval=\$$envname" - # Decide whether to add it to the environment or not: - case ${envval}: in - *:"$x":*) ;; - *) eval "${envname}=${envval}:$x";; - esac - fi - # Or if it begins with "http"... - if [[ $x == http* ]]; then + # Check that it's not an empty string: + if [ "$x" != "" ]; then + # If it's an existing directory, get its absolute path: + if [ -d $x ] && [ -r $x ] && [ -x $x ]; then + x=`cd $x; pwd` + fi # Get the current value of the environment variable: eval "envval=\$$envname" # Decide whether to add it to the environment or not: @@ -150,116 +142,68 @@ if [ "x${ENV_VAR_VALUE}" = "x" ]; then else export CMAKE_PREFIX_PATH=${@CMAKE_PROJECT_NAME@_DIR}:${CMAKE_PREFIX_PATH}: fi - if [ -d ${@CMAKE_PROJECT_NAME@_DIR}/bin ] || \ - [ -d ${@CMAKE_PROJECT_NAME@_DIR}/share ]; then - if [ -d ${@CMAKE_PROJECT_NAME@_DIR}/bin ]; then - if [ -z "${PATH}" ]; then - export PATH=${@CMAKE_PROJECT_NAME@_DIR}/bin: - else - export PATH=${@CMAKE_PROJECT_NAME@_DIR}/bin:${PATH}: - fi - fi - if [ -d ${@CMAKE_PROJECT_NAME@_DIR}/share ]; then - if [ -z "${PATH}" ]; then - export PATH=${@CMAKE_PROJECT_NAME@_DIR}/share: - else - export PATH=${@CMAKE_PROJECT_NAME@_DIR}/share:${PATH}: - fi - fi - else - export PATH=${PATH}: - fi - if [ -d ${@CMAKE_PROJECT_NAME@_DIR}/lib ]; then - if [ -z "${LD_LIBRARY_PATH}" ]; then - export LD_LIBRARY_PATH=${@CMAKE_PROJECT_NAME@_DIR}/lib: - else - export LD_LIBRARY_PATH=${@CMAKE_PROJECT_NAME@_DIR}/lib:${LD_LIBRARY_PATH}: - fi - if [ -z "${DYLD_LIBRARY_PATH}" ]; then - export DYLD_LIBRARY_PATH=${@CMAKE_PROJECT_NAME@_DIR}/lib: - else - export DYLD_LIBRARY_PATH=${@CMAKE_PROJECT_NAME@_DIR}/lib:${DYLD_LIBRARY_PATH}: - fi - if [ -z "${PYTHONPATH}" ]; then - export PYTHONPATH=${@CMAKE_PROJECT_NAME@_DIR}/lib: - else - export PYTHONPATH=${@CMAKE_PROJECT_NAME@_DIR}/lib:${PYTHONPATH}: - fi + + # Set up the binary path(s): + if [ -z "${PATH}" ]; then + export PATH=${@CMAKE_PROJECT_NAME@_DIR}/bin: else - export LD_LIBRARY_PATH=${LD_LIBRARY_PATH}: - export DYLD_LIBRARY_PATH=${DYLD_LIBRARY_PATH}: + export PATH=${@CMAKE_PROJECT_NAME@_DIR}/bin:${PATH}: fi - if [ -d ${@CMAKE_PROJECT_NAME@_DIR}/python ]; then - if [ -z "${PYTHONPATH}" ]; then - export PYTHONPATH=${@CMAKE_PROJECT_NAME@_DIR}/python: - else - export PYTHONPATH=${@CMAKE_PROJECT_NAME@_DIR}/python:${PYTHONPATH}: - fi + export PATH=${@CMAKE_PROJECT_NAME@_DIR}/share:${PATH}: + + # Set up the library path(s): + if [ -z "${LD_LIBRARY_PATH}" ]; then + export LD_LIBRARY_PATH=${@CMAKE_PROJECT_NAME@_DIR}/lib: else - export PYTHONPATH=${PYTHONPATH}: + export LD_LIBRARY_PATH=${@CMAKE_PROJECT_NAME@_DIR}/lib:${LD_LIBRARY_PATH}: fi - if [ -d ${@CMAKE_PROJECT_NAME@_DIR}/jobOptions ]; then - if [ -z "${JOBOPTSEARCHPATH}" ]; then - export JOBOPTSEARCHPATH=${@CMAKE_PROJECT_NAME@_DIR}/jobOptions: - else - export JOBOPTSEARCHPATH=${@CMAKE_PROJECT_NAME@_DIR}/jobOptions:${JOBOPTSEARCHPATH}: - fi + if [ -z "${DYLD_LIBRARY_PATH}" ]; then + export DYLD_LIBRARY_PATH=${@CMAKE_PROJECT_NAME@_DIR}/lib: else - export JOBOPTSEARCHPATH=${JOBOPTSEARCHPATH}: + export DYLD_LIBRARY_PATH=${@CMAKE_PROJECT_NAME@_DIR}/lib:${DYLD_LIBRARY_PATH}: fi - if [ -d ${@CMAKE_PROJECT_NAME@_DIR}/share ]; then - if [ -z "${DATAPATH}" ]; then - export DATAPATH=${@CMAKE_PROJECT_NAME@_DIR}/share: - else - export DATAPATH=${@CMAKE_PROJECT_NAME@_DIR}/share:${DATAPATH}: - fi + + # Set up the python path(s): + if [ -z "${PYTHONPATH}" ]; then + export PYTHONPATH=${@CMAKE_PROJECT_NAME@_DIR}/lib: else - export DATAPATH=${DATAPATH}: + export PYTHONPATH=${@CMAKE_PROJECT_NAME@_DIR}/lib:${PYTHONPATH}: fi - if [ -d ${@CMAKE_PROJECT_NAME@_DIR}/share ]; then - if [ -z "${CALIBPATH}" ]; then - export CALIBPATH=${@CMAKE_PROJECT_NAME@_DIR}/share: - else - export CALIBPATH=${@CMAKE_PROJECT_NAME@_DIR}/share:${CALIBPATH}: - fi + export PYTHONPATH=${@CMAKE_PROJECT_NAME@_DIR}/python:${PYTHONPATH}: + + # Set up the jobOptions path: + if [ -z "${JOBOPTSEARCHPATH}" ]; then + export JOBOPTSEARCHPATH=${@CMAKE_PROJECT_NAME@_DIR}/jobOptions: else - export CALIBPATH=${CALIBPATH}: + export JOBOPTSEARCHPATH=${@CMAKE_PROJECT_NAME@_DIR}/jobOptions:${JOBOPTSEARCHPATH}: fi - if [ -d ${@CMAKE_PROJECT_NAME@_DIR}/data ]; then - if [ -z "${DATAPATH}" ]; then - export DATAPATH=${@CMAKE_PROJECT_NAME@_DIR}/data: - else - export DATAPATH=${@CMAKE_PROJECT_NAME@_DIR}/data:${DATAPATH}: - fi + + # Set up the data path(s): + if [ -z "${DATAPATH}" ]; then + export DATAPATH=${@CMAKE_PROJECT_NAME@_DIR}/share: else - export DATAPATH=${DATAPATH}: + export DATAPATH=${@CMAKE_PROJECT_NAME@_DIR}/share:${DATAPATH}: fi - if [ -d ${@CMAKE_PROJECT_NAME@_DIR}/data ]; then - if [ -z "${CALIBPATH}" ]; then - export CALIBPATH=${@CMAKE_PROJECT_NAME@_DIR}/data: - else - export CALIBPATH=${@CMAKE_PROJECT_NAME@_DIR}/data:${CALIBPATH}: - fi + export DATAPATH=${@CMAKE_PROJECT_NAME@_DIR}/data:${DATAPATH}: + if [ -z "${CALIBPATH}" ]; then + export CALIBPATH=${@CMAKE_PROJECT_NAME@_DIR}/share: else - export CALIBPATH=${CALIBPATH}: + export CALIBPATH=${@CMAKE_PROJECT_NAME@_DIR}/share:${CALIBPATH}: fi - if [ -d ${@CMAKE_PROJECT_NAME@_DIR}/include ]; then - if [ -z "${ROOT_INCLUDE_PATH}" ]; then - export ROOT_INCLUDE_PATH=${@CMAKE_PROJECT_NAME@_DIR}/include: - else - export ROOT_INCLUDE_PATH=${@CMAKE_PROJECT_NAME@_DIR}/include:${ROOT_INCLUDE_PATH}: - fi + export CALIBPATH=${@CMAKE_PROJECT_NAME@_DIR}/data:${CALIBPATH}: + + # Set up the include path: + if [ -z "${ROOT_INCLUDE_PATH}" ]; then + export ROOT_INCLUDE_PATH=${@CMAKE_PROJECT_NAME@_DIR}/include: else - export ROOT_INCLUDE_PATH=${ROOT_INCLUDE_PATH}: + export ROOT_INCLUDE_PATH=${@CMAKE_PROJECT_NAME@_DIR}/include:${ROOT_INCLUDE_PATH}: fi - if [ -d ${@CMAKE_PROJECT_NAME@_DIR}/XML ]; then - if [ -z "${XMLPATH}" ]; then - export XMLPATH=${@CMAKE_PROJECT_NAME@_DIR}/XML: - else - export XMLPATH=${@CMAKE_PROJECT_NAME@_DIR}/XML:${XMLPATH}: - fi + + # Set up the XML path: + if [ -z "${XMLPATH}" ]; then + export XMLPATH=${@CMAKE_PROJECT_NAME@_DIR}/XML: else - export XMLPATH=${XMLPATH}: + export XMLPATH=${@CMAKE_PROJECT_NAME@_DIR}/XML:${XMLPATH}: fi # We can already not be in external-only mode. But the rest should only diff --git a/Control/AthContainers/Root/normalizedTypeinfoName.cxx b/Control/AthContainers/Root/normalizedTypeinfoName.cxx index 2e505189955ef4f59e4ab89be1e06cbc5336f1f4..b52ddc54e5ce975fad11096853f49851f3b41bbe 100644 --- a/Control/AthContainers/Root/normalizedTypeinfoName.cxx +++ b/Control/AthContainers/Root/normalizedTypeinfoName.cxx @@ -90,6 +90,9 @@ void initRules (CxxUtils::ClassName::Rules& rules) rules.add ("DataVector<$T, $U>", "DataVector<$T>"); rules.add ("DataList<$T, $U>", "DataList<$T>"); + // Handle gcc's C++11 ABI. + rules.add ("std::__cxx11", "std"); + // Needed for macos? rules.add ("std::__1", "std"); } diff --git a/Control/AthContainers/test/normalizedTypeinfoName_test.cxx b/Control/AthContainers/test/normalizedTypeinfoName_test.cxx index ecff8005e5c2d4312a5085d8e7b3b51a1ae31a3b..d862c563ed18a344125fc53bea60387077f306e3 100644 --- a/Control/AthContainers/test/normalizedTypeinfoName_test.cxx +++ b/Control/AthContainers/test/normalizedTypeinfoName_test.cxx @@ -32,6 +32,9 @@ void test1() const std::type_info& ti3 = typeid (std::map<int, float>); assert (SG::normalizedTypeinfoName (ti3) == "std::map<int,float>"); + + const std::type_info& ti4 = typeid (std::vector<std::string>); + assert (SG::normalizedTypeinfoName (ti4) == "std::vector<std::string>"); } diff --git a/Control/AthenaCommon/python/AppMgr.py b/Control/AthenaCommon/python/AppMgr.py index 167b2cf4ffa05c828a35d77899844a533ec3cac7..420e9e9562e9e4e447bfac4df83910d522295433 100755 --- a/Control/AthenaCommon/python/AppMgr.py +++ b/Control/AthenaCommon/python/AppMgr.py @@ -38,11 +38,6 @@ def release_metadata(): """ import ConfigParser import os - release_data = None - for d in os.environ['LD_LIBRARY_PATH'].split(os.pathsep): - release_data = os.path.join(d, '..', 'ReleaseData') - if os.path.exists(release_data): - break d = { 'project name': '?', 'release': '?', @@ -52,14 +47,22 @@ def release_metadata(): 'date': '?', 'platform': os.getenv('CMTCONFIG', '?'), } - if release_data: - cfg = ConfigParser.SafeConfigParser() - try: - cfg.read( release_data ) - if cfg.has_section( 'release_metadata' ): - d.update( dict( cfg.items( 'release_metadata' ) ) ) - except Exception: - pass + + for ld_path in os.environ['LD_LIBRARY_PATH'].split(os.pathsep): + release_data = os.path.join(ld_path, '..', 'ReleaseData') + if os.path.exists(release_data): + d1=d + cfg = ConfigParser.SafeConfigParser() + try: + cfg.read( release_data ) + if cfg.has_section( 'release_metadata' ): + d1.update( dict( cfg.items( 'release_metadata' ) ) ) + release = d1['release'].split('.') + base_release = d1['base release'].split('.') + if len(release)>=3 or len(base_release)>=3: + return d1 + except Exception: + pass return d ### associator for public tools ---------------------------------------------- diff --git a/Control/AthenaCommon/python/JobProperties.py b/Control/AthenaCommon/python/JobProperties.py index e82630d66f7f131f8b53a22ccbea29c82e114df4..ddda7f7aadb8151b0fbff566c40cfa436e95c97b 100755 --- a/Control/AthenaCommon/python/JobProperties.py +++ b/Control/AthenaCommon/python/JobProperties.py @@ -476,10 +476,16 @@ class JobPropertyContainer (object): elif(self.__dict__.__contains__(name)): pass else: - raise AttributeError( - "JobPropertyContainer:: %s does not have property %s" % - (self._context_name, name) - ) + errString="JobPropertyContainer:: %s does not have property %s" % (self._context_name, name) + try: + from difflib import get_close_matches + closestMatch=get_close_matches(name,self.__dict__.keys(),1) + if len(closestMatch)>0: + errString+=". Did you mean \'%s\'?" % closestMatch[0] + except: + pass #No execption from here + + raise AttributeError(errString) try: protected=hasattr(self.__dict__[name],'_context_name') except: @@ -490,12 +496,8 @@ class JobPropertyContainer (object): property_obj=self.__dict__.get(name) property_obj.StoredValue=n_value property_obj.statusOn=True - # NOT - #def __getattribute__(self,name): - # obj_JobProperty=object.__getattribute__(self,name) - # if isinstance(obj_JobProperty,JobProperty): - # return obj_JobProperty.__getattribute__('StoredValue') - # return obj_JobProperty + + def __str__(self): if self._context_name.count('.')==0: @@ -736,6 +738,20 @@ class JobPropertyContainer (object): else: raise ValueError('The received data is has not the expected' 'type/format') + + def __getattribute__(self,name): + try: + return object.__getattribute__(self, name) + except AttributeError: + + errString="JobPropertyContainer:: %s does not have property %s" % (object.__getattribute__(self,'_context_name'), name) + allattrs=object.__getattribute__(self,'__dict__').keys() + from difflib import get_close_matches + closestMatch=get_close_matches(name,allattrs,1) + if len(closestMatch)>0: + errString+=". Did you mean \'%s\'?" % closestMatch[0] + raise AttributeError(errString) + pass #======================================================================= diff --git a/Control/AthenaMP/src/memory-monitor/MemoryMonitor.cxx b/Control/AthenaMP/src/memory-monitor/MemoryMonitor.cxx index 5e93bd9e89a8837197ebed3c018fb4d5133a372b..59e1fefe9a7d9cea7ecb4955d6761f9db59b7fa5 100644 --- a/Control/AthenaMP/src/memory-monitor/MemoryMonitor.cxx +++ b/Control/AthenaMP/src/memory-monitor/MemoryMonitor.cxx @@ -10,13 +10,13 @@ using namespace rapidjson; -int ReadProcs(pid_t mother_pid, unsigned long values[8], bool verbose){ +int ReadProcs(pid_t mother_pid, unsigned long long values[8], bool verbose){ //Get child process IDs std::vector<pid_t> cpids; - char smaps_buffer[32]; - char io_buffer[32]; - snprintf(smaps_buffer,32,"pstree -A -p %ld | tr \\- \\\\n",(long)mother_pid); + char smaps_buffer[64]; + char io_buffer[64]; + snprintf(smaps_buffer,64,"pstree -A -p %ld | tr \\- \\\\n",(long)mother_pid); FILE* pipe = popen(smaps_buffer, "r"); if (pipe==0) { if (verbose) @@ -41,45 +41,45 @@ int ReadProcs(pid_t mother_pid, unsigned long values[8], bool verbose){ cpids.push_back(pt);} } } pclose(pipe); - long tsize(0); - long trss(0); - long tpss(0); - long tswap(0); + long long tsize(0); + long long trss(0); + long long tpss(0); + long long tswap(0); - long trchar(0); - long twchar(0); - long trbyte(0); - long twbyte(0); + long long trchar(0); + long long twchar(0); + long long trbyte(0); + long long twbyte(0); std::vector<std::string> openFails; for(std::vector<pid_t>::const_iterator it=cpids.begin(); it!=cpids.end(); ++it) { - snprintf(smaps_buffer,32,"/proc/%ld/smaps",(long)*it); + snprintf(smaps_buffer,64,"/proc/%ld/smaps",(long)*it); FILE *file = fopen(smaps_buffer,"r"); if(file==0) { openFails.push_back(std::string(smaps_buffer));} else { while(fgets(buffer,256,file)) { - if(sscanf(buffer,"Size: %80ld kB",&tsize)==1) values[0]+=tsize; - if(sscanf(buffer,"Pss: %80ld kB", &tpss)==1) values[1]+=tpss; - if(sscanf(buffer,"Rss: %80ld kB", &trss)==1) values[2]+=trss; - if(sscanf(buffer,"Swap: %80ld kB",&tswap)==1) values[3]+=tswap; } + if(sscanf(buffer,"Size: %80lld kB",&tsize)==1) values[0]+=tsize; + if(sscanf(buffer,"Pss: %80lld kB", &tpss)==1) values[1]+=tpss; + if(sscanf(buffer,"Rss: %80lld kB", &trss)==1) values[2]+=trss; + if(sscanf(buffer,"Swap: %80lld kB",&tswap)==1) values[3]+=tswap; } fclose(file); } - snprintf(io_buffer,32,"/proc/%ld/io",(long)*it); + snprintf(io_buffer,64,"/proc/%ld/io",(long)*it); FILE *file2 = fopen(io_buffer,"r"); if(file2==0) { openFails.push_back(std::string(io_buffer));} else { while(fgets(buffer,256,file2)) { - if(sscanf(buffer, "rchar: %80ld kB", &trchar)==1) values[4]+=trchar; - if(sscanf(buffer, "wchar: %80ld kB", &twchar)==1) values[5]+=twchar; - if(sscanf(buffer, "read_bytes: %80ld kB", &trbyte)==1) values[6]+=trbyte; - if(sscanf(buffer,"write_bytes: %80ld kB", &twbyte)==1) values[7]+=twbyte; } + if(sscanf(buffer, "rchar: %80lld", &trchar)==1) values[4]+=trchar; + if(sscanf(buffer, "wchar: %80lld", &twchar)==1) values[5]+=twchar; + if(sscanf(buffer, "read_bytes: %80lld", &trbyte)==1) values[6]+=trbyte; + if(sscanf(buffer,"write_bytes: %80lld", &twbyte)==1) values[7]+=twbyte; } fclose(file); } @@ -101,10 +101,11 @@ int MemoryMonitor(pid_t mpid, char* filename, char* jsonSummary, unsigned int in signal(SIGUSR1, SignalCallbackHandler); - unsigned long values[8] = {0,0,0,0,0,0,0,0}; - unsigned long maxValues[8] = {0,0,0,0,0,0,0,0}; - unsigned long avgValues[8] = {0,0,0,0,0,0,0,0}; - unsigned long oldValues[8] = {0,0,0,0,0,0,0,0}; + unsigned long long values[8] = {0,0,0,0,0,0,0,0}; + unsigned long long maxValues[8] = {0,0,0,0,0,0,0,0}; + unsigned long long avgValues[8] = {0,0,0,0,0,0,0,0}; + unsigned long long oldValues[8] = {0,0,0,0,0,0,0,0}; + int iteration = 0; time_t lastIteration = time(0) - interval; time_t currentTime; @@ -146,10 +147,10 @@ int MemoryMonitor(pid_t mpid, char* filename, char* jsonSummary, unsigned int in << values[1] << "\t" << values[2] << "\t" << values[3] << "\t" - << (int) (values[4] - oldValues[4]) << "\t" - << (int) (values[5] - oldValues[5]) << "\t" - << (int) (values[6] - oldValues[6]) << "\t" - << (int) (values[7] - oldValues[7]) << std::endl; + << (long long) (values[4] - oldValues[4]) << "\t" + << (long long) (values[5] - oldValues[5]) << "\t" + << (long long) (values[6] - oldValues[6]) << "\t" + << (long long) (values[7] - oldValues[7]) << std::endl; // Compute statistics for(int i=0;i<4;i++){ @@ -161,7 +162,7 @@ int MemoryMonitor(pid_t mpid, char* filename, char* jsonSummary, unsigned int in for(int i=4;i<8;i++){ - avgValues[i] = avgValues[i] + (int) (values[i] - oldValues[i]) / ((float) interval) ; + avgValues[i] = avgValues[i] + (long long) (values[i] - oldValues[i]) / (interval) ; if (values[i] > maxValues[i]) maxValues[i] = values[i]; // values[i] = 0; @@ -188,8 +189,8 @@ int MemoryMonitor(pid_t mpid, char* filename, char* jsonSummary, unsigned int in ++i.first, ++i.second){ if (tmp < 8) { - i.first->value.SetUint(maxValues[tmp]); - i.second->value.SetUint(avgValues[tmp]/iteration); + i.first->value.SetUint64(maxValues[tmp]); + i.second->value.SetUint64(avgValues[tmp]/iteration); } tmp += 1; diff --git a/Control/AthenaMP/src/memory-monitor/MemoryMonitor.h b/Control/AthenaMP/src/memory-monitor/MemoryMonitor.h index 2d653f81fa4d4f47af5c076e63d654b2a6bbac04..c521530fa177c2bd6dceffe12f7fc0d22a0f2ca4 100644 --- a/Control/AthenaMP/src/memory-monitor/MemoryMonitor.h +++ b/Control/AthenaMP/src/memory-monitor/MemoryMonitor.h @@ -19,7 +19,7 @@ #include <thread> #include <sstream> -int ReadProcs(pid_t mother_pid, unsigned long values[8], bool verbose=false); +int ReadProcs(pid_t mother_pid, unsigned long long values[8], bool verbose=false); int MemoryMonitor(pid_t mpid, char* filename=NULL, char* jsonSummary=NULL, unsigned int interval=600); diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py index 41a65303e69c923171fa669a9613b624e572778c..dbbaa82341541e9afa70ebdcdde93475f00f1a97 100755 --- a/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py +++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/InDetGM.py @@ -56,8 +56,8 @@ elif ( DetFlags.detdescr.ID_on() ): else: from SCT_SLHC_GeoModel.SCT_SLHC_GeoModelConf import SCT_SLHC_DetectorTool sctSLHCTool = SCT_SLHC_DetectorTool() + sctSLHCTool.ServiceBuilderTool = InDetServMatBuilderToolSLHC GeoModelSvc.DetectorTools += [ sctSLHCTool ] - sctSLHCTool.ServiceBuilderTool = InDetServMatBuilderToolSLHC if not hasattr(svcMgr,'SCTLorentzAngleSvc'): from SiLorentzAngleSvc.SiLorentzAngleSvcConf import SiLorentzAngleSvc SCTLorentzAngleSvc = SiLorentzAngleSvc(name = "SCTLorentzAngleSvc", diff --git a/DetectorDescription/GeoModel/AtlasGeoModel/python/SetGeometryVersion.py b/DetectorDescription/GeoModel/AtlasGeoModel/python/SetGeometryVersion.py index 88c751e24b35def351c84735b9d0619211fd5274..4197881b70ba3629f06691933aae60636700f61a 100755 --- a/DetectorDescription/GeoModel/AtlasGeoModel/python/SetGeometryVersion.py +++ b/DetectorDescription/GeoModel/AtlasGeoModel/python/SetGeometryVersion.py @@ -50,9 +50,10 @@ else: # Set the SupportedGeometry flag from AthenaCommon.AppMgr import release_metadata -relversion = release_metadata()['release'].split('.') +rel_metadata = release_metadata() +relversion = rel_metadata['release'].split('.') if len(relversion) < 3: - relversion = release_metadata()['base release'].split('.') + relversion = rel_metadata['base release'].split('.') print "SetGeometryVersion.py obtained major release version %s" % relversion[0] GeoModelSvc.SupportedGeometry = int(relversion[0]) diff --git a/Event/xAOD/xAODJet/CMakeLists.txt b/Event/xAOD/xAODJet/CMakeLists.txt index b1c327e456340357e234ba4d2f3a3f076bebebf8..675b79b2247a611bb615d7360e9f758d44227322 100644 --- a/Event/xAOD/xAODJet/CMakeLists.txt +++ b/Event/xAOD/xAODJet/CMakeLists.txt @@ -1,4 +1,4 @@ -# $Id: CMakeLists.txt 749875 2016-05-26 13:40:34Z krasznaa $ +# $Id: CMakeLists.txt 774256 2016-09-21 08:28:51Z jchapman $ ################################################################################ # Package: xAODJet ################################################################################ @@ -6,10 +6,21 @@ # Declare the package name: atlas_subdir( xAODJet ) +# Optional dependencies: +set( extra_deps ) +set( extra_libs ) +set( extra_private_deps ) +set( extra_test_libs ) + # Extra dependencies, when we are not in a standalone build: if( NOT XAOD_STANDALONE ) - set( extra_deps Control/SGTools ) - set( extra_libs SGTools ) + set( extra_private_deps Control/SGTools ) + set( extra_test_libs SGTools ) +endif() + +if( NOT SIMULATIONBASE ) + set( extra_deps Event/xAOD/xAODBTagging Event/xAOD/xAODTrigger Event/xAOD/xAODPFlow) + set( extra_libs xAODBTagging xAODPFlow xAODTrigger ) endif() # Declare the package's dependencies: @@ -17,15 +28,13 @@ atlas_depends_on_subdirs( PUBLIC Control/AthContainers Control/AthLinks - Event/xAOD/xAODBTagging Event/xAOD/xAODBase Event/xAOD/xAODCore - Event/xAOD/xAODPFlow - Event/xAOD/xAODTrigger + ${extra_deps} PRIVATE Control/CxxUtils Event/xAOD/xAODCaloEvent - ${extra_deps} ) + ${extra_private_deps} ) # External dependencies: find_package( ROOT COMPONENTS Core GenVector ) @@ -36,8 +45,8 @@ atlas_add_library( xAODJet Root/*.cxx PUBLIC_HEADERS xAODJet INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers AthLinks xAODBTagging - xAODBase xAODCore xAODPFlow xAODTrigger + LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers AthLinks + xAODBase xAODCore ${extra_libs} PRIVATE_LINK_LIBRARIES CxxUtils xAODCaloEvent ) atlas_add_dictionary( xAODJetDict @@ -49,4 +58,4 @@ atlas_add_dictionary( xAODJetDict # Test(s) in the package: atlas_add_test( xAODJet_Jet_test SOURCES test/xAODJet_Jet_test.cxx - LINK_LIBRARIES xAODCore xAODCaloEvent xAODJet CxxUtils ${extra_libs} ) + LINK_LIBRARIES xAODCore xAODCaloEvent xAODJet CxxUtils ${extra_test_libs} ) diff --git a/Event/xAOD/xAODJet/Root/JetConstituentVector.cxx b/Event/xAOD/xAODJet/Root/JetConstituentVector.cxx index a5f454b972c3b10e5ac0645820c98e0624d477b0..1da848710eec8189b6549739a341f8b547f5c791 100644 --- a/Event/xAOD/xAODJet/Root/JetConstituentVector.cxx +++ b/Event/xAOD/xAODJet/Root/JetConstituentVector.cxx @@ -44,8 +44,8 @@ namespace xAOD { cl->rawEta(), cl->rawPhi(), cl->rawM() ); - return; } + return; } #ifndef SIMULATIONBASE case Type::ParticleFlow: { diff --git a/Event/xAOD/xAODJet/Root/Jet_v1.cxx b/Event/xAOD/xAODJet/Root/Jet_v1.cxx index 0a886fe2cd5da183ef4db5708365cadb542c581a..a0aa6bc7d44ad3dda59d4ceebd1aca093d04881d 100644 --- a/Event/xAOD/xAODJet/Root/Jet_v1.cxx +++ b/Event/xAOD/xAODJet/Root/Jet_v1.cxx @@ -375,28 +375,29 @@ namespace xAOD { } #endif //SIMULATIONBASE - void Jet_v1::toPersistent() { - - if( constituentAcc.isAvailableWritable( *this ) ) { - std::vector< ElementLink< IParticleContainer > >::iterator itr = - constituentAcc( *this ).begin(); - std::vector< ElementLink< IParticleContainer > >::iterator end = - constituentAcc( *this ).end(); - for( ; itr != end; ++itr ) { - itr->toPersistent(); - } - } - -#ifndef SIMULATIONBASE - // On a new object we could only create a link with the new name, so: - if( btagAcc2.isAvailableWritable( *this ) ) { - btagAcc2( *this ).toPersistent(); - } -#endif //SIMULATIONBASE +// void Jet_v1::toPersistent() { +// No longer needed, as this is done by the POOL converter for the aux container + +// if( constituentAcc.isAvailableWritable( *this ) ) { +// std::vector< ElementLink< IParticleContainer > >::iterator itr = +// constituentAcc( *this ).begin(); +// std::vector< ElementLink< IParticleContainer > >::iterator end = +// constituentAcc( *this ).end(); +// for( ; itr != end; ++itr ) { +// itr->toPersistent(); +// } +// } + +// #ifndef SIMULATIONBASE +// // On a new object we could only create a link with the new name, so: +// if( btagAcc2.isAvailableWritable( *this ) ) { +// btagAcc2( *this ).toPersistent(); +// } +// #endif //SIMULATIONBASE - return; - } +// return; +// } } // namespace xAOD diff --git a/Event/xAOD/xAODJet/doc/mainpage.h b/Event/xAOD/xAODJet/doc/mainpage.h deleted file mode 100644 index 8c36b95c889b83c235195102841fe00743404c24..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODJet/doc/mainpage.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - @mainpage xAODJet package - - @author Pierre-Antoine Delsart <delsart@in2p3.fr> - @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> - - $Revision: 561982 $ - $Date: 2013-09-18 09:54:10 +0200 (Wed, 18 Sep 2013) $ - - @section xAODJetOverivew Overview - - This package holds the EDM classes describing the output of ATLAS's - jet reconstruction. - - @section xAODJetClasses Main Classes - - The main class(es) of the package are the following: - - xAOD::Jet: Typedef to the latest <code>Jet_vX</code> class - version. - - xAOD::JetContainer: Typedef to the latest jet container - version. - - xAOD::Jet_v1: The current latest jet implementation. - - @htmlinclude used_packages.html - - @include requirements -*/ diff --git a/Event/xAOD/xAODJet/test/TestStore.icc b/Event/xAOD/xAODJet/test/TestStore.icc deleted file mode 100644 index 99b996d81f732904651fdd1a1a32d0f2c377dc74..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODJet/test/TestStore.icc +++ /dev/null @@ -1,178 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - * @file TestStore.icc - * @author scott snyder <snyder@bnl.gov> - * @date Dec, 2013 - * @brief Dummy event store, for regression tests. - - copied from Control/AthLinks/trunk/test - */ - -#include "SGTools/IProxyDictWithPool.h" -#include "SGTools/StringPool.h" -#include "SGTools/DataProxy.h" - -#if __cplusplus < 201100 -# include "CxxUtils/unordered_map.h" -namespace SG_STD_OR_SG = SG; -#else -# include <unordered_map> -namespace SG_STD_OR_SG = std; -#endif - -//#include <map> - -struct TestStoreRemap -{ - TestStoreRemap (SG::sgkey_t the_key=0, size_t the_index = 0) - : key (the_key), index (the_index) {} - bool operator== (const TestStoreRemap& other) const - { return other.key == key && other.index == index; } - SG::sgkey_t key; - size_t index; -}; - - -struct TestStoreRemapHash -{ - size_t operator() (const TestStoreRemap& m) const - { return m.key + m.index; } -}; - - -class TestStore - : public IProxyDictWithPool -{ -public: - unsigned long addRef() - { std::cout << "addRef\n"; std::abort(); } - unsigned long release() - { std::cout << "release\n"; std::abort(); } - StatusCode queryInterface(const InterfaceID &/*ti*/, void** /*pp*/) - { std::cout << "queryInterface\n"; std::abort(); } - const std::string& name() const - { std::cout << "name\n"; std::abort(); } - - - SG::DataProxy* deep_proxy(const void* const /*pTransient*/) const - { std::cout << "deep_proxy\n"; std::abort(); } - SG::DataProxy* proxy(const void* const pTransient) const - { - tmap_t::const_iterator i = m_tmap.find (pTransient); - if (i != m_tmap.end()) - return i->second; - return 0; - } - SG::DataProxy* proxy(const CLID& /*id*/) const - { std::cout << "proxy2\n"; std::abort(); } - SG::DataProxy* proxy(const CLID& id, const std::string& key) const - { - sgkey_t sgkey = const_cast<TestStore*>(this)->stringToKey (key, id); - kmap_t::const_iterator i = m_kmap.find (sgkey); - if (i != m_kmap.end()) - return i->second; - return 0; - } - virtual SG::DataProxy* proxy_exact (SG::sgkey_t sgkey) const - { - kmap_t::const_iterator i = m_kmap.find (sgkey); - if (i != m_kmap.end()) - return i->second; - return 0; - } - std::vector<const SG::DataProxy*> proxies() const - { std::cout << "proxies\n"; std::abort(); } - - sgkey_t stringToKey (const std::string& str, CLID clid) - { - return m_stringPool.stringToKey (str, clid); - } - const std::string* keyToString (sgkey_t /*key*/) const - { std::cout << "keyToString1\n"; std::abort(); } - const std::string* keyToString (sgkey_t key, CLID& clid) const - { - return m_stringPool.keyToString (key, clid); - } - void registerKey (sgkey_t /*key*/, const std::string& /*str*/, CLID /*clid*/) - { std::cout << "registerKey\n"; std::abort(); } - - - bool tryELRemap (sgkey_t sgkey_in, size_t index_in, - sgkey_t& sgkey_out, size_t& index_out) - { - remap_t::iterator i = m_remap.find (TestStoreRemap (sgkey_in, index_in)); - if (i == m_remap.end()) return false; - sgkey_out = i->second.key; - index_out = i->second.index; - return true; - } - - StatusCode addToStore (CLID /*id*/, SG::DataProxy* proxy) - { - proxy->setStore (this); - m_kmap[proxy->transientAddress()->sgkey()] = proxy; - return StatusCode::SUCCESS; - } - - - template <class T> - void record (const T* p, const std::string& key) - { - DataObject* obj = SG::asStorable<T>(const_cast<T*>(p)); - CLID clid = ClassID_traits<T>::ID(); - sgkey_t sgkey = stringToKey (key, clid); - if (m_kmap.find (sgkey) != m_kmap.end()) { - SG::DataProxy* dp = m_kmap[sgkey]; - dp->setObject (obj); - if (dp->transientAddress()->clID() == CLID_NULL) - dp->transientAddress()->setID (clid, key); - m_tmap[p] = dp; - return; - } - - SG::TransientAddress* tAddr = new SG::TransientAddress(clid, key); - SG::DataProxy* dp = new SG::DataProxy(obj, tAddr); - dp->setStore (this); - m_tmap[p] = dp; - - m_kmap[sgkey] = dp; - tAddr->setSGKey (sgkey); - } - - - template <class T> - void remap (const std::string& key_in, const std::string& key_out, - size_t index_in = 0, size_t index_out = 0) - { - CLID clid = ClassID_traits<T>::ID(); - sgkey_t sgkey_in = stringToKey (key_in, clid); - sgkey_t sgkey_out = stringToKey (key_out, clid); - m_remap[TestStoreRemap(sgkey_in, index_in)] = - TestStoreRemap(sgkey_out, index_out); - } - - typedef SG_STD_OR_SG::unordered_map<const void*, SG::DataProxy*> tmap_t; - tmap_t m_tmap; - - typedef SG_STD_OR_SG::unordered_map<sgkey_t, SG::DataProxy*> kmap_t; - kmap_t m_kmap; - - typedef SG_STD_OR_SG::unordered_map<TestStoreRemap, TestStoreRemap, TestStoreRemapHash> remap_t; - remap_t m_remap; - - SG::StringPool m_stringPool; -}; - - -TestStore store; -IProxyDictWithPool* storePtr = &store; - - -IProxyDictWithPool** getTestDataSourcePointer (const std::string&) -{ - return &storePtr; -} - diff --git a/Event/xAOD/xAODJet/test/xAODJet_Jet_test.cxx b/Event/xAOD/xAODJet/test/xAODJet_Jet_test.cxx index 3fdaec334630fe30fbe3674cceddd6bc5ce4b691..f455e83f8cd48861bdc1ae9d81228035b0c58ccd 100644 --- a/Event/xAOD/xAODJet/test/xAODJet_Jet_test.cxx +++ b/Event/xAOD/xAODJet/test/xAODJet_Jet_test.cxx @@ -19,13 +19,8 @@ #ifndef XAOD_STANDALONE // allows to test EL #include "AthLinks/ElementLink.h" -// Done like this so that this will compile in both releases 20 and 21. -# ifdef SGTOOLS_CURRENTEVENTSTORE_H -# include "SGTools/TestStore.h" - using namespace SGTest; -# else -# include "TestStore.icc" -# endif +#include "SGTools/TestStore.h" +using namespace SGTest; #endif @@ -43,7 +38,7 @@ bool is_equal (double x1, double x2) #define TEST_MSG( msg ) std::cout << msg << std::endl -#define TESTMACRO( failcond , errmsg ) { if(! ( failcond) ) {TEST_MSG( "TEST FAILED : " << errmsg ) ; return 1 ;} else {TEST_MSG( "TEST SUCCEEDED : "<< errmsg );} } while(0) +#define TESTMACRO( failcond , errmsg ) do { if(! ( failcond) ) {TEST_MSG( "TEST FAILED : " << errmsg ) ; return 1 ;} else {TEST_MSG( "TEST SUCCEEDED : "<< errmsg );} } while(0) std::vector<xAOD::JetFourMom_t> jet4moms ={ xAOD::JetFourMom_t(40000, 0, 1, 10000 ), diff --git a/Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h b/Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h index bb33bc2718464e2b90ccccdb5646b97ab2c84b0b..35b78f3aa9a4dcb0eb0f9ca697e8c0acdd3af911 100644 --- a/Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h +++ b/Event/xAOD/xAODJet/xAODJet/versions/Jet_v1.h @@ -52,8 +52,8 @@ namespace xAOD { /// @author Pierre-Antoine Delsart <delsart@in2p3.fr> /// @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> /// - /// $Revision: 675972 $ - /// $Date: 2015-06-17 15:07:55 +0200 (Wed, 17 Jun 2015) $ + /// $Revision: 795692 $ + /// $Date: 2017-02-06 00:08:21 +0100 (Mon, 06 Feb 2017) $ /// class Jet_v1 : public IParticle { @@ -334,7 +334,7 @@ namespace xAOD { /// Function making sure that the object is ready for persistification - void toPersistent(); + // void toPersistent(); /// workaround some I/O limitations void reset(); diff --git a/Event/xAOD/xAODJetAthenaPool/CMakeLists.txt b/Event/xAOD/xAODJetAthenaPool/CMakeLists.txt index ad2c0738f0fda62c2ce9d657f733d5e3162cf016..b4eedb6825cb51ec29bad4d715bde8ad5d7a4c58 100644 --- a/Event/xAOD/xAODJetAthenaPool/CMakeLists.txt +++ b/Event/xAOD/xAODJetAthenaPool/CMakeLists.txt @@ -16,11 +16,22 @@ atlas_depends_on_subdirs( PRIVATE # External dependencies: find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) +set( poolcnv_files ) +set( poolcnv_types ) + +if( NOT SIMULATIONBASE ) + set( poolcnv_files xAODJet/JetContainer.h xAODJet/JetAuxContainer.h xAODJet/JetTrigAuxContainer.h) + set( poolcnv_types xAOD::JetContainer xAOD::JetAuxContainer xAOD::JetTrigAuxContainer) +else() + set( poolcnv_files xAODJet/JetContainer.h xAODJet/JetAuxContainer.h) + set( poolcnv_types xAOD::JetContainer xAOD::JetAuxContainer) +endif() + # Component(s) in the package: atlas_add_poolcnv_library( xAODJetAthenaPoolPoolCnv src/*.cxx - FILES xAODJet/JetContainer.h xAODJet/JetAuxContainer.h xAODJet/JetTrigAuxContainer.h - TYPES_WITH_NAMESPACE xAOD::JetContainer xAOD::JetAuxContainer xAOD::JetTrigAuxContainer + FILES ${poolcnv_files} + TYPES_WITH_NAMESPACE ${poolcnv_types} CNV_PFX xAOD INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} AthContainers AthenaKernel AthenaPoolCnvSvcLib AthenaPoolUtilities xAODJet ) diff --git a/Event/xAOD/xAODJetAthenaPool/src/xAODJetContainerCnv.cxx b/Event/xAOD/xAODJetAthenaPool/src/xAODJetContainerCnv.cxx index 24a29cc376323200e35b463bdd14dd8a52f6223f..6583d908c490c2ab50a7484a8a61ad1fad1c87c0 100644 --- a/Event/xAOD/xAODJetAthenaPool/src/xAODJetContainerCnv.cxx +++ b/Event/xAOD/xAODJetAthenaPool/src/xAODJetContainerCnv.cxx @@ -2,7 +2,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: xAODJetContainerCnv.cxx 581167 2014-02-03 10:45:56Z krasznaa $ +// $Id: xAODJetContainerCnv.cxx 795694 2017-02-05 23:13:50Z khoo $ // System include(s): #include <exception> @@ -55,12 +55,12 @@ xAODJetContainerCnv::createPersistent( xAOD::JetContainer* trans ) { new xAOD::JetContainer( trans->begin(), trans->end(), SG::VIEW_ELEMENTS ); - // Prepare the objects to be written out: - xAOD::JetContainer::iterator itr = result->begin(); - xAOD::JetContainer::iterator end = result->end(); - for( ; itr != end; ++itr ) { - toPersistent( *itr ); - } + // // Prepare the objects to be written out: + // xAOD::JetContainer::iterator itr = result->begin(); + // xAOD::JetContainer::iterator end = result->end(); + // for( ; itr != end; ++itr ) { + // toPersistent( *itr ); + // } // Return the new container: return result; @@ -84,10 +84,10 @@ xAOD::JetContainer* xAODJetContainerCnv::createTransient() { return 0; } -void xAODJetContainerCnv::toPersistent( xAOD::Jet* jet ) const { +// void xAODJetContainerCnv::toPersistent( xAOD::Jet* jet ) const { - // Tell the object to prepare all its smart pointers for persistification: - jet->toPersistent(); +// // Tell the object to prepare all its smart pointers for persistification: +// jet->toPersistent(); - return; -} +// return; +// } diff --git a/Event/xAOD/xAODJetAthenaPool/src/xAODJetContainerCnv.h b/Event/xAOD/xAODJetAthenaPool/src/xAODJetContainerCnv.h index ad8b8f65b9ee458f3b77a3f7b19b53cf6fa998ad..646204cc6ad978978b955ba00b4eda91250c0c70 100644 --- a/Event/xAOD/xAODJetAthenaPool/src/xAODJetContainerCnv.h +++ b/Event/xAOD/xAODJetAthenaPool/src/xAODJetContainerCnv.h @@ -4,7 +4,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: xAODJetContainerCnv.h 581167 2014-02-03 10:45:56Z krasznaa $ +// $Id: xAODJetContainerCnv.h 795694 2017-02-05 23:13:50Z khoo $ #ifndef XAODJETATHENAPOOL_XAODJETCONTAINERCNV_H #define XAODJETATHENAPOOL_XAODJETCONTAINERCNV_H @@ -30,8 +30,8 @@ typedef T_AthenaPoolCustomCnv< xAOD::JetContainer, * * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> * - * $Revision: 581167 $ - * $Date: 2014-02-03 11:45:56 +0100 (Mon, 03 Feb 2014) $ + * $Revision: 795694 $ + * $Date: 2017-02-06 00:13:50 +0100 (Mon, 06 Feb 2017) $ */ class xAODJetContainerCnv : public xAODJetContainerCnvBase { @@ -51,8 +51,8 @@ public: virtual xAOD::JetContainer* createTransient(); private: - /// Function preparing a vertex object for persistence - void toPersistent( xAOD::Jet* jet ) const; + // /// Function preparing a vertex object for persistence + // void toPersistent( xAOD::Jet* jet ) const; /// StoreGate key of the container just being created std::string m_key; diff --git a/Event/xAOD/xAODMissingET/Root/MissingETAssociation_v1.cxx b/Event/xAOD/xAODMissingET/Root/MissingETAssociation_v1.cxx index 16484953ae3017b280f85182c041c11d43394656..f98b7bc8f7566a23e1d61be96bd387a09d862374 100644 --- a/Event/xAOD/xAODMissingET/Root/MissingETAssociation_v1.cxx +++ b/Event/xAOD/xAODMissingET/Root/MissingETAssociation_v1.cxx @@ -182,27 +182,27 @@ namespace xAOD { } } - void MissingETAssociation_v1::updateLinks() - { - this->updateJetLink(); - static SG::AuxElement::Accessor<MissingETBase::Types::objlink_vector_t> acc("objectLinks"); - if(acc.isAvailableWritable(*this)) { - for ( auto& link : this->f_objectLinks() ) { - link.toPersistent(); - } - } - } - - void MissingETAssociation_v1::updateJetLink() { - if(!this->isMisc()) { - static SG::AuxElement::Accessor<MissingETBase::Types::jetlink_t> acc("jetLink"); - if(acc.isAvailableWritable(*this)) { - if(f_setLink<MissingETBase::Types::jetlink_t>(this->f_jetLink())) { - this->f_jetLink().toPersistent(); - } - } - } - } + // void MissingETAssociation_v1::updateLinks() + // { + // this->updateJetLink(); + // static SG::AuxElement::Accessor<MissingETBase::Types::objlink_vector_t> acc("objectLinks"); + // if(acc.isAvailableWritable(*this)) { + // for ( auto& link : this->f_objectLinks() ) { + // link.toPersistent(); + // } + // } + // } + + // void MissingETAssociation_v1::updateJetLink() { + // if(!this->isMisc()) { + // static SG::AuxElement::Accessor<MissingETBase::Types::jetlink_t> acc("jetLink"); + // if(acc.isAvailableWritable(*this)) { + // if(f_setLink<MissingETBase::Types::jetlink_t>(this->f_jetLink())) { + // this->f_jetLink().toPersistent(); + // } + // } + // } + // } bool MissingETAssociation_v1::removeContrib() { diff --git a/Event/xAOD/xAODMissingET/Root/MissingETComponent_v1.cxx b/Event/xAOD/xAODMissingET/Root/MissingETComponent_v1.cxx index 9fd29c568e611bf3a061639e9a7e4cba0a4184d0..1f5628aa1375fd2b47367866d174f4743d2c2e92 100644 --- a/Event/xAOD/xAODMissingET/Root/MissingETComponent_v1.cxx +++ b/Event/xAOD/xAODMissingET/Root/MissingETComponent_v1.cxx @@ -151,30 +151,30 @@ bool MissingETComponent_v1::addObject(const IParticle* pPart,double wpx,double w } } -void MissingETComponent_v1::updateLinks() -{ - this->updateMETLink(); - static SG::AuxElement::Accessor<MissingETBase::Types::objlink_vector_t> acc("objectLinks"); - if(acc.isAvailableWritable(*this)) { - MissingETBase::Types::objlink_vector_t::iterator fLnk(this->f_objectLinks().begin()); - MissingETBase::Types::objlink_vector_t::iterator lLnk(this->f_objectLinks().end()); - for ( ; fLnk != lLnk; ++fLnk ) { - // avoid validity check to prevent crashes due to thinning - // if(f_setLink<MissingETBase::Types::objlink_t>(*fLnk)){ - fLnk->toPersistent(); - // } - } - } -} - -void MissingETComponent_v1::updateMETLink() { - static SG::AuxElement::Accessor<MissingETBase::Types::metlink_t> acc("metLink"); - if(acc.isAvailableWritable(*this)) { - if(f_setLink<MissingETBase::Types::metlink_t>(this->f_metLink())) { - this->f_metLink().toPersistent(); - } - } -} +// void MissingETComponent_v1::updateLinks() +// { +// this->updateMETLink(); +// static SG::AuxElement::Accessor<MissingETBase::Types::objlink_vector_t> acc("objectLinks"); +// if(acc.isAvailableWritable(*this)) { +// MissingETBase::Types::objlink_vector_t::iterator fLnk(this->f_objectLinks().begin()); +// MissingETBase::Types::objlink_vector_t::iterator lLnk(this->f_objectLinks().end()); +// for ( ; fLnk != lLnk; ++fLnk ) { +// // avoid validity check to prevent crashes due to thinning +// // if(f_setLink<MissingETBase::Types::objlink_t>(*fLnk)){ +// fLnk->toPersistent(); +// // } +// } +// } +// } + +// void MissingETComponent_v1::updateMETLink() { +// static SG::AuxElement::Accessor<MissingETBase::Types::metlink_t> acc("metLink"); +// if(acc.isAvailableWritable(*this)) { +// if(f_setLink<MissingETBase::Types::metlink_t>(this->f_metLink())) { +// this->f_metLink().toPersistent(); +// } +// } +// } bool MissingETComponent_v1::removeContrib() { diff --git a/Event/xAOD/xAODMissingET/Root/MissingETComposition.cxx b/Event/xAOD/xAODMissingET/Root/MissingETComposition.cxx index 3a963c24608b363d7a6e42acbec61f41bf206e0e..2ffb0e79e5d0076f7e0b170c77b1365cefb56041 100644 --- a/Event/xAOD/xAODMissingET/Root/MissingETComposition.cxx +++ b/Event/xAOD/xAODMissingET/Root/MissingETComposition.cxx @@ -66,22 +66,6 @@ namespace xAOD { return flag; } - bool MissingETComposition::updateLinks(MissingETComponentMap* pMap) - { - if ( pMap == 0 ) return false; - // - for ( auto iter : *pMap ) { iter->updateLinks(); } - return true; - } - - bool MissingETComposition::updateMETLinks(MissingETComponentMap* pMap) - { - if ( pMap == 0 ) return false; - // - for ( auto iter : *pMap ) { iter->updateMETLink(); } - return true; - } - // ------------------------------------------ find contribution from a particle // It is assumed that the default constructor for DataVector<MissingETComponent>::(const_)iterator initalizes diff --git a/Event/xAOD/xAODMissingET/doc/mainpage.h b/Event/xAOD/xAODMissingET/doc/mainpage.h deleted file mode 100644 index f36e445e26a971b4650f05a43f1eac7b8804ae90..0000000000000000000000000000000000000000 --- a/Event/xAOD/xAODMissingET/doc/mainpage.h +++ /dev/null @@ -1,152 +0,0 @@ -// -*- c++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/*! @mainpage Data objects for Missing Transverse Momentum reconstruction - * - * @tableofcontents - * - * The event data model provided in this package supports the reconstruction of missing transverse energy in ATLAS, and provides the - * data containers to represent the results of this reconstruction. - * - * @section met_intro Introduction - * - * Missing transverse momentum (MET, @f$ E_{\rm T}^{\rm miss}) @f$ reconstruction in ATLAS is actually represented by the three - * kinematic components @f$ (p_{x}^{\rm miss},p_{y}^{\rm miss},\Sigma E_{\rm T}) @f$, which are the missing momentum components - * in the transverse plane, and the scalar sum of transverse momenta contributing to MET. In addition to the full event MET, - * MET @a terms represent contributions from - * certain physics and signal objects. In general, all reconstructed hard physics objects like individual particles and particle - * jets contribute their (fully calibrated) kinematics to their specific MET term (e.g., @f$ E_{\rm T}^{\rm miss,electron} @f$, - * @f$ E_{\rm T}^{\rm miss,jet} @f$, ...). In addition, signal objects (topological calorimeter cell clusters and reconstructed tracks) - * not used by hard objects are collected into a dedicated soft term MET contribution (SoftTerm). The sum of all terms reconstructed - * within the context of a given MET configuration is then the full event MET. - * - * @subsection met_intro_scope MET reconstruction scope and basics - * - * The scope of MET reconstruction is to use all hard objects passing dedicated kinematic and topological cuts, and having an acceptable - * reconstruction quality indicator, for the individual MET terms. As there is likely signal overlap between these objects, an event signal - * ambiguity resolution strategy is applied which is based on tagging common calorimeter signal use and rejecting object contributions if - * the signal they are based on is already used in a previously scheduled MET contribution. After all hard objects are considered this way, - * the residual unused signals are collected into the MET SoftTerm. - * - * This strategy makes the resulting total MET dependent on the order with which the hard objects are considered. This order is by default - * defined by expectations for the reconstruction quality and precision, leading to the sequence (1) electrons, (2) photons, (3) taus, - * (4) muons, (5) particle jets, and (6) SoftTerm. - * - * @subsection met_intro_edm Event data model basics - * - * The MET event data model (EDM) reflects the needs introduced by the MET reconstruction discussed above. It consists of two basic data objects and - * their respective containers, in addition to the corresponding auxiliary storage objects. The two basic data objects respectively provide storage of the - * @ref met_intro "kinematic variables" related to a MET term - * (@link xAOD::MissingET_v1 MissingET @endlink object), and storage of information related to the contributions - * to this MET term (@link xAOD::MissingETComponent_v1 MissingETComponent @endlink object). With this approach the kinematic data, characterized by - * basic internally used data types and structures, is clearly separated from the composition data providing detailed information, which typically - * requires to provide more support for data management and search capabilities. - * - * The @link xAOD::MissingET_v1 MissingET @endlink is considered universal, as it is used to store individual MET terms as well as the final - * full event MET. The objects representing the terms and the full event MET are stored in a container object - * (@link xAOD::MissingETContainer_v1 MissingETContainer @endlink). Standard MET reconstruction tools also create a MET component object for - * each MET term, but not for the full event MET, as this means duplication of information. This - * @link xAOD::MissingETComponent_v1 MissingETComponent @endlink object is stored in its own container - * (@link xAOD::MissingETComponentMap_v1 MissingETComponentMap @endlink, one per MET term). - * - * @section met_edm Missing Transverse Momentum Event Data Model - * - * The MET EDM is tailored to support a dynamic (MET reconstruction in the precision reconstruction and analysis context) and static (mostly - * MET related data retrieval in an analysis context) phase. This means that the data objects in this EDM need to (among others) - * @li provide storage for the variables characterizing a MET term; - * @li support easy and efficient access to these variables for a given term; - * @li support searching for a specific MET term and its components in their respective containers; - * @li implement the algebra correctly calculating the kinematic variables in the dynamic phase; - * @li support event signal ambiguity resolution; - * @li provide access to the individual contributions to a given MET term; - * @li support re-reconstruction of the full MET for a given configuration, or of selected MET terms only. - * - * @note The MET EDM does not provide any implementation directly reconstructing a MET term. There is no functionality provided which fills e.g. - * the basic data object and the component object at the same time. There is also no implementation provided which e.g. extracts underlying - * basic signals like topological calorimeter cell clusters or reconstructed charged tracks from a given physics object. These are tasks which - * need to be implemented in the dedicated tools reconstructing a MET term from a list of given objects. On the other hand, the MET EDM provides - * the book-keeping to keep track of use clusters and tracks, with the idea that the corresponding data has to be provided by the tools again - * (used signal objects have to be explicitly set in the book-keeping caches). - * - * @subsection met_edm_data MissingET and MissingETContainer - * - * The basic kinematic data object for an individual MET term, any combination of those, and the final (summed) MET is the - * @link xAOD::MissingET_v1 MissingET @endlink object. It provides all functionality and support for the correct algebra applicable for MET - * reconstruction. The relevant stored kinematic variables are @f$ (p_{x}^{\rm miss}, p_{y}^{\rm miss}, \Sigma E_{\rm T}) @f$. - * - * The result of MET reconstruction is represented by three kinematic variables @f$ (p_{x}^{\rm miss},p_{y}^{\rm miss},\Sigma E_{\rm T}) @f$, which are - * constructed as - * @anchor met_sum_rule - * @f{eqnarray*}{ - * p_{x}^{\rm miss} & = & - \sum_{i = 1}^{N_{\rm contrib}} p_{x,i} \\ - * p_{y}^{\rm miss} & = & - \sum_{i = 1}^{N_{\rm contrib}} p_{y,i} \\ - * \Sigma E_{\rm T} & = & \sum_{i = 1}^{N_{\rm contrib}} p_{{\rm T},i} . - * @f} - * Here @f$ N_{\rm contrib} @f$ is the number of contributions to the MET term, and - * @f$ p_{x,i} @f$ and @f$ p_{y,i} @f$ are the transverse momentum components of contribution @f$ i @f$, and @f$ p_{{\rm T},i} @f$ is the transverse - * momentum of this component. These three MET variables can be accessed, set, and manipulated using methods provided by the - * @link xAOD::MissingET_v1 MissingET @endlink object. - * - * In addition, each @link xAOD::MissingET_v1 MissingET @endlink object provides accessors and setters for the name of the MET term it represents, - * and a source indicator (bitmask). - * - // * @subsubsection met_edm_basics_construct Construction - // * - // * The @link xAOD::MissingET_v1 MissingET @endlink can be instantiated in three principal states. The <i>default state</i> - // * is a data object without even a data store, which generally is unusable for reconstruction or data presentation, but is needed for some internal I/O - // * and data container instantiation support. The <i>empty state</i> is represented by a MET object with a name and (default or client provided) source - // * indicator. The kinematic variables are set to @f$( p_{x}^{\rm miss} = 0, p_{y}^{\rm miss} = 0, \Sigma E_{\rm T} = 0) @f$. The last option is the - // * <i>loaded state</i>, which has the same data content as the empty date, except that the kinematic variables are loaded from a given contributing - // * object, or a corresponding set of numbers. - // * - // * The dynamic phase is supported by @link xAOD::MissingET_v1::add methods @endlink implementing the summing convention given in this - // * @ref met_sum_rule "set of equations". Other operations like re-scaling to the kinematic variables and removing a kinematic contribution - // * from a given physics or signal object are implemented as well. - // * - // * @note It is suggested that clients interact with the @link xAOD::MissingET_v1 MissingET @endlink object using the available - // * methods and operators. This allows maintaining the consistency of the kinematic data. In addition, the correct sum rules - // * are applied. - // * - // * @subsubsection met_edm_basics_storage Storage - // * - // * @link xAOD::MissingET_v1 MissingET @endlink objects are initially constructed as individual, non-storable data objects - either in the default or - // * one of the plain-old-data (POD) states (empty or loaded). Independent of the initial state, if the pointer to a - // * @link xAOD::MissingET_v1 MissingET @endlink is stored in a @link xAOD::MissingETContainer_v1 MissingETContainer @endlink, and this container - // * has a valid reference to an auxiliary data store provided by the @link xAOD::MissingETAuxContainer_v1 MissingETAuxContainer @endlink, the - // * @link xAOD::MissingET_v1 MissingET @endlink object becomes fully useable and storable. If its initial object state is default, the newly attached - // * data store has default content, while for the other two states the (private) data store content is transfered to the auxiliary store. - // * - // * While there are no implementations enforcing any rules on the sequence of the @link xAOD::MissingET_v1 MissingET @endlink pointers - - -// As mentioned above, each of these data objects typically contains the contribution from a set of same type final state objects -// * like particles and jets, and is identified as a specific contribution by a name and a source indicator (bit pattern). In general all MET objects from the various -// * sources contribute to a given MET reconstruction configuration and their sum is the overall MET for the event. For storage, and to indicated that a given xAOD::MissingET_v1 -// * object represents a certain MET term in a given MET reconstruction configuration, the individual MET objects -// * are collected into a xAOD::MissingETContainer_v1 object. Typically, the insertion sequence (e.g. the index of an individual MET object) in this container is -// * determined by the tool sequence with which the MET terms are reconstructed, there is no particular enforcement of this rule in the EDM. Safe (random) accessors using the -// * name or the source indicator of the requested MET object are provided by the MET object. - -// * -// * The @link xAOD::MissingET_v1 MissingET @endlink object can be instantiated as a plain-old-data (POD) object. To store it, it needs to be -// * collected into a @link xAOD::MissingETContainer_v1 MissingETContainer @endlink with an attached auxiliary -// * @link xAOD::MissingETAuxContainer_v1 MissingETAuxContainer @endlink store. This auxiliary store provides the underlying storable (and optimized) -// * data structures. - * - * @subsection met_edm_composition Contributions and composition - * - * The contributions to a given MET term are characterized by (1) a list of contributing objects, (2) a list of the kinematic weights associated with - * each contributing object, and (3) a list of status-words characterizing each of the contributions. The data object storing this information is - * @link xAOD::MissingETContribution_v1 MissingETContribution @endlink. This object can be instantiated as POD, and it provides all functionality - * to manipulate the mentioned stores. - * - * For storage, and to describe a fully reconstructed MET, the @link xAOD::MissingETContribution_v1 MissingETContribution @endlink objects are collected - * into a @link xAOD::MissingETCompositionMap_v1 MissingETCompositionMap @endlink object, which together with its auxiliary - * @link xAOD::MissingETAuxCompositionMap_v1 MissingETAuxCompositionMap @endlink store providing the underlying storage structures, can be persistified. - * - * Most of the functionality connected with the access and management of the @link xAOD::MissingETCompositionMap_v1 MissingETCompositionMap @endlink - * is provided by static functions in the @link xAOD::MissingETComposition MissingETComposition @endlink structure. - */ diff --git a/Event/xAOD/xAODMissingET/xAODMissingET/MissingETComposition.h b/Event/xAOD/xAODMissingET/xAODMissingET/MissingETComposition.h index 7f53582f0ff502efc96029c75a1aa0e0ac79d653..182f2f10c621a13f44bcde7b249f079c0d9f6138 100644 --- a/Event/xAOD/xAODMissingET/xAODMissingET/MissingETComposition.h +++ b/Event/xAOD/xAODMissingET/xAODMissingET/MissingETComposition.h @@ -77,48 +77,6 @@ namespace xAOD */ static bool insert(MissingETComponentMap* pMap,const MissingET* pMET,const IParticle* pPart,const MissingETBase::Types::object_vector_t& signalList,double wpx,double wpy,double wet, MissingETBase::UsageHandler::Policy p=MissingETBase::UsageHandler::OnlyCluster); - /*! @brief Update all ElementLinks in all contributions - * - * This function triggers an update of all ElementLinks stored in the map entries. This may be necessary in case a @link MissingETComponent MissingETComponent @endlink - * object has been filled with POD MET, particle, and/or signal objects, thus rendering the corresponding ElementLink incomplete. If the linked to objects are - * stored in a collection later, this function makes sure that all ElementLinks are updated with the collection pointer. - * - * @warning Usually MET terms are reconstructed from signal or physics objects stored in a collection. In this case this function does not need to be - * used at all, as all ElemenntLinks to contributing objects are complete. On the other hand, the @link MissingET MissingET @endlink in the - * contribution is usually still a POD when the composition map entry for the corresponding MET term is generated, and the ElementLink to - * it requires an update later, when the @link MissingET MissingET @endlink object is stored in a @link MissingETContainer MissingEETContainer @endlink. - * In this case MissingETComposition::updateMETLinks(MissingETComponentMap*) should be used after the MET object is inserted in its container, as - * it is much faster (only scans the small number of @link MissingETComponent MissingETComponent @endlink objects in the map). - * - * @return @c true if all links in all MET contributions in the composition map are updated correctly. In case of an unsuccessful update attempt, or - * an invalid pointer to the @link MissingETComponentMap MissingETComponentMap @endlink object (NULL pointer), @c false is - * returned. - * - * @param[in] pMap pointer referencing a modifiable MET composition map. - * - * @note This method involves a scan of all @link MissingETComponent MissingETComponent @endlink objects stored in the map, and a scan - * of the contributing object list in these MET contributions. This can be costly in terms off CPU usage. - * - */ - static bool updateLinks(MissingETComponentMap* pMap); - /*! @brief Update all ElementLinks to MET objects only in all contributions - * - * This function triggers an update of all ElementLinks stored in the map entries. This may be necessary in case a @link MissingETComponent MissingETComponent @endlink - * object has been filled with POD @link MissingET MissingET @endlink, thus rendering the corresponding ElementLink incomplete. If the linked to MET objects are - * stored in a collection later, this function makes sure that the ElementLinks are updated with the collection pointer. - * - * @return @c true if all links to @link MissingET MissingET @endlink objects in all MET contributions in the composition map are updated correctly. - * In case of an unsuccessful update attempt, or - * an invalid pointer to the @link MissingETComponentMap MissingETComponentMap @endlink object (NULL pointer), @c false is - * returned. - * - * @param[in] pMap pointer referencing a modifiable MET composition map. - * - * @note This method involves a scan of all @link MissingETComponent MissingETComponent @endlink objects stored in the map. - * - */ - static bool updateMETLinks(MissingETComponentMap* pMap); - /*!@}*/ /*! @name Find a contributing particle */ /*!@{*/ diff --git a/Event/xAOD/xAODMissingET/xAODMissingET/versions/MissingETAssociation_v1.h b/Event/xAOD/xAODMissingET/xAODMissingET/versions/MissingETAssociation_v1.h index 00459154ed62e880b6c422413dfb137c8b6db6f3..d6702fdb52152f5c977311d90117a98e72b4dff7 100644 --- a/Event/xAOD/xAODMissingET/xAODMissingET/versions/MissingETAssociation_v1.h +++ b/Event/xAOD/xAODMissingET/xAODMissingET/versions/MissingETAssociation_v1.h @@ -335,12 +335,12 @@ namespace xAOD /*!@{*/ /*! @brief Update all internally used ElementLink instances * - * @note This method scans the full list of contributing objects. It invokes + * @note [Deprecated] This method scans the full list of contributing objects. It invokes * MissingETAssociation_v1::updateJetlink internally. */ - void updateLinks(); - /*! @brief Update link to reference jet only */ - void updateJetLink(); + // void updateLinks(); + // /*! @brief [Deprecated] Update link to reference jet only */ + // void updateJetLink(); size_t size() const; size_t sizeCal() const; size_t sizeTrk() const; diff --git a/Event/xAOD/xAODMissingET/xAODMissingET/versions/MissingETComponent_v1.h b/Event/xAOD/xAODMissingET/xAODMissingET/versions/MissingETComponent_v1.h index 033edba2574aaaa90c4606bf343baf8f9c2aaec6..65fb6844f8d1ecbf9d1c849a301005542563d0c0 100644 --- a/Event/xAOD/xAODMissingET/xAODMissingET/versions/MissingETComponent_v1.h +++ b/Event/xAOD/xAODMissingET/xAODMissingET/versions/MissingETComponent_v1.h @@ -192,14 +192,14 @@ namespace xAOD /*! @name List management and information */ /*!@{*/ - /*! @brief Update all internally used ElementLink instances + /*! @brief [Deprecated] Update all internally used ElementLink instances * * @note This method scans the full list of contributing objects. It invokes * MissingETComponent_v1::updateMETLink internally. */ - void updateLinks(); - /*! @brief Update link MissingET object only */ - void updateMETLink(); + // void updateLinks(); + /*! @brief [Deprecated] Update link MissingET object only */ + // void updateMETLink(); size_t size() const; /*! @brief Empty list of contributing objects indicator */ bool empty() const; diff --git a/Event/xAOD/xAODMissingETAthenaPool/cmt/requirements b/Event/xAOD/xAODMissingETAthenaPool/cmt/requirements index 7107d91222cb886bbe996f3342aae6b4d212f721..89e341d2d8ce0ceefc4aaab093bab3069881c330 100644 --- a/Event/xAOD/xAODMissingETAthenaPool/cmt/requirements +++ b/Event/xAOD/xAODMissingETAthenaPool/cmt/requirements @@ -13,6 +13,7 @@ private # Base package(s): use GaudiInterface GaudiInterface-* External +use AthenaKernel AthenaKernel-* Control # POOL package(s): use AthenaPoolUtilities AthenaPoolUtilities-* Database/AthenaPOOL @@ -21,7 +22,6 @@ use AthenaPoolCnvSvc AthenaPoolCnvSvc-* Database/AthenaPOOL # EDM package(s): use xAODMissingET xAODMissingET-* Event/xAOD use AthContainers AthContainers-* Control -use AthenaKernel AthenaKernel-* Control # Declare the pool converter(s): apply_pattern poolcnv typesWithNamespace="xAOD::MissingETContainer \ diff --git a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAssociationMapCnv.cxx b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAssociationMapCnv.cxx index cf87c73639e52fee530ae136dca09498fd48eabd..19bc96be9cb058dbe5ce7b2c436cec9cb3cdb430 100644 --- a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAssociationMapCnv.cxx +++ b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAssociationMapCnv.cxx @@ -3,7 +3,7 @@ */ -// $Id: xAODMissingETAssociationMapCnv.cxx 692089 2015-08-30 14:36:16Z khoo $ +// $Id: xAODMissingETAssociationMapCnv.cxx 795699 2017-02-05 23:26:05Z khoo $ // System include(s): #include <exception> @@ -55,12 +55,12 @@ xAODMissingETAssociationMapCnv::createPersistent( xAOD::MissingETAssociationMap* xAOD::MissingETAssociationMap* result = new xAOD::MissingETAssociationMap( trans->begin(), trans->end(), SG::VIEW_ELEMENTS ); - // Prepare the objects to be written out: - xAOD::MissingETAssociationMap::iterator itr = result->begin(); - xAOD::MissingETAssociationMap::iterator end = result->end(); - for( ; itr != end; ++itr ) { - toPersistent( *itr ); - } + // // Prepare the objects to be written out: + // xAOD::MissingETAssociationMap::iterator itr = result->begin(); + // xAOD::MissingETAssociationMap::iterator end = result->end(); + // for( ; itr != end; ++itr ) { + // toPersistent( *itr ); + // } // Return the new container: return result; @@ -85,10 +85,10 @@ xAOD::MissingETAssociationMap* xAODMissingETAssociationMapCnv::createTransient() return 0; } -void xAODMissingETAssociationMapCnv::toPersistent( xAOD::MissingETAssociation* comp ) const { +// void xAODMissingETAssociationMapCnv::toPersistent( xAOD::MissingETAssociation* comp ) const { - // Tell the object to prepare all its smart pointers for persistification: - comp->updateLinks(); +// // Tell the object to prepare all its smart pointers for persistification: +// comp->updateLinks(); - return; -} +// return; +// } diff --git a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAssociationMapCnv.h b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAssociationMapCnv.h index ac0a54338e11ee1065f6f5f4390eae94ee03837c..735e48bc0947c555bb0fd3a7d6b1ebba35557cae 100644 --- a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAssociationMapCnv.h +++ b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAssociationMapCnv.h @@ -4,7 +4,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: xAODMissingETAssociationMapCnv.h 692089 2015-08-30 14:36:16Z khoo $ +// $Id: xAODMissingETAssociationMapCnv.h 795699 2017-02-05 23:26:05Z khoo $ #ifndef XAODMISSINGETATHENAPOOL_XAODMISSINGETASSOCIATIONMAPCNV_H #define XAODMISSINGETATHENAPOOL_XAODMISSINGETASSOCIATIONMAPCNV_H @@ -31,8 +31,8 @@ typedef T_AthenaPoolCustomCnv< xAOD::MissingETAssociationMap, * * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> * - * $Revision: 692089 $ - * $Date: 2015-08-30 16:36:16 +0200 (Sun, 30 Aug 2015) $ + * $Revision: 795699 $ + * $Date: 2017-02-06 00:26:05 +0100 (Mon, 06 Feb 2017) $ */ class xAODMissingETAssociationMapCnv : public xAODMissingETAssociationMapCnvBase { @@ -53,7 +53,8 @@ public: private: /// Function preparing a met object for persistence - void toPersistent( xAOD::MissingETAssociation* metComp ) const; + // Should be done by the aux container + // void toPersistent( xAOD::MissingETAssociation* metComp ) const; /// StoreGate key of the container just being created std::string m_key; diff --git a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAuxAssociationMapCnv.cxx b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAuxAssociationMapCnv.cxx index 1dc6253b186f548944ad391a2bbd5857af624593..3f5b3c1cf3d42b940373543ee64037b6a0e992b8 100644 --- a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAuxAssociationMapCnv.cxx +++ b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAuxAssociationMapCnv.cxx @@ -2,7 +2,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: xAODMissingETAuxAssociationMapCnv.cxx 692925 2015-09-03 12:11:56Z khoo $ +// $Id: xAODMissingETAuxAssociationMapCnv.cxx 795534 2017-02-04 16:24:29Z khoo $ // System include(s): #include <exception> @@ -11,6 +11,10 @@ #include "xAODMissingETAuxAssociationMapCnv.h" #include "xAODMissingETAuxAssociationMapCnv_v1.h" +// Correct ElementLink treatment +#include "AthenaKernel/IThinningSvc.h" +#include "AthContainers/tools/copyAuxStoreThinned.h" + xAODMissingETAuxAssociationMapCnv::xAODMissingETAuxAssociationMapCnv( ISvcLocator* svcLoc ) : xAODMissingETAuxAssociationMapCnvBase( svcLoc ) { @@ -21,8 +25,8 @@ xAODMissingETAuxAssociationMapCnv:: createPersistent( xAOD::MissingETAuxAssociationMap* trans ) { // Create a copy of the container: - xAOD::MissingETAuxAssociationMap* result = - new xAOD::MissingETAuxAssociationMap( *trans ); + xAOD::MissingETAuxAssociationMap* result = new xAOD::MissingETAuxAssociationMap; + SG::copyAuxStoreThinned( *trans, *result, IThinningSvc::instance() ); return result; } @@ -55,3 +59,4 @@ xAOD::MissingETAuxAssociationMap* xAODMissingETAuxAssociationMapCnv::createTrans "xAOD::MissingETAuxAssociationMap found" ); return 0; } + diff --git a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAuxComponentMapCnv.cxx b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAuxComponentMapCnv.cxx index 1a608b11a8ba5f0816aa8e311d87b3a5f97dcc3a..0d368eee034cbaad05513b087658ab45862e5531 100644 --- a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAuxComponentMapCnv.cxx +++ b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAuxComponentMapCnv.cxx @@ -2,7 +2,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: xAODMissingETAuxComponentMapCnv.cxx 586838 2014-03-08 15:10:34Z khoo $ +// $Id: xAODMissingETAuxComponentMapCnv.cxx 795622 2017-02-05 10:36:00Z khoo $ // System include(s): #include <exception> @@ -10,6 +10,10 @@ // Local include(s): #include "xAODMissingETAuxComponentMapCnv.h" +// Correct ElementLink treatment +#include "AthenaKernel/IThinningSvc.h" +#include "AthContainers/tools/copyAuxStoreThinned.h" + xAODMissingETAuxComponentMapCnv::xAODMissingETAuxComponentMapCnv( ISvcLocator* svcLoc ) : xAODMissingETAuxComponentMapCnvBase( svcLoc ) { @@ -20,8 +24,8 @@ xAODMissingETAuxComponentMapCnv:: createPersistent( xAOD::MissingETAuxComponentMap* trans ) { // Create a copy of the container: - xAOD::MissingETAuxComponentMap* result = - new xAOD::MissingETAuxComponentMap( *trans ); + xAOD::MissingETAuxComponentMap* result = new xAOD::MissingETAuxComponentMap; + SG::copyAuxStoreThinned( *trans, *result, IThinningSvc::instance() ); return result; } diff --git a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAuxContainerCnv.cxx b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAuxContainerCnv.cxx index 7c5627f91455837ff23392b390f240cf7853487c..b9b18f65915dbd42b28c77a18252dfdeccd1f77d 100644 --- a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAuxContainerCnv.cxx +++ b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETAuxContainerCnv.cxx @@ -2,7 +2,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: xAODMissingETAuxContainerCnv.cxx 586838 2014-03-08 15:10:34Z khoo $ +// $Id: xAODMissingETAuxContainerCnv.cxx 795622 2017-02-05 10:36:00Z khoo $ // System include(s): #include <exception> @@ -10,6 +10,10 @@ // Local include(s): #include "xAODMissingETAuxContainerCnv.h" +// Correct ElementLink treatment +#include "AthenaKernel/IThinningSvc.h" +#include "AthContainers/tools/copyAuxStoreThinned.h" + xAODMissingETAuxContainerCnv::xAODMissingETAuxContainerCnv( ISvcLocator* svcLoc ) : xAODMissingETAuxContainerCnvBase( svcLoc ) { @@ -20,8 +24,8 @@ xAODMissingETAuxContainerCnv:: createPersistent( xAOD::MissingETAuxContainer* trans ) { // Create a copy of the container: - xAOD::MissingETAuxContainer* result = - new xAOD::MissingETAuxContainer( *trans ); + xAOD::MissingETAuxContainer* result = new xAOD::MissingETAuxContainer; + SG::copyAuxStoreThinned( *trans, *result, IThinningSvc::instance() ); return result; } diff --git a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETComponentMapCnv.cxx b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETComponentMapCnv.cxx index aef59ada2852e069ff680a2028bfec8ec898ea86..4ef9cadd1cbaec545402773fa3d88096478a51e1 100644 --- a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETComponentMapCnv.cxx +++ b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETComponentMapCnv.cxx @@ -3,7 +3,7 @@ */ -// $Id: xAODMissingETComponentMapCnv.cxx 614274 2014-08-30 18:38:15Z khoo $ +// $Id: xAODMissingETComponentMapCnv.cxx 795699 2017-02-05 23:26:05Z khoo $ // System include(s): #include <exception> @@ -55,12 +55,12 @@ xAODMissingETComponentMapCnv::createPersistent( xAOD::MissingETComponentMap* tra xAOD::MissingETComponentMap* result = new xAOD::MissingETComponentMap( trans->begin(), trans->end(), SG::VIEW_ELEMENTS ); - // Prepare the objects to be written out: - xAOD::MissingETComponentMap::iterator itr = result->begin(); - xAOD::MissingETComponentMap::iterator end = result->end(); - for( ; itr != end; ++itr ) { - toPersistent( *itr ); - } + // // Prepare the objects to be written out: + // xAOD::MissingETComponentMap::iterator itr = result->begin(); + // xAOD::MissingETComponentMap::iterator end = result->end(); + // for( ; itr != end; ++itr ) { + // toPersistent( *itr ); + // } // Return the new container: return result; @@ -85,10 +85,10 @@ xAOD::MissingETComponentMap* xAODMissingETComponentMapCnv::createTransient() { return 0; } -void xAODMissingETComponentMapCnv::toPersistent( xAOD::MissingETComponent* comp ) const { +// void xAODMissingETComponentMapCnv::toPersistent( xAOD::MissingETComponent* comp ) const { - // Tell the object to prepare all its smart pointers for persistification: - comp->updateLinks(); +// // Tell the object to prepare all its smart pointers for persistification: +// comp->updateLinks(); - return; -} +// return; +// } diff --git a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETComponentMapCnv.h b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETComponentMapCnv.h index d450f30920a572bb53b68d8aef9416372aa30304..9aa155db8dba7724ef62a5c6fdc2fa7a22ee7c2f 100644 --- a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETComponentMapCnv.h +++ b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETComponentMapCnv.h @@ -4,7 +4,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: xAODMissingETComponentMapCnv.h 586838 2014-03-08 15:10:34Z khoo $ +// $Id: xAODMissingETComponentMapCnv.h 795699 2017-02-05 23:26:05Z khoo $ #ifndef XAODMISSINGETATHENAPOOL_XAODMISSINGETCOMPONENTMAPCNV_H #define XAODMISSINGETATHENAPOOL_XAODMISSINGETCOMPONENTMAPCNV_H @@ -31,8 +31,8 @@ typedef T_AthenaPoolCustomCnv< xAOD::MissingETComponentMap, * * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> * - * $Revision: 586838 $ - * $Date: 2014-03-08 16:10:34 +0100 (Sat, 08 Mar 2014) $ + * $Revision: 795699 $ + * $Date: 2017-02-06 00:26:05 +0100 (Mon, 06 Feb 2017) $ */ class xAODMissingETComponentMapCnv : public xAODMissingETComponentMapCnvBase { @@ -52,8 +52,8 @@ public: virtual xAOD::MissingETComponentMap* createTransient(); private: - /// Function preparing a met object for persistence - void toPersistent( xAOD::MissingETComponent* metComp ) const; + // /// Function preparing a met object for persistence + // void toPersistent( xAOD::MissingETComponent* metComp ) const; /// StoreGate key of the container just being created std::string m_key; diff --git a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETContainerCnv.h b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETContainerCnv.h index 0412bc3fbfd4546aae7d4917a2a7fbf931d3b81b..c134fd7ba767aecbd459b3442b3ffa258b21148d 100644 --- a/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETContainerCnv.h +++ b/Event/xAOD/xAODMissingETAthenaPool/src/xAODMissingETContainerCnv.h @@ -4,7 +4,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: xAODMissingETContainerCnv.h 586838 2014-03-08 15:10:34Z khoo $ +// $Id: xAODMissingETContainerCnv.h 795699 2017-02-05 23:26:05Z khoo $ #ifndef XAODMISSINGETATHENAPOOL_XAODMISSINGETCONTAINERCNV_H #define XAODMISSINGETATHENAPOOL_XAODMISSINGETCONTAINERCNV_H @@ -31,8 +31,8 @@ typedef T_AthenaPoolCustomCnv< xAOD::MissingETContainer, * * @author Attila Krasznahorkay <Attila.Krasznahorkay@cern.ch> * - * $Revision: 586838 $ - * $Date: 2014-03-08 16:10:34 +0100 (Sat, 08 Mar 2014) $ + * $Revision: 795699 $ + * $Date: 2017-02-06 00:26:05 +0100 (Mon, 06 Feb 2017) $ */ class xAODMissingETContainerCnv : public xAODMissingETContainerCnvBase { @@ -52,8 +52,8 @@ public: virtual xAOD::MissingETContainer* createTransient(); private: - /// Function preparing a met object for persistence - void toPersistent( xAOD::MissingET* met ) const; + // /// Function preparing a met object for persistence + // void toPersistent( xAOD::MissingET* met ) const; /// StoreGate key of the container just being created std::string m_key; diff --git a/Event/xAOD/xAODMuon/CMakeLists.txt b/Event/xAOD/xAODMuon/CMakeLists.txt index fb3ca0da11ca8f67a4e9108309e4c14840f3e04c..d1b65e619d1cd99528a6e925f0003eafd330c4fd 100644 --- a/Event/xAOD/xAODMuon/CMakeLists.txt +++ b/Event/xAOD/xAODMuon/CMakeLists.txt @@ -1,4 +1,4 @@ -# $Id: CMakeLists.txt 744530 2016-05-03 15:37:50Z krasznaa $ +# $Id: CMakeLists.txt 790886 2016-12-22 22:03:35Z ssnyder $ ################################################################################ # Package: xAODMuon ################################################################################ @@ -29,7 +29,6 @@ atlas_depends_on_subdirs( atlas_add_library( xAODMuon xAODMuon/*.h xAODMuon/versions/*.h Root/*.cxx PUBLIC_HEADERS xAODMuon - PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES AthContainers AthLinks xAODBase xAODCaloEvent xAODCore xAODPrimitives xAODTracking MuonIdHelpersLib ${extra_libs} ) diff --git a/Event/xAOD/xAODMuon/Root/MuonAuxContainer_v4.cxx b/Event/xAOD/xAODMuon/Root/MuonAuxContainer_v4.cxx index 7d941c10a5e5f41f271d2787fd4dfbaab5f89ab3..8f091ea8f91504af68b8dbc08419c46e82308624 100644 --- a/Event/xAOD/xAODMuon/Root/MuonAuxContainer_v4.cxx +++ b/Event/xAOD/xAODMuon/Root/MuonAuxContainer_v4.cxx @@ -77,18 +77,22 @@ namespace xAOD { AUX_VARIABLE( phiLayer1RPCHits ); AUX_VARIABLE( phiLayer2RPCHits ); AUX_VARIABLE( phiLayer3RPCHits ); + AUX_VARIABLE( phiLayer4RPCHits ); AUX_VARIABLE( etaLayer1RPCHits ); AUX_VARIABLE( etaLayer2RPCHits ); AUX_VARIABLE( etaLayer3RPCHits ); + AUX_VARIABLE( etaLayer4RPCHits ); AUX_VARIABLE( phiLayer1RPCHoles ); AUX_VARIABLE( phiLayer2RPCHoles ); AUX_VARIABLE( phiLayer3RPCHoles ); + AUX_VARIABLE( phiLayer4RPCHoles ); AUX_VARIABLE( etaLayer1RPCHoles ); AUX_VARIABLE( etaLayer2RPCHoles ); AUX_VARIABLE( etaLayer3RPCHoles ); + AUX_VARIABLE( etaLayer4RPCHoles ); AUX_VARIABLE( phiLayer1TGCHits ); AUX_VARIABLE( phiLayer2TGCHits ); @@ -110,6 +114,9 @@ namespace xAOD { AUX_VARIABLE( etaLayer3TGCHoles ); AUX_VARIABLE( etaLayer4TGCHoles ); + AUX_VARIABLE( cscEtaHits ); + AUX_VARIABLE( cscUnspoiledEtaHits ); + // Isolation AUX_VARIABLE( etcone20 ); AUX_VARIABLE( etcone30 ); diff --git a/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx b/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx index 341a945b51b140f8c82603bf8cd15c6258b84abb..5b356d7a414d76371cb5b11cf4ed37a887df1104 100644 --- a/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx +++ b/Event/xAOD/xAODMuon/Root/MuonTrackSummaryAccessors_v1.cxx @@ -2,7 +2,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: MuonTrackSummaryAccessors_v1.cxx 784489 2016-11-16 06:48:48Z jomeyer $ +// $Id: MuonTrackSummaryAccessors_v1.cxx 796148 2017-02-08 10:18:43Z wleight $ // System include(s): #include <iostream> @@ -68,18 +68,22 @@ namespace xAOD { DEFINE_ACCESSOR( uint8_t, phiLayer1RPCHits ); DEFINE_ACCESSOR( uint8_t, phiLayer2RPCHits ); DEFINE_ACCESSOR( uint8_t, phiLayer3RPCHits ); + DEFINE_ACCESSOR( uint8_t, phiLayer4RPCHits ); DEFINE_ACCESSOR( uint8_t, etaLayer1RPCHits ); DEFINE_ACCESSOR( uint8_t, etaLayer2RPCHits ); DEFINE_ACCESSOR( uint8_t, etaLayer3RPCHits ); + DEFINE_ACCESSOR( uint8_t, etaLayer4RPCHits ); DEFINE_ACCESSOR( uint8_t, phiLayer1RPCHoles ); DEFINE_ACCESSOR( uint8_t, phiLayer2RPCHoles ); DEFINE_ACCESSOR( uint8_t, phiLayer3RPCHoles ); + DEFINE_ACCESSOR( uint8_t, phiLayer4RPCHoles ); DEFINE_ACCESSOR( uint8_t, etaLayer1RPCHoles ); DEFINE_ACCESSOR( uint8_t, etaLayer2RPCHoles ); DEFINE_ACCESSOR( uint8_t, etaLayer3RPCHoles ); + DEFINE_ACCESSOR( uint8_t, etaLayer4RPCHoles ); DEFINE_ACCESSOR( uint8_t, phiLayer1TGCHits ); DEFINE_ACCESSOR( uint8_t, phiLayer2TGCHits ); @@ -116,6 +120,9 @@ namespace xAOD { DEFINE_ACCESSOR( uint8_t, isEndcapGoodLayers ); DEFINE_ACCESSOR( uint8_t, isSmallGoodSectors ); + DEFINE_ACCESSOR( uint8_t, cscEtaHits ); + DEFINE_ACCESSOR( uint8_t, cscUnspoiledEtaHits ); + default: std::cerr << "xAOD::MuonTrackParticle_v1 ERROR Unknown MuonSummaryType (" << type << ") requested" << std::endl; diff --git a/Event/xAOD/xAODMuon/Root/Muon_v1.cxx b/Event/xAOD/xAODMuon/Root/Muon_v1.cxx index 6bc3aca06a0aa14401833e70f2866e6a23b46535..cf568af465c2a0e405dbbf82610c59b4e195a28a 100644 --- a/Event/xAOD/xAODMuon/Root/Muon_v1.cxx +++ b/Event/xAOD/xAODMuon/Root/Muon_v1.cxx @@ -2,7 +2,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: Muon_v1.cxx 745098 2016-05-05 15:47:04Z wleight $ +// $Id: Muon_v1.cxx 792230 2017-01-15 06:03:39Z ssnyder $ // Misc includes #include <vector> @@ -479,6 +479,8 @@ bool Muon_v1::isolationCaloCorrection( float& value, const Iso::IsolationFlavou const ElementLink< TrackParticleContainer >& link = acc3( *this ); if ( link.isValid() ) return *link; } + + return 0; } default: { diff --git a/Event/xAOD/xAODMuon/xAODMuon/versions/MuonAuxContainer_v4.h b/Event/xAOD/xAODMuon/xAODMuon/versions/MuonAuxContainer_v4.h index b7058a4fc4e171e146818a135ce874ee981d9e89..53000121f0b541717c4b1de00dc5d9b92d8fab30 100644 --- a/Event/xAOD/xAODMuon/xAODMuon/versions/MuonAuxContainer_v4.h +++ b/Event/xAOD/xAODMuon/xAODMuon/versions/MuonAuxContainer_v4.h @@ -104,18 +104,22 @@ namespace xAOD { std::vector< uint8_t > phiLayer1RPCHits; std::vector< uint8_t > phiLayer2RPCHits; std::vector< uint8_t > phiLayer3RPCHits; + std::vector< uint8_t > phiLayer4RPCHits; std::vector< uint8_t > etaLayer1RPCHits; std::vector< uint8_t > etaLayer2RPCHits; std::vector< uint8_t > etaLayer3RPCHits; + std::vector< uint8_t > etaLayer4RPCHits; std::vector< uint8_t > phiLayer1RPCHoles; std::vector< uint8_t > phiLayer2RPCHoles; std::vector< uint8_t > phiLayer3RPCHoles; + std::vector< uint8_t > phiLayer4RPCHoles; std::vector< uint8_t > etaLayer1RPCHoles; std::vector< uint8_t > etaLayer2RPCHoles; std::vector< uint8_t > etaLayer3RPCHoles; + std::vector< uint8_t > etaLayer4RPCHoles; std::vector< uint8_t > phiLayer1TGCHits; std::vector< uint8_t > phiLayer2TGCHits; @@ -137,6 +141,9 @@ namespace xAOD { std::vector< uint8_t > etaLayer3TGCHoles; std::vector< uint8_t > etaLayer4TGCHoles; + std::vector< uint8_t > cscEtaHits; + std::vector< uint8_t > cscUnspoiledEtaHits; + /// @} /// @name Isolation values diff --git a/Event/xAOD/xAODTau/Root/TauJetAccessors_v3.icc b/Event/xAOD/xAODTau/Root/TauJetAccessors_v3.icc index 6deda2c19edb32cfaab526bf2e753ed84274dc5a..c23f1ed53a9538e361ef501cf6dc0c6a385315a1 100644 --- a/Event/xAOD/xAODTau/Root/TauJetAccessors_v3.icc +++ b/Event/xAOD/xAODTau/Root/TauJetAccessors_v3.icc @@ -221,6 +221,7 @@ break; DEFINE_TAUJETPARAMETER_ACCESSOR( int, GhostMuonSegmentCount ); DEFINE_TAUJETPARAMETER_ACCESSOR( int, nChargedTracks ); DEFINE_TAUJETPARAMETER_ACCESSOR( int, nIsolatedTracks ); + DEFINE_TAUJETPARAMETER_ACCESSOR( int, nModifiedIsolationTracks ); default: std::cerr << "xAOD::TauJetParameters ERROR Unknown integer detail (" diff --git a/Event/xAOD/xAODTau/xAODTau/TauDefs.h b/Event/xAOD/xAODTau/xAODTau/TauDefs.h index 7fad9f909fa77bbade0f44f78e6ce1618cd8f8cd..1d31ed3c7045e730501cdc0268b02897289dcf89 100644 --- a/Event/xAOD/xAODTau/xAODTau/TauDefs.h +++ b/Event/xAOD/xAODTau/xAODTau/TauDefs.h @@ -4,7 +4,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: TauDefs.h 784645 2016-11-16 16:36:25Z griffith $ +// $Id: TauDefs.h 796092 2017-02-08 00:14:16Z griffith $ #ifndef XAODTAU_TAUDEFS_H #define XAODTAU_TAUDEFS_H @@ -126,6 +126,7 @@ namespace TauJetParameters // = 16, // = 17, // = 18, + JetBDTSigVeryLoose = 18, // new in r21 JetBDTSigLoose = 19, // rename (add sig) JetBDTSigMedium = 20, // rename (add sig) JetBDTSigTight = 21, // rename (add sig) @@ -314,6 +315,7 @@ namespace TauJetParameters nChargedTracks=109, nIsolatedTracks=110, + nModifiedIsolationTracks=111,//no static variable for now //Tau/Ele BDTVars @@ -401,6 +403,7 @@ namespace TauJetParameters classifiedFake = 8, // track classified as pileup or fake tracks (should not be used for isolation computation) unclassified = 9, // helper enum for not yet classified tracks passTrkSelectionTight = 10, //pass the xAOD Tight track selection + modifiedIsolationTrack = 11, //passTrkSelector && !classifiedCharged //if you add another flag, you'll need to check the track sorting alg, it assumes unclassified is the last flag *This should be fixed in TauTrackClassifier now* //Track sorting just requires that the classifiedXXX bits are consecutive, charged is first (of classifiedXXX), and fake is last (of classifiedXXX) }; diff --git a/Event/xAOD/xAODTau/xAODTau/TauJetContainer.h b/Event/xAOD/xAODTau/xAODTau/TauJetContainer.h index a1eea6eafc21799569d8e5c3869f1a3ba28eb689..753631151e84d04caee36bd6d4cfbbaa3954e23b 100644 --- a/Event/xAOD/xAODTau/xAODTau/TauJetContainer.h +++ b/Event/xAOD/xAODTau/xAODTau/TauJetContainer.h @@ -4,7 +4,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: TauJetContainer.h 740338 2016-04-14 16:03:58Z griffith $ +// $Id: TauJetContainer.h 796007 2017-02-07 15:38:04Z griffith $ #ifndef XAODTAU_TAUJETCONTAINER_H #define XAODTAU_TAUJETCONTAINER_H diff --git a/Event/xAOD/xAODTau/xAODTau/versions/TauJetContainer_v2.h b/Event/xAOD/xAODTau/xAODTau/versions/TauJetContainer_v2.h index bb38e3e337be6e755850e1f9b545cae59549f9df..53a0c769f02423e8a259ac39b7eb6d47c1a3c263 100644 --- a/Event/xAOD/xAODTau/xAODTau/versions/TauJetContainer_v2.h +++ b/Event/xAOD/xAODTau/xAODTau/versions/TauJetContainer_v2.h @@ -4,7 +4,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: TauJetContainer_v2.h 631748 2014-11-28 09:58:13Z janus $ +// $Id: TauJetContainer_v2.h 796007 2017-02-07 15:38:04Z griffith $ #ifndef XAODTAU_VERSIONS_TAUCONTAINER_V2_H #define XAODTAU_VERSIONS_TAUCONTAINER_V2_H diff --git a/Event/xAOD/xAODTau/xAODTau/xAODTauDict.h b/Event/xAOD/xAODTau/xAODTau/xAODTauDict.h index 977c90f1e530eb76dbb6c2ff7ad820ddd6edf737..211a84aef0a0151af575cf07cc73c88e60b4c10a 100644 --- a/Event/xAOD/xAODTau/xAODTau/xAODTauDict.h +++ b/Event/xAOD/xAODTau/xAODTau/xAODTauDict.h @@ -4,7 +4,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: xAODTauDict.h 740338 2016-04-14 16:03:58Z griffith $ +// $Id: xAODTauDict.h 796007 2017-02-07 15:38:04Z griffith $ #ifndef XAODTAU_XAODTAUDICT_H #define XAODTAU_XAODTAUDICT_H diff --git a/Event/xAOD/xAODTracking/Root/NeutralParticleAuxContainer_v1.cxx b/Event/xAOD/xAODTracking/Root/NeutralParticleAuxContainer_v1.cxx index 397050704ea295c648f9db0f19ef8ab366283b6d..87aac54347afed946bd7cd517244985be5b21349 100644 --- a/Event/xAOD/xAODTracking/Root/NeutralParticleAuxContainer_v1.cxx +++ b/Event/xAOD/xAODTracking/Root/NeutralParticleAuxContainer_v1.cxx @@ -4,6 +4,10 @@ // $Id: NeutralParticleAuxContainer_v1.cxx 573493 2013-12-03 13:05:51Z emoyse $ +// System include(s): +#include <iostream> +#include <iterator> + // Local include(s): #include "xAODTracking/versions/NeutralParticleAuxContainer_v1.h" diff --git a/Event/xAOD/xAODTracking/test/xAODTracking_TrackParticlexAODHelpers_test.cxx b/Event/xAOD/xAODTracking/test/xAODTracking_TrackParticlexAODHelpers_test.cxx index d22e958f7d175e4b3e1edf7c28ef07d10ccee6dc..83edf848a6ff4915b73d3232f675f0e62f1eadd1 100644 --- a/Event/xAOD/xAODTracking/test/xAODTracking_TrackParticlexAODHelpers_test.cxx +++ b/Event/xAOD/xAODTracking/test/xAODTracking_TrackParticlexAODHelpers_test.cxx @@ -195,7 +195,7 @@ void test_d0significance() { float ref_d0_uncert=.05; float ref_z0_uncert=.5; float ref_qoverp = 1/30e3; - float ref_theta=60/180*M_PI; + float ref_theta=60.0/180.0*M_PI; //coverity 111358 std::vector<bool>::const_iterator valid_iter = valid.begin(); for (const Cov_t &beamspot_sigma: beamspot_sigma_list) { for( const float &phi: phi_list) { diff --git a/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h b/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h index 700839ece17e57e5e62a1fc7461bef37431287b5..a04109609e539daae3102e52314234f026b058fe 100644 --- a/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h +++ b/Event/xAOD/xAODTracking/xAODTracking/TrackingPrimitives.h @@ -354,42 +354,49 @@ namespace xAOD { phiLayer1RPCHits = 45, //!< number of phi hits in the first RPC trigger layer (BML1) phiLayer2RPCHits = 46, //!< number of phi hits in the second RPC trigger layer (BML2) phiLayer3RPCHits = 47, //!< number of phi hits in the third RPC trigger layer (BOL1) - - etaLayer1RPCHits = 48, //!< number of eta hits in the first RPC trigger layer (BML1) - etaLayer2RPCHits = 49, //!< number of eta hits in the second RPC trigger layer (BML2) - etaLayer3RPCHits = 50, //!< number of eta hits in the third RPC trigger layer (BOL1) - - phiLayer1RPCHoles = 51, //!< number of phi holes in the first RPC trigger layer (BML1) - phiLayer2RPCHoles = 52, //!< number of phi holes in the second RPC trigger layer (BML2) - phiLayer3RPCHoles = 53, //!< number of phi holes in the third RPC trigger layer (BOL1) - - etaLayer1RPCHoles = 54, //!< number of eta holes in the first RPC trigger layer (BML1) - etaLayer2RPCHoles = 55, //!< number of eta holes in the second RPC trigger layer (BML2) - etaLayer3RPCHoles = 56, //!< number of eta holes in the third RPC trigger layer (BOL1) - - phiLayer1TGCHits = 57, //!< number of phi hits in the first TGC trigger layer (T4) - phiLayer2TGCHits = 58, //!< number of phi hits in the second TGC trigger layer (T1) - phiLayer3TGCHits = 59, //!< number of phi hits in the third TGC trigger layer (T2) - phiLayer4TGCHits = 60, //!< number of phi hits in the fourth TGC trigger layer (T3) - - etaLayer1TGCHits = 61, //!< number of eta hits in the first TGC trigger layer (T4) - etaLayer2TGCHits = 62, //!< number of eta hits in the second TGC trigger layer (T1) - etaLayer3TGCHits = 63, //!< number of eta hits in the third TGC trigger layer (T2) - etaLayer4TGCHits = 64, //!< number of eta hits in the fourth TGC trigger layer (T3) - - phiLayer1TGCHoles = 65, //!< number of phi holes in the first TGC trigger layer (T4) - phiLayer2TGCHoles = 66, //!< number of phi holes in the second TGC trigger layer (T1) - phiLayer3TGCHoles = 67, //!< number of phi holes in the third TGC trigger layer (T2) - phiLayer4TGCHoles = 68, //!< number of phi holes in the fourth TGC trigger layer (T3) - - etaLayer1TGCHoles = 69, //!< number of eta holes in the first TGC trigger layer (T4) - etaLayer2TGCHoles = 70, //!< number of eta holes in the second TGC trigger layer (T1) - etaLayer3TGCHoles = 71, //!< number of eta holes in the third TGC trigger layer (T2) - etaLayer4TGCHoles = 72, //!< number of eta holes in the fourth TGC trigger layer (T3) - + phiLayer4RPCHits = 48, //!< number of phi hits in the fourth RPC trigger layer (BOL2) + + etaLayer1RPCHits = 49, //!< number of eta hits in the first RPC trigger layer (BML1) + etaLayer2RPCHits = 50, //!< number of eta hits in the second RPC trigger layer (BML2) + etaLayer3RPCHits = 51, //!< number of eta hits in the third RPC trigger layer (BOL1) + etaLayer4RPCHits = 52, //!< number of eta hits in the fourth RPC trigger layer (BOL2) + + phiLayer1RPCHoles = 53, //!< number of phi holes in the first RPC trigger layer (BML1) + phiLayer2RPCHoles = 54, //!< number of phi holes in the second RPC trigger layer (BML2) + phiLayer3RPCHoles = 55, //!< number of phi holes in the third RPC trigger layer (BOL1) + phiLayer4RPCHoles = 56, //!< number of phi holes in the fourth RPC trigger layer (BOL2) + + etaLayer1RPCHoles = 57, //!< number of eta holes in the first RPC trigger layer (BML1) + etaLayer2RPCHoles = 58, //!< number of eta holes in the second RPC trigger layer (BML2) + etaLayer3RPCHoles = 59, //!< number of eta holes in the third RPC trigger layer (BOL1) + etaLayer4RPCHoles = 60, //!< number of eta holes in the fourth RPC trigger layer (BOL2) + + phiLayer1TGCHits = 61, //!< number of phi hits in the first TGC trigger layer (T4) + phiLayer2TGCHits = 62, //!< number of phi hits in the second TGC trigger layer (T1) + phiLayer3TGCHits = 63, //!< number of phi hits in the third TGC trigger layer (T2) + phiLayer4TGCHits = 64, //!< number of phi hits in the fourth TGC trigger layer (T3) + + etaLayer1TGCHits = 65, //!< number of eta hits in the first TGC trigger layer (T4) + etaLayer2TGCHits = 66, //!< number of eta hits in the second TGC trigger layer (T1) + etaLayer3TGCHits = 67, //!< number of eta hits in the third TGC trigger layer (T2) + etaLayer4TGCHits = 68, //!< number of eta hits in the fourth TGC trigger layer (T3) + + phiLayer1TGCHoles = 69, //!< number of phi holes in the first TGC trigger layer (T4) + phiLayer2TGCHoles = 70, //!< number of phi holes in the second TGC trigger layer (T1) + phiLayer3TGCHoles = 71, //!< number of phi holes in the third TGC trigger layer (T2) + phiLayer4TGCHoles = 72, //!< number of phi holes in the fourth TGC trigger layer (T3) + + etaLayer1TGCHoles = 73, //!< number of eta holes in the first TGC trigger layer (T4) + etaLayer2TGCHoles = 74, //!< number of eta holes in the second TGC trigger layer (T1) + etaLayer3TGCHoles = 75, //!< number of eta holes in the third TGC trigger layer (T2) + etaLayer4TGCHoles = 76, //!< number of eta holes in the fourth TGC trigger layer (T3) + + //CSC debugging + cscEtaHits = 77, //!<number of CSC eta clusters on the track + cscUnspoiledEtaHits = 78, //!<number of unspoiled CSC eta clusters on track // -- numbers... - numberOfMuonSummaryTypes = 73 + numberOfMuonSummaryTypes = 79 }; /// A convenience namespace to make the client code easier to understand diff --git a/Event/xAOD/xAODTruthCnv/CMakeLists.txt b/Event/xAOD/xAODTruthCnv/CMakeLists.txt index 6141b7f244f5b128bc89077177fec6703cff555a..d9ee502e5ff549b65bf922ab866807acd886047f 100644 --- a/Event/xAOD/xAODTruthCnv/CMakeLists.txt +++ b/Event/xAOD/xAODTruthCnv/CMakeLists.txt @@ -1,10 +1,10 @@ ################################################################################ # Package: xAODTruthCnv ################################################################################ - + # Declare the package name: atlas_subdir( xAODTruthCnv ) - + # Declare the package's dependencies: atlas_depends_on_subdirs( PRIVATE Control/AthenaBaseComps @@ -12,20 +12,21 @@ atlas_depends_on_subdirs( PRIVATE Control/DataModel Control/StoreGate Event/EventInfo - Control/CxxUtils + Event/xAOD/xAODEventInfo Event/xAOD/xAODTruth GaudiKernel Generators/GeneratorObjects ) - + # External dependencies: find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) - + # Component(s) in the package: atlas_add_component( xAODTruthCnv src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaBaseComps AthenaKernel DataModel StoreGateLib SGtests EventInfo xAODEventInfo xAODTruth GaudiKernel GeneratorObjects ) - + # Install files from the package: atlas_install_joboptions( share/*.py ) + diff --git a/Event/xAOD/xAODTruthCnv/cmt/requirements b/Event/xAOD/xAODTruthCnv/cmt/requirements index ba25c87a6d49673065c0b4ebe52840a9de460e2a..b069962263610e129ada641fd77f14254e8699c6 100644 --- a/Event/xAOD/xAODTruthCnv/cmt/requirements +++ b/Event/xAOD/xAODTruthCnv/cmt/requirements @@ -7,7 +7,6 @@ author andy.buckley@cern.ch # Base package(s): use AtlasPolicy AtlasPolicy-* - public use AtlasPolicy AtlasPolicy-* private diff --git a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx index 94b7b988e2000259a08525d519ebbeff5ec26c62..4b0d32a14dd8a0563a109df3c1a0c6a43b4f37c6 100644 --- a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx +++ b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.cxx @@ -41,420 +41,423 @@ using namespace std; namespace xAODMaker { - - - xAODTruthCnvAlg::xAODTruthCnvAlg( const string& name, ISvcLocator* svcLoc ) + + + xAODTruthCnvAlg::xAODTruthCnvAlg( const string& name, ISvcLocator* svcLoc ) : AthAlgorithm( name, svcLoc ), m_metaStore( "MetaDataStore", name ), inputMetaStore( "StoreGateSvc/InputMetaDataStore",name) - { - declareProperty("AODContainerName", m_aodContainerName="GEN_AOD" ); - declareProperty("xAODTruthEventContainerName", m_xaodTruthEventContainerName="TruthEvents" ); - declareProperty("xAODTruthPileupEventContainerName", m_xaodTruthPUEventContainerName="TruthPileupEvents" ); - /// @todo TruthParticle -> TruthParticles - declareProperty("xAODTruthParticleContainerName", m_xaodTruthParticleContainerName="TruthParticles" ); - /// @todo TruthVertex -> TruthVertices - declareProperty("xAODTruthVertexContainerName", m_xaodTruthVertexContainerName="TruthVertices" ); - declareProperty("TruthLinks", m_truthLinkContainerName="xAODTruthLinks" ); - declareProperty( "WriteAllPileUpTruth", m_doAllPileUp = false); - declareProperty( "WriteInTimePileUpTruth", m_doInTimePileUp = false); - declareProperty( "MetaObjectName", m_metaName = "TruthMetaData" ); - declareProperty( "MetaDataStore", m_metaStore ); - declareProperty( "ForceRerun", m_forceRerun = false); - } - - - StatusCode xAODTruthCnvAlg::initialize() { - ATH_MSG_DEBUG("Initializing; package version: " << PACKAGE_VERSION ); - ATH_MSG_DEBUG("AODContainerName = " << m_aodContainerName ); - ATH_MSG_DEBUG("xAOD TruthEventContainer name = " << m_xaodTruthEventContainerName ); - ATH_MSG_DEBUG("xAOD TruthPileupEventContainer name = " << m_xaodTruthPUEventContainerName ); - ATH_MSG_DEBUG("xAOD TruthParticleContainer name = " << m_xaodTruthParticleContainerName ); - ATH_MSG_DEBUG("xAOD TruthVertexContainer name = " << m_xaodTruthVertexContainerName ); - if (m_doAllPileUp && m_doInTimePileUp) { - ATH_MSG_FATAL( "Contradictory xAOD truth pile-up setting: all pile-up AND in-time alone requested simultaneously. Check settings." ); - return StatusCode::FAILURE; + { + declareProperty("AODContainerName", m_aodContainerName="GEN_AOD" ); + declareProperty("xAODTruthEventContainerName", m_xaodTruthEventContainerName="TruthEvents" ); + declareProperty("xAODTruthPileupEventContainerName", m_xaodTruthPUEventContainerName="TruthPileupEvents" ); + /// @todo TruthParticle -> TruthParticles + declareProperty("xAODTruthParticleContainerName", m_xaodTruthParticleContainerName="TruthParticles" ); + /// @todo TruthVertex -> TruthVertices + declareProperty("xAODTruthVertexContainerName", m_xaodTruthVertexContainerName="TruthVertices" ); + declareProperty("TruthLinks", m_truthLinkContainerName="xAODTruthLinks" ); + declareProperty( "WriteAllPileUpTruth", m_doAllPileUp = false); + declareProperty( "WriteInTimePileUpTruth", m_doInTimePileUp = false); + declareProperty( "MetaObjectName", m_metaName = "TruthMetaData" ); + declareProperty( "MetaDataStore", m_metaStore ); + declareProperty( "ForceRerun", m_forceRerun = false); + declareProperty( "WriteTruthMetaData", m_writeMetaData = true); } - if (m_doAllPileUp) ATH_MSG_INFO( "All pile-up truth (including out-of-time) will be written" ); - if (m_doInTimePileUp) ATH_MSG_INFO( "In-time pile-up truth (but not out-of-time) will be written" ); - if (!m_doAllPileUp && !m_doInTimePileUp) ATH_MSG_INFO( "No pile-up truth will be written" ); - - CHECK( m_metaStore.retrieve() ); - - // Create an empty truth meta data container: - xAOD::TruthMetaDataAuxContainer* aux = new xAOD::TruthMetaDataAuxContainer(); - m_tmd = new xAOD::TruthMetaDataContainer(); - m_tmd->setStore( aux ); - - // Record the trigger configuration metadata into it: - CHECK( m_metaStore->record( aux, m_metaName + "Aux." ) ); - CHECK( m_metaStore->record( m_tmd, m_metaName ) ); - - return StatusCode::SUCCESS; - } - - - StatusCode xAODTruthCnvAlg::execute() { - - - // If the containers already exist then assume that nothing needs to be done - /// @todo Should this check be AND rather than OR? But pileup might be missing. - if ((evtStore()->contains< xAOD::TruthEventContainer >(m_xaodTruthEventContainerName) || - evtStore()->contains< xAOD::TruthPileupEventContainer >(m_xaodTruthPUEventContainerName) || - evtStore()->contains< xAOD::TruthParticleContainer >(m_xaodTruthParticleContainerName) || - evtStore()->contains< xAOD::TruthVertexContainer >(m_xaodTruthVertexContainerName)) && - !m_forceRerun) { - ATH_MSG_WARNING("xAOD Truth seems to be already available in the event"); - return StatusCode::SUCCESS; - } - - xAODTruthParticleLinkVector* truthLinkVec = new xAODTruthParticleLinkVector(); - CHECK( evtStore()->record( truthLinkVec, m_truthLinkContainerName ) ); - - if (evtStore()->contains<McEventCollection>(m_aodContainerName)) { - - // Retrieve the HepMC truth: - const McEventCollection* mcColl = 0; - CHECK( evtStore()->retrieve( mcColl, m_aodContainerName ) ); - ATH_MSG_DEBUG( "Retrieved HepMC with key: " << m_aodContainerName ); - - // ************************************************************** - // Create the xAOD containers and their auxiliary stores: - // ************************************************************** - // Signal event - xAOD::TruthEventContainer* xTruthEventContainer = new xAOD::TruthEventContainer(); - CHECK( evtStore()->record( xTruthEventContainer, m_xaodTruthEventContainerName ) ); - xAOD::TruthEventAuxContainer* xTruthEventAuxContainer = new xAOD::TruthEventAuxContainer(); - CHECK( evtStore()->record( xTruthEventAuxContainer, m_xaodTruthEventContainerName + "Aux." ) ); - xTruthEventContainer->setStore( xTruthEventAuxContainer ); - ATH_MSG_DEBUG( "Recorded TruthEventContainer with key: " << m_xaodTruthEventContainerName ); - // Pile-up events - xAOD::TruthPileupEventContainer* xTruthPileupEventContainer = 0; - xAOD::TruthPileupEventAuxContainer* xTruthPileupEventAuxContainer = 0; - if (m_doAllPileUp || m_doInTimePileUp) { - xTruthPileupEventContainer = new xAOD::TruthPileupEventContainer(); - CHECK( evtStore()->record( xTruthPileupEventContainer, m_xaodTruthPUEventContainerName ) ); - xTruthPileupEventAuxContainer = new xAOD::TruthPileupEventAuxContainer(); - CHECK( evtStore()->record( xTruthPileupEventAuxContainer, m_xaodTruthPUEventContainerName + "Aux." ) ); - xTruthPileupEventContainer->setStore( xTruthPileupEventAuxContainer ); - ATH_MSG_DEBUG( "Recorded TruthPileupEventContainer with key: " << m_xaodTruthPUEventContainerName ); - } - // Particles - xAOD::TruthParticleContainer* xTruthParticleContainer = new xAOD::TruthParticleContainer(); - CHECK( evtStore()->record( xTruthParticleContainer, m_xaodTruthParticleContainerName ) ); - xAOD::TruthParticleAuxContainer* xTruthParticleAuxContainer = new xAOD::TruthParticleAuxContainer(); - CHECK( evtStore()->record( xTruthParticleAuxContainer, m_xaodTruthParticleContainerName + "Aux." ) ); - xTruthParticleContainer->setStore( xTruthParticleAuxContainer ); - ATH_MSG_DEBUG( "Recorded TruthParticleContainer with key: " << m_xaodTruthParticleContainerName ); - // Vertices - xAOD::TruthVertexContainer* xTruthVertexContainer = new xAOD::TruthVertexContainer(); - CHECK( evtStore()->record( xTruthVertexContainer, m_xaodTruthVertexContainerName ) ); - xAOD::TruthVertexAuxContainer* xTruthVertexAuxContainer = new xAOD::TruthVertexAuxContainer(); - CHECK( evtStore()->record( xTruthVertexAuxContainer, m_xaodTruthVertexContainerName + "Aux." ) ); - xTruthVertexContainer->setStore( xTruthVertexAuxContainer ); - ATH_MSG_DEBUG( "Recorded TruthVertexContainer with key: " << m_xaodTruthVertexContainerName ); - - // *********************************************************************************** - // Create the xAOD objects - // This consists of three parts: - // (1) For each Athena event, loop over the GenEvents and build TruthEvent collections - // In principle there can be more than one GenEvent per event - // (2) For each GenEvent, loop over the GenParticles. For each GenParticle: - // (a) Create a TruthParticle. - // (b) Call fillParticle - // (c) Add the TruthParticle to the TruthParticle container, and add - // an EL to this TruthParticle to the truthParticles in TruthEvent - // (call this EL eltp) - // (d) For the GenVertex * that's this particle's production vertex, - // (i) see if it is in tempMap. If not, add it. - // (ii) add a copy of eltp (the EL to this truth particle) to map[gv].second - // (e) For the GenVertex * that's this particle's decay vertex, - // (i) see if it is in tempMap. If not, add it. - // (ii) add a copy of eltp (the EL to this truth particle) to map[gv].first - // (3) Iterate over tempMap. For each GenVertex *: - // (a) Create a TruthVertex - // (b) Call fillVertex - // (c) Add the TruthVertex to the TruthTruth container, and add an EL to this TruthVertex - // to the truthVertices in TruthEvent. (call this EL eltv) - // (d) call tv->setIncomingParticles(mapiter.second.first) <- I think mapiter.second.first is the first of the pair - // (e) call tv->setOutgoingParticles(mapiter.second.second) - // (f) Iterate through the incomingParticles, and set the decay vertex EL as eltv. - // (g) Iterate through the outgoingParticles, and set the incoming vertex EL as eltv. - // - // Comment lines below follow this recipe - // ************************************************************************************ - - // (1) Build TruthEvents - ATH_MSG_DEBUG("Number of GenEvents in this Athena event = " << mcColl->size()); - for (unsigned int cntr = 0; cntr < mcColl->size(); ++cntr) { - const HepMC::GenEvent* genEvt = (*mcColl)[cntr]; - bool isSignalProcess(false); - if (cntr==0) isSignalProcess=true; - if (cntr>0) { - // Handle pile-up events - // If in-time pileup only is requested, loop stops when - // the separator between out-of-time and in-time is reached - // Separator defined by pid==0 and eventNumber==-1 as per - // https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/PileupDigitization#Arrangement_of_Truth_Information - if (!m_doInTimePileUp && !m_doAllPileUp) break; - isSignalProcess=false; - int pid = genEvt->signal_process_id(); - int eventNumber = genEvt->event_number(); - if (m_doInTimePileUp && pid==0 && eventNumber==-1) break; // stop at the separator + + + StatusCode xAODTruthCnvAlg::initialize() { + ATH_MSG_DEBUG("Initializing; package version: " << PACKAGE_VERSION ); + ATH_MSG_DEBUG("AODContainerName = " << m_aodContainerName ); + ATH_MSG_DEBUG("xAOD TruthEventContainer name = " << m_xaodTruthEventContainerName ); + ATH_MSG_DEBUG("xAOD TruthPileupEventContainer name = " << m_xaodTruthPUEventContainerName ); + ATH_MSG_DEBUG("xAOD TruthParticleContainer name = " << m_xaodTruthParticleContainerName ); + ATH_MSG_DEBUG("xAOD TruthVertexContainer name = " << m_xaodTruthVertexContainerName ); + if (m_doAllPileUp && m_doInTimePileUp) { + ATH_MSG_FATAL( "Contradictory xAOD truth pile-up setting: all pile-up AND in-time alone requested simultaneously. Check settings." ); + return StatusCode::FAILURE; } - - xAOD::TruthEvent* xTruthEvent = new xAOD::TruthEvent(); - xAOD::TruthPileupEvent* xTruthPileupEvent = new xAOD::TruthPileupEvent(); - - /// @todo Drop or re-enable these? Signal process can be set to DSID... preferably not to the gen-name code - //xTruthEvent->setSignalProcessId(genEvt->signal_process_id()); - //xTruthEvent->setEventNumber(genEvt->event_number()); - - if (isSignalProcess) { - xTruthEventContainer->push_back( xTruthEvent ); - // Cross-section - const HepMC::GenCrossSection* const crossSection = genEvt->cross_section(); - xTruthEvent->setCrossSection(crossSection ? (float)crossSection->cross_section() : -1); - xTruthEvent->setCrossSectionError(crossSection ? (float)crossSection->cross_section_error() : -1); - - //The mcChannelNumber is used as a unique identifier for which truth meta data belongs to - const EventStreamInfo* esi = nullptr; - CHECK( inputMetaStore->retrieve(esi)); - uint32_t mcChannelNumber = esi->getEventTypes().begin()->mc_channel_number(); + if (m_doAllPileUp) ATH_MSG_INFO( "All pile-up truth (including out-of-time) will be written" ); + if (m_doInTimePileUp) ATH_MSG_INFO( "In-time pile-up truth (but not out-of-time) will be written" ); + if (!m_doAllPileUp && !m_doInTimePileUp) ATH_MSG_INFO( "No pile-up truth will be written" ); + + if (m_writeMetaData) { + CHECK( m_metaStore.retrieve() ); + // Create an empty truth meta data container: + xAOD::TruthMetaDataAuxContainer* aux = new xAOD::TruthMetaDataAuxContainer(); + m_tmd = new xAOD::TruthMetaDataContainer(); + m_tmd->setStore( aux ); + + // Record the trigger configuration metadata into it: + CHECK( m_metaStore->record( aux, m_metaName + "Aux." ) ); + CHECK( m_metaStore->record( m_tmd, m_metaName ) ); + } + + return StatusCode::SUCCESS; + } - //Inserting in a (unordered_)set returns an <iterator, boolean> pair, where the boolean - //is used to check if the key already exists (returns false in the case it exists) - if( m_existingMetaDataChan.insert(mcChannelNumber).second ) { - xAOD::TruthMetaData* md = new xAOD::TruthMetaData(); - m_tmd->push_back( md ); - - auto weightNameMap = genEvt->m_weights.m_names; - std::vector<std::string> orderedWeightNameVec; - orderedWeightNameVec.reserve( weightNameMap.size() ); - for (auto& entry: weightNameMap) { - orderedWeightNameVec.push_back(entry.first); - } - - //The map from the HepMC record pairs the weight names with a corresponding index, - //it is not guaranteed that the indices are ascending when iterating over the map - std::sort(orderedWeightNameVec.begin(), orderedWeightNameVec.end(), - [&](std::string i, std::string j){return weightNameMap.at(i) < weightNameMap.at(j);}); - - md->setMcChannelNumber(mcChannelNumber); - md->setWeightNames( std::move(orderedWeightNameVec) ); - } - - // Event weights - vector<float> weights; - for (const double& w : genEvt->weights()) weights.push_back((float)(w)); - xTruthEvent->setWeights(weights); - - // Heavy ion info - const HepMC::HeavyIon* const hiInfo = genEvt->heavy_ion(); - if (hiInfo) { - xTruthEvent->setHeavyIonParameter(hiInfo->Ncoll_hard(), xAOD::TruthEvent::NCOLLHARD); - xTruthEvent->setHeavyIonParameter(hiInfo->Npart_proj(), xAOD::TruthEvent::NPARTPROJ); - xTruthEvent->setHeavyIonParameter(hiInfo->Npart_targ(), xAOD::TruthEvent::NPARTTARG); - xTruthEvent->setHeavyIonParameter(hiInfo->Ncoll(), xAOD::TruthEvent::NCOLL); - xTruthEvent->setHeavyIonParameter(hiInfo->spectator_neutrons(), xAOD::TruthEvent::SPECTATORNEUTRONS); - xTruthEvent->setHeavyIonParameter(hiInfo->spectator_protons(), xAOD::TruthEvent::SPECTATORPROTONS); - xTruthEvent->setHeavyIonParameter(hiInfo->N_Nwounded_collisions(), xAOD::TruthEvent::NNWOUNDEDCOLLISIONS); - xTruthEvent->setHeavyIonParameter(hiInfo->Nwounded_N_collisions(), xAOD::TruthEvent::NWOUNDEDNCOLLISIONS); - xTruthEvent->setHeavyIonParameter(hiInfo->Nwounded_Nwounded_collisions(), xAOD::TruthEvent::NWOUNDEDNWOUNDEDCOLLISIONS); - xTruthEvent->setHeavyIonParameter(hiInfo->impact_parameter(), xAOD::TruthEvent::IMPACTPARAMETER); - xTruthEvent->setHeavyIonParameter(hiInfo->event_plane_angle(), xAOD::TruthEvent::EVENTPLANEANGLE); - xTruthEvent->setHeavyIonParameter(hiInfo->eccentricity(), xAOD::TruthEvent::ECCENTRICITY); - xTruthEvent->setHeavyIonParameter(hiInfo->sigma_inel_NN(), xAOD::TruthEvent::SIGMAINELNN); - // This doesn't yet exist in our version of HepMC - // xTruthEvent->setHeavyIonParameter(hiInfo->centrality(),xAOD::TruthEvent::CENTRALITY); - } - - // Parton density info - // This will exist 99% of the time, except for e.g. cosmic or particle gun simulation - const HepMC::PdfInfo* const pdfInfo = genEvt->pdf_info(); - if (pdfInfo) { - xTruthEvent->setPdfInfoParameter(pdfInfo->id1(), xAOD::TruthEvent::PDGID1); - xTruthEvent->setPdfInfoParameter(pdfInfo->id2(), xAOD::TruthEvent::PDGID2); - xTruthEvent->setPdfInfoParameter(pdfInfo->pdf_id1(), xAOD::TruthEvent::PDFID1); - xTruthEvent->setPdfInfoParameter(pdfInfo->pdf_id2(), xAOD::TruthEvent::PDFID2); - - xTruthEvent->setPdfInfoParameter((float)pdfInfo->x1(), xAOD::TruthEvent::X1); - xTruthEvent->setPdfInfoParameter((float)pdfInfo->x2(), xAOD::TruthEvent::X2); - xTruthEvent->setPdfInfoParameter((float)pdfInfo->scalePDF(), xAOD::TruthEvent::Q); - xTruthEvent->setPdfInfoParameter((float)pdfInfo->pdf1(), xAOD::TruthEvent::XF1); - xTruthEvent->setPdfInfoParameter((float)pdfInfo->pdf2(), xAOD::TruthEvent::XF2); - } - } - if (!isSignalProcess) xTruthPileupEventContainer->push_back( xTruthPileupEvent ); - - // (2) Build particles and vertices - // Map for building associations between particles and vertices - // The pair in the map is the (incomingParticles . outgoingParticles) of the given vertex - // If signal process vertex is a disconnected vertex (no incoming/outgoing particles), add it manually - VertexMap vertexMap; - VertexMap::iterator mapItr; - vector<const HepMC::GenVertex*> vertices; - - // Check signal process vertex - // If this is a disconnected vertex, add it manually or won't be added from the loop over particles below. - HepMC::GenVertex* disconnectedSignalProcessVtx = genEvt->signal_process_vertex(); // Get the signal process vertex - if (disconnectedSignalProcessVtx) { - if (disconnectedSignalProcessVtx->particles_in_size() == 0 && - disconnectedSignalProcessVtx->particles_out_size() == 0 ) { - //This is a disconnected vertex, add it manually - vertices.push_back (disconnectedSignalProcessVtx); - } - } else { - ATH_MSG_WARNING("Signal process vertex pointer not valid in HepMC Collection for GenEvent #" << cntr << " / " << mcColl->size()); - } - - // Get the beam particles - pair<HepMC::GenParticle*,HepMC::GenParticle*> beamParticles; - if ( genEvt->valid_beam_particles() ) beamParticles = genEvt->beam_particles(); - for (HepMC::GenEvent::particle_const_iterator pitr=genEvt->particles_begin(); pitr!=genEvt->particles_end(); ++pitr) { - // (a) create TruthParticle - xAOD::TruthParticle* xTruthParticle = new xAOD::TruthParticle(); - xTruthParticleContainer->push_back( xTruthParticle ); - fillParticle(xTruthParticle, *pitr); // (b) Copy HepMC info into the new particle - // (c) Put particle into container; Build Event<->Particle element link - const ElementLink<xAOD::TruthParticleContainer> eltp(*xTruthParticleContainer, xTruthParticleContainer->size()-1); - if (isSignalProcess) xTruthEvent->addTruthParticleLink(eltp); - if (!isSignalProcess) xTruthPileupEvent->addTruthParticleLink(eltp); - - // Create link between HepMC and xAOD truth - if (isSignalProcess) truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*pitr),0), eltp)); - if (!isSignalProcess) truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*pitr),genEvt->event_number()), eltp)); - - // Is this one of the beam particles? - if (genEvt->valid_beam_particles()) { - if (isSignalProcess) { - if (*pitr == beamParticles.first) xTruthEvent->setBeamParticle1Link(eltp); - if (*pitr == beamParticles.second) xTruthEvent->setBeamParticle2Link(eltp); + + StatusCode xAODTruthCnvAlg::execute() { + + + // If the containers already exist then assume that nothing needs to be done + /// @todo Should this check be AND rather than OR? But pileup might be missing. + if ((evtStore()->contains< xAOD::TruthEventContainer >(m_xaodTruthEventContainerName) || + evtStore()->contains< xAOD::TruthPileupEventContainer >(m_xaodTruthPUEventContainerName) || + evtStore()->contains< xAOD::TruthParticleContainer >(m_xaodTruthParticleContainerName) || + evtStore()->contains< xAOD::TruthVertexContainer >(m_xaodTruthVertexContainerName)) && + !m_forceRerun) { + ATH_MSG_WARNING("xAOD Truth seems to be already available in the event"); + return StatusCode::SUCCESS; + } + + xAODTruthParticleLinkVector* truthLinkVec = new xAODTruthParticleLinkVector(); + CHECK( evtStore()->record( truthLinkVec, m_truthLinkContainerName ) ); + + if (evtStore()->contains<McEventCollection>(m_aodContainerName)) { + + // Retrieve the HepMC truth: + const McEventCollection* mcColl = 0; + CHECK( evtStore()->retrieve( mcColl, m_aodContainerName ) ); + ATH_MSG_DEBUG( "Retrieved HepMC with key: " << m_aodContainerName ); + + // ************************************************************** + // Create the xAOD containers and their auxiliary stores: + // ************************************************************** + // Signal event + xAOD::TruthEventContainer* xTruthEventContainer = new xAOD::TruthEventContainer(); + CHECK( evtStore()->record( xTruthEventContainer, m_xaodTruthEventContainerName ) ); + xAOD::TruthEventAuxContainer* xTruthEventAuxContainer = new xAOD::TruthEventAuxContainer(); + CHECK( evtStore()->record( xTruthEventAuxContainer, m_xaodTruthEventContainerName + "Aux." ) ); + xTruthEventContainer->setStore( xTruthEventAuxContainer ); + ATH_MSG_DEBUG( "Recorded TruthEventContainer with key: " << m_xaodTruthEventContainerName ); + // Pile-up events + xAOD::TruthPileupEventContainer* xTruthPileupEventContainer = 0; + xAOD::TruthPileupEventAuxContainer* xTruthPileupEventAuxContainer = 0; + if (m_doAllPileUp || m_doInTimePileUp) { + xTruthPileupEventContainer = new xAOD::TruthPileupEventContainer(); + CHECK( evtStore()->record( xTruthPileupEventContainer, m_xaodTruthPUEventContainerName ) ); + xTruthPileupEventAuxContainer = new xAOD::TruthPileupEventAuxContainer(); + CHECK( evtStore()->record( xTruthPileupEventAuxContainer, m_xaodTruthPUEventContainerName + "Aux." ) ); + xTruthPileupEventContainer->setStore( xTruthPileupEventAuxContainer ); + ATH_MSG_DEBUG( "Recorded TruthPileupEventContainer with key: " << m_xaodTruthPUEventContainerName ); } - } - // (d) Particle's production vertex - HepMC::GenVertex* productionVertex = (*pitr)->production_vertex(); - if (productionVertex) { - VertexParticles& parts = vertexMap[productionVertex]; - if (parts.incoming.empty() && parts.outgoing.empty()) - vertices.push_back (productionVertex); - parts.outgoingEL.push_back(eltp); - parts.outgoing.push_back(xTruthParticle); - } - // - // else maybe want to keep track that this is the production vertex - // - // (e) Particle's decay vertex - HepMC::GenVertex* decayVertex = (*pitr)->end_vertex(); - if (decayVertex) { - VertexParticles& parts = vertexMap[decayVertex]; - if (parts.incoming.empty() && parts.outgoing.empty()) - vertices.push_back (decayVertex); - parts.incomingEL.push_back(eltp); - parts.incoming.push_back(xTruthParticle); - } - - } // end of loop over particles - - // (3) Loop over the map - HepMC::GenVertex* signalProcessVtx = genEvt->signal_process_vertex(); // Get the signal process vertex - for (const HepMC::GenVertex* vertex : vertices) { - const auto& parts = vertexMap[vertex]; - // (a) create TruthVertex - xAOD::TruthVertex* xTruthVertex = new xAOD::TruthVertex(); - xTruthVertexContainer->push_back( xTruthVertex ); - fillVertex(xTruthVertex, vertex); // (b) Copy HepMC info into the new vertex - // (c) Put particle into container; Build Event<->Vertex element link - ElementLink<xAOD::TruthVertexContainer> eltv(*xTruthVertexContainer, xTruthVertexContainer->size()-1); - // Mark if this is the signal process vertex - if (vertex == signalProcessVtx && isSignalProcess) xTruthEvent->setSignalProcessVertexLink(eltv); - if (isSignalProcess) xTruthEvent->addTruthVertexLink(eltv); - if (!isSignalProcess) xTruthPileupEvent->addTruthVertexLink(eltv); - // (d) Assign incoming particles to the vertex, from the map - xTruthVertex->setIncomingParticleLinks( parts.incomingEL ); - // (e) Assign outgoing particles to the vertex, from the map - xTruthVertex->setOutgoingParticleLinks( parts.outgoingEL ); - // (f) Set Particle<->Vertex links for incoming particles - for (xAOD::TruthParticle* p : parts.incoming) p->setDecayVtxLink(eltv); - // (g) Set Particle<->Vertex links for incoming particles - for (xAOD::TruthParticle* p : parts.outgoing) p->setProdVtxLink(eltv); - } //end of loop over vertices - - // Delete the event that wasn't used - if (isSignalProcess) delete xTruthPileupEvent; - if (!isSignalProcess) delete xTruthEvent; - - } // end of loop over McEventCollection - - } else { - - ATH_MSG_INFO("McEventCollection with name " << m_aodContainerName << " not found"); - - // Retrieve the xAOD Truth and recreate the TruthLinks - if ( !evtStore()->contains<xAOD::TruthEventContainer>(m_xaodTruthEventContainerName) ) { - ATH_MSG_WARNING("TruthEventContainer " << m_xaodTruthEventContainerName << " not found"); - return StatusCode::SUCCESS; - } - xAOD::TruthEventContainer* xTruthEventContainer = 0; - CHECK( evtStore()->retrieve( xTruthEventContainer, m_xaodTruthEventContainerName ) ); - - // Loop over events and particles - for (auto evt : *xTruthEventContainer) { - for (const auto& par : evt->truthParticleLinks()) { - if ( !par.isValid() ) { - //ATH_MSG_WARNING("Found invalid particle element link in TruthEvent " << evt->eventNumber()); - ATH_MSG_WARNING("Found invalid particle element link in TruthEvent"); //< @todo Use HepMC evt number? - continue; - } - // Create link between HepMC and xAOD truth - //truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*par)->barcode(), evt->eventNumber()), par)); - /// @todo AB: Truth particle links should only be made to the signal event... hence the 0. Right? - truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*par)->barcode(), 0), par)); + // Particles + xAOD::TruthParticleContainer* xTruthParticleContainer = new xAOD::TruthParticleContainer(); + CHECK( evtStore()->record( xTruthParticleContainer, m_xaodTruthParticleContainerName ) ); + xAOD::TruthParticleAuxContainer* xTruthParticleAuxContainer = new xAOD::TruthParticleAuxContainer(); + CHECK( evtStore()->record( xTruthParticleAuxContainer, m_xaodTruthParticleContainerName + "Aux." ) ); + xTruthParticleContainer->setStore( xTruthParticleAuxContainer ); + ATH_MSG_DEBUG( "Recorded TruthParticleContainer with key: " << m_xaodTruthParticleContainerName ); + // Vertices + xAOD::TruthVertexContainer* xTruthVertexContainer = new xAOD::TruthVertexContainer(); + CHECK( evtStore()->record( xTruthVertexContainer, m_xaodTruthVertexContainerName ) ); + xAOD::TruthVertexAuxContainer* xTruthVertexAuxContainer = new xAOD::TruthVertexAuxContainer(); + CHECK( evtStore()->record( xTruthVertexAuxContainer, m_xaodTruthVertexContainerName + "Aux." ) ); + xTruthVertexContainer->setStore( xTruthVertexAuxContainer ); + ATH_MSG_DEBUG( "Recorded TruthVertexContainer with key: " << m_xaodTruthVertexContainerName ); + + // *********************************************************************************** + // Create the xAOD objects + // This consists of three parts: + // (1) For each Athena event, loop over the GenEvents and build TruthEvent collections + // In principle there can be more than one GenEvent per event + // (2) For each GenEvent, loop over the GenParticles. For each GenParticle: + // (a) Create a TruthParticle. + // (b) Call fillParticle + // (c) Add the TruthParticle to the TruthParticle container, and add + // an EL to this TruthParticle to the truthParticles in TruthEvent + // (call this EL eltp) + // (d) For the GenVertex * that's this particle's production vertex, + // (i) see if it is in tempMap. If not, add it. + // (ii) add a copy of eltp (the EL to this truth particle) to map[gv].second + // (e) For the GenVertex * that's this particle's decay vertex, + // (i) see if it is in tempMap. If not, add it. + // (ii) add a copy of eltp (the EL to this truth particle) to map[gv].first + // (3) Iterate over tempMap. For each GenVertex *: + // (a) Create a TruthVertex + // (b) Call fillVertex + // (c) Add the TruthVertex to the TruthTruth container, and add an EL to this TruthVertex + // to the truthVertices in TruthEvent. (call this EL eltv) + // (d) call tv->setIncomingParticles(mapiter.second.first) <- I think mapiter.second.first is the first of the pair + // (e) call tv->setOutgoingParticles(mapiter.second.second) + // (f) Iterate through the incomingParticles, and set the decay vertex EL as eltv. + // (g) Iterate through the outgoingParticles, and set the incoming vertex EL as eltv. + // + // Comment lines below follow this recipe + // ************************************************************************************ + + // (1) Build TruthEvents + ATH_MSG_DEBUG("Number of GenEvents in this Athena event = " << mcColl->size()); + for (unsigned int cntr = 0; cntr < mcColl->size(); ++cntr) { + const HepMC::GenEvent* genEvt = (*mcColl)[cntr]; + bool isSignalProcess(false); + if (cntr==0) isSignalProcess=true; + if (cntr>0) { + // Handle pile-up events + // If in-time pileup only is requested, loop stops when + // the separator between out-of-time and in-time is reached + // Separator defined by pid==0 and eventNumber==-1 as per + // https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/PileupDigitization#Arrangement_of_Truth_Information + if (!m_doInTimePileUp && !m_doAllPileUp) break; + isSignalProcess=false; + int pid = genEvt->signal_process_id(); + int eventNumber = genEvt->event_number(); + if (m_doInTimePileUp && pid==0 && eventNumber==-1) break; // stop at the separator + } + + xAOD::TruthEvent* xTruthEvent = new xAOD::TruthEvent(); + xAOD::TruthPileupEvent* xTruthPileupEvent = new xAOD::TruthPileupEvent(); + + /// @todo Drop or re-enable these? Signal process can be set to DSID... preferably not to the gen-name code + //xTruthEvent->setSignalProcessId(genEvt->signal_process_id()); + //xTruthEvent->setEventNumber(genEvt->event_number()); + + if (isSignalProcess) { + xTruthEventContainer->push_back( xTruthEvent ); + // Cross-section + const HepMC::GenCrossSection* const crossSection = genEvt->cross_section(); + xTruthEvent->setCrossSection(crossSection ? (float)crossSection->cross_section() : -1); + xTruthEvent->setCrossSectionError(crossSection ? (float)crossSection->cross_section_error() : -1); + + if (m_writeMetaData) { + //The mcChannelNumber is used as a unique identifier for which truth meta data belongs to + const EventStreamInfo* esi = nullptr; + CHECK( inputMetaStore->retrieve(esi)); + uint32_t mcChannelNumber = esi->getEventTypes().begin()->mc_channel_number(); + + //Inserting in a (unordered_)set returns an <iterator, boolean> pair, where the boolean + //is used to check if the key already exists (returns false in the case it exists) + if( m_existingMetaDataChan.insert(mcChannelNumber).second ) { + xAOD::TruthMetaData* md = new xAOD::TruthMetaData(); + m_tmd->push_back( md ); + + auto weightNameMap = genEvt->m_weights.m_names; + std::vector<std::string> orderedWeightNameVec; + orderedWeightNameVec.reserve( weightNameMap.size() ); + for (auto& entry: weightNameMap) { + orderedWeightNameVec.push_back(entry.first); + } + + //The map from the HepMC record pairs the weight names with a corresponding index, + //it is not guaranteed that the indices are ascending when iterating over the map + std::sort(orderedWeightNameVec.begin(), orderedWeightNameVec.end(), + [&](std::string i, std::string j){return weightNameMap.at(i) < weightNameMap.at(j);}); + + md->setMcChannelNumber(mcChannelNumber); + md->setWeightNames( std::move(orderedWeightNameVec) ); + } + } + // Event weights + vector<float> weights; + for (const double& w : genEvt->weights()) weights.push_back((float)(w)); + xTruthEvent->setWeights(weights); + + // Heavy ion info + const HepMC::HeavyIon* const hiInfo = genEvt->heavy_ion(); + if (hiInfo) { + xTruthEvent->setHeavyIonParameter(hiInfo->Ncoll_hard(), xAOD::TruthEvent::NCOLLHARD); + xTruthEvent->setHeavyIonParameter(hiInfo->Npart_proj(), xAOD::TruthEvent::NPARTPROJ); + xTruthEvent->setHeavyIonParameter(hiInfo->Npart_targ(), xAOD::TruthEvent::NPARTTARG); + xTruthEvent->setHeavyIonParameter(hiInfo->Ncoll(), xAOD::TruthEvent::NCOLL); + xTruthEvent->setHeavyIonParameter(hiInfo->spectator_neutrons(), xAOD::TruthEvent::SPECTATORNEUTRONS); + xTruthEvent->setHeavyIonParameter(hiInfo->spectator_protons(), xAOD::TruthEvent::SPECTATORPROTONS); + xTruthEvent->setHeavyIonParameter(hiInfo->N_Nwounded_collisions(), xAOD::TruthEvent::NNWOUNDEDCOLLISIONS); + xTruthEvent->setHeavyIonParameter(hiInfo->Nwounded_N_collisions(), xAOD::TruthEvent::NWOUNDEDNCOLLISIONS); + xTruthEvent->setHeavyIonParameter(hiInfo->Nwounded_Nwounded_collisions(), xAOD::TruthEvent::NWOUNDEDNWOUNDEDCOLLISIONS); + xTruthEvent->setHeavyIonParameter(hiInfo->impact_parameter(), xAOD::TruthEvent::IMPACTPARAMETER); + xTruthEvent->setHeavyIonParameter(hiInfo->event_plane_angle(), xAOD::TruthEvent::EVENTPLANEANGLE); + xTruthEvent->setHeavyIonParameter(hiInfo->eccentricity(), xAOD::TruthEvent::ECCENTRICITY); + xTruthEvent->setHeavyIonParameter(hiInfo->sigma_inel_NN(), xAOD::TruthEvent::SIGMAINELNN); + // This doesn't yet exist in our version of HepMC + // xTruthEvent->setHeavyIonParameter(hiInfo->centrality(),xAOD::TruthEvent::CENTRALITY); + } + + // Parton density info + // This will exist 99% of the time, except for e.g. cosmic or particle gun simulation + const HepMC::PdfInfo* const pdfInfo = genEvt->pdf_info(); + if (pdfInfo) { + xTruthEvent->setPdfInfoParameter(pdfInfo->id1(), xAOD::TruthEvent::PDGID1); + xTruthEvent->setPdfInfoParameter(pdfInfo->id2(), xAOD::TruthEvent::PDGID2); + xTruthEvent->setPdfInfoParameter(pdfInfo->pdf_id1(), xAOD::TruthEvent::PDFID1); + xTruthEvent->setPdfInfoParameter(pdfInfo->pdf_id2(), xAOD::TruthEvent::PDFID2); + + xTruthEvent->setPdfInfoParameter((float)pdfInfo->x1(), xAOD::TruthEvent::X1); + xTruthEvent->setPdfInfoParameter((float)pdfInfo->x2(), xAOD::TruthEvent::X2); + xTruthEvent->setPdfInfoParameter((float)pdfInfo->scalePDF(), xAOD::TruthEvent::Q); + xTruthEvent->setPdfInfoParameter((float)pdfInfo->pdf1(), xAOD::TruthEvent::XF1); + xTruthEvent->setPdfInfoParameter((float)pdfInfo->pdf2(), xAOD::TruthEvent::XF2); + } + } + if (!isSignalProcess) xTruthPileupEventContainer->push_back( xTruthPileupEvent ); + + // (2) Build particles and vertices + // Map for building associations between particles and vertices + // The pair in the map is the (incomingParticles . outgoingParticles) of the given vertex + // If signal process vertex is a disconnected vertex (no incoming/outgoing particles), add it manually + VertexMap vertexMap; + VertexMap::iterator mapItr; + vector<const HepMC::GenVertex*> vertices; + + // Check signal process vertex + // If this is a disconnected vertex, add it manually or won't be added from the loop over particles below. + HepMC::GenVertex* disconnectedSignalProcessVtx = genEvt->signal_process_vertex(); // Get the signal process vertex + if (disconnectedSignalProcessVtx) { + if (disconnectedSignalProcessVtx->particles_in_size() == 0 && + disconnectedSignalProcessVtx->particles_out_size() == 0 ) { + //This is a disconnected vertex, add it manually + vertices.push_back (disconnectedSignalProcessVtx); + } + } else { + ATH_MSG_WARNING("Signal process vertex pointer not valid in HepMC Collection for GenEvent #" << cntr << " / " << mcColl->size()); + } + + // Get the beam particles + pair<HepMC::GenParticle*,HepMC::GenParticle*> beamParticles; + if ( genEvt->valid_beam_particles() ) beamParticles = genEvt->beam_particles(); + for (HepMC::GenEvent::particle_const_iterator pitr=genEvt->particles_begin(); pitr!=genEvt->particles_end(); ++pitr) { + // (a) create TruthParticle + xAOD::TruthParticle* xTruthParticle = new xAOD::TruthParticle(); + xTruthParticleContainer->push_back( xTruthParticle ); + fillParticle(xTruthParticle, *pitr); // (b) Copy HepMC info into the new particle + // (c) Put particle into container; Build Event<->Particle element link + const ElementLink<xAOD::TruthParticleContainer> eltp(*xTruthParticleContainer, xTruthParticleContainer->size()-1); + if (isSignalProcess) xTruthEvent->addTruthParticleLink(eltp); + if (!isSignalProcess) xTruthPileupEvent->addTruthParticleLink(eltp); + + // Create link between HepMC and xAOD truth + if (isSignalProcess) truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*pitr),0), eltp)); + if (!isSignalProcess) truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*pitr),genEvt->event_number()), eltp)); + + // Is this one of the beam particles? + if (genEvt->valid_beam_particles()) { + if (isSignalProcess) { + if (*pitr == beamParticles.first) xTruthEvent->setBeamParticle1Link(eltp); + if (*pitr == beamParticles.second) xTruthEvent->setBeamParticle2Link(eltp); + } + } + // (d) Particle's production vertex + HepMC::GenVertex* productionVertex = (*pitr)->production_vertex(); + if (productionVertex) { + VertexParticles& parts = vertexMap[productionVertex]; + if (parts.incoming.empty() && parts.outgoing.empty()) + vertices.push_back (productionVertex); + parts.outgoingEL.push_back(eltp); + parts.outgoing.push_back(xTruthParticle); + } + // + // else maybe want to keep track that this is the production vertex + // + // (e) Particle's decay vertex + HepMC::GenVertex* decayVertex = (*pitr)->end_vertex(); + if (decayVertex) { + VertexParticles& parts = vertexMap[decayVertex]; + if (parts.incoming.empty() && parts.outgoing.empty()) + vertices.push_back (decayVertex); + parts.incomingEL.push_back(eltp); + parts.incoming.push_back(xTruthParticle); + } + + } // end of loop over particles + + // (3) Loop over the map + HepMC::GenVertex* signalProcessVtx = genEvt->signal_process_vertex(); // Get the signal process vertex + for (const HepMC::GenVertex* vertex : vertices) { + const auto& parts = vertexMap[vertex]; + // (a) create TruthVertex + xAOD::TruthVertex* xTruthVertex = new xAOD::TruthVertex(); + xTruthVertexContainer->push_back( xTruthVertex ); + fillVertex(xTruthVertex, vertex); // (b) Copy HepMC info into the new vertex + // (c) Put particle into container; Build Event<->Vertex element link + ElementLink<xAOD::TruthVertexContainer> eltv(*xTruthVertexContainer, xTruthVertexContainer->size()-1); + // Mark if this is the signal process vertex + if (vertex == signalProcessVtx && isSignalProcess) xTruthEvent->setSignalProcessVertexLink(eltv); + if (isSignalProcess) xTruthEvent->addTruthVertexLink(eltv); + if (!isSignalProcess) xTruthPileupEvent->addTruthVertexLink(eltv); + // (d) Assign incoming particles to the vertex, from the map + xTruthVertex->setIncomingParticleLinks( parts.incomingEL ); + // (e) Assign outgoing particles to the vertex, from the map + xTruthVertex->setOutgoingParticleLinks( parts.outgoingEL ); + // (f) Set Particle<->Vertex links for incoming particles + for (xAOD::TruthParticle* p : parts.incoming) p->setDecayVtxLink(eltv); + // (g) Set Particle<->Vertex links for incoming particles + for (xAOD::TruthParticle* p : parts.outgoing) p->setProdVtxLink(eltv); + } //end of loop over vertices + + // Delete the event that wasn't used + if (isSignalProcess) delete xTruthPileupEvent; + if (!isSignalProcess) delete xTruthEvent; + + } // end of loop over McEventCollection + + } else { + + ATH_MSG_INFO("McEventCollection with name " << m_aodContainerName << " not found"); + + // Retrieve the xAOD Truth and recreate the TruthLinks + if ( !evtStore()->contains<xAOD::TruthEventContainer>(m_xaodTruthEventContainerName) ) { + ATH_MSG_WARNING("TruthEventContainer " << m_xaodTruthEventContainerName << " not found"); + return StatusCode::SUCCESS; + } + xAOD::TruthEventContainer* xTruthEventContainer = 0; + CHECK( evtStore()->retrieve( xTruthEventContainer, m_xaodTruthEventContainerName ) ); + + // Loop over events and particles + for (auto evt : *xTruthEventContainer) { + for (const auto& par : evt->truthParticleLinks()) { + if ( !par.isValid() ) { + //ATH_MSG_WARNING("Found invalid particle element link in TruthEvent " << evt->eventNumber()); + ATH_MSG_WARNING("Found invalid particle element link in TruthEvent"); //< @todo Use HepMC evt number? + continue; + } + // Create link between HepMC and xAOD truth + //truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*par)->barcode(), evt->eventNumber()), par)); + /// @todo AB: Truth particle links should only be made to the signal event... hence the 0. Right? + truthLinkVec->push_back(new xAODTruthParticleLink(HepMcParticleLink((*par)->barcode(), 0), par)); + } + } + } - } - + + std::stable_sort(truthLinkVec->begin(), truthLinkVec->end(), SortTruthParticleLink()); + ATH_MSG_VERBOSE("Summarizing truth link size: " << truthLinkVec->size() ); + + return StatusCode::SUCCESS; } - - std::stable_sort(truthLinkVec->begin(), truthLinkVec->end(), SortTruthParticleLink()); - ATH_MSG_VERBOSE("Summarizing truth link size: " << truthLinkVec->size() ); - - return StatusCode::SUCCESS; - } - - - // A helper to set up a TruthVertex (without filling the ELs) - void xAODTruthCnvAlg::fillVertex(xAOD::TruthVertex* tv, const HepMC::GenVertex* gv) { - tv->setId(gv->id()); - tv->setBarcode(gv->barcode()); - - // No vertex weights - // vector<float> weights; - // for (const double& w : gv->weights()) weights.push_back((float)w); - // tv->setWeights(weights); - - tv->setX(gv->position().x()); - tv->setY(gv->position().y()); - tv->setZ(gv->position().z()); - tv->setT(gv->position().t()); - } - - - // A helper to set up a TruthParticle (without filling the ELs) - void xAODTruthCnvAlg::fillParticle(xAOD::TruthParticle* tp, const HepMC::GenParticle* gp) { - tp->setPdgId(gp->pdg_id()); - tp->setBarcode(gp->barcode()); - tp->setStatus(gp->status()); - - const HepMC::Polarization& pol = gp->polarization(); - if (pol.is_defined()) { - tp->setPolarizationParameter(pol.theta(), xAOD::TruthParticle::polarizationTheta); - tp->setPolarizationParameter(pol.phi(), xAOD::TruthParticle::polarizationPhi); + + + // A helper to set up a TruthVertex (without filling the ELs) + void xAODTruthCnvAlg::fillVertex(xAOD::TruthVertex* tv, const HepMC::GenVertex* gv) { + tv->setId(gv->id()); + tv->setBarcode(gv->barcode()); + + // No vertex weights + // vector<float> weights; + // for (const double& w : gv->weights()) weights.push_back((float)w); + // tv->setWeights(weights); + + tv->setX(gv->position().x()); + tv->setY(gv->position().y()); + tv->setZ(gv->position().z()); + tv->setT(gv->position().t()); } - - tp->setM(gp->generated_mass()); - tp->setPx(gp->momentum().px()); - tp->setPy(gp->momentum().py()); - tp->setPz(gp->momentum().pz()); - tp->setE(gp->momentum().e()); - } - - + + + // A helper to set up a TruthParticle (without filling the ELs) + void xAODTruthCnvAlg::fillParticle(xAOD::TruthParticle* tp, const HepMC::GenParticle* gp) { + tp->setPdgId(gp->pdg_id()); + tp->setBarcode(gp->barcode()); + tp->setStatus(gp->status()); + + const HepMC::Polarization& pol = gp->polarization(); + if (pol.is_defined()) { + tp->setPolarizationParameter(pol.theta(), xAOD::TruthParticle::polarizationTheta); + tp->setPolarizationParameter(pol.phi(), xAOD::TruthParticle::polarizationPhi); + } + + tp->setM(gp->generated_mass()); + tp->setPx(gp->momentum().px()); + tp->setPy(gp->momentum().py()); + tp->setPz(gp->momentum().pz()); + tp->setE(gp->momentum().e()); + } + + } // namespace xAODMaker diff --git a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.h b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.h index 9f7e1fed3b7edb2c117b8a7604eb81258f076719..d287bb6dec9620cdaf84ab3c0bc259eefc22bb38 100644 --- a/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.h +++ b/Event/xAOD/xAODTruthCnv/src/xAODTruthCnvAlg.h @@ -83,6 +83,9 @@ namespace xAODMaker { /// a flag to force rerunning (useful for rerunning on ESDs) bool m_forceRerun; + /// option to disable writing of metadata (e.g. if running a filter on xAOD in generators) + bool m_writeMetaData; + }; // class xAODTruthCnvAlg diff --git a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx index 34c022d7b9d72c05c78381ff448af827d8dca97d..91ad5beaad66d16d47db2b025db0b9522fea7e93 100644 --- a/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx +++ b/HLT/Trigger/TrigControl/TrigServices/src/HltEventLoopMgr.cxx @@ -280,9 +280,9 @@ HltEventLoopMgr::HltEventLoopMgr(const std::string& nam, m_l1_hltPrescaleUpdateLB(0xffffffff), m_mandatoryL1ROBs{{begin(L1R_MANDATORY_ROBS), end(L1R_MANDATORY_ROBS)}}, m_histProp_Hlt_result_size(Gaudi::Histo1DDef("HltResultSize",0,200000,100)), - m_histProp_numStreamTags(Gaudi::Histo1DDef("NumberOfStreamTags",-.5,9.5,10)), + m_histProp_numStreamTags(Gaudi::Histo1DDef("NumberOfStreamTags",-.5,19.5,20)), m_histProp_streamTagNames(Gaudi::Histo1DDef("StreamTagNames",-.5,.5,1)), - m_histProp_num_partial_eb_robs(Gaudi::Histo1DDef("NumberROBsPartialEB",-.5,99.5,100)), + m_histProp_num_partial_eb_robs(Gaudi::Histo1DDef("NumberROBsPartialEB",-.5,199.5,200)), m_histProp_Hlt_Edm_Sizes(Gaudi::Histo1DDef("HltEDMSizes",0.,10000.,100)) { // General properties for event loop managers @@ -312,7 +312,9 @@ HltEventLoopMgr::HltEventLoopMgr(const std::string& nam, declareProperty("Lvl1CTPROBcheck", m_lvl1CTPROBcheck=true); declareProperty("WriteTruncatedHLTtoDebug", m_writeHltTruncationToDebug=true); declareProperty("HltTruncationDebugStreamName", m_HltTruncationDebugStreamName ="TruncatedHLTResult"); - declareProperty("ExcludeFromHltTruncationDebugStream", m_excludeFromHltTruncationDebugStream ={"CostMonitoring"}); + declareProperty("ExcludeFromHltTruncationDebugStream", m_excludeFromHltTruncationDebugStream ); + + m_excludeFromHltTruncationDebugStream = {"CostMonitoring"}; } //========================================================================= @@ -905,11 +907,9 @@ StatusCode HltEventLoopMgr::executeEvent(void* par) if (!b_invalidCTPRob) { sc = checkHltPrescaleUpdate(l1_hltCounters); if(sc.isFailure()) { - if (pHltResult) { - std::vector<uint32_t>& vExtraData = pHltResult->getExtras(); - // set the HLT PSK flag to 0 to indicate error - vExtraData[vExtraData.size()-2] = 0; // one word for prescale counter (=1 ok, =0 error) - } + std::vector<uint32_t>& vExtraData = pHltResult->getExtras(); + // set the HLT PSK flag to 0 to indicate error + vExtraData[vExtraData.size()-2] = 0; // one word for prescale counter (=1 ok, =0 error) msgStream() << MSG::FATAL << "HLT Conditions update failed" << endmsg; throw ers::HLTAbort(ERS_HERE, name()+": HLT Conditions update failed"); } @@ -1075,7 +1075,7 @@ StatusCode HltEventLoopMgr::processRoIs ( (m_hltTHistSvc->send()).ignore() ; if ( msgLevel() <= MSG::DEBUG ) { msgStream() << MSG::DEBUG << " ---> THistSvc->send(): m_hltTHistSvc = " - << m_hltTHistSvc << endmsg; + << m_hltTHistSvc << endmsg; } } @@ -1117,7 +1117,7 @@ StatusCode HltEventLoopMgr::processRoIs ( } // *-- SubDetectors in received L1 ROB list - if (m_hist_l1_robs) { + if (m_doMonitoring.value()) { scoped_lock_histogram lock; for(const auto& rob : l1_result) { @@ -1126,7 +1126,6 @@ StatusCode HltEventLoopMgr::processRoIs ( if(std::find(begin(L1R_BINS), end(L1R_BINS), sid.subdetector_id()) != end(L1R_BINS)) label = sid.human_detector(); - m_hist_l1_robs->Fill(label.c_str(), 1.); } } @@ -1249,8 +1248,7 @@ StatusCode HltEventLoopMgr::processRoIs ( } else { // no valid CTP fragment found m_invalid_lvl1_result++; - if (m_hist_l1_robs) - lock_histogram_operation<TH1F>(m_hist_l1_robs)->Fill(MISSING_L1R_CTP_LABEL, 1.); + if (m_doMonitoring.value()) m_hist_l1_robs->Fill(MISSING_L1R_CTP_LABEL, 1.); std::string issue_msg = std::string("No valid CTP fragment found. ") ; if (m_hltROBDataProviderSvc.isValid()) issue_msg = issue_msg + std::string("\n") + @@ -1357,7 +1355,8 @@ StatusCode HltEventLoopMgr::processRoIs ( << endmsg; } - msgStream() << MSG::DEBUG << " new xAOD::EventInfo: " << xev << endmsg; + if (msgLevel() <= MSG::DEBUG) + msgStream() << MSG::DEBUG << " new xAOD::EventInfo: " << xev << endmsg; //----------------------------------------------------------------------- // build HLT result @@ -1804,10 +1803,8 @@ hltonl::PSCErrorCode HltEventLoopMgr::HltResultROBs( // The HLT result got truncated, put the event on a special debug stream if requested if (!serializationOk) { m_truncated_hlt_result++; - if (m_hist_Hlt_truncated_result) { - scoped_lock_histogram lock; - m_hist_Hlt_truncated_result->Fill(1.); - } + if (m_doMonitoring.value()) m_hist_Hlt_truncated_result->Fill(1.); + if ((!m_HltTruncationDebugStreamName.value().empty()) && (m_writeHltTruncationToDebug.value())) { // check if event should be not send to the debug stream (e.g. Cost Monitoring) @@ -1820,10 +1817,7 @@ hltonl::PSCErrorCode HltEventLoopMgr::HltResultROBs( } if (sendToDebug) { m_truncated_hlt_result_to_debug++; - if (m_hist_Hlt_truncated_result) { - scoped_lock_histogram lock; - m_hist_Hlt_truncated_result->Fill(2.); - } + if (m_doMonitoring.value()) m_hist_Hlt_truncated_result->Fill(2.); hlt_result.stream_tag.clear(); addDebugStreamTag(hlt_result, m_HltTruncationDebugStreamName); msgStream() << MSG::ERROR << ST_WHERE @@ -1831,10 +1825,7 @@ hltonl::PSCErrorCode HltEventLoopMgr::HltResultROBs( << m_HltTruncationDebugStreamName << endmsg; } else { m_truncated_hlt_result_not_to_debug++; - if (m_hist_Hlt_truncated_result) { - scoped_lock_histogram lock; - m_hist_Hlt_truncated_result->Fill(3.); - } + if (m_doMonitoring.value()) m_hist_Hlt_truncated_result->Fill(3.); msgStream() << MSG::WARNING << ST_WHERE << "HLTResult was truncated. Event was NOT send to debug stream = " << m_HltTruncationDebugStreamName @@ -1843,30 +1834,24 @@ hltonl::PSCErrorCode HltEventLoopMgr::HltResultROBs( } } else { m_truncated_hlt_result_not_to_debug++; - if (m_hist_Hlt_truncated_result) { - scoped_lock_histogram lock; - m_hist_Hlt_truncated_result->Fill(3.); - } + if (m_doMonitoring.value()) m_hist_Hlt_truncated_result->Fill(3.); } } } } - if (m_hist_eventAcceptFlags) - lock_histogram_operation<TH1F>(m_hist_eventAcceptFlags)->Fill( - static_cast<float>(m_mapAccept.codeToHash(hlt_decision))); + if (m_doMonitoring.value()) + m_hist_eventAcceptFlags->Fill(static_cast<float>(m_mapAccept.codeToHash(hlt_decision))); - if(msgLevel() <= MSG::DEBUG) - { + if(msgLevel() <= MSG::DEBUG) { msgStream() << MSG::DEBUG << ST_WHERE << "Decision = " << hltonl::PrintHltAcceptFlag(hlt_decision) << "\n" << hlt_result << endmsg; - if(dobj) - { + if(dobj) { const auto& extraData = dobj->getExtraData(); msgStream() << MSG::DEBUG << ST_WHERE - << "HltResult extra data: Host name = " << extraData.appName - << ", status code = " << extraData.statusCode << endmsg; + << "HltResult extra data: Host name = " << extraData.appName + << ", status code = " << extraData.statusCode << endmsg; } } @@ -1930,169 +1915,163 @@ void HltEventLoopMgr::bookHistograms() // *-- | Event accept flags | // +--------------------+ uint32_t n_bins_eventAcceptFlags = hltonl::NUM_ACCEPTANCE_FLAGS; - m_hist_eventAcceptFlags = new TH1F ("EventAcceptFlags", - "EventAcceptFlags;;entries", n_bins_eventAcceptFlags, 0.5, n_bins_eventAcceptFlags+0.5); + m_hist_eventAcceptFlags = new TH1F ("EventAcceptFlags", + "EventAcceptFlags;;entries", + n_bins_eventAcceptFlags, 0.5, + n_bins_eventAcceptFlags+0.5); - if (m_hist_eventAcceptFlags) { - for (hltonl::MapAcceptFlag::EnumMap::const_iterator map_it = m_mapAccept.begin(); map_it != m_mapAccept.end(); ++map_it) { - m_hist_eventAcceptFlags->GetXaxis()->SetBinLabel( ((*map_it).second).second , (((*map_it).second).first).c_str() ); - } - regHistsTH1F.push_back(&m_hist_eventAcceptFlags); + for (const auto& m : m_mapAccept) { + m_hist_eventAcceptFlags->GetXaxis()->SetBinLabel( m.second.second , (m.second.first).c_str() ); } + regHistsTH1F.push_back(&m_hist_eventAcceptFlags); // +-----------------------+ // *-- | HLT result properties | // +-----------------------+ // *-- HLT result size plot - m_hist_Hlt_result_size = new TH1F ((m_histProp_Hlt_result_size.value().title()).c_str(), - (m_histProp_Hlt_result_size.value().title() + ";words;entries").c_str(), - m_histProp_Hlt_result_size.value().bins(), - m_histProp_Hlt_result_size.value().lowEdge(), - m_histProp_Hlt_result_size.value().highEdge()); - if (m_hist_Hlt_result_size) { - m_hist_Hlt_result_size->SetCanExtend(TH1::kAllAxes); - regHistsTH1F.push_back(&m_hist_Hlt_result_size); - } + m_hist_Hlt_result_size = new TH1F ((m_histProp_Hlt_result_size.value().title()).c_str(), + (m_histProp_Hlt_result_size.value().title() + ";words;entries").c_str(), + m_histProp_Hlt_result_size.value().bins(), + m_histProp_Hlt_result_size.value().lowEdge(), + m_histProp_Hlt_result_size.value().highEdge()); + + m_hist_Hlt_result_size->SetCanExtend(TH1::kAllAxes); + regHistsTH1F.push_back(&m_hist_Hlt_result_size); // *-- HLT result status codes uint32_t n_bins_ResultStatus = hltonl::NUM_HLT_STATUS_CODES; - m_hist_Hlt_result_status = new TH1F ("HltResultStatusCodes", - "HltResultStatusCodes;;entries", n_bins_ResultStatus, 0.5, n_bins_ResultStatus+0.5); - - if (m_hist_Hlt_result_status) { - // do not print label for normal HLT result with no errors, it is not filled - for (hltonl::MapResultStatusCode::EnumMap::const_iterator map_it = m_mapResultStatus.begin(); map_it != m_mapResultStatus.end(); ++map_it) { - if ( (*map_it).first == hltonl ::NORMAL_HLT_RESULT ) { - m_hist_Hlt_result_status->GetXaxis()->SetBinLabel( ((*map_it).second).second, (((*map_it).second).first+" (bin not filled)").c_str() ); - } else { - m_hist_Hlt_result_status->GetXaxis()->SetBinLabel( ((*map_it).second).second, (((*map_it).second).first).c_str() ); - } + m_hist_Hlt_result_status = new TH1F ("HltResultStatusCodes", "HltResultStatusCodes;;entries", + n_bins_ResultStatus, 0.5, n_bins_ResultStatus+0.5); + + // do not print label for normal HLT result with no errors, it is not filled + for (hltonl::MapResultStatusCode::EnumMap::const_iterator map_it = m_mapResultStatus.begin(); map_it != m_mapResultStatus.end(); ++map_it) { + if ( (*map_it).first == hltonl ::NORMAL_HLT_RESULT ) { + m_hist_Hlt_result_status->GetXaxis()->SetBinLabel( ((*map_it).second).second, (((*map_it).second).first+" (bin not filled)").c_str() ); + } else { + m_hist_Hlt_result_status->GetXaxis()->SetBinLabel( ((*map_it).second).second, (((*map_it).second).first).c_str() ); } - regHistsTH1F.push_back(&m_hist_Hlt_result_status); } + regHistsTH1F.push_back(&m_hist_Hlt_result_status); // *-- HLT result truncation uint32_t n_bins_ResultTruncation = 3; - m_hist_Hlt_truncated_result = new TH1F ("HltResultTruncation", - "HltResultTruncation;;entries", n_bins_ResultTruncation, 0.5, n_bins_ResultTruncation+0.5); + m_hist_Hlt_truncated_result = new TH1F ("HltResultTruncation", + "HltResultTruncation;;entries", + n_bins_ResultTruncation, 0.5, n_bins_ResultTruncation+0.5); - if (m_hist_Hlt_truncated_result) { - m_hist_Hlt_truncated_result->GetXaxis()->SetBinLabel( 1, std::string("Truncated HLT result").c_str() ); - m_hist_Hlt_truncated_result->GetXaxis()->SetBinLabel( 2, std::string("Truncated HLT result (send to debug stream)").c_str() ); - m_hist_Hlt_truncated_result->GetXaxis()->SetBinLabel( 3, std::string("Truncated HLT result (not send to debug stream)").c_str() ); - regHistsTH1F.push_back(&m_hist_Hlt_truncated_result); - } + m_hist_Hlt_truncated_result->GetXaxis()->SetBinLabel( 1, std::string("Truncated HLT result").c_str() ); + m_hist_Hlt_truncated_result->GetXaxis()->SetBinLabel( 2, std::string("Truncated HLT result (send to debug stream)").c_str() ); + m_hist_Hlt_truncated_result->GetXaxis()->SetBinLabel( 3, std::string("Truncated HLT result (not send to debug stream)").c_str() ); + regHistsTH1F.push_back(&m_hist_Hlt_truncated_result); // *-- HLT result size plot (Stream Physiscs Main) - m_hist_Hlt_result_size_physics = new TH1F (((m_histProp_Hlt_result_size.value().title()) + "-(Stream (Main:physics))").c_str(), - (m_histProp_Hlt_result_size.value().title() + "-(Stream (Main:physics))" + ";words;entries").c_str(), - m_histProp_Hlt_result_size.value().bins(), - m_histProp_Hlt_result_size.value().lowEdge(), - m_histProp_Hlt_result_size.value().highEdge()); - if (m_hist_Hlt_result_size_physics) { - m_hist_Hlt_result_size_physics->SetCanExtend(TH1::kAllAxes); - regHistsTH1F.push_back(&m_hist_Hlt_result_size_physics); - } + m_hist_Hlt_result_size_physics = + new TH1F (((m_histProp_Hlt_result_size.value().title()) + "-(Stream (Main:physics))").c_str(), + (m_histProp_Hlt_result_size.value().title() + "-(Stream (Main:physics))" + ";words;entries").c_str(), + m_histProp_Hlt_result_size.value().bins(), + m_histProp_Hlt_result_size.value().lowEdge(), + m_histProp_Hlt_result_size.value().highEdge()); + + m_hist_Hlt_result_size_physics->SetCanExtend(TH1::kAllAxes); + regHistsTH1F.push_back(&m_hist_Hlt_result_size_physics); + // *-- HLT result size plot (Stream Express) - m_hist_Hlt_result_size_express = new TH1F (((m_histProp_Hlt_result_size.value().title()) + "-(Stream (express:express))").c_str(), - (m_histProp_Hlt_result_size.value().title() + "-(Stream (express:express))" + ";words;entries").c_str(), - m_histProp_Hlt_result_size.value().bins(), - m_histProp_Hlt_result_size.value().lowEdge(), - m_histProp_Hlt_result_size.value().highEdge()); - if (m_hist_Hlt_result_size_express) { - m_hist_Hlt_result_size_express->SetCanExtend(TH1::kAllAxes); - regHistsTH1F.push_back(&m_hist_Hlt_result_size_express); - } + m_hist_Hlt_result_size_express = + new TH1F (((m_histProp_Hlt_result_size.value().title()) + "-(Stream (express:express))").c_str(), + (m_histProp_Hlt_result_size.value().title() + "-(Stream (express:express))" + ";words;entries").c_str(), + m_histProp_Hlt_result_size.value().bins(), + m_histProp_Hlt_result_size.value().lowEdge(), + m_histProp_Hlt_result_size.value().highEdge()); + + m_hist_Hlt_result_size_express->SetCanExtend(TH1::kAllAxes); + regHistsTH1F.push_back(&m_hist_Hlt_result_size_express); + // *-- HLT result size plot (Stream calibration, DataScouting results) - m_hist_Hlt_result_size_DataScouting = new TH1F (((m_histProp_Hlt_result_size.value().title()) + "-(Streams (DataScouting_*:calibration))").c_str(), - (m_histProp_Hlt_result_size.value().title() + "-(Streams (DataScouting_*:calibration))" + ";words;entries").c_str(), - m_histProp_Hlt_result_size.value().bins(), - m_histProp_Hlt_result_size.value().lowEdge(), - m_histProp_Hlt_result_size.value().highEdge()); - if (m_hist_Hlt_result_size_DataScouting) { - m_hist_Hlt_result_size_DataScouting->SetCanExtend(TH1::kAllAxes); - regHistsTH1F.push_back(&m_hist_Hlt_result_size_DataScouting); - } + m_hist_Hlt_result_size_DataScouting = + new TH1F (((m_histProp_Hlt_result_size.value().title()) + "-(Streams (DataScouting_*:calibration))").c_str(), + (m_histProp_Hlt_result_size.value().title() + "-(Streams (DataScouting_*:calibration))" + ";words;entries").c_str(), + m_histProp_Hlt_result_size.value().bins(), + m_histProp_Hlt_result_size.value().lowEdge(), + m_histProp_Hlt_result_size.value().highEdge()); + + m_hist_Hlt_result_size_DataScouting->SetCanExtend(TH1::kAllAxes); + regHistsTH1F.push_back(&m_hist_Hlt_result_size_DataScouting); + // *-- HLT result size profile plot for all stream types "physiscs" - m_hist_HltResultSizes_Stream_physics = new TProfile( std::string("Average Hlt Result size for physics streams").c_str(), - std::string("Average Hlt Result size for physics streams;Stream Name;Average size in words").c_str(), - 1, - (double) 0., (double) 1., - (double) 0., (double) 3000000.); - if (m_hist_HltResultSizes_Stream_physics) { - m_hist_HltResultSizes_Stream_physics->GetXaxis()->SetBinLabel(1,std::string("NoTag").c_str() ); - m_hist_HltResultSizes_Stream_physics->SetCanExtend(TH1::kAllAxes); - regHistsTProfile.push_back(&m_hist_HltResultSizes_Stream_physics); - } + m_hist_HltResultSizes_Stream_physics = new TProfile( "Average Hlt Result size for physics streams", + "Average Hlt Result size for physics streams;Stream Name;Average size in words", + 1, + (double) 0., (double) 1., + (double) 0., (double) 3000000.); + + m_hist_HltResultSizes_Stream_physics->GetXaxis()->SetBinLabel(1, "NoTag"); + m_hist_HltResultSizes_Stream_physics->SetCanExtend(TH1::kAllAxes); + regHistsTProfile.push_back(&m_hist_HltResultSizes_Stream_physics); // *-- HLT result size profile plot for all stream names "DataScouting" - m_hist_HltResultSizes_Stream_DataScouting = new TProfile( std::string("Average Hlt Result size for data scouting streams").c_str(), - std::string("Average Hlt Result size for data scouting streams;Stream Name;Average size in words").c_str(), - 1, - (double) 0., (double) 1., - (double) 0., (double) 3000000.); - if (m_hist_HltResultSizes_Stream_DataScouting) { - m_hist_HltResultSizes_Stream_DataScouting->GetXaxis()->SetBinLabel(1,std::string("NoTag").c_str() ); - m_hist_HltResultSizes_Stream_DataScouting->SetCanExtend(TH1::kAllAxes); - regHistsTProfile.push_back(&m_hist_HltResultSizes_Stream_DataScouting); - } + m_hist_HltResultSizes_Stream_DataScouting = new TProfile( "Average Hlt Result size for data scouting streams", + "Average Hlt Result size for data scouting streams;Stream Name;Average size in words", + 1, + (double) 0., (double) 1., + (double) 0., (double) 3000000.); + + m_hist_HltResultSizes_Stream_DataScouting->GetXaxis()->SetBinLabel(1, "NoTag"); + m_hist_HltResultSizes_Stream_DataScouting->SetCanExtend(TH1::kAllAxes); + regHistsTProfile.push_back(&m_hist_HltResultSizes_Stream_DataScouting); // +-----------------------+ // *-- | framework error codes | // +-----------------------+ uint32_t n_bins_error = hltonl::NUM_PSC_ERROR_CODES; m_hist_frameworkErrorCodes = new TH1F ("FrameworkErrorCodes", - "FrameworkErrorCodes;;entries", n_bins_error, 0.5, n_bins_error+0.5); + "FrameworkErrorCodes;;entries", + n_bins_error, 0.5, n_bins_error+0.5); - if (m_hist_frameworkErrorCodes) { - for (hltonl::MapPscErrorCode::EnumMap::const_iterator map_it = m_mapPscError.begin(); map_it != m_mapPscError.end(); ++map_it) { - m_hist_frameworkErrorCodes->GetXaxis()->SetBinLabel( ((*map_it).second).second , (((*map_it).second).first).c_str() ); - } - regHistsTH1F.push_back(&m_hist_frameworkErrorCodes); + for (const auto& m : m_mapPscError) { + m_hist_frameworkErrorCodes->GetXaxis()->SetBinLabel( m.second.second , (m.second.first).c_str() ); } - + regHistsTH1F.push_back(&m_hist_frameworkErrorCodes); + // +-------------+ // *-- | Stream Tags | // +-------------+ // *-- number of set stream tags - m_hist_numStreamTags = new TH1F ((m_histProp_numStreamTags.value().title()).c_str(), - (m_histProp_numStreamTags.value().title() + ";tags;entries").c_str(), - m_histProp_numStreamTags.value().bins(), - m_histProp_numStreamTags.value().lowEdge(), - m_histProp_numStreamTags.value().highEdge()); - if (m_hist_numStreamTags) { - m_hist_numStreamTags->SetCanExtend(TH1::kAllAxes); - regHistsTH1F.push_back(&m_hist_numStreamTags); - } + m_hist_numStreamTags = new TH1F ((m_histProp_numStreamTags.value().title()).c_str(), + (m_histProp_numStreamTags.value().title() + ";tags;entries").c_str(), + m_histProp_numStreamTags.value().bins(), + m_histProp_numStreamTags.value().lowEdge(), + m_histProp_numStreamTags.value().highEdge()); + regHistsTH1F.push_back(&m_hist_numStreamTags); + // *-- stream tag types uint32_t n_bins_tag = eformat::helper::TagTypeDictionary.size() + 1; - m_hist_streamTagTypes = new TH1F ("StreamTagTypes", - "StreamTagTypes;tags;entries", n_bins_tag, -0.5 , n_bins_tag-0.5); - if (m_hist_streamTagTypes) { - using eformat::helper::tagtype_to_string; - for(uint32_t i=0; i < n_bins_tag; i++ ) { // StreamTag labels - uint32_t bit = (1u << i); - m_hist_streamTagTypes->GetXaxis()->SetBinLabel( i+1, tagtype_to_string( static_cast<eformat::TagType>(bit) ).c_str() ); - } - m_hist_streamTagTypes->GetXaxis()->SetBinLabel(n_bins_tag, "NoTag(=Rejected)"); - regHistsTH1F.push_back(&m_hist_streamTagTypes); + m_hist_streamTagTypes = new TH1F ("StreamTagTypes", + "StreamTagTypes;tags;entries", n_bins_tag, -0.5 , n_bins_tag-0.5); + + using eformat::helper::tagtype_to_string; + for(uint32_t i=0; i < n_bins_tag; i++ ) { // StreamTag labels + uint32_t bit = (1u << i); + m_hist_streamTagTypes->GetXaxis()->SetBinLabel( i+1, tagtype_to_string( static_cast<eformat::TagType>(bit) ).c_str() ); } + m_hist_streamTagTypes->GetXaxis()->SetBinLabel(n_bins_tag, "NoTag(=Rejected)"); + regHistsTH1F.push_back(&m_hist_streamTagTypes); + // *-- stream tag names - m_hist_streamTagNames = new TH1F ((m_histProp_streamTagNames.value().title()).c_str(), - (m_histProp_streamTagNames.value().title() + ";tags;entries").c_str(), - m_histProp_streamTagNames.value().bins(), - m_histProp_streamTagNames.value().lowEdge(), - m_histProp_streamTagNames.value().highEdge()); - if (m_hist_streamTagNames) { - if (m_histProp_streamTagNames.value().bins()>0) m_hist_streamTagNames->GetXaxis()->SetBinLabel(1,std::string("NoTag").c_str() ); - m_hist_streamTagNames->SetCanExtend(TH1::kAllAxes); - regHistsTH1F.push_back(&m_hist_streamTagNames); + m_hist_streamTagNames = new TH1F ((m_histProp_streamTagNames.value().title()).c_str(), + (m_histProp_streamTagNames.value().title() + ";tags;entries").c_str(), + m_histProp_streamTagNames.value().bins(), + m_histProp_streamTagNames.value().lowEdge(), + m_histProp_streamTagNames.value().highEdge()); + if (m_histProp_streamTagNames.value().bins()>0) { + m_hist_streamTagNames->GetXaxis()->SetBinLabel(1,std::string("NoTag").c_str() ); } + m_hist_streamTagNames->SetCanExtend(TH1::kAllAxes); + regHistsTH1F.push_back(&m_hist_streamTagNames); // +------------------------+ // *-- | Partial event building | @@ -2102,119 +2081,98 @@ void HltEventLoopMgr::bookHistograms() // *-- number of ROBs for partial event building m_hist_num_partial_eb_robs = new TH1F ((m_histProp_num_partial_eb_robs.value().title()).c_str(), - (m_histProp_num_partial_eb_robs.value().title() + ";robs;entries").c_str(), - m_histProp_num_partial_eb_robs.value().bins(), - m_histProp_num_partial_eb_robs.value().lowEdge(), - m_histProp_num_partial_eb_robs.value().highEdge()); - if (m_hist_num_partial_eb_robs) { - m_hist_num_partial_eb_robs->SetCanExtend(TH1::kAllAxes); - regHistsTH1F.push_back(&m_hist_num_partial_eb_robs); - } + (m_histProp_num_partial_eb_robs.value().title() + ";robs;entries").c_str(), + m_histProp_num_partial_eb_robs.value().bins(), + m_histProp_num_partial_eb_robs.value().lowEdge(), + m_histProp_num_partial_eb_robs.value().highEdge()); + + regHistsTH1F.push_back(&m_hist_num_partial_eb_robs); + // *-- number of SubDetectors used in partial event building m_hist_num_partial_eb_SubDetectors = new TH1F ("NumberSubDetectorsPartialEB", - "NumberSubDetectorsPartialEB;subdet;entries", - n_bins_partEBSubDet,-0.5,(float) n_bins_partEBSubDet-0.5); - if (m_hist_num_partial_eb_SubDetectors) { - m_hist_num_partial_eb_SubDetectors->SetCanExtend(TH1::kAllAxes); - regHistsTH1F.push_back(&m_hist_num_partial_eb_SubDetectors); - } + "NumberSubDetectorsPartialEB;subdet;entries", + n_bins_partEBSubDet,-0.5,(float) n_bins_partEBSubDet-0.5); + regHistsTH1F.push_back(&m_hist_num_partial_eb_SubDetectors); // *-- SubDetectors used in partial event building: ROB list m_hist_partial_eb_SubDetectors_ROBs = new TH1F ("SubDetectorsPartialEBFromROBList", - "SubDetectorsPartialEBFromROBList;;entries", - n_bins_partEBSubDet,0.,(float) n_bins_partEBSubDet); - if (m_hist_partial_eb_SubDetectors_ROBs) { - uint32_t n_tmp_bin = 1; - for (const auto& sub : eformat::helper::SubDetectorDictionary) { - m_hist_partial_eb_SubDetectors_ROBs->GetXaxis()->SetBinLabel( n_tmp_bin, sub.second.c_str() ); - n_tmp_bin++; - } - m_hist_partial_eb_SubDetectors_ROBs->SetCanExtend(TH1::kAllAxes); - regHistsTH1F.push_back(&m_hist_partial_eb_SubDetectors_ROBs); + "SubDetectorsPartialEBFromROBList;;entries", + n_bins_partEBSubDet,0.,(float) n_bins_partEBSubDet); + uint32_t n_tmp_bin = 1; + for (const auto& sub : eformat::helper::SubDetectorDictionary) { + m_hist_partial_eb_SubDetectors_ROBs->GetXaxis()->SetBinLabel( n_tmp_bin++, sub.second.c_str() ); } + regHistsTH1F.push_back(&m_hist_partial_eb_SubDetectors_ROBs); // *-- SubDetectors used in partial event building: SD list m_hist_partial_eb_SubDetectors_SDs = new TH1F ("SubDetectorsPartialEBFromSDList", - "SubDetectorsPartialEBFromSDList;;entries", - n_bins_partEBSubDet,0.,(float) n_bins_partEBSubDet); - if (m_hist_partial_eb_SubDetectors_SDs) { - uint32_t n_tmp_bin = 1; - for (const auto& sub: eformat::helper::SubDetectorDictionary) { - m_hist_partial_eb_SubDetectors_SDs->GetXaxis()->SetBinLabel( n_tmp_bin, sub.second.c_str() ); - n_tmp_bin++; - } - m_hist_partial_eb_SubDetectors_SDs->SetCanExtend(TH1::kAllAxes); - regHistsTH1F.push_back(&m_hist_partial_eb_SubDetectors_SDs); + "SubDetectorsPartialEBFromSDList;;entries", + n_bins_partEBSubDet,0.,(float) n_bins_partEBSubDet); + + n_tmp_bin = 1; + for (const auto& sub: eformat::helper::SubDetectorDictionary) { + m_hist_partial_eb_SubDetectors_SDs->GetXaxis()->SetBinLabel( n_tmp_bin++, sub.second.c_str() ); } + regHistsTH1F.push_back(&m_hist_partial_eb_SubDetectors_SDs); + // +---------------+ // *-- | HLT EDM Sizes | // +---------------+ // *-- EDM sizes for all events without a truncated HLT result - m_hist_HltEdmSizes_No_Truncation = new TProfile( (m_histProp_Hlt_Edm_Sizes.value().title()+":Events_Without_Truncation").c_str(), - (m_histProp_Hlt_Edm_Sizes.value().title()+":Events_Without_Truncation;;Average size in words").c_str(), - m_histProp_Hlt_Edm_Sizes.value().bins(), - (double) 0., (double) m_histProp_Hlt_Edm_Sizes.value().bins(), - (double) m_histProp_Hlt_Edm_Sizes.value().lowEdge(), - (double) m_histProp_Hlt_Edm_Sizes.value().highEdge()); - if (m_hist_HltEdmSizes_No_Truncation) { - uint32_t n_tmp_bin = 1; - for (const std::string& col_name : m_hltEdmCollectionNames.value()) { - m_hist_HltEdmSizes_No_Truncation->GetXaxis()->SetBinLabel( n_tmp_bin, col_name.c_str() ); - n_tmp_bin++; - } - // m_hist_HltEdmSizes_No_Truncation->SetBit(TProfile::kCanRebin); - regHistsTProfile.push_back(&m_hist_HltEdmSizes_No_Truncation); + m_hist_HltEdmSizes_No_Truncation = + new TProfile( (m_histProp_Hlt_Edm_Sizes.value().title()+":Events_Without_Truncation").c_str(), + (m_histProp_Hlt_Edm_Sizes.value().title()+":Events_Without_Truncation;;Average size in words").c_str(), + m_histProp_Hlt_Edm_Sizes.value().bins(), 0., m_histProp_Hlt_Edm_Sizes.value().bins(), + m_histProp_Hlt_Edm_Sizes.value().lowEdge(), m_histProp_Hlt_Edm_Sizes.value().highEdge()); + + n_tmp_bin = 1; + for (const std::string& col_name : m_hltEdmCollectionNames.value()) { + m_hist_HltEdmSizes_No_Truncation->GetXaxis()->SetBinLabel( n_tmp_bin++, col_name.c_str() ); } + regHistsTProfile.push_back(&m_hist_HltEdmSizes_No_Truncation); + // *-- EDM sizes for all events with a truncated HLT result - m_hist_HltEdmSizes_With_Truncation = new TProfile( (m_histProp_Hlt_Edm_Sizes.value().title()+":Events_With_Truncation").c_str(), - (m_histProp_Hlt_Edm_Sizes.value().title()+":Events_With_Truncation;;Average size in words").c_str(), - m_histProp_Hlt_Edm_Sizes.value().bins(), - (double) 0., (double) m_histProp_Hlt_Edm_Sizes.value().bins(), - (double) m_histProp_Hlt_Edm_Sizes.value().lowEdge(), - (double) m_histProp_Hlt_Edm_Sizes.value().highEdge()); - if (m_hist_HltEdmSizes_With_Truncation) { - uint32_t n_tmp_bin = 1; - for (const std::string& col_name : m_hltEdmCollectionNames.value()) { - m_hist_HltEdmSizes_With_Truncation->GetXaxis()->SetBinLabel( n_tmp_bin, col_name.c_str() ); - n_tmp_bin++; - } - // m_hist_HltEdmSizes_With_Truncation->SetBit(TProfile::kCanRebin); - regHistsTProfile.push_back(&m_hist_HltEdmSizes_With_Truncation); + m_hist_HltEdmSizes_With_Truncation = + new TProfile( (m_histProp_Hlt_Edm_Sizes.value().title()+":Events_With_Truncation").c_str(), + (m_histProp_Hlt_Edm_Sizes.value().title()+":Events_With_Truncation;;Average size in words").c_str(), + m_histProp_Hlt_Edm_Sizes.value().bins(), 0., m_histProp_Hlt_Edm_Sizes.value().bins(), + m_histProp_Hlt_Edm_Sizes.value().lowEdge(), m_histProp_Hlt_Edm_Sizes.value().highEdge()); + + n_tmp_bin = 1; + for (const std::string& col_name : m_hltEdmCollectionNames.value()) { + m_hist_HltEdmSizes_With_Truncation->GetXaxis()->SetBinLabel( n_tmp_bin++, col_name.c_str() ); } + regHistsTProfile.push_back(&m_hist_HltEdmSizes_With_Truncation); + // *-- Sizes of collections which were retained for events with a truncated HLT result - m_hist_HltEdmSizes_TruncatedResult_Retained_Collections = new TProfile( "Events_With_HLTResult_Truncation:Size_of_Not_Truncated_Collections", - "Events_With_HLTResult_Truncation:Size_of_Not_Truncated_Collections;;Average size in words", - m_histProp_Hlt_Edm_Sizes.value().bins(), - (double) 0., (double) m_histProp_Hlt_Edm_Sizes.value().bins(), - (double) m_histProp_Hlt_Edm_Sizes.value().lowEdge(), - (double) m_histProp_Hlt_Edm_Sizes.value().highEdge()); - if (m_hist_HltEdmSizes_TruncatedResult_Retained_Collections) { - uint32_t n_tmp_bin = 1; - for (const std::string& col_name : m_hltEdmCollectionNames.value()) { - m_hist_HltEdmSizes_TruncatedResult_Retained_Collections->GetXaxis()->SetBinLabel( n_tmp_bin, col_name.c_str() ); - n_tmp_bin++; - } - // m_hist_HltEdmSizes_TruncatedResult_Retained_Collections->SetBit(TProfile::kCanRebin); - regHistsTProfile.push_back(&m_hist_HltEdmSizes_TruncatedResult_Retained_Collections); + m_hist_HltEdmSizes_TruncatedResult_Retained_Collections = + new TProfile( "Events_With_HLTResult_Truncation:Size_of_Not_Truncated_Collections", + "Events_With_HLTResult_Truncation:Size_of_Not_Truncated_Collections;;Average size in words", + m_histProp_Hlt_Edm_Sizes.value().bins(), 0., m_histProp_Hlt_Edm_Sizes.value().bins(), + m_histProp_Hlt_Edm_Sizes.value().lowEdge(), m_histProp_Hlt_Edm_Sizes.value().highEdge()); + + n_tmp_bin = 1; + for (const std::string& col_name : m_hltEdmCollectionNames.value()) { + m_hist_HltEdmSizes_TruncatedResult_Retained_Collections->GetXaxis()->SetBinLabel( n_tmp_bin++, col_name.c_str() ); } + regHistsTProfile.push_back(&m_hist_HltEdmSizes_TruncatedResult_Retained_Collections); + // *-- Sizes of collections which were truncated for events with a truncated HLT result - m_hist_HltEdmSizes_TruncatedResult_Truncated_Collections = new TProfile( "Events_With_HLTResult_Truncation:Size_of_Truncated_Collections", - "Events_With_HLTResult_Truncation:Size_of_Truncated_Collections;;Average size in words", - m_histProp_Hlt_Edm_Sizes.value().bins(), - (double) 0., (double) m_histProp_Hlt_Edm_Sizes.value().bins(), - (double) m_histProp_Hlt_Edm_Sizes.value().lowEdge(), - (double) m_histProp_Hlt_Edm_Sizes.value().highEdge()); - if (m_hist_HltEdmSizes_TruncatedResult_Truncated_Collections) { - uint32_t n_tmp_bin = 1; - for (const std::string& col_name : m_hltEdmCollectionNames.value()) { - m_hist_HltEdmSizes_TruncatedResult_Truncated_Collections->GetXaxis()->SetBinLabel( n_tmp_bin, col_name.c_str() ); - n_tmp_bin++; - } - // m_hist_HltEdmSizes_TruncatedResult_Truncated_Collections->SetBit(TProfile::kCanRebin); - regHistsTProfile.push_back(&m_hist_HltEdmSizes_TruncatedResult_Truncated_Collections); + m_hist_HltEdmSizes_TruncatedResult_Truncated_Collections = + new TProfile( "Events_With_HLTResult_Truncation:Size_of_Truncated_Collections", + "Events_With_HLTResult_Truncation:Size_of_Truncated_Collections;;Average size in words", + m_histProp_Hlt_Edm_Sizes.value().bins(), 0., m_histProp_Hlt_Edm_Sizes.value().bins(), + m_histProp_Hlt_Edm_Sizes.value().lowEdge(), + m_histProp_Hlt_Edm_Sizes.value().highEdge()); + + n_tmp_bin = 1; + for (const std::string& col_name : m_hltEdmCollectionNames.value()) { + m_hist_HltEdmSizes_TruncatedResult_Truncated_Collections->GetXaxis()->SetBinLabel( n_tmp_bin++, col_name.c_str() ); } + regHistsTProfile.push_back(&m_hist_HltEdmSizes_TruncatedResult_Truncated_Collections); + // +---------------------+ // *-- | register histograms | // +---------------------+ @@ -2296,10 +2254,13 @@ void HltEventLoopMgr::fillHltResultHistograms(const hltinterface::HLTResult& hlt uint16_t hltrob_moduleID = eformat::helper::SourceIdentifier( hltrob.rob_source_id() ).module_id(); // *-- HLT result size plots - if ((m_hist_Hlt_result_size) && (hltrob_moduleID == 0)) lock_histogram_operation<TH1F>(m_hist_Hlt_result_size)->Fill( (float) hltrob.fragment_size_word() ) ; + if (hltrob_moduleID == 0) { + lock_histogram_operation<TH1F>(m_hist_Hlt_result_size)->Fill( (float) hltrob.fragment_size_word() ) ; + } - if ( (m_hist_Hlt_result_size_physics) || (m_hist_Hlt_result_size_express) || (m_hist_Hlt_result_size_DataScouting) || - (m_hist_HltResultSizes_Stream_physics) || (m_hist_HltResultSizes_Stream_DataScouting) ) { + int xbins_physics = m_hist_HltResultSizes_Stream_physics->GetNbinsX(); + int xbins_DS = m_hist_HltResultSizes_Stream_DataScouting->GetNbinsX(); + { scoped_lock_histogram lock; for (const eformat::read::ROBFragment& rob : hlt_result.hltResult_robs) { uint16_t moduleID = eformat::helper::SourceIdentifier( rob.rob_source_id() ).module_id(); @@ -2307,29 +2268,34 @@ void HltEventLoopMgr::fillHltResultHistograms(const hltinterface::HLTResult& hlt // only normal HLT Results if (moduleID == 0) { if (st.type == "physics") { - if ((st.name == "Main") && (m_hist_Hlt_result_size_physics)) m_hist_Hlt_result_size_physics->Fill( (float) rob.fragment_size_word() ) ; - if (m_hist_HltResultSizes_Stream_physics) m_hist_HltResultSizes_Stream_physics->Fill( st.name.c_str(), (double) rob.fragment_size_word() ) ; + if (st.name == "Main") m_hist_Hlt_result_size_physics->Fill( (float) rob.fragment_size_word() ) ; + m_hist_HltResultSizes_Stream_physics->Fill( st.name.c_str(), (double) rob.fragment_size_word() ) ; } if (st.type == "express") { - if (m_hist_Hlt_result_size_express) m_hist_Hlt_result_size_express->Fill( (float) rob.fragment_size_word() ) ; + m_hist_Hlt_result_size_express->Fill( (float) rob.fragment_size_word() ) ; } } // DataScouting HLT ROBs if (moduleID != 0) { if ((st.type == "calibration") && ((st.name).find("DataScouting_") != std::string::npos)) { - if (m_hist_Hlt_result_size_DataScouting) m_hist_Hlt_result_size_DataScouting->Fill( (float) rob.fragment_size_word() ) ; - if (m_hist_HltResultSizes_Stream_DataScouting) m_hist_HltResultSizes_Stream_DataScouting->Fill( (st.name).c_str(), (double) rob.fragment_size_word() ) ; + m_hist_Hlt_result_size_DataScouting->Fill( (float) rob.fragment_size_word() ) ; + m_hist_HltResultSizes_Stream_DataScouting->Fill( st.name.c_str(), (double) rob.fragment_size_word() ) ; } } } + } + + // deflate bins for profile histograms if needed + if ( m_hist_HltResultSizes_Stream_physics->GetNbinsX()!=xbins_physics ) { + m_hist_HltResultSizes_Stream_physics->LabelsDeflate("X"); + } + if ( m_hist_HltResultSizes_Stream_DataScouting->GetNbinsX()!=xbins_DS ) { + m_hist_HltResultSizes_Stream_DataScouting->LabelsDeflate("X"); } - // deflate bins for profile histograms - m_hist_HltResultSizes_Stream_physics->LabelsDeflate("X"); - m_hist_HltResultSizes_Stream_DataScouting->LabelsDeflate("X"); } // *-- HLT result status codes - if ((hltrob.nstatus() > 1) && (m_hist_Hlt_result_status) && (hltrob_moduleID == 0)) { + if ((hltrob.nstatus() > 1) && (hltrob_moduleID == 0)) { scoped_lock_histogram lock; const uint32_t* it; hltrob.status(it); @@ -2340,7 +2306,7 @@ void HltEventLoopMgr::fillHltResultHistograms(const hltinterface::HLTResult& hlt // +-----------------------+ // *-- | framework error codes | // +-----------------------+ - if ((hlt_result.psc_errors.size() > 0) && (m_hist_frameworkErrorCodes)) { + if (hlt_result.psc_errors.size() > 0) { scoped_lock_histogram lock; for (uint32_t ec : hlt_result.psc_errors) { m_hist_frameworkErrorCodes->Fill( (float) m_mapPscError.codeToHash( (hltonl::PSCErrorCode) ec) ); @@ -2351,33 +2317,32 @@ void HltEventLoopMgr::fillHltResultHistograms(const hltinterface::HLTResult& hlt // *-- | Stream Tags | // +-------------+ // number of set stream tags - if (m_hist_numStreamTags) lock_histogram_operation<TH1F>(m_hist_numStreamTags)->Fill( (float) hlt_result.stream_tag.size() ); + m_hist_numStreamTags->Fill( (float) hlt_result.stream_tag.size() ); // stream tag types - if (m_hist_streamTagTypes) { - scoped_lock_histogram lock; - if(hlt_result.stream_tag.empty()) - m_hist_streamTagTypes->Fill( (float) m_hist_streamTagTypes->GetXaxis()->GetNbins() - 1. ); - using namespace eformat::helper; - for(int32_t i=0; i < m_hist_streamTagTypes->GetXaxis()->GetNbins(); i++) { - uint32_t bit = (1u<<i); - if( contains_type(hlt_result.stream_tag, static_cast<eformat::TagType>(bit)) ) { - m_hist_streamTagTypes->Fill( (float) i); - } + if(hlt_result.stream_tag.empty()) { + m_hist_streamTagTypes->Fill( (float) m_hist_streamTagTypes->GetXaxis()->GetNbins() - 1. ); + } + using namespace eformat::helper; + for(int32_t i=0; i < m_hist_streamTagTypes->GetXaxis()->GetNbins(); i++) { + uint32_t bit = (1u<<i); + if( contains_type(hlt_result.stream_tag, static_cast<eformat::TagType>(bit)) ) { + m_hist_streamTagTypes->Fill( (float) i); } } // stream tag names - if (m_hist_streamTagNames) { - scoped_lock_histogram lock; - if(hlt_result.stream_tag.empty()) { - m_hist_streamTagNames->Fill(0.); - } else { - for(const eformat::helper::StreamTag& st: hlt_result.stream_tag) { - m_hist_streamTagNames->Fill(st.name.c_str(),1.); - } + if(hlt_result.stream_tag.empty()) { + m_hist_streamTagNames->Fill(0.); + } else { + int xbins = m_hist_streamTagNames->GetNbinsX(); + scoped_lock_histogram lock; + for(const eformat::helper::StreamTag& st: hlt_result.stream_tag) { + m_hist_streamTagNames->Fill(st.name.c_str(),1.); } - m_hist_streamTagNames->LabelsDeflate("X"); + // Remove extra empty bins if needed + if ( m_hist_streamTagNames->GetNbinsX()!=xbins ) + m_hist_streamTagNames->LabelsDeflate("X"); } // +------------------------+ @@ -2395,27 +2360,19 @@ void HltEventLoopMgr::fillHltResultHistograms(const hltinterface::HLTResult& hlt } // *-- number of ROBs for partial event building - if (m_hist_num_partial_eb_robs) lock_histogram_operation<TH1F>(m_hist_num_partial_eb_robs)->Fill( (float) num_robs); + m_hist_num_partial_eb_robs->Fill( (float) num_robs); // *-- number of SubDetectors for partial event building - if (m_hist_num_partial_eb_SubDetectors) lock_histogram_operation<TH1F>(m_hist_num_partial_eb_SubDetectors)->Fill( (float) num_sd); + m_hist_num_partial_eb_SubDetectors->Fill( (float) num_sd); // *-- SubDetectors for partial event building in ROB list - if (m_hist_partial_eb_SubDetectors_ROBs) { - scoped_lock_histogram lock; - for(uint32_t rob : peb_robs) { - m_hist_partial_eb_SubDetectors_ROBs->Fill(eformat::helper::SourceIdentifier(rob).human_detector().c_str(),1.); - m_hist_partial_eb_SubDetectors_ROBs->LabelsDeflate("X"); - } - } + for(uint32_t rob : peb_robs) { + m_hist_partial_eb_SubDetectors_ROBs->Fill(eformat::helper::SourceIdentifier(rob).human_detector().c_str(),1.); + } // *-- SubDetectors for partial event building in SD list - if (m_hist_partial_eb_SubDetectors_SDs) { - scoped_lock_histogram lock; - for (const eformat::SubDetector& sd : peb_sd) { - m_hist_partial_eb_SubDetectors_SDs->Fill(eformat::helper::SourceIdentifier(sd,0).human_detector().c_str(),1.); - m_hist_partial_eb_SubDetectors_SDs->LabelsDeflate("X"); - } + for (const eformat::SubDetector& sd : peb_sd) { + m_hist_partial_eb_SubDetectors_SDs->Fill(eformat::helper::SourceIdentifier(sd,0).human_detector().c_str(),1.); } return; @@ -2435,9 +2392,6 @@ StatusCode HltEventLoopMgr::callOnAlgs(const function<StatusCode(IAlgorithm&)> & func, const string & fname, bool failureIsError) { - msgStream() << MSG::DEBUG << ST_WHERE - << "calling " << fname << "() on all algorithms" << endmsg; - StatusCode sc; for(auto alg : m_topAlgList) { diff --git a/HLT/Trigger/TrigControl/TrigServices/src/THistSvcHLT.cxx b/HLT/Trigger/TrigControl/TrigServices/src/THistSvcHLT.cxx index 47a3bf6730b0d6cee104d2bc04b0a3b0cd17d291..eafaf3e89009bca51cf5e2cd582dffa87ce68357 100644 --- a/HLT/Trigger/TrigControl/TrigServices/src/THistSvcHLT.cxx +++ b/HLT/Trigger/TrigControl/TrigServices/src/THistSvcHLT.cxx @@ -1876,36 +1876,34 @@ void THistSvcHLT::copyFileLayout (TDirectory *dst, TDirectory *src) { if (m_log.level() <= MSG::DEBUG) - m_log << MSG::DEBUG - << "copyFileLayout() to dst path: " << dst->GetPath () << endmsg; - - // strip out URLs - TString path ((char*)strstr (dst->GetPath(), ":")); - path.Remove (0, 2); - - src->cd (path); - TDirectory *cur_src_dir = gDirectory; - - // loop over all keys in this directory - TList *key_list = cur_src_dir->GetListOfKeys (); - int n = key_list->GetEntries (); - for ( int j = 0; j < n; ++j ) { - TKey *k = (TKey*)key_list->At (j); - const std::string src_pathname = cur_src_dir->GetPath() - + std::string("/") - + k->GetName(); - TObject *o=src->Get (src_pathname.c_str()); - + m_log << MSG::DEBUG << "copyFileLayout() to dst path: " << dst->GetPath () << endmsg; + + // strip out URLs + TString path ((char*)strstr (dst->GetPath(), ":")); + path.Remove (0, 2); + + src->cd (path); + TDirectory *cur_src_dir = gDirectory; + + // loop over all keys in this directory + TList *key_list = cur_src_dir->GetListOfKeys (); + int n = key_list->GetEntries (); + for ( int j = 0; j < n; ++j ) { + TKey *k = (TKey*)key_list->At (j); + const std::string src_pathname = cur_src_dir->GetPath() + + std::string("/") + + k->GetName(); + TObject *o=src->Get (src_pathname.c_str()); + if ( o && o->IsA()->InheritsFrom ("TDirectory")) { if (m_log.level() <= MSG::VERBOSE) - m_log << MSG::VERBOSE << " subdir [" << o->GetName() << "]..." - << endmsg; - dst->cd (); - TDirectory * dst_dir = dst->mkdir (o->GetName(), o->GetTitle()); + m_log << MSG::VERBOSE << " subdir [" << o->GetName() << "]..." << endmsg; + dst->cd (); + TDirectory * dst_dir = dst->mkdir (o->GetName(), o->GetTitle()); copyFileLayout (dst_dir, src); - } - } // loop over keys - return; + } + } // loop over keys + return; } //* * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * * *// diff --git a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetConversionTrackSelectorTool.cxx b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetConversionTrackSelectorTool.cxx index df0f3c670a1d1c233a3d30b34ada7c0eff3a2142..7a573e37c247c92828ab9f01c7d17037f66e8717 100644 --- a/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetConversionTrackSelectorTool.cxx +++ b/InnerDetector/InDetRecTools/InDetTrackSelectorTool/src/InDetConversionTrackSelectorTool.cxx @@ -59,7 +59,6 @@ namespace InDet declareProperty("significanceZ0_Trt", m_sZ0_Trt); declareProperty("IsConversion", m_isConv); declareProperty("BeamPositionSvc", m_iBeamCondSvc); - declareProperty("BeamPositionSvc", m_iBeamCondSvc); declareProperty("PIDonlyForXe", m_PIDonlyForXe = false, "Only check TRT PID if all hits are Xe hits"); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt b/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt index a8d75e2c3e4be8da7beffb0546ba1ad0d8e987b3..e0cf896ac7258ef2d435cdfbc26b2d9d16e3ec66 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/CMakeLists.txt @@ -44,13 +44,14 @@ atlas_depends_on_subdirs( PUBLIC find_package( Eigen ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread EG ) find_package( XercesC ) +find_package( Boost ) # Component(s) in the package: atlas_add_component( InDetPhysValMonitoring src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps AthenaMonitoringLib xAODTracking xAODTruth GaudiKernel PATCoreLib TrkValHistUtils AsgTools AthenaKernel AtlasDetDescr GeoPrimitives EventPrimitives xAODBase xAODEventInfo xAODJet InDetIdentifier InDetPrepRawData InDetRIO_OnTrack MCTruthClassifierLib PathResolver TrkEventPrimitives TrkParameters TrkTrack TrkExInterfaces TrkToolInterfaces ) + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${XERCESC_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${EIGEN_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${XERCESC_LIBRARIES} ${Boost_LIBRARIES} ${EIGEN_LIBRARIES} AthenaBaseComps AthenaMonitoringLib xAODTracking xAODTruth GaudiKernel PATCoreLib TrkValHistUtils AsgTools AthenaKernel AtlasDetDescr GeoPrimitives EventPrimitives xAODBase xAODEventInfo xAODJet InDetIdentifier InDetPrepRawData InDetRIO_OnTrack MCTruthClassifierLib PathResolver TrkEventPrimitives TrkParameters TrkTrack TrkExInterfaces TrkToolInterfaces ) # Install files from the package: atlas_install_headers( InDetPhysValMonitoring ) diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/cmt/requirements b/InnerDetector/InDetValidation/InDetPhysValMonitoring/cmt/requirements index 54528dc487e787b5d16fcf18dda270aa5a490336..b528b48b851a77c61633f3d47bd9958789f688d0 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/cmt/requirements +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/cmt/requirements @@ -27,7 +27,8 @@ use xAODBase xAODBase-* Event/xAOD private -use AtlasXercesC AtlasXercesC-* External +use AtlasXercesC AtlasXercesC-* External +use AtlasBoost AtlasBoost-* External use TrkExInterfaces TrkExInterfaces-* Tracking/TrkExtrapolation use TrkToolInterfaces TrkToolInterfaces-* Tracking/TrkTools use AtlasROOT AtlasROOT-* External @@ -51,7 +52,6 @@ use TrkTrack TrkTrack-* Tracking/TrkEvent # for the DummyTrackSlimmingTool use TrkToolInterfaces TrkToolInterfaces-* Tracking/TrkTools/ - branches src src/components doc # I would like to generate a dictionary, but this crashes in compilation: diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/HistogramDefinitionSvc.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/HistogramDefinitionSvc.py index 680c6ce73d63c47b404f2bec60d11e64fb12b36b..b2375aa9cd49ea4bc67cfbb164ff3e5a66903015 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/HistogramDefinitionSvc.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/HistogramDefinitionSvc.py @@ -26,6 +26,6 @@ class HistogramDefinitionSvc(object) : name = self.__class__.__name__)) # special parameters of the default HistogramDefinitionSvc - self.DefinitionSource="InDetPhysValMonitoringPlotDefinitions.xml" + self.DefinitionSource="InDetPVMPlotDefRun2.xml" self.DefinitionFormat="text/xml" diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecoration.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecoration.py index ae3347449a4d8794d165aac5c96d78f74874c071..3bab4cc9ec1759879a17971738b9821fbc18c177 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecoration.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValDecoration.py @@ -367,7 +367,7 @@ def addExtraMonitoring() : try: from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags # flags are at this stage already initialised, so do not need to InDetPhysValFlags.init() - if InDetPhysValFlags.doValidateGSFTracks() or InDetPhysValFlags.doValidateDBMTracks() : + if InDetPhysValFlags.doValidateGSFTracks() or InDetPhysValFlags.doValidateDBMTracks() or InDetPhysValFlags.doValidateTightPrimaryTracks() : mon_index = findMonMan() if mon_index != None : from AthenaCommon.AlgSequence import AlgSequence @@ -375,6 +375,11 @@ def addExtraMonitoring() : mon_manager = topSequence.getChildren()[mon_index] from InDetPhysValMonitoring.InDetPhysValMonitoringTool import InDetPhysValMonitoringTool + from InDetRecExample.InDetKeys import InDetKeys + # for backward compatibility check whether DBM has been added already + if InDetPhysValFlags.doValidateTightPrimaryTracks() : + mon_manager.AthenaMonTools += [ toolFactory(InDetPhysValMonitoringTool.InDetPhysValMonitoringToolTightPrimary ) ] + if InDetPhysValFlags.doValidateGSFTracks() : mon_manager.AthenaMonTools += [ toolFactory(InDetPhysValMonitoringTool.InDetPhysValMonitoringToolGSF ) ] @@ -448,7 +453,7 @@ def addDecoratorIfNeeded() : # the monitoring manager exists already. from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags InDetPhysValFlags.init() - if InDetPhysValFlags.doValidateGSFTracks() or InDetPhysValFlags.doValidateDBMTracks() : + if InDetPhysValFlags.doValidateGSFTracks() or InDetPhysValFlags.doValidateDBMTracks() or InDetPhysValFlags.doValidateTightPrimaryTracks(): from RecExConfig.RecFlags import rec rec.UserExecs += ['from InDetPhysValMonitoring.InDetPhysValDecoration import addExtraMonitoring;addExtraMonitoring();'] diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValJobProperties.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValJobProperties.py index b342fddf85f824d16a36314c1ed29c295ba4e733..751cd8c30e4db6097fdd906e6460636d142eba00 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValJobProperties.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValJobProperties.py @@ -52,6 +52,15 @@ class doValidateGSFTracks(InDetPhysValFlagsJobProperty): allowedTypes = ['bool'] StoredValue = False +class doValidateTightPrimaryTracks(InDetPhysValFlagsJobProperty): + statusOn = True + allowedTypes = ['bool'] + StoredValue = False + +class doValidateTracksInJets(InDetPhysValFlagsJobProperty): + statusOn = True + allowedTypes = ['bool'] + StoredValue = False from InDetRecExample.InDetJobProperties import Enabled @@ -108,7 +117,9 @@ jobproperties.add_Container(InDetPhysValJobProperties) _list_InDetPhysValJobProperties = [ Enabled, doValidateDBMTracks, - doValidateGSFTracks + doValidateGSFTracks, + doValidateTightPrimaryTracks, + doValidateTracksInJets ] for j in _list_InDetPhysValJobProperties: diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringTool.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringTool.py index 231e7a5675226b106ded904b5a4cde5f978e6c08..e941f93a2bfb5b80f169c93c1439503e86748656 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringTool.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/InDetPhysValMonitoringTool.py @@ -1,6 +1,6 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -from ConfigUtils import injectNameArgument,checkKWArgs,_args,serviceFactory +from ConfigUtils import injectNameArgument,checkKWArgs,_args,serviceFactory,toolFactory import InDetPhysValMonitoring.InDetPhysValMonitoringConf @@ -57,14 +57,20 @@ class InDetPhysValMonitoringTool(object) : # at the moment there can only be one HistogramDefinitionSvc from InDetPhysValMonitoring.HistogramDefinitionSvc import HistogramDefinitionSvc #self.HistogramDefinitionSvc = - serviceFactory(HistogramDefinitionSvc.HistogramDefinitionSvc) + serviceFactory(HistogramDefinitionSvc.HistogramDefinitionSvc) - from InDetPhysValMonitoring.InDetPhysValJobProperties import isMC + from InDetPhysValMonitoring.InDetPhysValJobProperties import isMC,InDetPhysValFlags if isMC() : self.TruthParticleContainerName = "TruthParticles" - self.jetContainerName ='AntiKt4TruthJets' - from InDetPhysValMonitoring.addTruthJets import addTruthJetsIfNotExising - addTruthJetsIfNotExising(self.jetContainerName) + if InDetPhysValFlags.doValidateTracksInJets() : + self.jetContainerName ='AntiKt4TruthJets' + self.FillTrackInJetPlots = True + from InDetPhysValMonitoring.addTruthJets import addTruthJetsIfNotExising + addTruthJetsIfNotExising(self.jetContainerName) + else : + self.jetContainerName ='' + self.FillTrackInJetPlots = False + else : # disable truth monitoring for data @@ -79,7 +85,26 @@ class InDetPhysValMonitoringTool(object) : from RecExConfig.RecFlags import rec rec.UserExecs += ['from InDetPhysValMonitoring.InDetPhysValMonitoringTool import removePhysValExample;removePhysValExample();'] + class InDetPhysValMonitoringToolTightPrimary(InDetPhysValMonitoringTool) : + ''' + InDetPhysValMonitoringTool for track particles which pass the tight primary selection + ''' + #@injectNameArgument + #def __new__(cls, *args, **kwargs) : + # return InDetPhysValMonitoringTool.InDetPhysValMonitoringTool.__new__(cls,*args,**kwargs) + + @checkKWArgs + def __init__(self, **kwargs) : + super(InDetPhysValMonitoringTool.InDetPhysValMonitoringToolTightPrimary,self)\ + .__init__(**_args( kwargs, + name = self.__class__.__name__)) + + # special parameters of the InDetPhysValMonitoringTool for monitoring tight primary tracks + self.SubFolder='TightPrimary/' + self.useTrackSelection = True + from InDetPhysValMonitoring.TrackSelectionTool import InDetTrackSelectionTool + self.TrackSelectionTool = toolFactory(InDetTrackSelectionTool.InDetTrackSelectionToolTightPrimary) class InDetPhysValMonitoringToolGSF(InDetPhysValMonitoringTool) : diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/TrackSelectionTool.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/TrackSelectionTool.py new file mode 100644 index 0000000000000000000000000000000000000000..e24bf518dcd12185873b2cb598fd42a63d63724e --- /dev/null +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/python/TrackSelectionTool.py @@ -0,0 +1,28 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from ConfigUtils import injectNameArgument,checkKWArgs,_args,serviceFactory +from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool + +class InDetTrackSelectionTool(object) : + ''' + Namespace for inner detector hole search tools + ''' + def __init__(self) : + raise('must not be instantiated. Only child classes should be instantiated.') + + class InDetTrackSelectionToolTightPrimary(InDet__InDetTrackSelectionTool) : + ''' + Default InDetTrackSelectionTool for InDetTrackParticles + ''' + @injectNameArgument + def __new__(cls, *args, **kwargs) : + return InDet__InDetTrackSelectionTool.__new__(cls,*args,**kwargs) + + @checkKWArgs + def __init__(self, **kwargs) : + super(InDetTrackSelectionTool.InDetTrackSelectionToolTightPrimary,self)\ + .__init__(**_args( kwargs, + name = self.__class__.__name__)) + + # special parameters of the InDetTrackSelectionToolTightPrimary + self.CutLevel = "TightPrimary" diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/AllAndTightSelections.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/AllAndTightSelections.py new file mode 100644 index 0000000000000000000000000000000000000000..72bd0fa131f2b0b8e49847d0a7db32cf98b0576f --- /dev/null +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/AllAndTightSelections.py @@ -0,0 +1,84 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +# $Id: AllAndTightSelections.py 789797 2016-12-15 06:07:11Z lmijovic $ + + +FNAME = "AOD.pool.root" + +include( "AthenaPython/iread_file.py" ) + +# Access the algorithm sequence: +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from InDetPhysValMonitoring.InDetPhysValMonitoringConf import HistogramDefinitionSvc +ToolSvc = ServiceMgr.ToolSvc +ServiceMgr+=HistogramDefinitionSvc() +ServiceMgr.HistogramDefinitionSvc.DefinitionSource="../share/InDetPVMPlotDefRun2.xml" +ServiceMgr.HistogramDefinitionSvc.DefinitionFormat="text/xml" + +from InDetPhysValMonitoring.InDetPhysValMonitoringConf import InDetPhysValDecoratorAlg +decorators = InDetPhysValDecoratorAlg() +topSequence += decorators + +from AthenaMonitoring.AthenaMonitoringConf import AthenaMonManager +monMan = AthenaMonManager( "PhysValMonManager" ) +monMan.ManualDataTypeSetup = True +monMan.DataType = "monteCarlo" +monMan.Environment = "altprod" +monMan.ManualRunLBSetup = True +monMan.Run = 1 +monMan.LumiBlock = 1 +monMan.FileKey = "M_output" +topSequence += monMan + + + +from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool +InDetTrackSelectorTool=InDet__InDetTrackSelectionTool() +ToolSvc += InDetTrackSelectorTool +InDetTrackSelectorTool.CutLevel = "TightPrimary" + +#This section should control TTST 7-12-16 + +from InDetPhysValMonitoring.InDetPhysValMonitoringConf import AthTruthSelectionTool +AthTruthSelectionTool = AthTruthSelectionTool() + + +print AthTruthSelectionTool +ToolSvc += AthTruthSelectionTool + +from InDetPhysValMonitoring.InDetPhysValMonitoringConf import InDetPhysValMonitoringTool +tool1 = InDetPhysValMonitoringTool() +tool1.TruthSelectionTool = AthTruthSelectionTool +tool1.useTrackSelection = False +#tool1.TrackSelectionTool=InDetTrackSelectorTool +tool1.FillTrackInJetPlots = False +print tool1 +ToolSvc += tool1 +# +tool2 = InDetPhysValMonitoringTool(name="TightPrimary") +tool2.TruthSelectionTool = AthTruthSelectionTool +tool2.useTrackSelection = True +tool2.TrackSelectionTool=InDetTrackSelectorTool +tool2.FillTrackInJetPlots = False +tool2.DirName = "TightPrimary/" +ToolSvc += tool2 + +monMan.AthenaMonTools += [tool1, tool2] + +from InDetTrackHoleSearch.InDetTrackHoleSearchConf import InDet__InDetTrackHoleSearchTool +InDetHoleSearchTool = InDet__InDetTrackHoleSearchTool(name = "InDetHoleSearchTool", Extrapolator = InDetExtrapolator, usePixel = True, useSCT= True, CountDeadModulesAfterLastHit = True) +ToolSvc += InDetHoleSearchTool +print InDetHoleSearchTool + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +svcMgr.THistSvc.Output += ["M_output DATAFILE='M_output.root' OPT='RECREATE'"] + +# Do some additional tweaking: +from AthenaCommon.AppMgr import theApp +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 10000 +theApp.EvtMax = 10 + diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysValITk_jobOptions.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysValITk_jobOptions.py index b5a5a662dfed3b1615f56ca3436e2b754912a4b7..40ddd176d7d71fce76c1f7a20955f6146609fbb8 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysValITk_jobOptions.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysValITk_jobOptions.py @@ -42,7 +42,11 @@ xmlTags = [ ["ATLAS-P2-ITK-05","ExtBrl_32",""], ["ATLAS-P2-ITK-08","InclBrl_4",""], ["ATLAS-P2-SFCAL-01-08-01","InclBrl_4","GMX"], ["ATLAS-P2-ITK-10-00-00","InclBrl_4","GMX"], - ["ATLAS-P2-ITK-09-00-00","ExtBrl_4","GMX"],] + ["ATLAS-P2-ITK-09-00-00","ExtBrl_4","GMX"], + ["ATLAS-P2-ITK-10-00-01","InclBrl_4","GMX"], + ["ATLAS-P2-ITK-09-00-01","ExtBrl_4","GMX"], + ["ATLAS-P2-ITK-11-00-01","ExtBrl_4_33mm","GMX"], + ["ATLAS-P2-ITK-12-00-01","IExtBrl_4","GMX"],] for geoTag, layoutDescr, gmx in xmlTags: if (globalflags.DetDescrVersion().startswith(geoTag)): @@ -93,7 +97,6 @@ topSequence = AlgSequence() from InDetPhysValMonitoring.InDetPhysValMonitoringConf import HistogramDefinitionSvc ToolSvc = ServiceMgr.ToolSvc ServiceMgr+=HistogramDefinitionSvc() -# new master/daughter xml-s common to Run2 and ITK: under testing ServiceMgr.HistogramDefinitionSvc.DefinitionSource="../share/InDetPVMPlotDefITK.xml" ServiceMgr.HistogramDefinitionSvc.DefinitionFormat="text/xml" @@ -139,12 +142,11 @@ TrackTruthSelectionTool = AthTruthSelectionTool() TrackTruthSelectionTool.maxEta = 4.0 TrackTruthSelectionTool.maxPt = -1 TrackTruthSelectionTool.minPt = 900 # default 400 MeV -TrackTruthSelectionTool.maxBarcode = 200e3 +TrackTruthSelectionTool.maxBarcode = int(200e3) TrackTruthSelectionTool.pdgId = -1 TrackTruthSelectionTool.requireCharged = True TrackTruthSelectionTool.requireStatus1 = True TrackTruthSelectionTool.maxProdVertRadius = 260. #max prod. vertex radius of secondaries [mm] -#TrackTruthSelectionTool.requireDecayBeforePixel = True TrackTruthSelectionTool.OutputLevel = INFO ToolSvc += TrackTruthSelectionTool @@ -153,7 +155,6 @@ ToolSvc += TrackTruthSelectionTool #------------------------------------------------------------- from InDetPhysValMonitoring.InDetPhysValMonitoringConf import InDetPhysValMonitoringTool InDetPhysValMonitoringTool = InDetPhysValMonitoringTool("InDetPhysValMonitoringTool") -##rdh InDetPhysValMonitoringTool.DirName = "InDetPhysValMon_inclusive/" InDetPhysValMonitoringTool.useTrackSelection = True InDetPhysValMonitoringTool.TrackSelectionTool = InDetTrackSelectorTool #InDetPhysValMonitoringTool.TruthSelectionTool = TrackTruthSelectionTool @@ -175,7 +176,7 @@ ServiceMgr.MessageSvc.OutputLevel = WARNING ServiceMgr.MessageSvc.defaultLimit = 10000 # max. number of events to process -theApp.EvtMax = 10 +theApp.EvtMax = -1 # dump configuration from AthenaCommon.ConfigurationShelve import saveToAscii diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py index e1f038b76622b97b95dfb37834fd986a60412bf6..73e2ba0c667302f2b3c6a10364895c8fc1eaff23 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/PhysVal_jobOptions.py @@ -1,18 +1,23 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -# $Id: PhysVal_jobOptions.py 785412 2016-11-20 15:01:26Z sroe $ +# $Id: PhysVal_jobOptions.py 795792 2017-02-06 14:45:08Z sroe $ # Set up the reading of the input xAOD: import getpass FNAME = "AOD.pool.root" +mode = "Fwd" #Set this to "Back" for backtracking +usingTrackSelection = False +# +#options for Max to explore backtracking if (getpass.getuser())=="mbaugh": + mode="Back" FNAME = "../command/target.pool.root" ''' The following sets an environment variable to enable backtracking debug messages. To use in C++: const char * debugBacktracking = std::getenv("BACKTRACKDEBUG"); ''' - os.environ["BACKTRACKDEBUG"] = "0" + os.environ["BACKTRACKDEBUG"] = "1" # include( "AthenaPython/iread_file.py" ) @@ -23,7 +28,7 @@ topSequence = AlgSequence() from InDetPhysValMonitoring.InDetPhysValMonitoringConf import HistogramDefinitionSvc ToolSvc = ServiceMgr.ToolSvc ServiceMgr+=HistogramDefinitionSvc() -ServiceMgr.HistogramDefinitionSvc.DefinitionSource="../share/InDetPhysValMonitoringPlotDefinitions.xml" +ServiceMgr.HistogramDefinitionSvc.DefinitionSource="../share/InDetPVMPlotDefRun2.xml" ServiceMgr.HistogramDefinitionSvc.DefinitionFormat="text/xml" from InDetPhysValMonitoring.InDetPhysValMonitoringConf import InDetPhysValDecoratorAlg @@ -67,8 +72,12 @@ InDetTrackSelectorTool = InDet__InDetTrackSelectionTool(name = "InDetTrackSelect ToolSvc += InDetTrackSelectorTool ''' +from InDetTrackSelectionTool.InDetTrackSelectionToolConf import InDet__InDetTrackSelectionTool +InDetTrackSelectorTool=InDet__InDetTrackSelectionTool() +ToolSvc += InDetTrackSelectorTool +InDetTrackSelectorTool.CutLevel = "TightPrimary" + #This section should control TTST 7-12-16 -mode = "Fwd" #Set this to "Back" for backtracking from InDetPhysValMonitoring.InDetPhysValMonitoringConf import AthTruthSelectionTool AthTruthSelectionTool = AthTruthSelectionTool() @@ -78,7 +87,7 @@ if mode=="Back": AthTruthSelectionTool.maxProdVertRadius = 4000 AthTruthSelectionTool.maxBarcode = -1 AthTruthSelectionTool.hasNoGrandparent = True - + AthTruthSelectionTool.poselectronfromgamma = True os.environ["BACKTRACKDEBUG"] = "1" print AthTruthSelectionTool @@ -87,9 +96,10 @@ ToolSvc += AthTruthSelectionTool from InDetPhysValMonitoring.InDetPhysValMonitoringConf import InDetPhysValMonitoringTool tool1 = InDetPhysValMonitoringTool() tool1.TruthSelectionTool = AthTruthSelectionTool -tool1.useTrackSelection = False -#tool1.TrackSelectionTool=InDetTrackSelectorTool -tool1.FillTrackInJetPlots = False +tool1.useTrackSelection = usingTrackSelection +tool1.TrackSelectionTool=InDetTrackSelectorTool +tool1.useTrkSelectPV= False +tool1.FillTrackInJetPlots = True print tool1 ToolSvc += tool1 diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/ValidationOnly.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/ValidationOnly.py index 7e876d6df9bbe9bcf91207f573afa18b5382679e..ebbb1340c4beea327367c6318f5e46ae2f728744 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/ValidationOnly.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/ValidationOnly.py @@ -1,6 +1,6 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -# $Id: ValidationOnly.py 778514 2016-10-14 14:46:33Z sroe $ +# $Id: ValidationOnly.py 789797 2016-12-15 06:07:11Z lmijovic $ # Set up the reading of the input xAOD: @@ -21,7 +21,7 @@ ServiceMgr.ProfilerService.InitEvent=10 from InDetPhysValMonitoring.InDetPhysValMonitoringConf import HistogramDefinitionSvc ToolSvc = ServiceMgr.ToolSvc ServiceMgr+=HistogramDefinitionSvc() -ServiceMgr.HistogramDefinitionSvc.DefinitionSource="../share/InDetPhysValMonitoringPlotDefinitions.xml" +ServiceMgr.HistogramDefinitionSvc.DefinitionSource="../share/InDetPVMPlotDefRun2.xml" ServiceMgr.HistogramDefinitionSvc.DefinitionFormat="text/xml" diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/postprocessHistos.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/postprocessHistos.cxx index 99c8f4a1538b7b8671154311e4875fd206ce5612..71c6b1c30045de4b90bf76891e09205665ec7aa1 100755 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/postprocessHistos.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/postprocessHistos.cxx @@ -4,7 +4,7 @@ /*============================================================================== - Regenerate 1D profile plots or histograms from 2D histograms (TH2D) in an + Regenerate 1D profile plots or histograms from 2D histograms in an existing InDetStandardPlots.root. The file is updated with new histograms overriding the old ones). @@ -16,17 +16,33 @@ create_registeredTH1F (etc) reads in existing histograms rather than creating new ones. - Usage (from ROOT command): + Usage: + + 1) summ the files produced from the separate (grid) runs + hadd summ.root file1.root file2.root ... fileN.root + <=== LMTODO : this will be different for TEfficiencties ; + need a dedicated script at this step already - root -l -b -q InDetStandardPlots.root postprocessHistos.cxx+ + 2) the post-processing will + * loop over TProfiles + * replace incorrect TProfiles in TEfficiencies inline - Usage (after compiling and linking against ROOT libraries): + to run use either of: - ./postprocessHistos InDetStandardPlots.root + 2.1) command-line: + root -l -b -q summ.root postprocessHistos.cxx+ - Author: Soeren Prell + 2.2) compiled code: + NAME=postprocessHistos + g++ -O2 -Wall -fPIC $(root-config --cflags) -o ${NAME} ${NAME}.cxx $(root-config --libs) + ./$NAME summ.root + ----------------------------------------------------------------------------- + Author: Soeren Prell, Liza Mijovic ==============================================================================*/ +#define RLN cout << "l" << __LINE__ << ": "; +// 0, 1 or 2 in increasing order of verbosity +#define PRINTDBG 2 #include <iostream> #include <string> @@ -56,10 +72,8 @@ class IDStandardPerformance { public: IDStandardPerformance(TDirectory *top, const char *tracksName = "Tracks", - const char *histDirectoryName = "SelectedGoodTracks", - int verbose = 0, - bool plotsVsAbsEta = false) - : m_d0_vs_eta{}, + const char *histDirectoryName = "SelectedGoodTracks") : + m_d0_vs_eta{}, m_z0_vs_eta{}, m_phi_vs_eta{}, m_theta_vs_eta{}, @@ -129,39 +143,9 @@ public: m_theta_res_vs_pt{}, m_z0st_res_vs_pt{}, - m_eff_eta{}, - m_eff_phi{}, - m_eff_pt{}, - m_eff_pti{}, - m_eff_eta_pt{}, - m_eff_eta_phi{}, - - m_effdenom_eta{}, - m_effdenom_phi{}, - m_effdenom_pt{}, - m_effdenom_eta_pt{}, - m_effdenom_eta_phi{}, - - m_effnum_eta{}, - m_effnum_phi{}, - m_effnum_pt{}, - m_effnum_eta_pt{}, - m_effnum_eta_phi{}, - m_n_vs_jetDR_truth{}, - m_n_vs_jetDR_reco{}, - m_eff_jetDR{}, - - m_n_vs_jetPt_truth{}, - m_n_vs_jetPt_reco{}, - m_eff_jetPt{}, m_top(top), - m_verbose(verbose), m_tracksName(tracksName), - m_histDirectoryName(histDirectoryName), - m_trackPtBins(10), - m_trackEtaBins(20), - m_maxTrackEta(2.5), - m_plotsVsAbsEta(plotsVsAbsEta) { + m_histDirectoryName(histDirectoryName) { m_owned.SetOwner(); } @@ -187,111 +171,81 @@ public: private: // 2D histograms - TH2D *m_d0_vs_eta; - TH2D *m_z0_vs_eta; - TH2D *m_phi_vs_eta; - TH2D *m_theta_vs_eta; - TH2D *m_z0st_vs_eta; - TH2D *m_qopt_vs_eta; - - TH2D *m_d0_vs_pt; - TH2D *m_z0_vs_pt; - TH2D *m_phi_vs_pt; - TH2D *m_theta_vs_pt; - TH2D *m_z0st_vs_pt; - TH2D *m_qopt_vs_pt; - - TH2D *m_d0pull_vs_eta; - TH2D *m_z0pull_vs_eta; - TH2D *m_phipull_vs_eta; - TH2D *m_thetapull_vs_eta; - TH2D *m_z0stpull_vs_eta; - TH2D *m_qoptpull_vs_eta; + TH2F *m_d0_vs_eta; + TH2F *m_z0_vs_eta; + TH2F *m_phi_vs_eta; + TH2F *m_theta_vs_eta; + TH2F *m_z0st_vs_eta; + TH2F *m_qopt_vs_eta; + + TH2F *m_d0_vs_pt; + TH2F *m_z0_vs_pt; + TH2F *m_phi_vs_pt; + TH2F *m_theta_vs_pt; + TH2F *m_z0st_vs_pt; + TH2F *m_qopt_vs_pt; + + TH2F *m_d0pull_vs_eta; + TH2F *m_z0pull_vs_eta; + TH2F *m_phipull_vs_eta; + TH2F *m_thetapull_vs_eta; + TH2F *m_z0stpull_vs_eta; + TH2F *m_qoptpull_vs_eta; // summary plots of track parameter resolutions and means versus eta - TH1D *m_d0_mean_vs_eta; - TH1D *m_phi_mean_vs_eta; - TH1D *m_qopt_mean_vs_eta; - TH1D *m_z0_mean_vs_eta; - TH1D *m_theta_mean_vs_eta; - TH1D *m_z0st_mean_vs_eta; - - TH1D *m_d0_width_vs_eta; - TH1D *m_phi_width_vs_eta; - TH1D *m_qopt_width_vs_eta; - TH1D *m_z0_width_vs_eta; - TH1D *m_theta_width_vs_eta; - TH1D *m_z0st_width_vs_eta; - - TH1D *m_d0pull_mean_vs_eta; - TH1D *m_phipull_mean_vs_eta; - TH1D *m_qoptpull_mean_vs_eta; - TH1D *m_z0pull_mean_vs_eta; - TH1D *m_thetapull_mean_vs_eta; - TH1D *m_z0stpull_mean_vs_eta; - - TH1D *m_d0pull_width_vs_eta; - TH1D *m_phipull_width_vs_eta; - TH1D *m_qoptpull_width_vs_eta; - TH1D *m_z0pull_width_vs_eta; - TH1D *m_thetapull_width_vs_eta; - TH1D *m_z0stpull_width_vs_eta; + TH1F *m_d0_mean_vs_eta; + TH1F *m_phi_mean_vs_eta; + TH1F *m_qopt_mean_vs_eta; + TH1F *m_z0_mean_vs_eta; + TH1F *m_theta_mean_vs_eta; + TH1F *m_z0st_mean_vs_eta; + + TH1F *m_d0_width_vs_eta; + TH1F *m_phi_width_vs_eta; + TH1F *m_qopt_width_vs_eta; + TH1F *m_z0_width_vs_eta; + TH1F *m_theta_width_vs_eta; + TH1F *m_z0st_width_vs_eta; + + TH1F *m_d0pull_mean_vs_eta; + TH1F *m_phipull_mean_vs_eta; + TH1F *m_qoptpull_mean_vs_eta; + TH1F *m_z0pull_mean_vs_eta; + TH1F *m_thetapull_mean_vs_eta; + TH1F *m_z0stpull_mean_vs_eta; + + TH1F *m_d0pull_width_vs_eta; + TH1F *m_phipull_width_vs_eta; + TH1F *m_qoptpull_width_vs_eta; + TH1F *m_z0pull_width_vs_eta; + TH1F *m_thetapull_width_vs_eta; + TH1F *m_z0stpull_width_vs_eta; // summary plots of track parameter resolutions vs pt - TH1D *m_d0_mean_vs_pt; - TH1D *m_phi_mean_vs_pt; - TH1D *m_qopt_mean_vs_pt; - TH1D *m_z0_mean_vs_pt; - TH1D *m_theta_mean_vs_pt; - TH1D *m_z0st_mean_vs_pt; - - TH1D *m_d0_width_vs_pt; - TH1D *m_phi_width_vs_pt; - TH1D *m_qopt_width_vs_pt; - TH1D *m_z0_width_vs_pt; - TH1D *m_theta_width_vs_pt; - TH1D *m_z0st_width_vs_pt; - - TH1D *m_d0_res_vs_pt; - TH1D *m_phi_res_vs_pt; - TH1D *m_qopt_res_vs_pt; - TH1D *m_z0_res_vs_pt; - TH1D *m_theta_res_vs_pt; - TH1D *m_z0st_res_vs_pt; - - // efficiency histograms / TProfiles - - TH1D *m_eff_eta; - TH1D *m_eff_phi; - TH1D *m_eff_pt; - TH1D *m_eff_pti; - TH2D *m_eff_eta_pt; - TH2D *m_eff_eta_phi; - - TH1D *m_effdenom_eta; - TH1D *m_effdenom_phi; - TH1D *m_effdenom_pt; - TH2D *m_effdenom_eta_pt; - TH2D *m_effdenom_eta_phi; - - TH1D *m_effnum_eta; - TH1D *m_effnum_phi; - TH1D *m_effnum_pt; - TH2D *m_effnum_eta_pt; - TH2D *m_effnum_eta_phi; - - TProfile *m_n_vs_jetDR_truth; - TProfile *m_n_vs_jetDR_reco; - TH1D *m_eff_jetDR; - - TProfile *m_n_vs_jetPt_truth; - TProfile *m_n_vs_jetPt_reco; - TH1D *m_eff_jetPt; + TH1F *m_d0_mean_vs_pt; + TH1F *m_phi_mean_vs_pt; + TH1F *m_qopt_mean_vs_pt; + TH1F *m_z0_mean_vs_pt; + TH1F *m_theta_mean_vs_pt; + TH1F *m_z0st_mean_vs_pt; + + TH1F *m_d0_width_vs_pt; + TH1F *m_phi_width_vs_pt; + TH1F *m_qopt_width_vs_pt; + TH1F *m_z0_width_vs_pt; + TH1F *m_theta_width_vs_pt; + TH1F *m_z0st_width_vs_pt; + + TH1F *m_d0_res_vs_pt; + TH1F *m_phi_res_vs_pt; + TH1F *m_qopt_res_vs_pt; + TH1F *m_z0_res_vs_pt; + TH1F *m_theta_res_vs_pt; + TH1F *m_z0st_res_vs_pt; TH1F *create_registeredTH1F(MonGroup &mon, const char *name); TH1D *create_registeredTH1D(MonGroup &mon, const char *name); TH2F *create_registeredTH2F(MonGroup &mon, const char *name); - TH2D *create_registeredTH2D(MonGroup &mon, const char *name); TProfile *create_registeredTProfile(MonGroup &mon, const char *name); void SetSafeMinimumMaximum(TH1 *h1, float min, float max); @@ -299,23 +253,18 @@ private: void CopyProfile(const TProfile *p, TH1 *h); void projectStandardProfileY(const TH2 *h, TH1 *profMean, TH1 *profWidth = 0, const char *fitfun = 0, Double_t cut_tail = 3.0); - void projectStandardProfileY(const std::vector<TH1D *> &hvec, TH1 *profMean, TH1 *profWidth = 0, + void projectStandardProfileY(const std::vector<TH1F *> &hvec, TH1 *profMean, TH1 *profWidth = 0, Int_t fold = -1, const char *fitfun = 0, Double_t cut_tail = 3.0); - void calculateEfficiency(TH1 *hEff, TH1 *hDenom, TH1 *hNum); void calculateIntegrated(TH1 *puri, TH1 *matched, TH1 *all); void inverseSum(TH1 *in, TH1 *out); TList m_owned, m_update; TDirectory *m_top; - int m_verbose; std::string m_tracksName; std::string m_histDirectoryName; - int m_trackPtBins; - int m_trackEtaBins; - float m_maxTrackEta; - bool m_plotsVsAbsEta; + }; @@ -331,6 +280,12 @@ GetPath(const TDirectory *dir, TString &path) { path += dir->GetName(); } +// +bool FileExists(const char *name) { + return (gSystem->AccessPathName(name, kFileExists))? + false : true; +} + void PrintHist(const TH1 *h, int detail = 1) { if (detail >= 1) { @@ -376,16 +331,16 @@ PrintHist(const TH1 *h, int detail = 1) { class MonGroup { public: - MonGroup(IDStandardPerformance *tool, const std::string &system, int level, int interval) - : m_tool(tool), m_system(system), m_level(level), m_interval(interval) { + MonGroup(IDStandardPerformance *tool, const std::string &system, int level) + : m_tool(tool), m_system(system), m_level(level) { } TH1 * regHist(const char *name) { TString path = Form("%s/%s", m_system.c_str(), name); - // cout << "Path: " << path << endl; - // cout << "m_level " << m_level << endl; + if (PRINTDBG) { cout <<"\t"; RLN; cout << "Path: " << path << endl;} + if (PRINTDBG) { cout <<"\t"; RLN; cout << "m_level " << m_level << endl;} TH1 *h = 0; @@ -399,16 +354,16 @@ public: // cout << "Histo added " << h->GetName() << endl; // cout << "Path " << path << endl; } else if (m_level >= 0) { - ; - } // cerr << "TH1::"<<path<<" not found" << endl; - // cout << "Return h " << h << endl; + if (PRINTDBG) { cout <<"\t"; RLN; cout << "TH1::"<<path<<" not found " << endl; } + } + if (PRINTDBG) {cout <<"\t MonGroup regHist "; RLN; cout << "Return h " << h << endl;} return h; } private: IDStandardPerformance *m_tool; std::string m_system; - int m_level, m_interval; + int m_level; }; @@ -439,16 +394,14 @@ IDStandardPerformance::create_registeredTH1D(MonGroup &mon, const char *name) { TH2F * IDStandardPerformance::create_registeredTH2F(MonGroup &mon, const char *name) { TH2F *hist = 0; - + if (PRINTDBG) { cout <<"\t"; RLN; cout <<" create_registeredTH2 for " << name << endl; } hist = dynamic_cast<TH2F *>(mon.regHist(name)); - return hist; -} - -TH2D * -IDStandardPerformance::create_registeredTH2D(MonGroup &mon, const char *name) { - TH2D *hist = 0; - - hist = dynamic_cast<TH2D *>(mon.regHist(name)); + if (hist) { + if (PRINTDBG) { cout <<"\t"; RLN; cout <<" returning " << hist->GetName() << endl; } + } + else { + if (PRINTDBG) { cout <<"\t"; RLN; cout <<" IDStandardPerformance::create_registeredTH2F dynamic_cast<TH2F *> failed. returning null pointer " << endl; } + } return hist; } @@ -462,140 +415,92 @@ IDStandardPerformance::create_registeredTProfile(MonGroup &mon, const char *name void IDStandardPerformance::bookHistograms(bool isNewRun) { - // if (m_verbose>=1) cout << "bookHistograms "<<m_histDirectoryName<<endl; - // cout << "bookHistograms "<<m_histDirectoryName<<endl; - int expert = m_verbose, debug = m_verbose, shift = m_verbose, run = 0; - // MsgStream log( msgSvc(), name() ); + cout <<"\t"; RLN; cout << "bookHistograms "<<m_histDirectoryName<<endl; std::string outputDirName = "IDPerformanceMon/" + m_tracksName + "/" + m_histDirectoryName; - - MonGroup al_expert(this, outputDirName, expert, run); - MonGroup al_shift(this, outputDirName, shift, run); - MonGroup al_debug(this, outputDirName, debug, run); - MonGroup effdenom(this, outputDirName + "Tracks/" + m_histDirectoryName + "Denom", expert, run); - MonGroup effnum(this, outputDirName + "Tracks/" + m_histDirectoryName + "Num", expert, run); + int run = 0; + + MonGroup al_expert(this, outputDirName, run); + MonGroup al_shift(this, outputDirName, run); + MonGroup al_debug(this, outputDirName, run); if (isNewRun) { - char name_tmp[100]; - - m_d0_vs_eta = create_registeredTH2D(al_debug, "res_d0_vs_eta"); - m_z0_vs_eta = create_registeredTH2D(al_debug, "res_z0_vs_eta"); - m_phi_vs_eta = create_registeredTH2D(al_debug, "res_phi_vs_eta"); - m_theta_vs_eta = create_registeredTH2D(al_debug, "res_theta_vs_eta"); - m_z0st_vs_eta = create_registeredTH2D(al_debug, "res_z0*sin(theta)_vs_eta"); - m_qopt_vs_eta = create_registeredTH2D(al_debug, "res_qOverP_vs_eta"); - - m_d0_vs_pt = create_registeredTH2D(al_debug, "res_d0_vs_logpt"); - m_z0_vs_pt = create_registeredTH2D(al_debug, "res_z0_vs_logpt"); - m_phi_vs_pt = create_registeredTH2D(al_debug, "res_phi_vs_logpt"); - m_theta_vs_pt = create_registeredTH2D(al_debug, "res_theta_vs_logpt"); - m_z0st_vs_pt = create_registeredTH2D(al_debug, "res_z0*sin(theta)_vs_logpt"); - m_qopt_vs_pt = create_registeredTH2D(al_debug, "res_qOverP_vs_logpt"); - - m_d0pull_vs_eta = create_registeredTH2D(al_debug, "pull_d0_vs_eta"); - m_z0pull_vs_eta = create_registeredTH2D(al_debug, "pull_z0_vs_eta"); - m_phipull_vs_eta = create_registeredTH2D(al_debug, "pull_phi_vs_eta"); - m_thetapull_vs_eta = create_registeredTH2D(al_debug, "pull_theta_vs_eta"); - m_z0stpull_vs_eta = create_registeredTH2D(al_debug, "pull_z0*sin(theta)_vs_eta"); - m_qoptpull_vs_eta = create_registeredTH2D(al_debug, "pull_qOverP_vs_eta"); - - int nbins_eta = m_trackEtaBins; - float min_eta = -m_maxTrackEta; - float max_eta = +m_maxTrackEta; - int nbins_pt = 20; - int min_pt, max_pt; - - if (m_plotsVsAbsEta) { - nbins_eta = m_trackEtaBins / 2; - min_eta = 0; - } - + if (PRINTDBG) { cout <<"\t"; RLN; cout << " isNewRun" << endl; } + if (PRINTDBG) { cout <<"\t"; RLN; cout << " m_d0_vs_eta = create_registeredTH2F " << endl; } + m_d0_vs_eta = create_registeredTH2F(al_debug, "res_d0_vs_eta"); + m_z0_vs_eta = create_registeredTH2F(al_debug, "res_z0_vs_eta"); + m_phi_vs_eta = create_registeredTH2F(al_debug, "res_phi_vs_eta"); + m_theta_vs_eta = create_registeredTH2F(al_debug, "res_theta_vs_eta"); + m_z0st_vs_eta = create_registeredTH2F(al_debug, "res_z0*sin(theta)_vs_eta"); + m_qopt_vs_eta = create_registeredTH2F(al_debug, "res_qOverP_vs_eta"); + + m_d0_vs_pt = create_registeredTH2F(al_debug, "res_d0_vs_logpt"); + m_z0_vs_pt = create_registeredTH2F(al_debug, "res_z0_vs_logpt"); + m_phi_vs_pt = create_registeredTH2F(al_debug, "res_phi_vs_logpt"); + m_theta_vs_pt = create_registeredTH2F(al_debug, "res_theta_vs_logpt"); + m_z0st_vs_pt = create_registeredTH2F(al_debug, "res_z0*sin(theta)_vs_logpt"); + m_qopt_vs_pt = create_registeredTH2F(al_debug, "res_qOverP_vs_logpt"); + + m_d0pull_vs_eta = create_registeredTH2F(al_debug, "pull_d0_vs_eta"); + m_z0pull_vs_eta = create_registeredTH2F(al_debug, "pull_z0_vs_eta"); + m_phipull_vs_eta = create_registeredTH2F(al_debug, "pull_phi_vs_eta"); + m_thetapull_vs_eta = create_registeredTH2F(al_debug, "pull_theta_vs_eta"); + m_z0stpull_vs_eta = create_registeredTH2F(al_debug, "pull_z0*sin(theta)_vs_eta"); + m_qoptpull_vs_eta = create_registeredTH2F(al_debug, "pull_qOverP_vs_eta"); // ------------------------------------------------------------------ // summary plots of track parameter resolutions amnd means versus eta // ------------------------------------------------------------------ - m_d0_mean_vs_eta = create_registeredTH1D(al_shift, "resmean_d0_vs_eta"); - m_z0_mean_vs_eta = create_registeredTH1D(al_shift, "resmean_z0_vs_eta"); - m_phi_mean_vs_eta = create_registeredTH1D(al_shift, "resmean_phi_vs_eta"); - m_theta_mean_vs_eta = create_registeredTH1D(al_shift, "resmean_theta_vs_eta"); - m_z0st_mean_vs_eta = create_registeredTH1D(al_shift, "resmean_z0*sin(theta)_vs_eta"); - // m_qopt_mean_vs_eta = create_registeredTH1D(al_shift, "resmean_qOverP_vs_eta"); - - m_d0_width_vs_eta = create_registeredTH1D(al_shift, "reswidth_d0_vs_eta"); - m_z0_width_vs_eta = create_registeredTH1D(al_shift, "reswidth_z0_vs_eta"); - m_phi_width_vs_eta = create_registeredTH1D(al_shift, "reswidth_phi_vs_eta"); - m_theta_width_vs_eta = create_registeredTH1D(al_shift, "reswidth_theta_vs_eta"); - m_z0st_width_vs_eta = create_registeredTH1D(al_shift, "reswidth_z0*sin(theta)_vs_eta"); - // m_qopt_width_vs_eta = create_registeredTH1D(al_shift, "reswidth_qOverP_vs_eta"); - - m_d0pull_mean_vs_eta = create_registeredTH1D(al_shift, "pullmean_d0_vs_eta"); - m_z0pull_mean_vs_eta = create_registeredTH1D(al_shift, "pullmean_z0_vs_eta"); - m_phipull_mean_vs_eta = create_registeredTH1D(al_shift, "pullmean_phi_vs_eta"); - m_thetapull_mean_vs_eta = create_registeredTH1D(al_shift, "pullmean_theta_vs_eta"); - m_z0stpull_mean_vs_eta = create_registeredTH1D(al_shift, "pullmean_z0*sin(theta)_vs_eta"); - // m_qoptpull_mean_vs_eta = create_registeredTH1D(al_shift, "pullmean_qopt_vs_eta"); - - m_d0pull_width_vs_eta = create_registeredTH1D(al_shift, "pullwidth_d0_vs_eta"); - m_z0pull_width_vs_eta = create_registeredTH1D(al_shift, "pullwidth_z0_vs_eta"); - m_phipull_width_vs_eta = create_registeredTH1D(al_shift, "pullwidth_phi_vs_eta"); - m_thetapull_width_vs_eta = create_registeredTH1D(al_shift, "pullwidth_theta_vs_eta"); - m_z0stpull_width_vs_eta = create_registeredTH1D(al_shift, "pullwidth_z0*sin(theta)_vs_eta"); - // m_qoptpull_width_vs_eta = create_registeredTH1D(al_shift, "pullwidth_qopt_vs_eta"); + m_d0_mean_vs_eta = create_registeredTH1F(al_shift, "resmean_d0_vs_eta"); + m_z0_mean_vs_eta = create_registeredTH1F(al_shift, "resmean_z0_vs_eta"); + m_phi_mean_vs_eta = create_registeredTH1F(al_shift, "resmean_phi_vs_eta"); + m_theta_mean_vs_eta = create_registeredTH1F(al_shift, "resmean_theta_vs_eta"); + m_z0st_mean_vs_eta = create_registeredTH1F(al_shift, "resmean_z0*sin(theta)_vs_eta"); + // m_qopt_mean_vs_eta = create_registeredTH1F(al_shift, "resmean_qOverP_vs_eta"); + + m_d0_width_vs_eta = create_registeredTH1F(al_shift, "reswidth_d0_vs_eta"); + m_z0_width_vs_eta = create_registeredTH1F(al_shift, "reswidth_z0_vs_eta"); + m_phi_width_vs_eta = create_registeredTH1F(al_shift, "reswidth_phi_vs_eta"); + m_theta_width_vs_eta = create_registeredTH1F(al_shift, "reswidth_theta_vs_eta"); + m_z0st_width_vs_eta = create_registeredTH1F(al_shift, "reswidth_z0*sin(theta)_vs_eta"); + // m_qopt_width_vs_eta = create_registeredTH1F(al_shift, "reswidth_qOverP_vs_eta"); + + m_d0pull_mean_vs_eta = create_registeredTH1F(al_shift, "pullmean_d0_vs_eta"); + m_z0pull_mean_vs_eta = create_registeredTH1F(al_shift, "pullmean_z0_vs_eta"); + m_phipull_mean_vs_eta = create_registeredTH1F(al_shift, "pullmean_phi_vs_eta"); + m_thetapull_mean_vs_eta = create_registeredTH1F(al_shift, "pullmean_theta_vs_eta"); + m_z0stpull_mean_vs_eta = create_registeredTH1F(al_shift, "pullmean_z0*sin(theta)_vs_eta"); + // m_qoptpull_mean_vs_eta = create_registeredTH1F(al_shift, "pullmean_qopt_vs_eta"); + + m_d0pull_width_vs_eta = create_registeredTH1F(al_shift, "pullwidth_d0_vs_eta"); + m_z0pull_width_vs_eta = create_registeredTH1F(al_shift, "pullwidth_z0_vs_eta"); + m_phipull_width_vs_eta = create_registeredTH1F(al_shift, "pullwidth_phi_vs_eta"); + m_thetapull_width_vs_eta = create_registeredTH1F(al_shift, "pullwidth_theta_vs_eta"); + m_z0stpull_width_vs_eta = create_registeredTH1F(al_shift, "pullwidth_z0*sin(theta)_vs_eta"); + // m_qoptpull_width_vs_eta = create_registeredTH1F(al_shift, "pullwidth_qopt_vs_eta"); // ------------------------------------------------------------------ // summary plots of track parameter resolutions versus pt // ------------------------------------------------------------------ - m_d0_mean_vs_pt = create_registeredTH1D(al_shift, "resmean_d0_vs_logpt"); - m_z0_mean_vs_pt = create_registeredTH1D(al_shift, "resmean_z0_vs_logpt"); - m_phi_mean_vs_pt = create_registeredTH1D(al_shift, "resmean_phi_vs_logpt"); - m_theta_mean_vs_pt = create_registeredTH1D(al_shift, "resmean_theta_vs_logpt"); - m_z0st_mean_vs_pt = create_registeredTH1D(al_shift, "resmean_z0*sin(theta)_vs_logpt"); - // m_qopt_mean_vs_pt = create_registeredTH1D(al_shift, "resmean_qOverP_vs_logpt")' - - m_d0_width_vs_pt = create_registeredTH1D(al_shift, "reswidth_d0_vs_logpt"); - m_z0_width_vs_pt = create_registeredTH1D(al_shift, "reswidth_z0_vs_logpt"); - m_phi_width_vs_pt = create_registeredTH1D(al_shift, "reswidth_phi_vs_logpt"); - m_theta_width_vs_pt = create_registeredTH1D(al_shift, "reswidth_theta_vs_logpt"); - m_z0st_width_vs_pt = create_registeredTH1D(al_shift, "reswidth_z0*sin(theta)_vs_logpt"); - // m_qopt_width_vs_pt = create_registeredTH1D(al_shift, "reswidth_qOverP_vs_logpt"); - - // ------------------------------------------------------------------ - // track efficiency plots - // ------------------------------------------------------------------ - - m_eff_eta = create_registeredTH1D(al_shift, "Eff_eta"); - m_effdenom_eta = create_registeredTH1D(effdenom, "eta"); - m_effnum_eta = create_registeredTH1D(effnum, "eta"); - - m_eff_phi = create_registeredTH1D(al_shift, "Eff_phi"); - m_effdenom_phi = create_registeredTH1D(effdenom, "phi"); - m_effnum_phi = create_registeredTH1D(effnum, "phi"); + m_d0_mean_vs_pt = create_registeredTH1F(al_shift, "resmean_d0_vs_logpt"); + m_z0_mean_vs_pt = create_registeredTH1F(al_shift, "resmean_z0_vs_logpt"); + m_phi_mean_vs_pt = create_registeredTH1F(al_shift, "resmean_phi_vs_logpt"); + m_theta_mean_vs_pt = create_registeredTH1F(al_shift, "resmean_theta_vs_logpt"); + m_z0st_mean_vs_pt = create_registeredTH1F(al_shift, "resmean_z0*sin(theta)_vs_logpt"); + // m_qopt_mean_vs_pt = create_registeredTH1F(al_shift, "resmean_qOverP_vs_logpt")' - m_eff_pt = create_registeredTH1D(al_shift, "Eff_pt"); - m_eff_pti = create_registeredTH1D(al_shift, "Eff_pti"); - m_effdenom_pt = create_registeredTH1D(effdenom, "pt"); - m_effnum_pt = create_registeredTH1D(effnum, "pt"); + m_d0_width_vs_pt = create_registeredTH1F(al_shift, "reswidth_d0_vs_logpt"); + m_z0_width_vs_pt = create_registeredTH1F(al_shift, "reswidth_z0_vs_logpt"); + m_phi_width_vs_pt = create_registeredTH1F(al_shift, "reswidth_phi_vs_logpt"); + m_theta_width_vs_pt = create_registeredTH1F(al_shift, "reswidth_theta_vs_logpt"); + m_z0st_width_vs_pt = create_registeredTH1F(al_shift, "reswidth_z0*sin(theta)_vs_logpt"); + // m_qopt_width_vs_pt = create_registeredTH1F(al_shift, "reswidth_qOverP_vs_logpt"); - m_eff_eta_pt = create_registeredTH2D(al_shift, "Eff_eta_pt"); - m_effdenom_eta_pt = create_registeredTH2D(effdenom, "eta_pt"); - m_effnum_eta_pt = create_registeredTH2D(effnum, "eta_pt"); - - m_eff_eta_phi = create_registeredTH2D(al_shift, "Eff_eta_phi"); - m_effdenom_eta_phi = create_registeredTH2D(effdenom, "eta_phi"); - m_effnum_eta_phi = create_registeredTH2D(effnum, "eta_phi"); - - m_n_vs_jetDR_truth = create_registeredTProfile(al_shift, "NTracks_vs_jetDR_truth"); - m_n_vs_jetDR_reco = create_registeredTProfile(al_shift, "NTracks_vs_jetDR_reco"); - m_eff_jetDR = create_registeredTH1D(al_shift, "NTracks_vs_jetDR_eff"); - - m_n_vs_jetPt_truth = create_registeredTProfile(al_shift, "NTracks_vs_jetPt_truth"); - m_n_vs_jetPt_reco = create_registeredTProfile(al_shift, "NTracks_vs_jetPt_reco"); - m_eff_jetPt = create_registeredTH1D(al_shift, "NTracks_vs_jetPt_eff"); } - if (m_verbose >= 1) { - cout << "bookHistograms " << m_histDirectoryName << " Done." << endl; + if (PRINTDBG > 1) { + cout <<"\t"; RLN; cout << "bookHistograms " << m_histDirectoryName << " Done." << endl; } } @@ -659,7 +564,7 @@ SetProfileBin(Int_t i, TH1 *h1, TH1 *pm, TH1 *pw, const char *fitfun = 0, Double } } -// projects a TH2 into a profile, expressed as a TH1D. +// projects a TH2 into a profile, expressed as a TH1F. // This is similar to the TH2::ProfileX method with the difference // that only the error within 3RMS around the mean is considered in the profile. // Specify a different range with cut_tail (>0:mean+/-RMS, <0:0+/-RMS). @@ -667,12 +572,17 @@ SetProfileBin(Int_t i, TH1 *h1, TH1 *pm, TH1 *pw, const char *fitfun = 0, Double void IDStandardPerformance::projectStandardProfileY(const TH2 *h, TH1 *profMean, TH1 *profWidth, const char *fitfun, Double_t cut_tail) { + if (PRINTDBG) { cout <<"\t"; RLN; cout << " projectStandardProfileY" << endl;} + if (!h) { + if (PRINTDBG) { cout <<"\t"; RLN; cout << " no TH2 h. No processing. " << endl; } return; } if (!profMean && !profWidth) { + if (PRINTDBG) { cout <<"\t"; RLN; cout << " !profMean && !profWidth No processing. " << endl;} return; } + if (PRINTDBG) { cout <<"\t"; RLN; cout << "processing for " << h->GetName() << endl;} Int_t nb = h->GetNbinsX(); Double_t xlo = h->GetXaxis()->GetXmin(), xhi = h->GetXaxis()->GetXmax(); if (profMean) { @@ -697,7 +607,7 @@ IDStandardPerformance::projectStandardProfileY(const TH2 *h, TH1 *profMean, TH1 } void -IDStandardPerformance::projectStandardProfileY(const std::vector<TH1D *> &hvec, TH1 *profMean, TH1 *profWidth, +IDStandardPerformance::projectStandardProfileY(const std::vector<TH1F *> &hvec, TH1 *profMean, TH1 *profWidth, Int_t fold, const char *fitfun, Double_t cut_tail) { TH1 *hx = profMean ? profMean : profWidth; @@ -730,7 +640,7 @@ IDStandardPerformance::projectStandardProfileY(const std::vector<TH1D *> &hvec, if (!(j1 >= 0 && hvec[j1])) { continue; } - TH1D *h1 = dynamic_cast<TH1D *>(hvec[j1]->Clone(Form("%s_mod", hvec[j1]->GetName()))); + TH1F *h1 = dynamic_cast<TH1F *>(hvec[j1]->Clone(Form("%s_mod", hvec[j1]->GetName()))); if (j2 >= 0 && hvec[j2]) { h1->Add(hvec[j2]); } @@ -749,29 +659,6 @@ IDStandardPerformance::projectStandardProfileY(const std::vector<TH1D *> &hvec, } } -void -IDStandardPerformance::calculateEfficiency(TH1 *hEff, TH1 *hDenom, TH1 *hNum) { - if (!hEff) { - return; - } - if (!hDenom) { - return; - } - if (!hNum) { - return; - } - - hEff->Reset(); - - hEff->Add(hNum); - if (!hEff->GetSumw2N()) { - hEff->Sumw2(); - } - hEff->Divide(hEff, hDenom, 1, 1, "B"); - - Update(hEff); -} - void IDStandardPerformance::calculateIntegrated(TH1 *puri, TH1 *all, TH1 *matched) { if (!matched) { @@ -818,21 +705,14 @@ IDStandardPerformance::inverseSum(TH1 *in, TH1 *out) { void IDStandardPerformance::procHistograms(bool isEndOfRun) { - if (m_verbose >= 1) { - cout << "procHistograms " << m_histDirectoryName << endl; + if (PRINTDBG >= 1) { + if (PRINTDBG) { cout <<"\t"; RLN; cout << "procHistograms " << m_histDirectoryName << endl;} } - // MsgStream log( msgSvc(), name() ); - // if (m_idHelper) delete m_idHelper; if (isEndOfRun) { - int halfEtaBins = m_trackEtaBins / 2; - int fold = m_plotsVsAbsEta ? halfEtaBins : 0; - - // cout << "procHistos" << endl; char fitter[5] = "iter"; - // cout << "Fitter: " << fitter << endl; - + if (PRINTDBG) { cout <<"\t"; RLN; cout << "trying m_d0_vs_eta " << endl;} projectStandardProfileY(m_d0_vs_eta, m_d0_mean_vs_eta, m_d0_width_vs_eta, fitter); projectStandardProfileY(m_z0_vs_eta, m_z0_mean_vs_eta, m_z0_width_vs_eta, fitter); projectStandardProfileY(m_phi_vs_eta, m_phi_mean_vs_eta, m_phi_width_vs_eta, fitter); @@ -852,27 +732,15 @@ IDStandardPerformance::procHistograms(bool isEndOfRun) { projectStandardProfileY(m_phipull_vs_eta, m_phipull_mean_vs_eta, m_phipull_width_vs_eta, fitter); projectStandardProfileY(m_thetapull_vs_eta, m_thetapull_mean_vs_eta, m_thetapull_width_vs_eta, fitter); projectStandardProfileY(m_z0stpull_vs_eta, m_z0stpull_mean_vs_eta, m_z0stpull_width_vs_eta, fitter); - // projectStandardProfileY (m_qoptpull_vs_eta, m_qoptpull_mean_vs_eta, m_qoptpull_width_vs_eta, fitter); - - calculateEfficiency(m_eff_eta, m_effdenom_eta, m_effnum_eta); - calculateEfficiency(m_eff_phi, m_effdenom_phi, m_effnum_phi); - calculateEfficiency(m_eff_pt, m_effdenom_pt, m_effnum_pt); - calculateIntegrated(m_eff_pti, m_effdenom_pt, m_effnum_pt); - calculateEfficiency(m_eff_eta_pt, m_effdenom_eta_pt, m_effnum_eta_pt); - calculateEfficiency(m_eff_eta_phi, m_effdenom_eta_phi, m_effnum_eta_phi); - - calculateEfficiency(m_eff_jetDR, m_n_vs_jetDR_truth, m_n_vs_jetDR_reco); - calculateEfficiency(m_eff_jetPt, m_n_vs_jetPt_truth, m_n_vs_jetPt_reco); SetSafeMinimumMaximum(m_d0_mean_vs_eta, -0.03, 0.03); SetSafeMinimumMaximum(m_phi_mean_vs_eta, -0.001, 0.001); SetSafeMinimumMaximum(m_theta_mean_vs_eta, -0.001, 0.001); SetSafeMinimumMaximum(m_z0st_mean_vs_eta, -0.05, 0.05); - // SetSafeMinimumMaximum(m_qopt_mean_vs_eta, -0.01, 0.01); } - if (m_verbose >= 1) { - cout << "procHistograms " << m_histDirectoryName << " Done." << endl; + if (PRINTDBG >= 1) { + cout <<"\t"; RLN; cout << "procHistograms " << m_histDirectoryName << " Done." << endl; } } @@ -911,7 +779,7 @@ IDStandardPerformance::updateFile() { if (!d) { continue; } - if (m_verbose >= 1) { + if (PRINTDBG > 1) { cout << "Updated "; PrintHist(h); } @@ -922,49 +790,30 @@ IDStandardPerformance::updateFile() { return n; } -int -postprocessHistos(TDirectory *file, const char *tracksName, const char *dirname, int verbose = 0) { +int postprocessHistos(TDirectory *file, const char *tracksName, const char *dirname) { + TString dir; - dir.Form("IDPerformanceMon/%s/%s", tracksName, dirname); - TH1 *h = 0; - - cout << "Now searching for " << dir << endl; - file->GetObject(dir + "/res_d0_vs_eta", h); - if (!h) { - file->GetObject(dir + "/HitContent_NBlayerHits", h); - } - if (!h) { - file->GetObject(dir + "/jetpT", h); - } - if (!h) { - return 0; - } - bool plotsVsAbsEta = (h->GetXaxis()->GetXmin() == 0.0); - delete h; + if (PRINTDBG>0) + cout << "Now processing histograms in " << dir << endl; - IDStandardPerformance idsp(file, tracksName, dirname, verbose, plotsVsAbsEta); + IDStandardPerformance idsp(file, tracksName, dirname); idsp.bookHistograms(); idsp.procHistograms(); int n = idsp.updateFile(); - if (verbose >= 0) { - cout << "Updated " << n << " histograms in " << dir; - if (plotsVsAbsEta) { - cout << " with |eta| range"; - } - cout << endl; - cout << endl; - } + if (PRINTDBG > 0) + cout << "\t Updated " << n << " histograms in " << dir << "\n " << endl; + return 1; } int -ScanDir(TList &dirs, TDirectory *file, TDirectory *dir, const char *tracksName = 0, int verbose = 0) { +ScanDir(TList &dirs, TDirectory *file, TDirectory *dir, const char *tracksName = 0) { int n = 0; - if (verbose >= 1) { + if (PRINTDBG > 0) { TString path; GetPath(dir, path); cout << "Scan directory " << path << endl; @@ -976,7 +825,7 @@ ScanDir(TList &dirs, TDirectory *file, TDirectory *dir, const char *tracksName = } if (TDirectory *subdir = dynamic_cast<TDirectory *>(k->ReadObj())) { if (!tracksName) { - n += ScanDir(dirs, file, subdir, subdir->GetName(), verbose); + n += ScanDir(dirs, file, subdir, subdir->GetName()); } else { dirs.Add(new TNamed(tracksName, subdir->GetName())); } @@ -986,86 +835,62 @@ ScanDir(TList &dirs, TDirectory *file, TDirectory *dir, const char *tracksName = return n; } -int -postprocessHistos(TDirectory *file, int verbose = 0) { - int n = 0; +int postprocessHistos(const char *name) { - if (verbose >= 0) { - cout << "Process file " << file->GetName() << endl; + if (PRINTDBG>0) + cout << "Process file " << name << endl; + + if (!FileExists(name)) { + cerr << "No such file: " << name << endl; + return 1; } + TFile *file = TFile::Open(name, "UPDATE"); + if (!file) { + cerr << "Could not UPDATE file " << name << endl; + return 1; + } + + int n = 0; TDirectory *dir = 0; file->GetObject("IDPerformanceMon", dir); if (dir) { TList dirs; dirs.SetOwner(); - n += ScanDir(dirs, file, dir, 0, verbose); + n += ScanDir(dirs, file, dir, 0); delete dir; for (TIter it = &dirs; TNamed *name = dynamic_cast<TNamed *>(it()); ) { - n += postprocessHistos(file, name->GetName(), name->GetTitle(), verbose); + cout << "processing this directory " << name->GetName() << " , " << name->GetTitle() << endl; + //n += postprocessHistos(file, name->GetName(), name->GetTitle()); } } if (!n) { cerr << "No histogram directories found in file " << file->GetName() << endl; + return 1; } - return n; -} - -int -postprocessHistos(const char *name, int verbose = 0) { - if (gSystem->AccessPathName(name, kFileExists)) { - cerr << "File " << name << " does not exist" << endl; - return 2; - } - TFile *file = TFile::Open(name, "UPDATE"); - if (!file) { - cerr << "Could not open file " << name << endl; - return 3; - } - int n = postprocessHistos(file, verbose); - delete file; - return n ? 0 : 4; + return 0; } -void -postprocessHistos(int verbose = 0) { +// for command-line running +void postprocessHistos() { for (TIter it = gROOT->GetListOfFiles(); TObject *o = it(); ) { TFile *file = dynamic_cast<TFile *>(o); if (!file) { continue; } - postprocessHistos(file->GetName(), verbose); + postprocessHistos(file->GetName()); } } #if !defined(__CINT__) && !defined(__ACLIC__) -int -main(int argc, const char * *argv) { - int i = 1, verbose = 0; - - for (; i < argc; i++) { - if (argv[i][0] != '-') { - break; - } - for (const char *a = argv[i] + 1; *a; ) { - switch (*a++) { - case 'v': verbose++; - break; +int main(int argc, const char * *argv) { - case 'q': verbose--; - break; - - default: i = argc; - break; - } - } - } - if (i >= argc) { - cout << "Usage: " << argv[0] << " [-vq] FILE.root [FILE.root...]" << endl; + if (argc<2) { + cout << "Usage: " << argv[0] << " FILE.root [FILE.root...]" << endl; return 1; } int err = 0; - for (; i < argc; i++) { - int stat = postprocessHistos(argv[i], verbose); + for (int i=0; i < argc; i++) { + int stat = postprocessHistos(argv[i]); if (!err) { err = stat; } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/postprocessHistos_updt.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/postprocessHistos_updt.cxx new file mode 100755 index 0000000000000000000000000000000000000000..a93916a8b26e41ef2a56b3bcaefaa0535fee284d --- /dev/null +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/postprocessHistos_updt.cxx @@ -0,0 +1,284 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/* + ____________________________________________________________________________ + + merge root files from several (grid) runs + dedicated treatment of profiles and efficiencies + Author: Liza Mijovic + ____________________________________________________________________________ +*/ + +#define RLN cout << "l" << __LINE__ << ": "; +// 0..3 in increasing verbosity +#define PRINTDBG 2 + +#include <iostream> +#include <iterator> + +#include <boost/program_options.hpp> +#include <boost/algorithm/string.hpp> + +#include "TFile.h" +#include "TSystem.h" +#include "TH1.h" +#include "TH2.h" +#include "TProfile.h" +#include "TEfficiency.h" +#include "TMath.h" +#include "TROOT.h" +#include "TKey.h" +#include "TClass.h" +#include "TObject.h" +#include "TObjString.h" + +using namespace std; + +namespace po = boost::program_options; + +int process_th1(TH1* p_h1, TH1* p_h2) { + p_h1->Add(p_h2); + return 0; +} + +int process_efficiency(TEfficiency* p_e1, TEfficiency* p_e2) { + if (PRINTDBG>2) + cout << "adding efficiency " << p_e1->GetName() << endl; + double pre1 = p_e1->GetTotalHistogram()->GetEntries(); + double pre2 = p_e2->GetTotalHistogram()->GetEntries(); + p_e1->Add(*p_e2); + double post = p_e1->GetTotalHistogram()->GetEntries(); + if (PRINTDBG>2) + cout << "pre1 pre2 post " << pre1 << " + " << pre2 << " = " << post << endl; + return 0; +} + +int process_profile(TProfile* p_p1,TProfile* p_p2) { + // TODO + return 0; +} +int process_object(string p_objname,TFile* p_ftarget,TFile* p_ftosumm,bool p_second_pass) { + int ret=0; + if (PRINTDBG>2) + cout << "process_object p_objname " << p_objname << endl; + TObject* o1 = (TObject*)p_ftarget->Get(p_objname.c_str()); + TObject* o2 = (TObject*)p_ftosumm->Get(p_objname.c_str()); + if (!o1 || !o2) + return 1; + if (p_second_pass) { + if (o1->IsA()->InheritsFrom(TProfile::Class())) { + if (PRINTDBG>2) + cout << "profile " << o1->GetName() << endl; + TProfile *p1 = dynamic_cast<TProfile*>(o1); + TProfile *p2 = dynamic_cast<TProfile*>(o2); + ret=process_profile(p1,p2); + if (!ret) + p1->Write(p_objname.c_str(),TObject::kOverwrite); + } + } + else { + if (o1->IsA()->InheritsFrom(TEfficiency::Class())) { + if (PRINTDBG>2) + cout << "TEfficiency " << o1->GetName() << endl; + TEfficiency *e1 = dynamic_cast<TEfficiency*>(o1); + TEfficiency *e2 = dynamic_cast<TEfficiency*>(o2); + ret=process_efficiency(e1,e2); + double post = e1->GetTotalHistogram()->GetEntries(); + if (PRINTDBG>2) + cout << "postwrote " << post << endl; + if (!ret) + e1->Write(p_objname.c_str(),TObject::kOverwrite); + } + else if (o1->IsA()->InheritsFrom(TH1::Class())) { + if (PRINTDBG>2) + cout << "TH1 " << o1->GetName() << endl; + TH1* h1 = dynamic_cast<TH1*>(o1); + TH1* h2 = dynamic_cast<TH1*>(o2); + ret=process_th1(h1,h2); + if (!ret) + h1->Write(p_objname.c_str(),TObject::kOverwrite); + } + } + return ret; +} + + +void get_all_objects(TDirectory* const p_source, vector<string>& p_all_objects,string p_dirup="") { + + TIter nextkey(p_source->GetListOfKeys()); + TDirectory *savdir = gDirectory; + TKey *key; + while ((key=(TKey*)nextkey())) { + TClass *cl = gROOT->GetClass(key->GetClassName()); + if (!cl) continue; + if (cl->InheritsFrom(TDirectory::Class())) { + p_source->cd(key->GetName()); + TDirectory *subdir = gDirectory; + string oneup=subdir->GetName(); + string dirup = (""!=p_dirup) ? p_dirup + "/" + oneup : oneup; + get_all_objects(subdir,p_all_objects,dirup); + } + p_all_objects.push_back(p_dirup+"/"+string(key->GetName())); + savdir->cd(); + } + return; +} + +bool file_exists(const string p_name) { + return (gSystem->AccessPathName(p_name.c_str(), kFileExists))? + false : true; +} + +int process_histos(string p_ofile, string p_infile) { + if (PRINTDBG>0) + cout << "merging file " << p_infile << " into "<< p_ofile << endl; + + // output file pre-exists by construction; + // at start of summing the output is created copy of 1st input + TFile* ofile = new TFile(p_ofile.c_str(),"UPDATE"); + if (! ofile ) { + cout << "could not open file for update "<< endl; + cout << p_ofile << endl; + return 1; + } + + vector<string> all_objects; + TDirectory* topdir=gDirectory; + get_all_objects(topdir,all_objects); + + TFile* const infile = new TFile(p_infile.c_str(),"READ"); + if (! infile ) { + cout << "could not open input file for reading "<< endl; + cout << p_infile << endl; + return 1; + } + + // process histograms and efficiencies, that can be summed directly + bool second_pass = false; + for (auto obj : all_objects) { + if (PRINTDBG>2) + cout << "running object " << obj << endl; + int ret=process_object(obj,ofile,infile,second_pass); + if (0!=ret) { + cout << "Error processing " << obj << endl; + } + } + // process TProfiles, that require pre-summed 2d-histograms + second_pass = true; + for (auto obj : all_objects) { + if (PRINTDBG>2) + cout << "running object 2nd pass " << obj; + int ret=process_object(obj,ofile,infile,second_pass); + if (0!=ret) { + cout << "Error processing " << obj << endl; + } + } + if (PRINTDBG>1) + cout << "loop all done " << endl; + + ofile->Close(); + infile->Close(); + + return 0; +} + +int main(int ac, char* av[]) { + + vector<string> infiles; + string ofile=""; + + try { + po::options_description desc("Allowed arguments: "); + desc.add_options() + ("h", "print help") + ("o", po::value<string>(), "output root file 'summ.root'") + ("i", po::value<string>(), "inputs 'file1.root,file2.root,file3.root'") + ; + + po::variables_map vm; + po::store(po::parse_command_line(ac, av, desc), vm); + po::notify(vm); + + if (vm.count("h")) { + + cout << "\n" << desc << "\n" << endl; + const char* ex_run = "./postprocessHistos_updt --i \"summ.root\" " + "--o \"file1.root,file2.root,file3.root\" "; + cout << "\n------- run -------" << endl; + cout << ex_run << endl; + cout << "\n"; + return 0; + } + + if (vm.count("o")) { + ofile=vm["o"].as<string>(); + cout << "Output file set to "<< ofile << endl; + } + + if (vm.count("i")) { + string infiles_cl=vm["i"].as<string>(); + boost::split(infiles , infiles_cl, boost::is_any_of(",")); + cout << "Summing input files "; + for (auto inf : infiles) + cout << inf << " " ; + cout << endl; + } + + if ("" == ofile) { + cout << "Invalid arguments. No output file passed."; + cout << "\n" << desc <<"\n" << endl; + return 1; + } + + if (infiles.empty()) { + cout << "Invalid arguments. No inputs to summ passed."; + cout << desc <<" \n " << endl; + return 1; + } + + } + catch(exception& e) { + cerr << __FILE__ << "error: " << e.what() << "\n"; + return 1; + } + catch(...) { + cerr << __FILE__ << "Exception of unknown type!\n"; + return 1; + } + + if (file_exists(ofile)) { + cout << "\n" << __FILE__ << "Target file exist: " << ofile << endl; + cout << "Please provide an empty target file \n"<< endl; + return 1; + } + + int processed = 0; + for (auto infile : infiles) { + if (0==processed) { + if (!file_exists(infile)) { + cout << __FILE__ << "Error: input file does not exist: " << infile << endl; + return 1; + } + cout << "\n" << __FILE__ << " Creating initial contents of " << ofile << endl; + cout << "from " << infile << endl; + gSystem->CopyFile(infile.c_str(),ofile.c_str()); + } + else { + int ret = process_histos(ofile,infile); + if (0 != ret) { + cout << "\n" << __FILE__ << " Non-0 return of process_histos for file " << endl; + cout << infile << endl; + cout << "Terminate postprocessing \n" << endl; + return 1; + } + } + ++processed; + cout << "\n" << __FILE__ << " Post-processed " << processed << " files " << endl; + } + cout << "\n" << __FILE__ << " Merging all done \n " << endl; + return 0; + +} + diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/run_postprocess.sh b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/run_postprocess.sh new file mode 100755 index 0000000000000000000000000000000000000000..82865f8a86e6d601af77d69f1bcc9dcf7060641b --- /dev/null +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/run/run_postprocess.sh @@ -0,0 +1,18 @@ +#!/usr/bin/env bash + +if [ -z $ROOTSYS ]; then + echo "Please set up ROOT to run" + exit 1 +fi + +echo "--------------------------------------------------------" +echo "compiling posprocessing script" +echo "--------------------------------------------------------" +NAME=postprocessHistos_updt +g++ -O2 -Wall -fPIC -std=c++11 $(root-config --cflags) -o ${NAME} ${NAME}.cxx $(root-config --libs) -lboost_program_options + +echo "--------------------------------------------------------" +echo "running postprocessing" +echo "--------------------------------------------------------" +./postprocessHistos_updt $@ + diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/hist_bookkeep_utils.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/hist_bookkeep_utils.py index 306e5a2dbad5603f34c415a7406e5d048fa9a2c2..c2a7a75fcd89f4d85cd34faf268e2dfdfc4d66c2 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/hist_bookkeep_utils.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/hist_bookkeep_utils.py @@ -8,10 +8,10 @@ import re ## -------------------------------------------------------- def weed(line): + line=line.strip() line=re.sub(' +',' ',line) line=re.sub(' =','=',line) line=re.sub('= ','=',line) - # line=re.sub('>\n','>',line) return line ## -------------------------------------------------------- @@ -38,21 +38,21 @@ def get_hbuff(_id,_infname,_withcomment=True): # loop over file to find histo-s with id xml and comment: with open(_infname, 'r') as _f: for _line in _f: - _line=weed(_line) - if _line.startswith("<h id=\""+_id+"\""): + _wline=weed(_line) + if _wline.startswith("<h id=\""+_id+"\""): _dobuff=True _buff=_commbuff - elif _line.startswith("</h>"): + elif _wline.startswith("</h>"): if (_dobuff): _buff.append(_line) # prepend comment _dobuff=False _commbuff=[] _docommbuff=False - elif _withcomment and _line.startswith("<!--"): + elif _withcomment and _wline.startswith("<!--"): if not _dobuff: _commbuff.append(_line) - if ( not re.search("-->",_line) ): + if ( not re.search("-->",_wline) ): # multi-line comment _docommbuff=True else: @@ -60,9 +60,9 @@ def get_hbuff(_id,_infname,_withcomment=True): else: if (_docommbuff): _commbuff.append(_line) - if ( re.search("-->\s*",_line) ): + if ( re.search("-->",_wline) ): _docommbuff=False - elif ( not re.search('\s*<',_line) and not _line in ['\n', '\r\n']): + elif not is_xml_form(_wline): print 'Warning', _infname, 'non-xml formatted line :', _line # buffer histo lines here: @@ -78,7 +78,7 @@ def get_comm_def(_buff): _comm_def=[[],[]] _iscomm=False for _bitem in _buff: - if _bitem.startswith("<!--"): + if _bitem.strip().startswith("<!--"): _iscomm=True _comm_def[0].append(_bitem) if ( re.search("-->",_bitem) ): @@ -92,3 +92,19 @@ def get_comm_def(_buff): return _comm_def +## -------------------------------------------------------- +## check for non-xml formated lines: +def is_xml_form(_line): + _line=_line.strip() + if _line.startswith("<") or _line.endswith(">"): + # assume these are .xml-s + return True + if not _line: + # empty line, that is '' after strip + return True + # any other exceptions? + if _line.startswith("&"): + # including daughters + return True + else: + return False diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/split_histdefs.py b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/split_histdefs.py index edbf6ea5148bc47c9ee5d927a55fbc9f997dc1ba..7a1c03e8a346b84e68ac1713f508c2c4a9352ab0 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/split_histdefs.py +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/split_histdefs.py @@ -1,11 +1,6 @@ #!/usr/bin/env python # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -''' -take two files and find overlapping histogram definitions. -... write out overlapping, different (in 1st file and 2nd file), -... and exclusive (only 1st file, only 2nd file) -''' import sys import string @@ -15,7 +10,11 @@ import argparse from hist_bookkeep_utils import * parser = argparse.ArgumentParser( - description='Get histogram xml blocks for list of id-s') + description=''' + take two files and find overlapping histogram definitions. + Write out overlapping, different (in 1st file and 2nd file), + and exclusive (only 1st file, only 2nd file''' +) parser.add_argument('--xml1', dest='in_xml1', @@ -64,7 +63,7 @@ def compare_xyline(_l1,_l2): ## -------------------------------------------------------- def compare_hbuffs(blist): - # strip definitions + # strip definitions of comments _buff1=(get_comm_def(blist[0])[1]) _buff2=(get_comm_def(blist[1])[1]) @@ -145,10 +144,9 @@ buff1=[] buff2=[] ## handle all definitions in 1st file: for line in args.in_xml1: - if line.startswith("<h"): + if line.strip().startswith("<h"): line=weed(line) id=get_val("id",line) - #print id buff1=get_hbuff(id,infname1,True) buff2=get_hbuff(id,infname2,True) # compare buffers @@ -171,10 +169,10 @@ buff1=[] buff2=[] for line in args.in_xml2: line=weed(line) - if line.startswith("<h"): + if line.strip().startswith("<h"): id=get_val("id",line) buff1=get_hbuff(id,infname1,True) - buff2=get_hbuff(id,infname2,True) + buff2=get_hbuff(id,infname2,True) if not buff1: for _bitem in buff2: buff_comp_dict[2].write(_bitem) diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/test1.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/test1.xml index 68498aa176bcafebc27e3816a5da9868dddfd3d7..b6b1d9b6731cfa6b7ca7d47d0da603680e248890 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/test1.xml +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/test1.xml @@ -1,13 +1,24 @@ <!-- --> -<!-- basic plots --> -<h id="basicd0" type="TH1F" title="d_{0} of selected tracks (in mm)"> +<!-- same definition in test1 and test2 --> +<h id="sameTest1Test2" type="TH1F" title="Same"> <x title="d_{0}(mm)" n="200" lo="-2" hi="2"/> <y title="Entries"/> </h> -<!-- -long comment ---> -<h id="basicz0" type="TH1F" title="z_{0} of selected tracks (in mm)"> + <!-- definition with range diff in test1 and test2 +long comment with offset and spaces +for a histogram with offsets and spaces + --> +<h id="rangediffTest1Test2" type="TH1F" title="Range difference"> + <x title="z_{0}(mm)" n="120" lo="-300" hi="300"/> + <y title="Entries"/> + </h> +<!-- definition with text diff in test1 and test2 --> +<h id="textdiffTest1Test2" type="TH1F" title="Text difference"> + <x title="z_{0}(mm)" n="120" lo="-300" hi="300"/> + <y title="ytit1"/> +</h> +<!-- definition only in test1 --> +<h id="only1" type="TH1F" title="Only test1"> <x title="z_{0}(mm)" n="120" lo="-300" hi="300"/> <y title="Entries"/> </h> diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/test2.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/test2.xml index 167fefa7f14a48b240d8d8aba755d82dc8794cef..7b4b3d35811e6f80f41bbe58d6883bbf9d7590f9 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/test2.xml +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/scripts/histdef_bookkeep/test2.xml @@ -1,20 +1,23 @@ <!-- --> -<!-- basic plots --> -<h id="basicd0" type="TH1F" title="d_{0} of selected tracks (in mm)"> +<!-- same definition in test1 and test2 --> +<h id="sameTest1Test2" type="TH1F" title="Same"> <x title="d_{0}(mm)" n="200" lo="-2" hi="2"/> <y title="Entries"/> </h> -<!-- -long comment ---> -<h id="basicz0" type="TH1F" title="z_{0} of selected tracks (in mm)"> +<!-- definition with range diff in test1 and test2 --> +<h id="rangediffTest1Test2" type="TH1F" title="Range difference"> <x title="z_{0}(mm)" n="1200" lo="-300" hi="300"/> <y title="Entries"/> </h> -<!-- -long 2 comment +<!-- definition with text diff in test1 and test2 +long comment --> -<h id="basicz20" type="TH1F" title="z_{0} of selected tracks (in mm)"> - <x title="z_{0}(mm)" n="2000" lo="-300" hi="300"/> +<h id="textdiffTest1Test2" type="TH1F" title="Text difference"> + <x title="z_{0}(mm)" n="120" lo="-300" hi="300"/> + <y title="ytit2"/> +</h> +<!-- definition only in test2 --> +<h id="only2" type="TH1F" title="Only test2"> + <x title="z_{0}(mm)" n="120" lo="-300" hi="300"/> <y title="Entries"/> </h> diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/ITKHistDef.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/ITKHistDef.xml deleted file mode 100644 index dd2a0face876636dd5fb78a5753992845215e2b3..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/ITKHistDef.xml +++ /dev/null @@ -1,1364 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?xml-stylesheet type="text/xsl" media="screen" href="hdefhtml.xsl"?> -<?xml-stylesheet type="text/xsl" media="tty" href="hdeftty.xsl" alternate="yes"?> -<!DOCTYPE hdef [ -<!ENTITY PI "3.1415926"> -<!ENTITY ETA "4.0"> -]> -<hdef xmlns:xi="http://www.w3.org/2001/XInclude"> -<h id="num_truthmatch_match" type="TH1F" title="num_truthmatch_match"> - <x title="Num. matching truth" n="10" lo="0" hi="10"/> - <y title="Entries"/> -</h> -<h id="nparticle" type="TH1F" title="Number of Truth Particles"> - <x title="Num. truth particles" n="200" lo="0" hi="2000"/> - <y title="Entries"/> -</h> -<h id="ntracksel" type="TH1F" title="Number of Selected Tracks"> - <x title="Num. tracks" n="200" lo="0" hi="1000"/> - <y title="Entries"/> -</h> -<h id="ntrack" type="TH1F" title="Number of Tracks"> - <x title="Num. tracks" n="200" lo="0" hi="1000"/> - <y title="Entries"/> -</h> -<!-- --> -<!-- pT --> -<h id="recpT" type="TH1F" title="p_{T} of selected rec tracks (in GeV)"> - <x title="p_{T} (GeV/c)" n="200" lo="0." hi="200"/> - <y title="Entries"/> -</h> -<h id="recPtLow" type="TH1F" title="p_{T} of selected rec tracks (in GeV)"> - <x title="p_{T} (GeV/c)" n="200" lo="0." hi="20"/> - <y title="Entries"/> -</h> -<!-- --> -<!-- basic plots --> -<h id="basicd0" type="TH1F" title="d_{0} of selected tracks (in mm)"> - <x title="d_{0}(mm)" n="200" lo="-2" hi="2"/> - <y title="Entries"/> -</h> -<h id="basicz0" type="TH1F" title="z_{0} of selected tracks (in mm)"> - <x title="z_{0}(mm)" n="120" lo="-300" hi="300"/> - <y title="Entries"/> -</h> -<h id="basicphi" type="TH1F" title="#phi of selected tracks"> - <x title="#phi" n="100" lo="-4;" hi="4"/> - <y title="Entries"/> -</h> -<h id="basiceta" type="TH1F" title="#eta of selected tracks"> - <x title="#eta" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="basictheta" type="TH1F" title="#theta of selected tracks"> - <x title="#theta" n="100" lo="0" hi="&PI;"/> - <y title="Entries"/> -</h> -<h id="basicqOverP" type="TH1F" title="q/p of selected tracks (in GeV)"> - <x title="p_{T}(GeV/c)" n="200" lo="-0.01" hi="0.01"/> - <y title="Entries"/> -</h> -<h id="truthd0" type="TH1F" title="d_{0} of selected truth (in mm)"> - <x title="d_{0}(mm)" n="2000" lo="-2" hi="2"/> - <y title="Entries"/> -</h> -<h id="truthz0" type="TH1F" title="z_{0} of selected truth (in mm)"> - <x title="z_{0}(mm)" n="120" lo="-300" hi="300"/> - <y title="Entries"/> -</h> -<h id="truthphi" type="TH1F" title="#phi of selected truth"> - <x title="#phi" n="100" lo="-4" hi="4"/> - <y title="Entries"/> -</h> -<h id="trutheta" type="TH1F" title="#eta of selected truth"> - <x title="#theta" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="truththeta" type="TH1F" title="#theta of selected truth"> - <x title="#theta" n="100" lo="0" hi="&PI;"/> - <y title="Entries"/> -</h> -<h id="truthqOverP" type="TH1F" title="q/p of selected truth (in GeV)"> - <x title="p_{T}(GeV/c)" n="200" lo="-0.005" hi="0.005"/> - <y title="Entries"/> -</h> -<h id="truthz0st" type="TH1F" title="z_{0} sin(#theta) of selected truth "> - <x title="p_{T}(GeV/c)" n="200" lo="-300" hi="300"/> - <y title="Entries"/> -</h> -<h id="truthprodR" type="TH1F" title="Radial distance (r) of truth vtx parameter from origin"> - <x title="(mm)" n="100" lo="0.0" hi="2.0"/> - <y title="Entries"/> -</h> -<h id="truthprodZ" type="TH1F" title="Longitudinal (z) distance of truth vtx parameter from origin"> - <x title="(mm)" n="100" lo="0" hi="300"/> - <y title="Entries"/> -</h> -<!-- --> -<!-- fakes --> -<h id="fakepT" type="TH1F" title="p_{T} of selected fake tracks (in GeV)"> - <x title="p_{T}(GeV/c)" n="200" lo="0." hi="200"/> - <y title="Entries"/> -</h> -<h id="fakepTlow" type="TH1F" title="p_{T} of selected fake tracks (in GeV)"> - <x title="p_{T}(GeV/c)" n="200" lo="0" hi="20"/> - <y title="Entries"/> -</h> -<h id="fakephi" type="TH1F" title="#phi of selected fake tracks"> - <x title="#phi" n="100" lo="-&PI;" hi="&PI;"/> - <y title="Entries"/> -</h> -<h id="fakeeta" type="TH1F" title="#eta of selected fake tracks"> - <x title="#eta" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="faked0" type="TH1F" title="d_{0} of selected fake tracks (in mm)"> - <x title="d_{0}(mm)" n="200" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="fakez0" type="TH1F" title="z_{0} of selected fake tracks (in mm)"> - <x title="z_{0}(mm)" n="120" lo="-300" hi="300"/> - <y title="Entries"/> -</h> -<h id="track_fakerate_vs_eta" type="TProfile" title="Fraction of tracks with <50% truth match probability"> - <x title="#eta" n="20" lo="-&ETA;" hi="&ETA;"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="track_fakerate_vs_pt" type="TProfile" title="Fraction of tracks with <50% truth match probability"> - <x title="p_{T}(GeV/c)" n="25" lo="0" hi="50"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="track_fakerate_vs_phi" type="TProfile" title="Fraction of tracks with <50% truth match probability"> - <x title="#phi" n="24" lo="-180" hi="180"/> - <y title="Fake Rate" lo="0" hi="100"/> -</h> -<h id="track_fakerate_vs_d0" type="TProfile" title="Fraction of tracks with <50% truth match probability"> - <x title="d0" n="20" lo="-6" hi="6"/> - <y title="Fake Rate" lo="0" hi="100"/> -</h> -<h id="track_fakerate_vs_z0" type="TProfile" title="Fraction of tracks with <50% truth match probability"> - <x title="z0" n="20" lo="-300" hi="300"/> - <y title="Fake Rate" lo="0" hi="100"/> -</h> -<h id="fakeEtaTotal" type="TProfile" title="Fake Rate (primary and secondary)"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="fakeetaPrimary" type="TProfile" title="Fake Rate (primary)"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="fakeetaSecondary" type="TProfile" title="Fake Rate (secondary)"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="fakeetaUnlinkedFrac" type="TProfile" title="Fake Rate (unlinked)"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> - -<h id="fakePtPrimary" type="TProfile" title="Fake Rate (primary)"> - <x title="p_{T}" n="100" lo="0" hi="100"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="fakePtSecondary" type="TProfile" title="Fake Rate (secondary)"> - <x title="p_{T}" n="100" lo="0" hi="100"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="fakePtUnlinkedFrac" type="TProfile" title="Fake Rate (secondary)"> - <x title="p_{T}" n="100" lo="0" hi="100"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="fakePhiPrimary" type="TProfile" title="Fake Rate (primary)"> - <x title="#phi" n="50" lo="-&PI;" hi="&PI;"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="fakePhiSecondary" type="TProfile" title="Fake Rate (secondary)"> - <x title="#phi" n="50" lo="-&PI;" hi="&PI;"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="fakePhiUnlinkedFrac" type="TProfile" title="Fake Rate (unlinked)"> - <x title="#phi" n="50" lo="-&PI;" hi="&PI;"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="faked0Primary" type="TProfile" title="Fake Rate (primary)"> - <x title="d_{0}" n="50" lo="-1.5" hi="1.5"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="faked0Secondary" type="TProfile" title="Fake Rate (secondary)"> - <x title="d_{0}" n="50" lo="-1.5" hi="1.5"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="faked0UnlinkedFrac" type="TProfile" title="Fake Rate (secondary)"> - <x title="d_{0}" n="50" lo="-1.5" hi="1.5"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="fakez0Primary" type="TProfile" title="Fake Rate (primary)"> - <x title="z_{0}" n="50" lo="-150" hi="150"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="fakez0Secondary" type="TProfile" title="Fake Rate (secondary)"> - <x title="z_{0}" n="50" lo="-150" hi="150"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="fakez0UnlinkedFrac" type="TProfile" title="Fake Rate (unlinked)"> - <x title="z_{0}" n="50" lo="-150" hi="150"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> - - -<!-- --> -<!-- efficiency plots --> -<h id="eff_pt_Numerator" type="TH1F" title="p_{T} of reco-matched truth track (in GeV)"> - <x title="p_{T}(GeV/c)" n="200" lo="0." hi="200"/> - <y title="Entries"/> -</h> -<h id="eff_pt_Denominator" type="TH1F" title="p_{T} of truth track (in GeV)"> - <x title="p_{T}(GeV/c)" n="200" lo="0." hi="200"/> - <y title="Entries"/> -</h> -<h id="eff_eta_Numerator" type="TH1F" title="#eta of reco-matched truth track"> - <x title="#eta" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="eff_eta_Denominator" type="TH1F" title="#eta of truth track"> - <x title="#eta" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="eff_phi_Numerator" type="TH1F" title="#phi of reco-matched truth track"> - <x title="#phi" n="100" lo="-&PI;" hi="&PI;"/> - <y title="Entries"/> -</h> -<h id="eff_phi_Denominator" type="TH1F" title="#phi of truth track"> - <x title="#phi" n="100" lo="-&PI;" hi="&PI;"/> - <y title="Entries"/> -</h> -<h id="eff_d0_Numerator" type="TH1F" title="d_{0} of reco-matched truth track (in mm)"> - <x title="d_{0}(mm)" n="150" lo="-300" hi="300"/> - <y title="Entries"/> -</h> -<h id="eff_d0_Denominator" type="TH1F" title="d_{0} of truth track (in mm)"> - <x title="d_{0}(mm)" n="150" lo="-300" hi="300"/> - <y title="Entries"/> -</h> -<h id="eff_z0_Numerator" type="TH1F" title="z_{0} of reco-matched truth track (in mm)"> - <x title="z_{0}(mm)" n="150" lo="-1500" hi="1500"/> - <y title="Entries"/> -</h> -<h id="eff_z0_Denominator" type="TH1F" title="z_{0} of truth track (in mm)"> - <x title="z_{0}(mm)" n="150" lo="-1500" hi="1500"/> - <y title="Entries"/> -</h> -<h id="eff_R_Numerator" type="TH1F" title="R of reco-matched truth track (in mm)"> - <x title="R(mm)" n="150" lo="0" hi="300"/> - <y title="Entries"/> -</h> -<h id="eff_R_Denominator" type="TH1F" title="R of truth track (in mm)"> - <x title="R(mm)" n="150" lo="0" hi="300"/> - <y title="Entries"/> -</h> -<h id="eff_Z_Numerator" type="TH1F" title="Z of reco-matched truth track (in mm)"> - <x title="Z(mm)" n="150" lo="-1500" hi="1500"/> - <y title="Entries"/> -</h> -<h id="eff_Z_Denominator" type="TH1F" title="Z of truth track (in mm)"> - <x title="Z(mm)" n="150" lo="-1500" hi="1500"/> - <y title="Entries"/> -</h> -<h id="eff_vs_pt" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="p_{T}(GeV/c)" n="40" lo="0" hi="200"/> - <y title="Efficiency" lo="0" hi="1"/> -</h> -<h id="eff_vs_eta" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="Efficiency" lo="0" hi="1"/> -</h> -<h id="eff_vs_phi" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="#phi" n="40" lo="-&PI;" hi="&PI;"/> - <y title="Efficiency" lo="0" hi="1"/> -</h> -<h id="eff_vs_d0" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="d0" n="40" lo="-300" hi="300"/> - <y title="Efficiency" lo="0" hi="1"/> -</h> -<h id="eff_vs_z0" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="z0" n="40" lo="-1500" hi="1500"/> - <y title="Efficiency" lo="0" hi="1"/> -</h> -<h id="eff_vs_R" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="R" n="40" lo="0" hi="300"/> - <y title="Efficiency" lo="0" hi="1"/> -</h> -<h id="eff_vs_Z" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="Z" n="40" lo="-1500" hi="1500"/> - <y title="Efficiency" lo="0" hi="1"/> -</h> -<h id="eff_pt_Numerator_st" type="TH1F" title="p_{T} of reco-matched truth track (in GeV)"> - <x title="p_{T}(GeV/c)" n="200" lo="0." hi="200"/> - <y title="Entries"/> -</h> -<h id="eff_eta_Numerator_st" type="TH1F" title="#eta of reco-matched truth track"> - <x title="#eta" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="eff_phi_Numerator_st" type="TH1F" title="#phi of reco-matched truth track"> - <x title="#phi" n="100" lo="-&PI;" hi="&PI;"/> - <y title="Entries"/> -</h> -<h id="eff_d0_Numerator_st" type="TH1F" title="d_{0} of reco-matched truth track (in mm)"> - <x title="d_{0}(mm)" n="150" lo="-300" hi="300"/> - <y title="Entries"/> -</h> -<h id="eff_z0_Numerator_st" type="TH1F" title="z_{0} of reco-matched truth track (in mm)"> - <x title="z_{0}(mm)" n="150" lo="-1500" hi="1500"/> - <y title="Entries"/> -</h> -<h id="eff_R_Numerator_st" type="TH1F" title="R of reco-matched truth track (in mm)"> - <x title="R(mm)" n="150" lo="0" hi="300"/> - <y title="Entries"/> -</h> -<h id="eff_Z_Numerator_st" type="TH1F" title="Z of reco-matched truth track (in mm)"> - <x title="Z(mm)" n="150" lo="-1500" hi="1500"/> - <y title="Entries"/> -</h> -<h id="eff_vs_pt_st" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="p_{T}(GeV/c)" n="40" lo="0" hi="200"/> - <y title="Efficiency" lo="0" hi="1"/> -</h> -<h id="eff_vs_eta_st" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="Efficiency" lo="0" hi="1"/> -</h> -<h id="eff_vs_phi_st" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="#phi" n="40" lo="-&PI;" hi="&PI;"/> - <y title="Efficiency" lo="0" hi="1"/> -</h> -<h id="eff_vs_d0_st" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="d0" n="40" lo="-300" hi="300"/> - <y title="Efficiency" lo="0" hi="1"/> -</h> -<h id="eff_vs_z0_st" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="z0" n="40" lo="-1500" hi="1500"/> - <y title="Efficiency" lo="0" hi="1"/> -</h> -<h id="eff_vs_R_st" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="R" n="40" lo="0" hi="300"/> - <y title="Efficiency" lo="0" hi="1"/> -</h> -<h id="eff_vs_Z_st" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="Z" n="40" lo="-1500" hi="1500"/> - <y title="Efficiency" lo="0" hi="1"/> -</h> -<!-- --> - -<!-- stuff pilfered from old backtracking script --> -<h id="eff_vs_eta_of_daughters" type="TProfile" title="Efficiency vs #eta of daughter particles"> - <x title="#eta" n="20" lo="-&ETA;" hi="&ETA;"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - -<h id="eff_vs_theta_of_daughters" type="TProfile" title="Efficiency vs #theta of daughter particles"> - <x title="#theta" n="28" lo="0.0" hi="&PI;"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - -<h id="eff_vs_theta_tan_of_daughters" type="TProfile" title="Efficiency vs tan(#theta) of daughter particles"> - <x title="tan(#theta)" n="32" lo="-8" hi="8"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - -<h id="eff_vs_theta_cotan_of_daughters" type="TProfile" title="Efficiency vs cotan(#theta) of daughter particles"> - <x title="cotan(#theta)" n="32" lo="-8" hi="8"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - -<h id="eff_vs_phi_of_daughters" type="TProfile" title="Efficiency vs #phi of daughter particles"> - <x title="#phi" n="16" lo="-&PI;" hi="&PI;"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - -<h id="eff_vs_phi_sin_of_daughters" type="TProfile" title="Efficiency vs sin(#phi) of daughter particles"> - <x title="sin(#phi)" n="14" lo="-1.2" hi="1.2"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - -<h id="eff_vs_phi_cos_of_daughters" type="TProfile" title="Efficiency vs cos(#phi) of daughter particles"> - <x title="cos(#phi)" n="14" lo="-1.2" hi="1.2"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - - -<!-- --> - -<!-- vertices --> -<h id="vx_x" type="TH1F" title="X position of vertex"> - <x title="X (mm)" n="200" lo="-1.0" hi="1.0"/> - <y title="Entries"/> -</h> -<h id="vx_y" type="TH1F" title="Y position of vertex"> - <x title="Y (mm)" n="200" lo="-1.0" hi="1.0"/> - <y title="Entries"/> -</h> -<h id="vx_z" type="TH1F" title="Z position of vertex"> - <x title="Z (mm)" n="100" lo="-300.0" hi="300.0"/> - <y title="Entries"/> -</h> -<h id="vx_err_x" type="TH1F" title="X position error of vertex"> - <x title="#sigma(X) (mm)" n="100" lo="0.0" hi="0.2"/> - <y title="Entries"/> -</h> -<h id="vx_err_y" type="TH1F" title="Y position error of vertex"> - <x title="#sigma(Y) (mm)" n="100" lo="0.0" hi="0.2"/> - <y title="Entries"/> -</h> -<h id="vx_err_z" type="TH1F" title="Z position error of vertex"> - <x title="#sigma(Z) (mm)" n="100" lo="0.0" hi="1.0"/> - <y title="Entries"/> -</h> -<h id="vx_chi2_over_ndf" type="TH1F" title="vertex #chi^2 / ndf"> - <x title="#chi^{2}/ndf" n="50" lo="0" hi="10."/> - <y title="Entries"/> -</h> -<h id="vx_type" type="TH1F" title="Vertex type"> - <x title="Vertex type" n="7" lo="0" hi="7"/> - <y title="Entries"/> -</h> -<h id="vx_nTracks" type="TH1F" title="Number of tracks at vertex"> - <x title="Number of Tracks" n="150" lo="0" hi="150"/> - <y title="Entries"/> -</h> -<h id="vx_track_weights" type="TH1F" title="Weights of tracks at vertex"> - <x title="Weight" n="100" lo="0." hi="10.0"/> - <y title="Entries"/> -</h> -<h id="vx_track_pt" type="TH1F" title="Tracks at vertex p_{T}"> - <x title="p_{T} (GeV)" n="100" lo="0" hi="20."/> - <y title="Entries"/> -</h> -<h id="vx_track_eta" type="TH1F" title="Tracks at vertex #eta"> - <x title="#eta" n="100" lo="-2.7" hi="2.7"/> - <y title="Entries"/> -</h> -<h id="vx_track_nSiHits" type="TH1F" title="Tracks at vertex number of Silicon Hits"> - <x title="Num. Si Hits" n="15" lo="5" hi="20"/> - <y title="Entries"/> -</h> -<h id="vx_track_nSiHoles" type="TH1F" title="Tracks at vertex number of Silicon Holes"> - <x title="Num. Si Holes" n="5" lo="0" hi="5"/> - <y title="Entries"/> -</h> -<h id="vx_track_d0" type="TH1F" title="Tracks at vertex d_{0}"> - <x title="d_{0} (mm)" n="100" lo="-2.0" hi="2.0"/> - <y title="Entries"/> -</h> -<h id="vx_track_err_d0" type="TH1F" title="Tracks at vertex d_{0} error"> - <x title="#sigma(d_{0}) (mm)" n="50" lo="0.0" hi="1.0"/> - <y title="Entries"/> -</h> -<h id="vx_track_z0" type="TH1F" title="Tracks at vertex z_{0} - z_{0}^{vertex}"> - <x title="z_{0}-z_{0}^{vertex} (mm)" n="100" lo="-5.0" hi="5.0"/> - <y title="Entries"/> -</h> -<h id="vx_track_err_z0" type="TH1F" title="Tracks at vertex z_{0} error"> - <x title="#sigma(z_{0}) (mm)" n="50" lo="0.0" hi="5.0"/> - <y title="Entries"/> -</h> -<!-- --> -<!-- Bad Match Rate (BMR) --> -<h id="BadMatchRate" type="TProfile" title="Fraction of Tracks with < 80% Truth Matching Probability"> - <x title="eta" n="20" lo="-&ETA;" hi="&ETA;"/> - <y title="Bad Match Rate" lo="0" hi="2"/> -</h> -<h id="BadMatchRate_vs_logpt" type="TProfile" title="Fraction of Tracks with < 80% TMP vs Log(Pt)"> - <x title="eta" n="10" lo="-0.5" hi="2"/> - <y title="Bad Match Rate vs Log(Pt)" lo="0" hi="2"/> -</h> -<h id="ReallyFakeRate" type="TProfile" title="Fraction of Tracks with < 20% Truth Matching Probability"> - <x title="eta" n="20" lo="-&ETA;" hi="&ETA;"/> - <y title="Really Fake Rate" lo="0" hi="2"/> -</h> -<!-- --> -<!-- hit residual plots --> -<!-- x residuals --> -<h id="residualx_pixel_barrel" type="TH1F" title="Residual: Pixel Barrel X"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_pixel_barrel_1hit" type="TH1F" title="Residual: Pixel Barrel X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_pixel_barrel_2ormorehits" type="TH1F" title="Residual: Pixel Barrel X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_sct_barrel" type="TH1F" title="Residual: SCT Barrel X"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_sct_barrel_1hit" type="TH1F" title="Residual: SCT Barrel X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_sct_barrel_2ormorehits" type="TH1F" title="Residual: SCT Barrel X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_blayer_barrel" type="TH1F" title="Residual: B-Layer Barrel X"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_blayer_barrel_1hit" type="TH1F" title="Residual: B-Layer Barrel X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_blayer_barrel_2ormorehits" type="TH1F" title="Residual: B-Layer Barrel X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_trt_barrel" type="TH1F" title="Residual: TRT Barrel X"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<!-- endcaps --> -<h id="residualx_pixel_endcap" type="TH1F" title="Residual: Pixel Endcap X"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_pixel_endcap_1hit" type="TH1F" title="Residual: Pixel Endcap X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_pixel_endcap_2ormorehits" type="TH1F" title="Residual: Pixel Endcap X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_sct_endcap" type="TH1F" title="Residual: SCT Endcap X"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_sct_endcap_1hit" type="TH1F" title="Residual: SCT Endcap X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_sct_endcap_2ormorehits" type="TH1F" title="Residual: SCT Endcap X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_blayer_endcap" type="TH1F" title="Residual: B-Layer Endcap X"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_blayer_endcap_1hit" type="TH1F" title="Residual: B-Layer Endcap X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_blayer_endcap_2ormorehits" type="TH1F" title="Residual: B-Layer Endcap X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_trt_endcap" type="TH1F" title="Residual: TRT Endcap X"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_dbm_neg" type="TH1F" title="Residual: DBM -side X"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_dbm_pos" type="TH1F" title="Residual: DBM +side X"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<!-- y residuals --> -<h id="residualy_pixel_barrel" type="TH1F" title="Residual: Pixel Barrel Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_pixel_barrel_1hit" type="TH1F" title="Residual: Pixel Barrel Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_pixel_barrel_2ormorehits" type="TH1F" title="Residual: Pixel Barrel Y >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_sct_barrel" type="TH1F" title="Residual: SCT Barrel Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_sct_barrel_1hit" type="TH1F" title="Residual: SCT Barrel Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_sct_barrel_2ormorehits" type="TH1F" title="Residual: SCT Barrel Y >=2 hits"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_blayer_barrel" type="TH1F" title="Residual: B-Layer Barrel Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_blayer_barrel_1hit" type="TH1F" title="Residual: B-Layer Barrel Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_blayer_barrel_2ormorehits" type="TH1F" title="Residual: B-Layer Barrel Y >=2 hits"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_trt_barrel" type="TH1F" title="Residual: TRT Barrel Y"> - <x title="y residual(#mum)" n="120" lo="0" hi="2500"/> - <y title="Entries"/> -</h> -<!-- endcaps --> -<h id="residualy_pixel_endcap" type="TH1F" title="Residual: Pixel Endcap Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_pixel_endcap_1hit" type="TH1F" title="Residual: Pixel Endcap Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_pixel_endcap_2ormorehits" type="TH1F" title="Residual: Pixel Endcap Y >=2 hits"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_sct_endcap" type="TH1F" title="Residual: SCT Endcap Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_sct_endcap_1hit" type="TH1F" title="Residual: SCT Endcap Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_sct_endcap_2ormorehits" type="TH1F" title="Residual: SCT Endcap Y >=2 hits"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_blayer_endcap" type="TH1F" title="Residual: B-Layer Endcap Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_blayer_endcap_1hit" type="TH1F" title="Residual: B-Layer Endcap Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_blayer_endcap_2ormorehits" type="TH1F" title="Residual: B-Layer Endcap Y >=2 hits"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_trt_endcap" type="TH1F" title="Residual: TRT Endcap Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_dbm_neg" type="TH1F" title="Residual: DBM -side Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualy_dbm_pos" type="TH1F" title="Residual: DBM +side Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<!-- --> -<!-- pulls --> -<!-- barrel, x --> -<h id="residualpullx_blayer_barrel" type="TH1F" title="Residualpull: B-Layer Barrel X"> - <x title="x residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_pixel_barrel" type="TH1F" title="Residualpull: Pixel Barrel X"> - <x title="x residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_sct_barrel" type="TH1F" title="Residualpull: SCT Barrel X"> - <x title="x residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_trt_barrel" type="TH1F" title="Residualpull: TRT Barrel X"> - <x title="x residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_dbm_barrel" type="TH1F" title="Residualpull: DBM -side X"> - <x title="x residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<!-- endcap, x --> -<h id="residualpullx_blayer_endcap" type="TH1F" title="Residualpull: B-Layer Endcap X"> - <x title="x residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_pixel_endcap" type="TH1F" title="Residualpull: Pixel Endcap X"> - <x title="x residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_sct_endcap" type="TH1F" title="Residualpull: SCT Endcap X"> - <x title="x residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_trt_endcap" type="TH1F" title="Residualpull: TRT Endcap X"> - <x title="x residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_dbm_endcap" type="TH1F" title="Residualpull: DBM +side X"> - <x title="x residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<!-- barrel, y --> -<h id="residualpully_blayer_barrel" type="TH1F" title="Residualpull: B-Layer Barrel Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_pixel_barrel" type="TH1F" title="Residualpull: Pixel Barrel Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_sct_barrel" type="TH1F" title="Residualpull: SCT Barrel Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_trt_barrel" type="TH1F" title="Residualpull: TRT Barrel Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_dbm_barrel" type="TH1F" title="Residualpull: DBM -side Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<!-- endcap, y --> -<h id="residualpully_blayer_endcap" type="TH1F" title="Residualpull: B-Layer Endcap Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_pixel_endcap" type="TH1F" title="Residualpull: Pixel Endcap Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_sct_endcap" type="TH1F" title="Residualpull: SCT Endcap Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_trt_endcap" type="TH1F" title="Residualpull: TRT Endcap Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_dbm_endcap" type="TH1F" title="Residualpull: DBM +side Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<!-- --> -<!-- TrackInJets --> -<h id="recInJetpT" type="TH1F" title="p_{T} of selected rec tracks in jets(in GeV)"> - <x title="p_{T}(GeV/c)" n="200" lo="0." hi="200"/> - <y title="Entries"/> -</h> -<h id="nTrackInJet" type="TH1F" title="Number of Tracks in Jet"> - <x title="N Tracks" n="50" lo="0." hi="50"/> - <y title="Entries"/> -</h> -<h id="sumPtinJet" type="TH1F" title="Sum p_{T} of Tracks in Jet"> - <x title="sum p_{T}(GeV/c)" n="25" lo="0" hi="500"/> - <y title="Entries"/> -</h> -<h id="fracPtInJet" type="TH1F" title="Sum p_{T} of Tracks over jet p_{T}"> - <x title="sum Track p_{T}/jet p_{T}" n="60" lo="0" hi="3"/> - <y title="Entries"/> -</h> -<!-- --> -<!-- Track in Jet efficiencies --> -<h id="trackinjeteff_vs_eta" type="TProfile" title="Track in jets efficiency vs #eta (Det. Paper def.)"> - <x title="#eta" n="20" lo="-&ETA;" hi="&ETA;"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackinjeteff_vs_phi" type="TProfile" title="Track in jets efficiency vs #phi (Det. Paper def.)"> - <x title="#eta" n="24" lo="-1.5708" hi="1.5708"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackinjeteff_vs_pt" type="TProfile" title="Track in jets efficiency vs p_{T} for |#eta| < &ETA; (Det. Paper def.)"> - <x title="p_{T} (GeV/c)" n="25" lo="0" hi="50"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackinjeteff_vs_dr" type="TProfile" title="Track in jets efficiency vs #DeltaR for |#eta| < &ETA; (Det. Paper def.)"> - <x title="#DeltaR" n="10" lo="0.0" hi="0.4"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackinjeteff_vs_dr_lt_j50" type="TProfile" title="Track in jets efficiency vs #DeltaR for |#eta| < &ETA; (E_{T}(jet) < 50 GeV)"> - <x title="#DeltaR" n="10" lo="0.0" hi="0.2"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackinjeteff_vs_dr_gr_j100" type="TProfile" title="Track in jets efficiency vs #DeltaR for |#eta| < &ETA; (E_{T}(jet) > 100 GeV)"> - <x title="#DeltaR" n="10" lo="0.0" hi="0.2"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackinjeteff_vs_jetet" type="TProfile" title="Track in jets efficiency vs jet E_{T} for |#eta| < &ETA; "> - <x title="E_{jet} (GeV)" n="10" lo="0.0" hi="250"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<!-- --> -<!-- spectrum plots --> -<h id="nPixDeadSensors_vs_eta" type="TProfile" title="# pix deadsensors vs Eta"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="# pix deadsensors" lo="0" hi="20"/> -</h> -<h id="nTotDeadSensors_vs_eta" type="TProfile" title="# total deadsensors vs Eta"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="# total deadsensors" lo="0" hi="20"/> -</h> -<h id="recoMatchProbabilitySpectrum" type="TH1F" title="truth match probability spectrum"> - <x title="truth match probability" n="40" lo="0." hi="1.1"/> - <y title="Entries"/> -</h> -<h id="recoEtaSpectrum" type="TH1F" title="reco eta spectrum"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="Entries"/> -</h> -<h id="recoPhiSpectrum" type="TH1F" title="reco phi spectrum"> - <x title="#phi" n="60" lo="-3" hi="3"/> - <y title="Entries"/> -</h> -<h id="recoPtSpectrum" type="TH1F" title="reco pt spectrum"> - <x title="pt (GeV/c)" n="100" lo="0." hi="100"/> - <y title="Entries"/> -</h> -<h id="truthEtaSpectrum" type="TH1F" title="truth eta spectrum"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="Entries"/> -</h> -<h id="truthPhiSpectrum" type="TH1F" title="truth phi spectrum"> - <x title="#phi" n="60" lo="-3" hi="3"/> - <y title="Entries"/> -</h> -<h id="truthPtSpectrum" type="TH1F" title="truth pt spectrum"> - <x title="pt (GeV/c)" n="100" lo="0." hi="100"/> - <y title="Entries"/> -</h> -<!-- --> -<!-- HitContent plots --> -<h id="HitContent_vs_eta_NBlayerHits" type="TProfile" title="Number of B-Layer clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of B-layer clusters>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelHits" type="TProfile" title="Number of Pixel clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of Pixel clusters>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_DBMHitsNeg" type="TProfile" title="Number of DBM Clusters"> - <x title="#eta" n="20" lo="-3.8" hi="-2.5"/> - <y title="<Number of DBM clusters, - side>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_DBMHitsPos" type="TProfile" title="Number of DBM Clusters"> - <x title="#eta" n="20" lo="2.5" hi="3.8"/> - <y title="<Number of DBM Clusters, + side>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelHoles" type="TProfile" title="Number of Pixel Holes"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of Pixel Holes>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NSCTHits" type="TProfile" title="Number of SCT Clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of SCT Clusters>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NSCTHoles" type="TProfile" title="Number of SCT Holes"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of SCT Holes>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NTRTHits" type="TProfile" title="Number of TRT Clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of TRT Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NTRTHighThresholdHits" type="TProfile" title="Number of TRT high threshold clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of High Thresh TRT Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NBlayerOutliers" type="TProfile" title="Number of B-layer outliers"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of B-layer Outliers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NBlayerSharedHits" type="TProfile" title="Number of shared B-layer clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of B-layer Shared Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NBLayerSplitHits" type="TProfile" title="Number of split B-layer clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of B-layer Split Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelOutliers" type="TProfile" title="Number of Pixel outliers"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of Pixel Outliers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelContribLayers" type="TProfile" title="Number of contributed Pixel layers"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of Pixel Layers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelSharedHits" type="TProfile" title="Number of shared Pixel clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of Pixel Shared Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelSplitHits" type="TProfile" title="Number of split Pixel clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of Pixel Split Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelGangedHits" type="TProfile" title="Number of ganged Pixel clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of Pixel Ganged Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NSCTOutliers" type="TProfile" title="Number of SCT Outliers"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of SCT Outliers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NSCTDoubleHoles" type="TProfile" title="Number of SCT double holes"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of SCT Double Holes>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NSCTSharedHits" type="TProfile" title="Number of SCT Shared clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of SCT Shared Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NTRTOutliers" type="TProfile" title="Number of TRT outliers"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of TRT Outliers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NTRTHighThresholdOutliers" type="TProfile" title="Number of TRT High Threshold outliers"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of TRT High Thresh Outliers>" lo="0" hi="100"/> -</h> -<h id="residualx_ibl_barrel" type="TH1F" title="Residual: IBL Barrel X"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_ibl_barrel_1hit" type="TH1F" title="Residual: IBL Barrel X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_ibl_barrel_2ormorehits" type="TH1F" title="Residual: IBL Barrel X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_ibl_barrel" type="TH1F" title="Residual: IBL Barrel Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_ibl_barrel_1hit" type="TH1F" title="Residual: IBL Barrel Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_ibl_barrel_2ormorehits" type="TH1F" title="Residual: IBL Barrel Y >=2 hits"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualpullx_ibl_barrel" type="TH1F" title="Residualpull: B-Layer Barrel X"> - <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_ibl_barrel" type="TH1F" title="Residualpull: B-Layer Barrel Y"> - <x title="y residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="HitContent_vs_eta_NPixelGangedHitsFlaggedFakes" type="TProfile" title="Number of ganged flagged fake Pixel hits vs eta"> - <x title="#eta" n="20" lo="-&ETA;" hi="&ETA;" /> - <y title="Flagged Fakes in Pixel" lo="0" hi="2" /> -</h> -<h id="trackeff_vs_eta" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="#eta" n="20" lo="-&ETA;" hi="&ETA;"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_pt" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="Pt (GeV)" n="25" lo="0" hi="50"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_phi" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="#phi" n="25" lo="-&PI;" hi="&PI;"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_d0" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="d0" n="100" lo="-25" hi="25"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_z0" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="z0" n="100" lo="-250" hi="250"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_R" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="R" n="100" lo="0" hi="50"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_Z" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="Z" n="100" lo="-350" hi="350"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_prodR" type="TProfile" title="Track Efficiency vs Production Vertex Radius"> - <x title="prod_R" n="100" lo="0" hi="1500"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_prodZ" type="TProfile" title="Track Efficiency vs Production Vertex Z"> - <x title="prod_Z" n="100" lo="0" hi="2000"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="eff_hit_vs_eta_ibl_barrel" type="TProfile" title="Cluster Efficiency: Pixel Barrel IBL"> - <x title="#eta" n="10" lo="0" hi="&ETA;"/> - <y title="Cluster Efficiency" lo="0" hi="2.0"/> -</h> -<h id="eff_hit_vs_eta_pix_barrel" type="TProfile" title="Cluster Efficiency: Pixel Barrel"> - <x title="#eta" n="10" lo="0" hi="&ETA;"/> - <y title="Cluster Efficiency" lo="0" hi="2.0"/> -</h> -<h id="eff_hit_vs_eta_pix_endcap" type="TProfile" title="Cluster Efficiency: Pixel Endcaps"> - <x title="#eta" n="4" lo="1.5" hi="&ETA;"/> - <y title="Cluster Efficiency" lo="0" hi="2.0"/> -</h> -<h id="eff_hit_vs_eta_sct_barrel" type="TProfile" title="Cluster Efficiency: SCT Barrel"> - <x title="#eta" n="7" lo="0" hi="1.75"/> - <y title="Cluster Efficiency" lo="0" hi="2.0"/> -</h> -<h id="eff_hit_vs_eta_sct_endcap" type="TProfile" title="Cluster Efficiency: SCT Endcaps"> - <x title="#eta" n="6" lo="1.0" hi="&ETA;"/> - <y title="Cluster Efficiency" lo="0" hi="2.0"/> -</h> -<h id="eff_hit_vs_eta_trt_barrel" type="TProfile" title="Cluster Efficiency: TRT Barrel"> - <x title="#eta" n="5" lo="0" hi="1.25"/> - <y title="Cluster Efficiency" lo="0" hi="2.0"/> -</h> -<h id="eff_hit_vs_eta_trt_endcap" type="TProfile" title="Cluster Efficiency: TRT Endcaps"> - <x title="#eta" n="6" lo="0.75" hi="2.25"/> - <y title="Cluster Efficiency" lo="0" hi="2.0"/> -</h> -<h id="trackinjet_badmatchrate_vs_dr_gr_j100" type="TProfile" title="Fraction of tracks with < 80% truth matching probability in Jets with E_{T} > 100 GeV"> - <x title="#DeltaR" n="10" lo="0.0" hi="0.2"/> - <y title="Bad Match Rate" lo="0.0" hi="2.0"/> -</h> -<h id="nSCTHits" type="TH1F" title="# SCT hits"> - <x title="# SCT Hits" n="20" lo="0." hi="20"/> - <y title="Entries"/> -</h> -<h id="nPixHits" type="TH1F" title="# Pix hits"> - <x title="# Pix Hits" n="20" lo="0." hi="20"/> - <y title="Entries"/> -</h> -<h id="nTotHits" type="TH1F" title="# Total hits"> - <x title="# Totat Hits" n="20" lo="0." hi="20"/> - <y title="Entries"/> -</h> -<h id="nSCTDeadSensors" type="TH1F" title="# SCT DeadSensors"> - <x title="# SCT DeadSensors" n="20" lo="0." hi="20"/> - <y title="Entries"/> -</h> -<h id="nPixDeadSensors" type="TH1F" title="# Pix DeadSensors"> - <x title="# Pix DeadSensors" n="20" lo="0." hi="20"/> - <y title="Entries"/> -</h> -<h id="nTotDeadSensors" type="TH1F" title="# Total DeadSensors"> - <x title="# Total DeadSensors" n="20" lo="0." hi="20"/> - <y title="Entries"/> -</h> -<h id="nSCTHits_vs_eta" type="TProfile" title="# SCT hits vs Eta"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="# SCT Hits" lo="0" hi="20"/> -</h> -<h id="nPixHits_vs_eta" type="TProfile" title="# Pix hits vs Eta"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="# Pix Hits" lo="0" hi="20"/> -</h> -<h id="nTotHits_vs_eta" type="TProfile" title="# total hits vs Eta"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="# total Hits" lo="0" hi="20"/> -</h> -<h id="nSCTDeadSensors_vs_eta" type="TProfile" title="# SCT deadsensors vs Eta"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="# SCT deadsensors" lo="0" hi="20"/> -</h> - -<!-- --> -<!-- Unsorted : todo: sort --> -<h id="incFakevsTracks" type="TProfile" title="Selected Reco Tracks / Selected Truth Tracks vs # of reco tracks"> - <x title="tracks" n="200" lo="0" hi="2000"/> - <y title="Inclusive Fake Rate" lo="0" hi="2"/> -</h> -<h id="selectedTracks_vs_nTracks" type="TH2F" title="Selected Reco Tracks vs # Reco Tracks "> - <x title="Reco Tracks" n="200" lo="0" hi="2000"/> - <y title="Selected Reco Tracks" n="80" lo="0" hi="1600"/> -</h> -<h id="nSCTHits_phi_vs_eta" type="TH2F" title="# SCT hits phi vs Eta"> - <x title="#etaphi" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="# SCT Hits" n="60" lo="-3" hi="3"/> -</h> -<h id="nPixHits_phi_vs_eta" type="TH2F" title="# Pix hits phi vs Eta"> - <x title="#etaphi" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="# Pix Hits" n="60" lo="-3" hi="3"/> -</h> -<h id="nTotHits_phi_vs_eta" type="TH2F" title="# total hits phi vs Eta"> - <x title="#etaphi" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="# total Hits" n="60" lo="-3" hi="3"/> -</h> -<h id="recoMatchProbabilitySpectrumUNLINKED" type="TH1F" title="truth match probability spectrum"> - <x title="truth match probability" n="110" lo="0." hi="1.1"/> - <y title="Entries"/> -</h> -<h id="recoMatchProbabilitySpectrumLINKED" type="TH1F" title="truth match probability spectrum"> - <x title="truth match probability" n="110" lo="0." hi="1.1"/> - <y title="Entries"/> -</h> -<h id="recod0Spectrum" type="TH1F" title="reco d0 spectrum"> - <x title="d0" n="200" lo="-5." hi="5."/> - <y title="Entries"/> -</h> -<h id="recoz0Spectrum" type="TH1F" title="reco z0 spectrum"> - <x title="z0" n="500" lo="-250." hi="250."/> - <y title="Entries"/> -</h> -<h id="recoz0sinSpectrum" type="TH1F" title="reco z0sin spectrum"> - <x title="z0sintheta" n="500" lo="-250." hi="250."/> - <y title="Entries"/> -</h> -<h id="recod0TVRSpectrum" type="TH1F" title="reco d0-TruthVtxR spectrum"> - <x title="d0-TrVtR" n="200" lo="-5." hi="5."/> - <y title="Entries"/> -</h> -<h id="recoz0TVZSpectrum" type="TH1F" title="reco z0-TruthVtxZ spectrum"> - <x title="d0-TrVtZ" n="200" lo="-10." hi="10."/> - <y title="Entries"/> -</h> -<h id="recoz0TVZsinSpectrum" type="TH1F" title="reco (z0-TruthVtxZ)sin spectrum"> - <x title="(d0-TrVtZ)sin" n="200" lo="-10." hi="10."/> - <y title="Entries"/> -</h> -<h id="ptvsEtaUnlinked_postSelect" type="TH2F" title="PT vs Eta Spectrum"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="pt" n="200" lo="0" hi="200"/> -</h> -<h id="probvsSCTUnlinked_postSelect" type="TH2F" title="Truth Match Probability vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="truth match probability" n="55" lo="0" hi="1.1"/> -</h> -<h id="probvsPixUnlinked_postSelect" type="TH2F" title="Truth Match Probability vs Pix Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="truth match probability" n="55" lo="0" hi="1.1"/> -</h> -<h id="sharedHitsvsSCTUnlinked_postSelect" type="TH2F" title="Shared Hits vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Shared Hits" n="20" lo="0" hi="20"/> -</h> -<h id="sharedHitsvsPixUnlinked_postSelect" type="TH2F" title="Shared Hits vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Shared Hits" n="20" lo="0" hi="20"/> -</h> -<h id="holesvsPixUnlinked_postSelect" type="TH2F" title="Holes vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="pixholesvsPixUnlinked_postSelect" type="TH2F" title="Pixel Holes vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="holesvsSCTUnlinked_postSelect" type="TH2F" title="Holes vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="sctholesvsSCTUnlinked_postSelect" type="TH2F" title="SCT Holes vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="outliersvsPixUnlinked_postSelect" type="TH2F" title="Outliers vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="pixoutliersvsPixUnlinked_postSelect" type="TH2F" title="Pixel Outliers vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="outliersvsSCTUnlinked_postSelect" type="TH2F" title="Outliers vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="sctoutliersvsSCTUnlinked_postSelect" type="TH2F" title="SCT Outliers vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="hitsvsEtaUnlinked_postSelect" type="TProfile" title="Hits vs Eta"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="Hits" lo="0" hi="20"/> -</h> -<h id="pixHolesvsEtaUnlinked_postSelect" type="TProfile" title="Pixel Holes vs Eta"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="Pixel Holes" lo="0" hi="5"/> -</h> -<h id="sctHolesvsEtaUnlinked_postSelect" type="TProfile" title="SCT Holes vs Eta"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="Pixel Holes" lo="0" hi="5"/> -</h> -<h id="sctHitsvsPixHitsUnlinked_postSelect" type="TH2F" title="SCT Hits vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="SCT Hits" n="20" lo="0" hi="20"/> -</h> -<h id="sctHitsvsEtaUnlinked_postSelect" type="TProfile" title="SCT Hits vs Eta"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="pixHitsvsEtaUnlinked_postSelect" type="TProfile" title="Pixel Hits vs Eta"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="sctOutliersvsEtaUnlinked_postSelect" type="TProfile" title="SCT Outliers vs Eta"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="pixOutliersvsEtaUnlinked_postSelect" type="TProfile" title="Pixel Outliers vs Eta"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="ptvsEtaLinked_postSelect" type="TH2F" title="PT vs Eta Spectrum"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="p_{T}" n="200" lo="0" hi="200"/> -</h> -<h id="probvsSCTLinked_postSelect" type="TH2F" title="Truth Match Probability vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="truth match probability" n="55" lo="0" hi="1.1"/> -</h> -<h id="probvsPixLinked_postSelect" type="TH2F" title="Truth Match Probability vs Pix Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="truth match probability" n="55" lo="0" hi="1.1"/> -</h> -<h id="sharedHitsvsSCTLinked_postSelect" type="TH2F" title="Shared Hits vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Shared Hits" n="20" lo="0" hi="20"/> -</h> -<h id="sharedHitsvsPixLinked_postSelect" type="TH2F" title="Shared Hits vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Shared Hits" n="20" lo="0" hi="20"/> -</h> -<h id="holesvsPixLinked_postSelect" type="TH2F" title="Holes vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="pixholesvsPixLinked_postSelect" type="TH2F" title="Pixel Holes vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="holesvsSCTLinked_postSelect" type="TH2F" title="Holes vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="sctholesvsSCTLinked_postSelect" type="TH2F" title="SCT Holes vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="outliersvsPixLinked_postSelect" type="TH2F" title="Outliers vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="pixoutliersvsPixLinked_postSelect" type="TH2F" title="Pixel Outliers vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="outliersvsSCTLinked_postSelect" type="TH2F" title="Outliers vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="sctoutliersvsSCTLinked_postSelect" type="TH2F" title="SCT Outliers vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="hitsvsEtaLinked_postSelect" type="TProfile" title="Hits vs Eta"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="Hits" lo="0" hi="20"/> -</h> -<h id="pixHolesvsEtaLinked_postSelect" type="TProfile" title="Pixel Holes vs Eta"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="Pixel Holes" lo="0" hi="5"/> -</h> -<h id="sctHolesvsEtaLinked_postSelect" type="TProfile" title="SCT Holes vs Eta"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="Pixel Holes" lo="0" hi="5"/> -</h> -<h id="sctHitsvsPixHitsLinked_postSelect" type="TH2F" title="SCT Hits vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="SCT Hits" n="20" lo="0" hi="20"/> -</h> -<h id="sctHitsvsEtaLinked_postSelect" type="TProfile" title="SCT Hits vs Eta"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="pixHitsvsEtaLinked_postSelect" type="TProfile" title="Pixel Hits vs Eta"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="sctOutliersvsEtaLinked_postSelect" type="TProfile" title="SCT Outliers vs Eta"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="pixOutliersvsEtaLinked_postSelect" type="TProfile" title="Pixel Outliers vs Eta"> - <x title="#eta" n="40" lo="-&ETA;" hi="&ETA;"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="recoMatchvsSiHitsUNLINKED_postSelect" type="TH2F" title="truth match probability vs Silicon hits (UNLINKED)"> - <x title="Si Hits" n="25" lo="0" hi="25"/> - <y title="truth match probability" n="40" lo="0" hi="1.1"/> -</h> -<h id="recoMatchvsSCTHitsUNLINKED_postSelect" type="TH2F" title="truth match probability vs SCT hits (UNLINKED)"> - <x title="SCT Hits" n="25" lo="0" hi="25"/> - <y title="truth match probability" n="40" lo="0" hi="1.1"/> -</h> -<h id="recoMatchvsPixHitsUNLINKED_postSelect" type="TH2F" title="truth match probability vs Pixel hits (UNLINKED)"> - <x title="Pixel Hits" n="25" lo="0" hi="25"/> - <y title="truth match probability" n="40" lo="0" hi="1.1"/> -</h> -<h id="recoMatchvsSiHitsLINKED_postSelect" type="TH2F" title="truth match probability vs Silicon hits (LINKED)"> - <x title="Si Hits" n="25" lo="0" hi="25"/> - <y title="truth match probability" n="40" lo="0" hi="1.1"/> -</h> -<h id="recoMatchvsSCTHitsLINKED_postSelect" type="TH2F" title="truth match probability vs SCT hits (LINKED)"> - <x title="SCT Hits" n="25" lo="0" hi="25"/> - <y title="truth match probability" n="40" lo="0" hi="1.1"/> -</h> -<h id="recoMatchvsPixHitsLINKED_postSelect" type="TH2F" title="truth match probability vs Pixel hits (LINKED)"> - <x title="Pixel Hits" n="25" lo="0" hi="25"/> - <y title="truth match probability" n="40" lo="0" hi="1.1"/> -</h> -<!-- --> -<!-- VTX-related --> -<h id="TVXspectrum" type="TH1F" title="TruthVtxX spectrum"> - <x title="TrVtxX" n="500" lo="-0.5" hi="0.5"/> - <y title="Entries"/> -</h> -<h id="TVYspectrum" type="TH1F" title="TruthVtxY spectrum"> - <x title="TrVtxY" n="500" lo="-0.5" hi="0.5"/> - <y title="Entries"/> -</h> -<h id="TVRspectrum" type="TH1F" title="TruthVtxR spectrum"> - <x title="TrVtxR" n="500" lo="0." hi="0.5"/> - <y title="Entries"/> -</h> -<h id="TVZspectrum" type="TH1F" title="TruthVtxZ spectrum"> - <x title="TrVtxZ" n="500" lo="-250." hi="250."/> - <y title="Entries"/> -</h> -<h id="recod0PVRSpectrum" type="TH1F" title="reco d0-PrimVtxR spectrum"> - <x title="d0-PrVtR" n="200" lo="-10." hi="10."/> - <y title="Entries"/> -</h> -<h id="recoz0PVZSpectrum" type="TH1F" title="reco z0-PrimVtxZ spectrum"> - <x title="d0-PrVtZ" n="200" lo="-20." hi="20."/> - <y title="Entries"/> -</h> -<h id="recoz0PVZsinSpectrum" type="TH1F" title="reco (z0-PrimVtxZ)sin spectrum"> - <x title="(d0-PrVtZ)sin" n="200" lo="-20." hi="20."/> - <y title="Entries"/> -</h> -<h id="PVXspectrum" type="TH1F" title="PrimVtxX spectrum"> - <x title="PrVtxX" n="500" lo="-0.25" hi="0.25"/> - <y title="Entries"/> -</h> -<h id="PVYspectrum" type="TH1F" title="PrimVtxY spectrum"> - <x title="PrVtxY" n="500" lo="-0.25" hi="0.25"/> - <y title="Entries"/> -</h> -<h id="PVRspectrum" type="TH1F" title="PrimVtxR spectrum"> - <x title="PrVtxR" n="100" lo="0." hi="0.25"/> - <y title="Entries"/> -</h> -<h id="PVZspectrum" type="TH1F" title="PrimVtxZ spectrum"> - <x title="PrVtxZ" n="500" lo="-250." hi="250."/> - <y title="Entries"/> -</h> - -</hdef> - - diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml index 881adc42008ad9a451e3403d5475d9dfbca8354a..2d2bc6cc18a0d5d587bf00947fd572a80ff52e98 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefCommon.xml @@ -1,3 +1,18 @@ +<!-- + ======================================================= + test plots: + * advertising new features + ======================================================== + --> +<h id="testEfficiency" type="TEfficiency" title="Eff. Test Case: Visible E_{T} (GeV)"> + <x title="x variable" n="75" lo="0" hi="75"/> + <y title="Efficiency"/> +</h> +<!-- + ======================================================= + end of test plots + ======================================================= +--> <!-- ======================================================= spectrum plots: @@ -352,6 +367,18 @@ <!-- hitResidual plots --> <!-- x residuals --> <!-- barrel--> +<h id="residualx_l0pix_barrel" type="TH1F" title="Residual: &L0PixBarr; X"> + <x title="x residual(#mum)" n="1000" lo="-500" hi="500"/> + <y title="Entries"/> +</h> +<h id="residualx_l0pix_barrel_1hit" type="TH1F" title="Residual: &L0PixBarr; X 1 hit"> + <x title="x residual(#mum)" n="1000" lo="-500" hi="500"/> + <y title="Entries"/> +</h> +<h id="residualx_l0pix_barrel_2ormorehits" type="TH1F" title="Residual: &L0PixBarr; X >=2 hits"> + <x title="x residual(#mum)" n="1000" lo="-500" hi="500"/> + <y title="Entries"/> +</h> <h id="residualx_pixel_barrel" type="TH1F" title="Residual: Pixel Barrel X"> <x title="x residual(#mum)" n="1000" lo="-500" hi="500"/> <y title="Entries"/> @@ -403,6 +430,18 @@ </h> <!-- y residuals --> <!-- barrel --> +<h id="residualy_l0pix_barrel" type="TH1F" title="Residual: &L0PixBarr; Y"> + <x title="y residual(#mum)" n="1000" lo="-500" hi="500"/> + <y title="Entries"/> +</h> +<h id="residualy_l0pix_barrel_1hit" type="TH1F" title="Residual: &L0PixBarr; Y 1 hit"> + <x title="y residual(#mum)" n="1000" lo="-500" hi="500"/> + <y title="Entries"/> +</h> +<h id="residualy_l0pix_barrel_2ormorehits" type="TH1F" title="Residual: &L0PixBarr; Y >=2 hits"> + <x title="y residual(#mum)" n="1000" lo="-500" hi="500"/> + <y title="Entries"/> +</h> <h id="residualy_pixel_barrel" type="TH1F" title="Residual: Pixel Barrel Y"> <x title="y residual(#mum)" n="1000" lo="-500" hi="500"/> <y title="Entries"/> @@ -442,6 +481,10 @@ </h> <!-- pulls --> <!-- barrel, x --> +<h id="residualpullx_l0pix_barrel" type="TH1F" title="Residualpull: B-Layer Barrel X"> + <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> + <y title="Entries"/> +</h> <h id="residualpullx_pixel_barrel" type="TH1F" title="Residualpull: Pixel Barrel X"> <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> <y title="Entries"/> @@ -460,6 +503,10 @@ <y title="Entries"/> </h> <!-- barrel, y --> +<h id="residualpully_l0pix_barrel" type="TH1F" title="Residualpull: B-Layer Barrel Y"> + <x title="y residual(#mum)" n="100" lo="-5" hi="5"/> + <y title="Entries"/> +</h> <h id="residualpully_pixel_barrel" type="TH1F" title="Residualpull: Pixel Barrel Y"> <x title="y residual(#mum)" n="100" lo="-5" hi="5"/> <y title="Entries"/> @@ -517,24 +564,24 @@ ======================================================== --> <!-- Pixel innermost barrel --> -<h id="eff_hit_vs_eta_ibl_barrel" type="TProfile" title="Cluster Efficiency: Pix Barrel Innermost"> +<h id="eff_hit_vs_eta_l0pix_barrel" type="TEfficiency" title="Cluster Efficiency: Pix Barrel Innermost"> <x title="#eta" n="10" lo="0" hi="&ETA;"/> <y title="Cluster Efficiency" lo="0" hi="2.0"/> </h> <!-- Pixel barrel: all appart from inner-most barrel region --> -<h id="eff_hit_vs_eta_pix_barrel" type="TProfile" title="Cluster Efficiency: Pixel Barrel"> +<h id="eff_hit_vs_eta_pix_barrel" type="TEfficiency" title="Cluster Efficiency: Pixel Barrel"> <x title="#eta" n="20" lo="0" hi="&ETA;"/> <y title="Cluster Efficiency" lo="0" hi="2.0"/> </h> -<h id="eff_hit_vs_eta_pix_endcap" type="TProfile" title="Cluster Efficiency: Pixel Endcaps"> +<h id="eff_hit_vs_eta_pix_endcap" type="TEfficiency" title="Cluster Efficiency: Pixel Endcaps"> <x title="#eta" n="20" lo="&ETAPixECMin;" hi="&ETA;"/> <y title="Cluster Efficiency" lo="0" hi="2.0"/> </h> -<h id="eff_hit_vs_eta_sct_barrel" type="TProfile" title="Cluster Efficiency: SCT Barrel"> +<h id="eff_hit_vs_eta_sct_barrel" type="TEfficiency" title="Cluster Efficiency: SCT Barrel"> <x title="#eta" n="20" lo="0" hi="&ETASct;"/> <y title="Cluster Efficiency" lo="0" hi="2.0"/> </h> -<h id="eff_hit_vs_eta_sct_endcap" type="TProfile" title="Cluster Efficiency: SCT Endcaps"> +<h id="eff_hit_vs_eta_sct_endcap" type="TEfficiency" title="Cluster Efficiency: SCT Endcaps"> <x title="#eta" n="20" lo="&ETASctECMin;" hi="&ETASct;"/> <y title="Cluster Efficiency" lo="0" hi="2.0"/> </h> @@ -542,61 +589,84 @@ ======================================================= end of hit efficiency plots ====================================================== - --> - +--> <!-- ======================================================= - xxx todo addcomments plots: - ======================================================== - --> -<h id="num_truthmatch_match" type="TH1F" title="num_truthmatch_match"> - <x title="Num. matching truth" n="10" lo="0" hi="10"/> - <y title="Entries"/> -</h> -<h id="nparticle" type="TH1F" title="Number of Truth Particles"> - <x title="Num. truth particles" n="500" lo="0" hi="5000"/> + pt plots + * filled by InDetPerfPlot_Pt class + * overlap with InDetBasicPlot, but kept in order + to maintain correspondence with old InDetPerformanceRTT + ====================================================== +--> +<h id="recpT" type="TH1F" title="p_{T} of selected rec tracks (in GeV)"> + <x title="p_{T} (GeV/c)" n="200" lo="0." hi="200"/> <y title="Entries"/> </h> -<h id="ntracksel" type="TH1F" title="Number of Selected Tracks"> - <x title="Num. tracks" n="500" lo="0" hi="5000"/> +<h id="recPtLow" type="TH1F" title="p_{T} of selected rec tracks (in GeV)"> + <x title="p_{T} (GeV/c)" n="200" lo="0." hi="20"/> <y title="Entries"/> </h> -<h id="ntrack" type="TH1F" title="Number of Tracks"> - <x title="Num. tracks" n="500" lo="0" hi="5000"/> - <y title="Entries"/> +<!-- + ======================================================= + end of pt plots + ====================================================== +--> +<!-- pt-plot for back-tracking --> +<h id="low_Pt_lepton_frac" type="TProfile" title="Fraction of Primary Leptons with Pt below 3 GeV"> + <x title="prod_R" n="100" lo="0" hi="1500"/> + <y title="Efficiency" lo="0.0" hi="2.0"/> </h> -<!-- --> -<!-- basic plots --> -<h id="basicd0" type="TH1F" title="d_{0} of selected tracks (in mm)"> +<!-- + ======================================================= + plots of basic IP & kinematics: + * filled by InDetBasicPlot + * reco- and truth- tracks after object selection + ======================================================== + --> +<!-- selected reco-level tracks --> +<h id="basicd0" type="TH1F" title="d_{0} of selected reco tracks"> <x title="d_{0}(mm)" n="200" lo="-2" hi="2"/> <y title="Entries"/> </h> -<h id="basicz0" type="TH1F" title="z_{0} of selected tracks (in mm)"> - <x title="z_{0}(mm)" n="120" lo="-300" hi="300"/> +<h id="basicz0" type="TH1F" title="z_{0} of selected reco tracks"> + <x title="z_{0}[mm]" n="120" lo="-300" hi="300"/> <y title="Entries"/> </h> -<h id="basicphi" type="TH1F" title="#phi of selected tracks"> +<h id="basicphi" type="TH1F" title="#phi of selected reco tracks"> <x title="#phi" n="100" lo="-&PI;" hi="&PI;"/> <y title="Entries"/> </h> -<h id="basiceta" type="TH1F" title="#eta of selected tracks"> - <x title="#eta" n="100" lo="-5" hi="5"/> +<h id="basiceta" type="TH1F" title="#eta of selected reco tracks"> + <x title="#eta" n="100" lo="-&ETA;" hi="&ETA;"/> <y title="Entries"/> </h> -<h id="basictheta" type="TH1F" title="#theta of selected tracks"> +<h id="basicpt" type="TH1F" title="pt of selected reco tracks"> + <x title="pt[GeV]" n="200" lo="0" hi="200"/> + <y title="Entries"/> +</h> +<h id="basictheta" type="TH1F" title="#theta of selected reco tracks"> <x title="#theta" n="100" lo="0" hi="&PI;"/> <y title="Entries"/> </h> -<h id="basicqOverP" type="TH1F" title="q/p of selected tracks (in GeV)"> +<h id="basicqOverP" type="TH1F" title="q/p of selected reco tracks (in GeV)"> <x title="p_{T}(GeV/c)" n="200" lo="-0.01" hi="0.01"/> <y title="Entries"/> </h> +<h id="basic_pt_vs_eta" type="TH2F" title="pt vs #eta of selected reco tracks"> + <x title="pt[GeV]" n="2000" lo="0" hi="200"/> + <y title="#eta" n="100" lo="-&ETA;" hi="&ETA;"/> +</h> +<h id="basic_phi_vs_eta" type="TH2F" title="#phi vs #eta of selected reco tracks"> + <x title="#phi" n="100" lo="-&PI;" hi="&PI;"/> + <y title="#eta" n="100" lo="-&ETA;" hi="&ETA;"/> +</h> +<!-- selected truth tracks --> <h id="truthd0" type="TH1F" title="d_{0} of selected truth (in mm)"> - <x title="d_{0}(mm)" n="2000" lo="-2" hi="2"/> + <x title="d_{0}[mm]" n="2000" lo="-2" hi="2"/> <y title="Entries"/> </h> <h id="truthz0" type="TH1F" title="z_{0} of selected truth (in mm)"> - <x title="z_{0}(mm)" n="120" lo="-300" hi="300"/> + <x title="z_{0}[mm]" n="120" lo="-300" hi="300"/> <y title="Entries"/> </h> <h id="truthphi" type="TH1F" title="#phi of selected truth"> @@ -607,12 +677,16 @@ <x title="#theta" n="100" lo="-5" hi="5"/> <y title="Entries"/> </h> +<h id="truthpt" type="TH1F" title="pt of selected truth"> + <x title="pt[GeV]" n="2000" lo="0" hi="200"/> + <y title="Entries"/> +</h> <h id="truththeta" type="TH1F" title="#theta of selected truth"> <x title="#theta" n="100" lo="0" hi="&PI;"/> <y title="Entries"/> </h> -<h id="truthqOverP" type="TH1F" title="q/p of selected truth (in GeV)"> - <x title="p_{T}(GeV/c)" n="200" lo="-0.005" hi="0.005"/> +<h id="truthqOverP" type="TH1F" title="q/p of selected truth"> + <x title="qOverP" n="200" lo="-0.005" hi="0.005"/> <y title="Entries"/> </h> <h id="truthz0st" type="TH1F" title="z_{0} sin(#theta) of selected truth "> @@ -620,23 +694,205 @@ <y title="Entries"/> </h> <h id="truthprodR" type="TH1F" title="Radial distance (r) of truth vtx parameter from origin"> - <x title="(mm)" n="100" lo="0.0" hi="2.0"/> - <y title="Entries"/> + <x title="[mm]" n="100" lo="0.0" hi="2.0"/> + <y title="Entries"/>x </h> <h id="truthprodZ" type="TH1F" title="Longitudinal (z) distance of truth vtx parameter from origin"> - <x title="(mm)" n="100" lo="0" hi="300"/> + <x title="[mm]" n="100" lo="0" hi="300"/> <y title="Entries"/> </h> -<!-- --> -<!-- pT --> -<h id="recpT" type="TH1F" title="p_{T} of selected rec tracks (in GeV)"> - <x title="p_{T} (GeV/c)" n="200" lo="0." hi="200"/> +<h id="truth_pt_vs_eta" type="TH2F" title="pt vs #eta of selected truth"> + <x title="pt[GeV]" n="2000" lo="0" hi="200"/> + <y title="#eta" n="100" lo="-5" hi="5"/> +</h> +<h id="truth_phi_vs_eta" type="TH2F" title="#phi vs #eta of selected truth"> + <x title="#phi" n="100" lo="-&PI;" hi="&PI;"/> + <y title="#eta" n="100" lo="-5" hi="5"/> +</h> +<!-- + ======================================================= + end of plots of basic IP & kinematics + ======================================================= + --> +<!-- + ======================================================= + hit content plots: + * filled by InDetPerfPlot_HitDetailed + * 1D histogram hit content of variouos parts of the ID + + their eta dependence profiles + * split into "general-interest" plots and "detailed" plots + the detailed plots can be swithced off in InDetPerfPlot_HitDetailed + ======================================================== + --> +<!-- general-interest plots : --> +<!-- 1D histograms --> +<h id="HitContent_NBlayerHits" type="TH1F" title="Number of B-Layer clusters"> + <x title="Number of Clusters" n="10" lo="-0.5" hi="9.5"/> <y title="Entries"/> </h> -<h id="recPtLow" type="TH1F" title="p_{T} of selected rec tracks (in GeV)"> - <x title="p_{T} (GeV/c)" n="200" lo="0." hi="20"/> +<h id="HitContent_NPixelHits" type="TH1F" title="Number of Pixel clusters"> + <x title="Number of Clusters" n="50" lo="-0.5" hi="49.5"/> + <y title="Entries"/> +</h> +<h id="HitContent_NPixelHoles" type="TH1F" title="Number of Pixel Holes"> + <x title="Number of Holes" n="10" lo="-0.5" hi="9.5"/> + <y title="Entries"/> +</h> +<h id="HitContent_NSCTHits" type="TH1F" title="Number of SCT Clusters"> + <x title="Number of Clusters" n="41" lo="-0.5" hi="40.5"/> + <y title="Entries"/> +</h> +<h id="HitContent_NSCTHoles" type="TH1F" title="Number of SCT Holes"> + <x title="Number of Holes" n="21" lo="-0.5" hi="20.5"/> + <y title="Entries"/> +</h> +<!-- eta profiles --> +<h id="HitContent_vs_eta_NBlayerHits" type="TProfile" title="Number of B-Layer clusters"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of B-layer clusters>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NPixelHits" type="TProfile" title="Number of Pixel clusters"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of Pixel clusters>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NPixelHoles" type="TProfile" title="Number of Pixel Holes"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of Pixel Holes>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NSCTHits" type="TProfile" title="Number of SCT Clusters"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of SCT Clusters>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NSCTHoles" type="TProfile" title="Number of SCT Holes"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of SCT Holes>" lo="0" hi="100"/> +</h> +<!-- detailed expert plots --> +<!-- 1D histograms --> +<h id="HitContent_NBlayerOutliers" type="TH1F" title="Number of B-layer outliers"> + <x title="Number of Outliers" n="5" lo="-0.5" hi="4.5"/> + <y title="Entries"/> +</h> +<h id="HitContent_NBlayerSharedHits" type="TH1F" title="Number of shared B-layer clusters"> + <x title="Number of Shared Clusters" n="5" lo="-0.5" hi="4.5"/> + <y title="Entries"/> +</h> +<h id="HitContent_NBLayerSplitHits" type="TH1F" title="Number of split B-layer clusters"> + <x title="Number of Split Clusters" n="5" lo="-0.5" hi="4.5"/> + <y title="Entries"/> +</h> +<h id="HitContent_NPixelOutliers" type="TH1F" title="Number of Pixel outliers"> + <x title="Number of Outliers" n="10" lo="-0.5" hi="9.5"/> <y title="Entries"/> </h> +<h id="HitContent_NPixelContribLayers" type="TH1F" title="Number of contributed Pixel layers"> + <x title="Number of Layers" n="10" lo="-0.5" hi="9.5"/> + <y title="Entries"/> +</h> +<h id="HitContent_NPixelSharedHits" type="TH1F" title="Number of shared Pixel clusters"> + <x title="Number of Shared Clusters" n="10" lo="-0.5" hi="9.5"/> + <y title="Entries"/> +</h> +<h id="HitContent_NPixelSplitHits" type="TH1F" title="Number of split Pixel clusters"> + <x title="Number of Split Clusters" n="5" lo="-0.5" hi="4.5"/> + <y title="Entries"/> +</h> +<h id="HitContent_NPixelGangedHits" type="TH1F" title="Number of ganged Pixel clusters"> + <x title="Number of Clusters" n="10" lo="-0.5" hi="9.5"/> + <y title="Entries"/> +</h> +<h id="HitContent_NPixelGangedHitsFlaggedFakes" type="TH1F" title="Number of ganged flagged fake Pixel hits vs eta"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;" /> + <y title="Entries"/> +</h> +<h id="HitContent_NSCTOutliers" type="TH1F" title="Number of SCT Outliers"> + <x title="Number of Outliers" n="21" lo="-0.5" hi="20.5"/> + <y title="Entries"/> +</h> +<h id="HitContent_NSCTDoubleHoles" type="TH1F" title="Number of SCT double holes"> + <x title="Number of Double Holes" n="21" lo="-0.5" hi="20.5"/> + <y title="Entries"/> +</h> +<h id="HitContent_NSCTSharedHits" type="TH1F" title="Number of SCT Shared clusters"> + <x title="Number of Shared Clusters" n="21" lo="-0.5" hi="20.5"/> + <y title="Entries"/> +</h> +<!-- eta profiles --> +<h id="HitContent_vs_eta_NBlayerOutliers" type="TProfile" title="Number of B-layer outliers"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of B-layer Outliers>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NBlayerSharedHits" type="TProfile" title="Number of shared B-layer clusters"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of B-layer Shared Hits>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NBLayerSplitHits" type="TProfile" title="Number of split B-layer clusters"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of B-layer Split Hits>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NPixelOutliers" type="TProfile" title="Number of Pixel outliers"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of Pixel Outliers>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NPixelContribLayers" type="TProfile" title="Number of contributed Pixel layers"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of Pixel Layers>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NPixelSharedHits" type="TProfile" title="Number of shared Pixel clusters"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of Pixel Shared Hits>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NPixelSplitHits" type="TProfile" title="Number of split Pixel clusters"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of Pixel Split Hits>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NPixelGangedHits" type="TProfile" title="Number of ganged Pixel clusters"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of Pixel Ganged Hits>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NPixelGangedHitsFlaggedFakes" type="TProfile" title="Number of ganged flagged fake Pixel hits vs eta"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;" /> + <y title="Flagged Fakes in Pixel" lo="0" hi="2" /> +</h> +<h id="HitContent_vs_eta_NSCTOutliers" type="TProfile" title="Number of SCT Outliers"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of SCT Outliers>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NSCTDoubleHoles" type="TProfile" title="Number of SCT double holes"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of SCT Double Holes>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NSCTSharedHits" type="TProfile" title="Number of SCT Shared clusters"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of SCT Shared Hits>" lo="0" hi="100"/> +</h> +<!-- + ======================================================= + end of hit content plots + ======================================================== + --> +<!-- + ======================================================= + xxx todo addcomments plots: + ======================================================== + --> +<h id="num_truthmatch_match" type="TH1F" title="num_truthmatch_match"> + <x title="Num. matching truth" n="10" lo="0" hi="10"/> + <y title="Entries"/> +</h> +<h id="nparticle" type="TH1F" title="Number of Truth Particles"> + <x title="Num. truth particles" n="500" lo="0" hi="5000"/> + <y title="Entries"/> +</h> +<h id="ntracksel" type="TH1F" title="Number of Selected Tracks"> + <x title="Num. tracks" n="500" lo="0" hi="5000"/> + <y title="Entries"/> +</h> +<h id="ntrack" type="TH1F" title="Number of Tracks"> + <x title="Num. tracks" n="500" lo="0" hi="5000"/> + <y title="Entries"/> +</h> +<!-- --> <!-- fakes --> <h id="fakepT" type="TH1F" title="p_{T} of selected fake tracks (in GeV)"> <x title="p_{T}(GeV/c)" n="200" lo="0." hi="200"/> @@ -877,10 +1133,102 @@ <x title="#eta" n="20" lo="-&ETA;" hi="&ETA;"/> <y title="Fake Rate" lo="0.0" hi="2.0" /> </h> -<h id="BadMatchRate_vs_logpt" type="TProfile" title="Fraction of Tracks with < 80% TMP vs Log(Pt)"> - <x title="Log(Pt)" n="10" lo="-0.5" hi="2" /> +<h id="BadMatchRate_vs_logpt" type="TProfile" title="Fraction of Tracks with < 80% TMP vs Log(p_{T})"> + <x title="Log(p_{T})" n="10" lo="-0.5" hi="2" /> <y title="Bad Match Rate" lo="0.0" hi="2.0" /> </h> +<!-- Dummy Plots --> +<h id="primary_photon_eta_vs_conversion_radius" type="TH2" title="Primary Photon #eta vs Conversion Radius"> + <x title="Conversion Radius [mm]" n="100" lo="0" hi="1500"/> + <y title="#eta" n="20" lo="-2.5" hi="2.5"/> +</h> +<h id="primary_photon_pt_vs_decay_radius" type="TH2" title="Primary Photon log(p_{T}) vs Decay Radius"> + <x title="Decay Radius [mm]" n="100" lo="0" hi="1500"/> + <y title="log(p_{T}) (GeV)" n="100" lo="-0.5" hi="3.0"/> +</h> +<h id="primary_photon_pt" type="TH1F" title="Primary Photon p_{T}"> + <x title="p_{T} (GeV)" n="100" lo="0" hi="500"/> + <y title="Entries"/> +</h> +<h id="brem_photon_eta_vs_radius_of_conversion" type="TH2" title="Brem Photon #eta vs Radius of Conversion"> + <x title="Radius of Conversion [mm]" n="100" lo="0" hi="1500"/> + <y title="#eta" n="20" lo="-2.5" hi="2.5"/> +</h> +<h id="brem_photon_pt_vs_radius_of_origin_of_conversion" type="TH2" title="Brem Photon log(p_{T}) vs Radius of Origin of Conversion"> + <x title="Radius of Origin of Conversion [mm]" n="100" lo="0" hi="1500"/> + <y title="log(p_{T}) (GeV)" n="100" lo="-0.5" hi="3.0"/> +</h> +<h id="lepton_disappearance_radius" type="TH1F" title="Radius at which electrons and positrons from the primary disappear"> + <x title="Radius of Disappearance [mm]" n="100" lo="0" hi="1500"/> + <y title="Entries"/> +</h> +<h id="nOut_of_lepdeath" type="TH1F" title="Number of Particles emerging from electron/positron endpoint"> + <x title="Number of Particles" n="6" lo="0" hi="5"/> + <y title="Entries"/> +</h> +<h id="brem_spectrum" type="TH2" title="log of the Energy of Brem Photons vs Radius of Emission"> + <x title="Radius of Emission [mm]" n="100" lo="0" hi="1500"/> + <y title="log (Energy (GeV))" n="100" lo="-3" hi="3"/> +</h> +<h id="energy_remaining" type="TH2" title="Fraction of electron/positron energy left at ECal vs production radius"> + <x title="Radius of Initial Conversion [mm]" n="100" lo="0" hi="1500"/> + <y title="Fraction of Energy Remaining" n="100" lo="0" hi="1.25"/> +</h> +<h id="energy_remaining_vs_eta" type="TH2" title="Fraction of electron/positron energy left at ECal vs Initial #eta"> + <x title="#eta" n="20" lo="-2.5" hi="2.5"/> + <y title="Fraction of Energy Remaining" n="100" lo="0" hi="1.25"/> +</h> +<h id="energy_remaining_vs_prodR_TRT_barrel" type="TH2" title="Fraction of electron/positron energy left at ECal vs production radius (0 < |#eta| < 0.625)"> + <x title="Radius of Initial Conversion [mm]" n="100" lo="0" hi="1500"/> + <y title="Fraction of Energy Remaining" n="100" lo="0" hi="1.25"/> +</h> +<h id="energy_remaining_vs_prodR_type_A_endcap" type="TH2" title="Fraction of electron/positron energy left at ECal vs production radius (1.070 < |#eta| < 1.304)"> + <x title="Radius of Initial Conversion [mm]" n="100" lo="0" hi="1500"/> + <y title="Fraction of Energy Remaining" n="100" lo="0" hi="1.25"/> +</h> +<h id="energy_remaining_vs_prodR_type_A_and_B" type="TH2" title="Fraction of electron/positron energy left at ECal vs production radius (1.304 < |#eta| < 1.752)"> + <x title="Radius of Initial Conversion [mm]" n="100" lo="0" hi="1500"/> + <y title="Fraction of Energy Remaining" n="100" lo="0" hi="1.25"/> +</h> +<h id="energy_remaining_vs_prodR_type_B_endcap" type="TH2" title="Fraction of electron/positron energy left at ECal vs production radius (1.752 < |#eta| < 2.0)"> + <x title="Radius of Initial Conversion [mm]" n="100" lo="0" hi="1500"/> + <y title="Fraction of Energy Remaining" n="100" lo="0" hi="1.25"/> +</h> +<h id="truthMatchProbability_vs_delta_R" type="TH2" title="Truth Matching Probability of electron/positron vs #DeltaR"> + <x title="#DeltaR" n="50" lo="0" hi="1.0"/> + <y title="Truth Matching Probability" n="100" lo="0" hi="1.0"/> +</h> +<h id="minimum_delta_R" type="TH1" title="Minimum #DeltaR for primary conversions within 100 mm of the origin"> + <x title="#DeltaR" n="50" lo="0" hi="0.50"/> + <y title="Entries"/> +</h> +<h id="minimum_delta_R_2" type="TH1" title="Minimum #DeltaR for primary conversions between 100 and 200 mm from the origin"> + <x title="#DeltaR" n="50" lo="0" hi="0.50"/> + <y title="Entries"/> +</h> +<h id="minimum_delta_R_3" type="TH1" title="Minimum #DeltaR for primary conversions between 200 and 300 mm from the origin"> + <x title="#DeltaR" n="50" lo="0" hi="0.50"/> + <y title="Entries"/> +</h> +<h id="minimum_delta_R_not_found" type="TH1" title="Minimum #DeltaR for primary conversions within 100 mm of the origin with no good match"> + <x title="#DeltaR" n="50" lo="0" hi="0.50"/> + <y title="Entries"/> +</h> +<h id="minimum_delta_R_2_not_found" type="TH1" title="Minimum #DeltaR for primary conversions between 100 and 200 mm from the origin with no good match"> + <x title="#DeltaR" n="50" lo="0" hi="0.50"/> + <y title="Entries"/> +</h> +<h id="minimum_delta_R_3_not_found" type="TH1" title="Minimum #DeltaR for primary conversions between 200 and 300 mm from the origin with no good match"> + <x title="#DeltaR" n="50" lo="0" hi="0.50"/> + <y title="Entries"/> +</h> +<h id="delta_inverse_pt" type="TH1" title="Difference between inverse pt for track and truth particles"> + <x title="(1/p_{T})^{track} - (1/p_{T})^{truth}" n="100" lo="0" hi="2"/> + <y title="Entries"/> +</h> + + + <!-- --> <!-- Track Parameter Resolution Plots --> <!-- Track Parameter TH2s vs eta --> @@ -1155,100 +1503,6 @@ -<!-- HitContent plots --> -<h id="HitContent_vs_eta_NBlayerHits" type="TProfile" title="Number of B-Layer clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of B-layer clusters>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelHits" type="TProfile" title="Number of Pixel clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of Pixel clusters>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_DBMHitsNeg" type="TProfile" title="Number of DBM Clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of DBM clusters, - side>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_DBMHitsPos" type="TProfile" title="Number of DBM Clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of DBM Clusters, + side>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelHoles" type="TProfile" title="Number of Pixel Holes"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of Pixel Holes>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NSCTHits" type="TProfile" title="Number of SCT Clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of SCT Clusters>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NSCTHoles" type="TProfile" title="Number of SCT Holes"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of SCT Holes>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NTRTHits" type="TProfile" title="Number of TRT Clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of TRT Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NTRTHighThresholdHits" type="TProfile" title="Number of TRT high threshold clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of High Thresh TRT Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NBlayerOutliers" type="TProfile" title="Number of B-layer outliers"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of B-layer Outliers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NBlayerSharedHits" type="TProfile" title="Number of shared B-layer clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of B-layer Shared Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NBLayerSplitHits" type="TProfile" title="Number of split B-layer clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of B-layer Split Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelOutliers" type="TProfile" title="Number of Pixel outliers"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of Pixel Outliers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelContribLayers" type="TProfile" title="Number of contributed Pixel layers"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of Pixel Layers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelSharedHits" type="TProfile" title="Number of shared Pixel clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of Pixel Shared Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelSplitHits" type="TProfile" title="Number of split Pixel clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of Pixel Split Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelGangedHits" type="TProfile" title="Number of ganged Pixel clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of Pixel Ganged Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelGangedHitsFlaggedFakes" type="TProfile" title="Number of ganged flagged fake Pixel hits vs eta"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;" /> - <y title="Flagged Fakes in Pixel" lo="0" hi="2" /> -</h> -<h id="HitContent_vs_eta_NSCTOutliers" type="TProfile" title="Number of SCT Outliers"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of SCT Outliers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NSCTDoubleHoles" type="TProfile" title="Number of SCT double holes"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of SCT Double Holes>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NSCTSharedHits" type="TProfile" title="Number of SCT Shared clusters"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of SCT Shared Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NTRTOutliers" type="TProfile" title="Number of TRT outliers"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of TRT Outliers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NTRTHighThresholdOutliers" type="TProfile" title="Number of TRT High Threshold outliers"> - <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> - <y title="<Number of TRT High Thresh Outliers>" lo="0" hi="100"/> -</h> -<!-- --> <!-- Track in Jet efficiencies --> <h id="trackinjeteff_vs_eta" type="TProfile" title="Track in jets efficiency vs #eta (Det. Paper def.)"> <x title="#eta" n="20" lo="-&ETA;" hi="&ETA;"/> @@ -1368,3 +1622,140 @@ <x title="cos(#phi)" n="14" lo="-1.2" hi="1.2"/> <y title="Efficiency" lo="0.0" hi="2.0"/> </h> +<!-- + ======================================================= + duplicate plots: + * filled by InDetPerfPlot_duplicate + * Results from efficiency calculation in InDetPhysValMonitoringTool (and similar) + ======================================================== + --> +<h id="duplicateDeltaPt" type="TH1" title="p_{T} difference of duplicate reco tracks (in GeV)"> + <x title="p_{T}(GeV/c)" n="50" lo="0" hi="50"/> + <y title="Entries"/> +</h> +<h id="duplicateDeltaPtZoomed" type="TH1" title="p_{T} difference of duplicate reco tracks (in GeV)"> + <x title="p_{T}(GeV/c)" n="50" lo="0" hi="5"/> + <y title="Entries"/> +</h> +<h id="duplicateDeltaEta" type="TH1" title="eta difference of duplicate reco tracks"> + <x title="p_{T}(GeV/c)" n="60" lo="-&ETA;" hi="&ETA;"/> + <y title="Entries"/> +</h> +<h id="duplicateDeltaPhi" type="TH1" title="phi difference of duplicate reco tracks"> + <x title="p_{T}(GeV/c)" n="60" lo="-&PI;" hi="&PI;"/> + <y title="Entries"/> +</h> +<h id="duplicateDeltaPTvsTruthPT" type="TH2" title="delta pt vs truth pt"> + <x title="p_{T}(GeV/c)" n="100" lo="0" hi="50"/> + <y title="p_{T}(GeV/c)" n="100" lo="0" hi="50"/> +</h> +<h id="duplicateDeltaPTvsTruthPTZoomed" type="TH2" title="delta pt vs truth pt"> + <x title="p_{T}(GeV/c)" n="50" lo="0" hi="10"/> + <y title="p_{T}(GeV/c)" n="50" lo="0" hi="10"/> +</h> +<!-- --> +<h id="duplicateLPT" type="TH1" title="p_{T} of the duplicate lower pt reco track (in GeV)"> + <x title="p_{T}(GeV/c)" n="40" lo="0" hi="40"/> + <y title="Entries"/> +</h> +<h id="duplicateLEta" type="TH1" title="eta of the duplicate lower pt reco track"> + <x title="eta" n="60" lo="-&ETA;" hi="&ETA;"/> + <y title="Entries"/> +</h> +<h id="duplicateLPhi" type="TH1" title="phi of the duplicate lower pt reco track"> + <x title="phi" n="60" lo="-&PI;" hi="&PI;"/> + <y title="Entries" /> +</h> +<h id="duplicateHPT" type="TH1" title="p_{T} of the duplicate higher pt reco track (in GeV)"> + <x title="p_{T}(GeV/c)" n="40" lo="0" hi="40"/> + <y title="Entries" /> +</h> + +<h id="duplicateHEta" type="TH1" title="eta of the duplicate higher pt reco track"> + <x title="p_{T}(GeV/c)" n="60" lo="-&ETA;" hi="&ETA;"/> + <y title="Entries"/> +</h> + +<h id="duplicateHPhi" type="TH1" title="phi of the duplicate higher pt reco track"> + <x title="p_{T}(GeV/c)" n="60" lo="-&PI;" hi="&PI;"/> + <y title="Entries"/> +</h> +<h id="duplicateTruthPT" type="TH1" title="p_{T} of the associated truth track (in GeV)"> + <x title="p_{T}(GeV/c)" n="40" lo="0" hi="40"/> + <y title="Entries"/> +</h> +<h id="duplicateTruthEta" type="TH1" title="p_{T} of the associated truth track (in GeV)"> + <x title="p_{T}(GeV/c)" n="60" lo="-&ETA;" hi="&ETA;"/> + <y title="Entries"/> +</h> + +<h id="duplicateTruthPhi" type="TH1" title="phi of the associated truth track"> + <x title="p_{T}(GeV/c)" n="60" lo="-&PI;" hi="&PI;"/> + <y title="Entries"/> +</h> +<h id="duplicateResLPT" type="TH1" title="p_{T} of the lower pt track minus truth pt (in GeV)"> + <x title="p_{T}(GeV/c)" n="60" lo="-15" hi="15"/> + <y title="Entries"/> +</h> +<h id="duplicateResLEta" type="TH1" title="eta of the lower pt track minus truth eta"> + <x title="eta" n="60" lo="-&ETA;" hi="&ETA;"/> + <y title="Entries"/> +</h> +<h id="duplicateResLPhi" type="TH1" title="phi of the lower pt track minus truth phi"> + <x title="phi" n="60" lo="-&PI;" hi="&PI;"/> + <y title="Entries"/> +</h> +<h id="duplicateResHPT" type="TH1" title="p_{T} of the higher pt track minus truth pt (in GeV)"> + <x title="p_{T}(GeV/c)" n="60" lo="-15" hi="15"/> + <y title="Entries"/> +</h> +<h id="duplicateResHEta" type="TH1" title="eta of the higher pt track minus truth eta"> + <x title="eta" n="60" lo="-&ETA;" hi="&ETA;"/> + <y title="Entries"/> +</h> +<h id="duplicateResHPhi" type="TH1" title="phi of the higher pt track minus truth phi"> + <x title="phi" n="60" lo="-&ETA;" hi="&ETA;"/> + <y title="Entries"/> +</h> +<h id="duplicateProbSpectrum" type="TH2" title="duplicate probability spectrum"> + <x title="Entries" n="30" lo="0.8" hi="1.1"/> + <y title="Entries" n="30" lo="0.8" hi="1.1"/> +</h> +<h id="duplicateLPTHoles" type="TH1" title=" # of holes of the lower pt track"> + <x title="Count" n="10" lo="0" hi="10"/> + <y title="Entries"/> +</h> +<h id="duplicateHPTHoles" type="TH1" title=" # of holes of the higher pt track"> + <x title="Count" n="10" lo="0" hi="10"/> + <y title="Entries"/> +</h> +<h id="singleMatchPTHoles" type="TH1" title="# of holes of a single matched reco track"> + <x title="Count" n="10" lo="0" hi="10"/> + <y title="Entries"/> +</h> +<h id="duplicateHPixelvsSCTShared" type="TH2" title="# of Pixel Shared Hits vs # of SCT Shared Hits for the higher pt track"> + <x title="Count" n="20" lo="0" hi="20"/> + <y title="Entries" n="20" lo="0" hi="20"/> +</h> +<h id="duplicateLPixelvsSCTShared" type="TH2" title="# of Pixel Shared Hits vs # of SCT Shared Hits for the lower pt track"> + <x title="Count" n="20" lo="0" hi="20"/> + <y title="Entries" n="20" lo="0" hi="20"/> +</h> +<h id="singleMatchPixelvsSCTShared" type="TH2" title="# of Pixel Shared Hits vs # of SCT Shared Hits for a single matched track"> + <x title="Count" n="20" lo="0" hi="20"/> + <y title="Entries" n="20" lo="0" hi="20"/> +</h> +<h id="twoMatchHPixelvsSCTShared" type="TH2" title="# of Pixel Shared Hits vs # of SCT Shared Hits for the higher pt track"> + <x title="Count" n="20" lo="0" hi="20"/> + <y title="Entries" n="20" lo="0" hi="20"/> +</h> +<h id="twoMatchLPixelvsSCTShared" type="TH2" title="# of Pixel Shared Hits vs # of SCT Shared Hits for the lower pt track"> + <x title="Count" n="20" lo="0" hi="20"/> + <y title="Entries" n="20" lo="0" hi="20"/> +</h> + + <!-- + ======================================================= + end of plots of 'duplicates' plots + ======================================================= + --> diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefITK.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefITK.xml index 92be7d8c91b8b7094aca9597f4c7fce3fce7a3c0..1473e97c6d1fc1caf71879a28e808d7ea40d8785 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefITK.xml +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefITK.xml @@ -3,10 +3,17 @@ <?xml-stylesheet type="text/xsl" media="tty" href="hdeftty.xsl" alternate="yes"?> <!DOCTYPE hdef [ <!ENTITY PI "3.1415926"> +<!-- eta coverage of the tracker --> <!ENTITY ETA "4.0"> +<!-- min eta covered by pix. endcaps --> <!ENTITY ETAPixECMin "1.5"> +<!-- eta coverage of sct --> <!ENTITY ETASct "2.5"> +<!-- min eta covered by sct endcaps --> <!ENTITY ETASctECMin "1.0"> +<!-- term used for innermost pixel barrel layer in histogram text --> +<!ENTITY L0PixBarr "Pix. Barr. layer0"> +<!-- histogram definitions common to Run2 and ITk --> <!ENTITY Common SYSTEM "InDetPVMPlotDefCommon.xml"> ]> diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefRun2.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefRun2.xml index ac3fdb6f5b1ed027c7a82061340608473e00eb82..5d025c7e5c08608e7723d92d9b9e85207fe09964 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefRun2.xml +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPVMPlotDefRun2.xml @@ -3,10 +3,17 @@ <?xml-stylesheet type="text/xsl" media="tty" href="hdeftty.xsl" alternate="yes"?> <!DOCTYPE hdef [ <!ENTITY PI "3.1415926"> +<!-- eta coverage of the tracker --> <!ENTITY ETA "2.5"> +<!-- min eta covered by pix. endcaps --> <!ENTITY ETAPixECMin "1.5"> +<!-- eta coverage of sct --> <!ENTITY ETASct "2.0"> +<!-- min eta covered by sct endcaps --> <!ENTITY ETASctECMin "1.0"> +<!-- term used for innermost pixel barrel layer in histogram text --> +<!ENTITY L0PixBarr "IBL"> +<!-- histogram definitions common to Run2 and ITk --> <!ENTITY Common SYSTEM "InDetPVMPlotDefCommon.xml"> ]> @@ -21,35 +28,11 @@ --> <!-- x residuals --> <!-- barrel--> - <h id="residualx_ibl_barrel" type="TH1F" title="Residual: IBL Barrel X"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> - </h> - <h id="residualx_ibl_barrel_1hit" type="TH1F" title="Residual: IBL Barrel X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> - </h> - <h id="residualx_ibl_barrel_2ormorehits" type="TH1F" title="Residual: IBL Barrel X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> - </h> <h id="residualx_trt_barrel" type="TH1F" title="Residual: TRT Barrel X"> <x title="x residual(#mum)" n="200" lo="-500" hi="500"/> <y title="Entries"/> </h> <!-- endcap--> - <h id="residualx_blayer_endcap" type="TH1F" title="Residual: B-Layer Endcap X"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> - </h> - <h id="residualx_blayer_endcap_1hit" type="TH1F" title="Residual: B-Layer Endcap X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> - </h> - <h id="residualx_blayer_endcap_2ormorehits" type="TH1F" title="Residual: B-Layer Endcap X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> - </h> <h id="residualx_trt_endcap" type="TH1F" title="Residual: TRT Endcap X"> <x title="x residual(#mum)" n="200" lo="-500" hi="500"/> <y title="Entries"/> @@ -64,18 +47,6 @@ </h> <!-- y residuals --> <!-- barrel --> - <h id="residualy_ibl_barrel" type="TH1F" title="Residual: IBL Barrel Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> - </h> - <h id="residualy_ibl_barrel_1hit" type="TH1F" title="Residual: IBL Barrel Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> - </h> - <h id="residualy_ibl_barrel_2ormorehits" type="TH1F" title="Residual: IBL Barrel Y >=2 hits"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> - </h> <h id="residualy_trt_barrel" type="TH1F" title="Residual: TRT Barrel Y"> <x title="y residual(#mum)" n="120" lo="0" hi="2500"/> <y title="Entries"/> @@ -93,18 +64,6 @@ <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> <y title="Entries"/> </h> - <h id="residualy_blayer_endcap" type="TH1F" title="Residual: B-Layer Endcap Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> - </h> - <h id="residualy_blayer_endcap_1hit" type="TH1F" title="Residual: B-Layer Endcap Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> - </h> - <h id="residualy_blayer_endcap_2ormorehits" type="TH1F" title="Residual: B-Layer Endcap Y >=2 hits"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> - </h> <h id="residualy_trt_endcap" type="TH1F" title="Residual: TRT Endcap Y"> <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> <y title="Entries"/> @@ -119,10 +78,6 @@ </h> <!-- pulls --> <!-- barrel, x --> - <h id="residualpullx_ibl_barrel" type="TH1F" title="Residualpull: B-Layer Barrel X"> - <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> - </h> <h id="residualpullx_trt_barrel" type="TH1F" title="Residualpull: TRT Barrel X"> <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> <y title="Entries"/> @@ -132,10 +87,6 @@ <y title="Entries"/> </h> <!-- endcap, x --> - <h id="residualpullx_ibl_endcap" type="TH1F" title="Residualpull: B-Layer Endcap X"> - <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> - </h> <h id="residualpullx_trt_endcap" type="TH1F" title="Residualpull: TRT Endcap X"> <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> <y title="Entries"/> @@ -145,10 +96,6 @@ <y title="Entries"/> </h> <!-- barrel, y --> - <h id="residualpully_ibl_barrel" type="TH1F" title="Residualpull: B-Layer Barrel Y"> - <x title="y residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> - </h> <h id="residualpully_trt_barrel" type="TH1F" title="Residualpull: TRT Barrel Y"> <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> <y title="Entries"/> @@ -158,10 +105,6 @@ <y title="Entries"/> </h> <!-- endcap,y --> - <h id="residualpully_ibl_endcap" type="TH1F" title="Residualpull: B-Layer Endcap Y"> - <x title="y residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> - </h> <h id="residualpully_trt_endcap" type="TH1F" title="Residualpull: TRT Endcap Y"> <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> <y title="Entries"/> @@ -193,5 +136,53 @@ end of hit efficiency plots ====================================================== --> +<!-- + ======================================================= + hit content plots: + ======================================================= + --> +<!-- general interest plots --> +<!-- 1D plots --> +<h id="HitContent_NTRTHits" type="TH1F" title="Number of TRT Clusters"> + <x title="Number of Hits" n="51" lo="-0.5" hi="50.5"/> + <y title="Entries"/> +</h> +<h id="HitContent_NTRTHighThresholdHits" type="TH1F" title="Number of TRT high threshold Hits"> + <x title="Number of Hits" n="51" lo="-0.5" hi="50.5"/> + <y title="Entries"/> +</h> +<!-- eta profiles --> +<h id="HitContent_vs_eta_NTRTHits" type="TProfile" title="Number of TRT Clusters"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of TRT Hits>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NTRTHighThresholdHits" type="TProfile" title="Number of TRT high threshold clusters"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of High Thresh TRT Hits>" lo="0" hi="100"/> +</h> +<!-- detailed expert plots --> +<!-- 1D plots --> +<h id="HitContent_NTRTOutliers" type="TH1F" title="Number of TRT Outliers"> + <x title="Number of Outliers" n="51" lo="-0.5" hi="49.5"/> + <y title="Entries"/> +</h> +<h id="HitContent_NTRTHighThresholdOutliers" type="TH1F" title="Number of TRT High Threshold outliers"> + <x title="Number of Outliers" n="51" lo="-0.5" hi="49.5"/> + <y title="Entries"/> +</h> +<!-- eta profiles --> +<h id="HitContent_vs_eta_NTRTOutliers" type="TProfile" title="Number of TRT outliers"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of TRT Outliers>" lo="0" hi="100"/> +</h> +<h id="HitContent_vs_eta_NTRTHighThresholdOutliers" type="TProfile" title="Number of TRT High Threshold outliers"> + <x title="#eta" n="80" lo="-&ETA;" hi="&ETA;"/> + <y title="<Number of TRT High Thresh Outliers>" lo="0" hi="100"/> +</h> +<!-- + ======================================================= + end of hit content plots + ======================================================== + --> </hdef> diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPhysValMonitoringPlotDefinitions.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPhysValMonitoringPlotDefinitions.xml deleted file mode 100644 index 814e8d55f57071db5df9e87d20c9405b8f39d419..0000000000000000000000000000000000000000 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/InDetPhysValMonitoringPlotDefinitions.xml +++ /dev/null @@ -1,1541 +0,0 @@ -<?xml version="1.0" encoding="UTF-8"?> -<?xml-stylesheet type="text/xsl" media="screen" href="hdefhtml.xsl"?> -<?xml-stylesheet type="text/xsl" media="tty" href="hdeftty.xsl" alternate="yes"?> -<!DOCTYPE hdef [ -<!ENTITY PI "3.1415926"> -]> -<hdef xmlns:xi="http://www.w3.org/2001/XInclude"> -<h id="num_truthmatch_match" type="TH1F" title="num_truthmatch_match"> - <x title="Num. matching truth" n="10" lo="0" hi="10"/> - <y title="Entries"/> -</h> -<h id="nparticle" type="TH1F" title="Number of Truth Particles"> - <x title="Num. truth particles" n="200" lo="0" hi="2000"/> - <y title="Entries"/> -</h> -<h id="ntracksel" type="TH1F" title="Number of Selected Tracks"> - <x title="Num. tracks" n="200" lo="0" hi="200"/> - <y title="Entries"/> -</h> -<h id="ntrack" type="TH1F" title="Number of Tracks"> - <x title="Num. tracks" n="200" lo="0" hi="1000"/> - <y title="Entries"/> -</h> -<!-- --> -<!-- testing --> -<h id="002_Al_N_01" type="TH1F" title="Test Case: Visible E_{T} (SRoe)"> - <x title="Visible E_{T} (sroe)" n="100" lo="0" hi="100"/> - <y title="Entries"/> -</h> -<h id="test" type="TH1F" title="Test Case: Visible E_{T} (GeV)"> - <x title="Visible E_{T} (GeV)" n="100" lo="0" hi="100"/> - <y title="Entries"/> -</h> -<h id="testProfile" type="TProfile" title="Test of TProfile"> - <x title="#eta" n="20" lo="-50" hi="50"/> - <y title="Entries" lo="0" hi="200"/> -</h> -<h id="testEfficiency" type="TEfficiency" title="Test of TEff"> - <x title="#eta" n="50" lo="0" hi="50"/> - <y title="Entries"/> -</h> -<!-- --> -<!-- pT --> -<h id="recpT" type="TH1F" title="p_{T} of selected rec tracks (in GeV)"> - <x title="p_{T} (GeV/c)" n="200" lo="0." hi="200"/> - <y title="Entries"/> -</h> -<h id="recPtLow" type="TH1F" title="p_{T} of selected rec tracks (in GeV)"> - <x title="p_{T} (GeV/c)" n="200" lo="0." hi="20"/> - <y title="Entries"/> -</h> -<!-- --> -<!-- basic plots --> -<h id="basicd0" type="TH1F" title="d_{0} of selected tracks (in mm)"> - <x title="d_{0}(mm)" n="200" lo="-2" hi="2"/> - <y title="Entries"/> -</h> -<h id="basicz0" type="TH1F" title="z_{0} of selected tracks (in mm)"> - <x title="z_{0}(mm)" n="120" lo="-300" hi="300"/> - <y title="Entries"/> -</h> -<h id="basicphi" type="TH1F" title="#phi of selected tracks"> - <x title="#phi" n="100" lo="-4" hi="4"/> - <y title="Entries"/> -</h> -<h id="basiceta" type="TH1F" title="#eta of selected tracks"> - <x title="#eta" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="basictheta" type="TH1F" title="#theta of selected tracks"> - <x title="#theta" n="100" lo="0" hi="&PI;"/> - <y title="Entries"/> -</h> -<h id="basicqOverP" type="TH1F" title="q/p of selected tracks (in GeV)"> - <x title="p_{T}(GeV/c)" n="200" lo="-0.01" hi="0.01"/> - <y title="Entries"/> -</h> -<h id="truthd0" type="TH1F" title="d_{0} of selected truth (in mm)"> - <x title="d_{0}(mm)" n="200" lo="-2" hi="2"/> - <y title="Entries"/> -</h> -<h id="truthz0" type="TH1F" title="z_{0} of selected truth (in mm)"> - <x title="z_{0}(mm)" n="120" lo="-300" hi="300"/> - <y title="Entries"/> -</h> -<h id="truthphi" type="TH1F" title="#phi of selected truth"> - <x title="#phi" n="100" lo="-4" hi="4"/> - <y title="Entries"/> -</h> -<h id="trutheta" type="TH1F" title="#eta of selected truth"> - <x title="#theta" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="truththeta" type="TH1F" title="#theta of selected truth"> - <x title="#theta" n="100" lo="0" hi="&PI;"/> - <y title="Entries"/> -</h> -<h id="truthqOverP" type="TH1F" title="q/p of selected truth (in GeV)"> - <x title="p_{T}(GeV/c)" n="200" lo="-0.005" hi="0.005"/> - <y title="Entries"/> -</h> -<h id="truthz0st" type="TH1F" title="z_{0} sin(#theta) of selected truth "> - <x title="p_{T}(GeV/c)" n="200" lo="-300" hi="300"/> - <y title="Entries"/> -</h> -<h id="truthprodR" type="TH1F" title="Radial distance (r) of truth vtx parameter from origin"> - <x title="(mm)" n="100" lo="0.0" hi="2.0"/> - <y title="Entries"/> -</h> -<h id="truthprodZ" type="TH1F" title="Longitudinal (z) distance of truth vtx parameter from origin"> - <x title="(mm)" n="100" lo="0" hi="300"/> - <y title="Entries"/> -</h> -<!-- --> -<!-- fakes --> -<h id="fakepT" type="TH1F" title="p_{T} of selected fake tracks (in GeV)"> - <x title="p_{T}(GeV/c)" n="200" lo="0." hi="200"/> - <y title="Entries"/> -</h> -<h id="fakepTlow" type="TH1F" title="p_{T} of selected fake tracks (in GeV)"> - <x title="p_{T}(GeV/c)" n="200" lo="0" hi="20"/> - <y title="Entries"/> -</h> -<h id="fakephi" type="TH1F" title="#phi of selected fake tracks"> - <x title="#phi" n="100" lo="-&PI;" hi="&PI;"/> - <y title="Entries"/> -</h> -<h id="fakeeta" type="TH1F" title="#eta of selected fake tracks"> - <x title="#eta" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="faked0" type="TH1F" title="d_{0} of selected fake tracks (in mm)"> - <x title="d_{0}(mm)" n="200" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="fakez0" type="TH1F" title="z_{0} of selected fake tracks (in mm)"> - <x title="z_{0}(mm)" n="120" lo="-300" hi="300"/> - <y title="Entries"/> -</h> -<h id="track_fakerate_vs_eta" type="TProfile" title="Fraction of tracks with <50% truth match probability"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="track_fakerate_vs_pt" type="TProfile" title="Fraction of tracks with <50% truth match probability"> - <x title="p_{T}(GeV/c)" n="25" lo="0" hi="50"/> - <y title="Fake Rate" lo="0" hi="1"/> -</h> -<h id="track_fakerate_vs_phi" type="TProfile" title="Fraction of tracks with <50% truth match probability"> - <x title="#phi" n="24" lo="-180" hi="180"/> - <y title="Fake Rate" lo="0" hi="100"/> -</h> -<h id="track_fakerate_vs_d0" type="TProfile" title="Fraction of tracks with <50% truth match probability"> - <x title="d_{0}" n="20" lo="-6" hi="6"/> - <y title="Fake Rate" lo="0" hi="100"/> -</h> -<h id="track_fakerate_vs_z0" type="TProfile" title="Fraction of tracks with <50% truth match probability"> - <x title="z_{0}" n="20" lo="-300" hi="300"/> - <y title="Fake Rate" lo="0" hi="100"/> -</h> -<!-- --> - -<!-- More fake plots --> -<h id="fakeEtaTotal" type="TProfile" title="Fraction of Linked Primary or Secondary tracks with <50% truth match probability vs Eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="Fraction" lo="0.0" hi="2.0"/> -</h> -<h id="fakePtPrimary" type="TProfile" title="Fraction of Linked Primary tracks with <50% truth match probability vs Pt"> - <x title="Pt (GeV)" n="400" lo="0" hi="200" /> - <y title="Fake Rate" lo="0" hi="2.0"/> -</h> -<h id="fakeetaPrimary" type="TProfile" title="Fraction of Linked Primary tracks with <50% truth match probability vs #eta"> - <x title="#eta" n="80" lo="-4" hi="4"/> - <y title="Fake Rate" lo="0" hi="2.0"/> -</h> -<h id="fakePhiPrimary" type="TProfile" title="Fraction of Linked Primary tracks with <50% truth match probability vs #phi"> - <x title="#phi" n="60" lo="-&PI;" hi="&PI;"/> - <y title="Fake Rate" lo="0" hi="2.0"/> -</h> -<h id="faked0Primary" type="TProfile" title="Fraction of Linked Primary tracks with <50% truth match probability vs d_{0}"> - <x title="d_{0}" n="60" lo="-1.5" hi="1.5"/> - <y title="Fake Rate" lo="0" hi="2.0"/> -</h> -<h id="fakez0Primary" type="TProfile" title="Fraction of Linked Primary tracks with <50% truth match probability vs z_{0}"> - <x title="z_{0}" n="50" lo="-200" hi="200"/> - <y title="Fake Rate" lo="0" hi="2.0"/> -</h> - -<h id="fakePtSecondary" type="TProfile" title="Fraction of Linked Secondary tracks with <50% truth match probability vs Pt"> - <x title="Pt (GeV)" n="400" lo="0" hi="200" /> - <y title="Fake Rate" lo="0" hi="2.0"/> -</h> -<h id="fakeetaSecondary" type="TProfile" title="Fraction of Linked Secondary tracks with <50% truth match probability vs #eta"> - <x title="#eta" n="80" lo="-4" hi="4"/> - <y title="Fake Rate" lo="0" hi="2.0"/> -</h> -<h id="fakePhiSecondary" type="TProfile" title="Fraction of Linked Secondary tracks with <50% truth match probability vs #phi"> - <x title="#phi" n="60" lo="-&PI;" hi="&PI;"/> - <y title="Fake Rate" lo="0" hi="2.0"/> -</h> -<h id="faked0Secondary" type="TProfile" title="Fraction of Linked Secondary tracks with <50% truth match probability vs d_{0}"> - <x title="d_{0}" n="60" lo="-1.5" hi="1.5"/> - <y title="Fake Rate" lo="0" hi="2.0"/> -</h> -<h id="fakez0Secondary" type="TProfile" title="Fraction of Linked Secondary tracks with <50% truth match probability vs z_{0}"> - <x title="z_{0}" n="50" lo="-200" hi="200"/> - <y title="Fake Rate" lo="0" hi="2.0"/> -</h> - -<h id="fakePtUnlinkedFrac" type="TProfile" title="Pt Unlinked Fraction"> - <x title="Pt (GeV)" n="400" lo="0" hi="200"/> - <y title="Unlinked Fake Rate" lo="0" hi="2.0"/> -</h> -<h id="fakeetaUnlinkedFrac" type="TProfile" title="#eta Unlinked Fraction"> - <x title="#eta" n="80" lo="-4" hi="4"/> - <y title="Unlinked Fake Rate" lo="0" hi="2.0"/> -</h> -<h id="fakePhiUnlinkedFrac" type="TProfile" title="#phi Unlinked Fraction"> - <x title="#phi" n="60" lo="-&PI;" hi="&PI;"/> - <y title="Unlinked Fake Rate" lo="0" hi="2.0"/> -</h> -<h id="faked0UnlinkedFrac" type="TProfile" title="d_{0} Unlinked Fraction"> - <x title="d_{0}" n="60" lo="-1.5" hi="1.5"/> - <y title="Unlinked Fake Rate" lo="0" hi="2.0"/> -</h> -<h id="fakez0UnlinkedFrac" type="TProfile" title="z_{0} Unlinked Fraction"> - <x title="z_{0}" n="50" lo="-200" hi="200"/> - <y title="Unlinked Fake Rate" lo="0" hi="2.0"/> -</h> - -<h id="incFakeEta" type="TProfile" title="Inclusive Fake Rate #eta"> - <x title="#eta" n="80" lo="-4" hi="4"/> - <y title="Inclusive Fake Rate" lo="0" hi="2.0"/> -</h> - -<h id="incFakePt" type="TProfile" title="Inclusive Fake Rate Pt"> - <x title="Pt" n="400" lo="0" hi="200"/> - <y title="Inclusive Fake Rate" lo="0" hi="2.0"/> -</h> - - -<!-- --> -<!-- GOOD eff plots --> -<h id="trackeff_vs_eta" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_pt" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="Pt (GeV)" n="25" lo="0" hi="50"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_phi" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="#phi" n="25" lo="-&PI;" hi="&PI;"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_d0" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="d0" n="100" lo="-25" hi="25"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_z0" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="z0" n="100" lo="-250" hi="250"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_R" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="R" n="100" lo="0" hi="50"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_Z" type="TProfile" title="Fraction of reco-matched truth track"> - <x title="Z" n="100" lo="-350" hi="350"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_prodR" type="TProfile" title="Track Efficiency vs Production Vertex Radius"> - <x title="prod_R" n="100" lo="0" hi="1500"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackeff_vs_prodZ" type="TProfile" title="Track Efficiency vs Production Vertex Z"> - <x title="prod_Z" n="100" lo="0" hi="2000"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="low_Pt_lepton_frac" type="TProfile" title="Fraction of Primary Leptons with Pt below 3 GeV"> - <x title="prod_R" n="100" lo="0" hi="1500"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - -<!-- Layer-by-Layer Efficiencies --> -<h id="eff_hit_vs_eta_ibl_barrel" type="TProfile" title="Cluster Efficiency: Pixel Barrel IBL"> - <x title="#eta" n="10" lo="0" hi="2.5"/> - <y title="Cluster Efficiency" lo="0" hi="2.0"/> -</h> -<h id="eff_hit_vs_eta_pix_barrel" type="TProfile" title="Cluster Efficiency: Pixel Barrel"> - <x title="#eta" n="10" lo="0" hi="2.5"/> - <y title="Cluster Efficiency" lo="0" hi="2.0"/> -</h> -<h id="eff_hit_vs_eta_pix_endcap" type="TProfile" title="Cluster Efficiency: Pixel Endcaps"> - <x title="#eta" n="4" lo="1.5" hi="2.5"/> - <y title="Cluster Efficiency" lo="0" hi="2.0"/> -</h> -<h id="eff_hit_vs_eta_sct_barrel" type="TProfile" title="Cluster Efficiency: SCT Barrel"> - <x title="#eta" n="7" lo="0" hi="1.75"/> - <y title="Cluster Efficiency" lo="0" hi="2.0"/> -</h> -<h id="eff_hit_vs_eta_sct_endcap" type="TProfile" title="Cluster Efficiency: SCT Endcaps"> - <x title="#eta" n="6" lo="1.0" hi="2.5"/> - <y title="Cluster Efficiency" lo="0" hi="2.0"/> -</h> -<h id="eff_hit_vs_eta_trt_barrel" type="TProfile" title="Cluster Efficiency: TRT Barrel"> - <x title="#eta" n="5" lo="0" hi="1.25"/> - <y title="Cluster Efficiency" lo="0" hi="2.0"/> -</h> -<h id="eff_hit_vs_eta_trt_endcap" type="TProfile" title="Cluster Efficiency: TRT Endcaps"> - <x title="#eta" n="6" lo="0.75" hi="2.25"/> - <y title="Cluster Efficiency" lo="0" hi="2.0"/> -</h> - - -<!-- vertices --> -<h id="vx_x" type="TH1F" title="X position of vertex"> - <x title="X (mm)" n="200" lo="-1.0" hi="1.0"/> - <y title="Entries"/> -</h> -<h id="vx_y" type="TH1F" title="Y position of vertex"> - <x title="Y (mm)" n="200" lo="-1.0" hi="1.0"/> - <y title="Entries"/> -</h> -<h id="vx_z" type="TH1F" title="Z position of vertex"> - <x title="Z (mm)" n="100" lo="-300.0" hi="300.0"/> - <y title="Entries"/> -</h> -<h id="vx_err_x" type="TH1F" title="X position error of vertex"> - <x title="#sigma(X) (mm)" n="100" lo="0.0" hi="0.2"/> - <y title="Entries"/> -</h> -<h id="vx_err_y" type="TH1F" title="Y position error of vertex"> - <x title="#sigma(Y) (mm)" n="100" lo="0.0" hi="0.2"/> - <y title="Entries"/> -</h> -<h id="vx_err_z" type="TH1F" title="Z position error of vertex"> - <x title="#sigma(Z) (mm)" n="100" lo="0.0" hi="1.0"/> - <y title="Entries"/> -</h> -<h id="vx_chi2_over_ndf" type="TH1F" title="vertex #chi^2 / ndf"> - <x title="#chi^{2}/ndf" n="50" lo="0" hi="10."/> - <y title="Entries"/> -</h> -<h id="vx_type" type="TH1F" title="Vertex type"> - <x title="Vertex type" n="7" lo="0" hi="7"/> - <y title="Entries"/> -</h> -<h id="vx_nTracks" type="TH1F" title="Number of tracks at vertex"> - <x title="Number of Tracks" n="150" lo="0" hi="150"/> - <y title="Entries"/> -</h> -<h id="vx_track_weights" type="TH1F" title="Weights of tracks at vertex"> - <x title="Weight" n="100" lo="0." hi="10.0"/> - <y title="Entries"/> -</h> -<h id="vx_track_pt" type="TH1F" title="Tracks at vertex p_{T}"> - <x title="p_{T} (GeV)" n="100" lo="0" hi="20."/> - <y title="Entries"/> -</h> -<h id="vx_track_eta" type="TH1F" title="Tracks at vertex #eta"> - <x title="#eta" n="100" lo="-2.7" hi="2.7"/> - <y title="Entries"/> -</h> -<h id="vx_track_nSiHits" type="TH1F" title="Tracks at vertex number of Silicon Hits"> - <x title="Num. Si Hits" n="15" lo="5" hi="20"/> - <y title="Entries"/> -</h> -<h id="vx_track_nSiHoles" type="TH1F" title="Tracks at vertex number of Silicon Holes"> - <x title="Num. Si Holes" n="5" lo="0" hi="5"/> - <y title="Entries"/> -</h> -<h id="vx_track_d0" type="TH1F" title="Tracks at vertex d_{0}"> - <x title="d_{0} (mm)" n="100" lo="-2.0" hi="2.0"/> - <y title="Entries"/> -</h> -<h id="vx_track_err_d0" type="TH1F" title="Tracks at vertex d_{0} error"> - <x title="#sigma(d_{0}) (mm)" n="50" lo="0.0" hi="1.0"/> - <y title="Entries"/> -</h> -<h id="vx_track_z0" type="TH1F" title="Tracks at vertex z_{0} - z_{0}^{vertex}"> - <x title="z_{0}-z_{0}^{vertex} (mm)" n="100" lo="-5.0" hi="5.0"/> - <y title="Entries"/> -</h> -<h id="vx_track_err_z0" type="TH1F" title="Tracks at vertex z_{0} error"> - <x title="#sigma(z_{0}) (mm)" n="50" lo="0.0" hi="5.0"/> - <y title="Entries"/> -</h> -<!-- --> - -<!-- Bad Match Rate (BMR) plots --> -<h id="BadMatchRate" type="TProfile" title="Fraction of Tracks with < 50.1% Truth Matching Probability"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="Bad Match Rate" lo="0.0" hi="2.0" /> -</h> - -<h id="ReallyFakeRate" type="TProfile" title="Fraction of Tracks with < 50.0% Truth Matching Probability"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="Really Fake Rate" lo="0.0" hi="2.0" /> -</h> - -<h id="BadMatchRate_vs_logpt" type="TProfile" title="Fraction of Tracks with < 50.1% TMP vs Log(Pt)"> - <x title="Log(Pt)" n="10" lo="-0.5" hi="2" /> - <y title="Bad Match Rate" lo="0.0" hi="2.0" /> -</h> -<!-- --> - -<!-- Track Parameter Resolution Plots --> -<!-- Track Parameter TH2s vs eta --> -<h id="res_d0_vs_eta" type="TH2" title="d_{0}: deviation vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="d_{0}^{rec} - d_{0}^{tru}" n="2000" lo="-1.0" hi="1.0"/> -</h> -<h id="res_z0_vs_eta" type="TH2" title="z_{0}: deviation vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="z_{0}^{rec} - z_{0}^{tru}" n="200" lo="-1.5" hi="1.5"/> -</h> -<h id="res_phi_vs_eta" type="TH2" title="#phi: deviation vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#phi^{rec} - #phi^{tru}" n="3000" lo="-0.03" hi="0.03"/> -</h> -<h id="res_theta_vs_eta" type="TH2" title="#theta: deviation vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#theta^{rec} - #theta^{tru}" n="2000" lo="-0.1" hi="0.1"/> -</h> -<h id="res_z0*sin(theta)_vs_eta" type="TH2" title="z0*sin(#theta): deviation vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="z_{0}*sin(#theta)^{rec} - z_{0}*sin(#theta)^{tru}" n="200" lo="-1.5" hi="1.5"/> -</h> -<h id="res_qopt_vs_eta" type="TH2" title="q/pt: deviation vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="(q/pt)^{rec} - (q/pt)^{tru}" n="200" lo="-0.4" hi="0.4"/> -</h> - -<!-- Track Parameter Means vs eta --> -<h id="resmean_d0_vs_eta" type="TH1F" title="d_{0} Track Measurement Bias vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="d_{0}^{rec} - d_{0}^{tru}"/> -</h> -<h id="resmean_z0_vs_eta" type="TH1F" title="z_{0} Track Measurement Bias vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="z_{0}^{rec} - z_{0}^{tru}"/> -</h> -<h id="resmean_phi_vs_eta" type="TH1F" title="#phi Track Measurement Bias vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#phi^{rec} - #phi^{tru}"/> -</h> -<h id="resmean_theta_vs_eta" type="TH1F" title="#theta Track Measurement Bias vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#theta^{rec} - #theta^{tru}"/> -</h> -<h id="resmean_z0*sin(theta)_vs_eta" type="TH1F" title="z_{0}*sin(#theta) Track Measurement Bias vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="z_{0}*sin(#theta)^{rec} - z_{0}*sin(#theta)^{tru}"/> -</h> -<h id="resmean_qopt_vs_eta" type="TH1F" title="q/pt Track Measurement Bias vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="(q/pt)^{rec} - (q/pt)^{tru}"/> -</h> - -<!-- Track Parameter Resolutions vs eta --> -<h id="reswidth_d0_vs_eta" type="TH1F" title="d_{0} Track Resolution vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#sigma(d_{0}^{rec} - d_{0}^{tru})"/> -</h> -<h id="reswidth_z0_vs_eta" type="TH1F" title="z_{0} Track Resolution vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#sigma(z_{0}^{rec} - z_{0}^{tru})"/> -</h> -<h id="reswidth_phi_vs_eta" type="TH1F" title="#phi Track Resolution vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#sigma(#phi^{rec} - #phi^{tru})"/> -</h> -<h id="reswidth_theta_vs_eta" type="TH1F" title="#theta Track Resolution vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#sigma(#theta^{rec} - #theta^{tru})"/> -</h> -<h id="reswidth_z0*sin(theta)_vs_eta" type="TH1F" title="z_{0}*sin(#theta) Track Resolution vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#sigma(z_{0}*sin(#theta)^{rec} - z_{0}*sin(#theta)^{tru})"/> -</h> -<h id="reswidth_qopt_vs_eta" type="TH1F" title="q/pt Track Resolution vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#sigma((q/pt)^{rec} - (q/pt)^{tru})"/> -</h> - -<!-- Track Parameter TH2s vs Log(Pt) --> -<h id="res_d0_vs_pt" type="TH2" title="d_{0}: deviation vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="d_{0}^{rec} - d_{0}^{tru}" n="2000" lo="-1.0" hi="1.0"/> -</h> -<h id="res_z0_vs_pt" type="TH2" title="z_{0}: deviation vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="z_{0}^{rec} - z_{0}^{tru}" n="200" lo="-1.5" hi="1.5"/> -</h> -<h id="res_phi_vs_pt" type="TH2" title="#phi: deviation vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="#phi^{rec} - #phi^{tru}" n="3000" lo="-0.03" hi="0.03"/> -</h> -<h id="res_theta_vs_pt" type="TH2" title="#theta: deviation vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="#theta^{rec} - #theta^{tru}" n="2000" lo="-0.1" hi="0.1"/> -</h> -<h id="res_z0*sin(theta)_vs_pt" type="TH2" title="z_{0}*sin(#theta): deviation vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="z_{0}*sin(#theta)^{rec} - z_{0}*sin(#theta)^{tru}" n="200" lo="-1.5" hi="1.5"/> -</h> -<h id="res_qopt_vs_pt" type="TH2" title="q/pt: deviation vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="(q/pt)^{rec} - (q/pt)^{tru}" n="200" lo="-0.4" hi="0.4"/> -</h> - -<!-- Track Parameter Means vs log(Pt) --> -<h id="resmean_d0_vs_pt" type="TH1F" title="d_{0} Track Measurement Bias vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="d_{0}^{rec} - d_{0}^{tru}"/> -</h> -<h id="resmean_z0_vs_pt" type="TH1F" title="z_{0} Track Measurement Bias vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="z_{0}^{rec} - z_{0}^{tru}"/> -</h> -<h id="resmean_phi_vs_pt" type="TH1F" title="#phi Track Measurement Bias vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="#phi^{rec} - #phi^{tru}"/> -</h> -<h id="resmean_theta_vs_pt" type="TH1F" title="#theta Track Measurement Bias vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="#theta^{rec} - #theta^{tru}"/> -</h> -<h id="resmean_z0*sin(theta)_vs_pt" type="TH1F" title="z_{0}*sin(#theta) Track Measurement Bias vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="z_{0}*sin(#theta)^{rec} - z_{0}*sin(#theta)^{tru}"/> -</h> -<h id="resmean_qopt_vs_pt" type="TH1F" title="q/pt Track Measurement Bias vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="(q/pt)^{rec} - (q/pt)^{tru}"/> -</h> - -<!-- Track Parameter Resolutions vs log(Pt) --> -<h id="reswidth_d0_vs_pt" type="TH1F" title="d_{0} Track Resolution vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="#sigma(d_{0}^{rec} - d_{0}^{tru})"/> -</h> -<h id="reswidth_z0_vs_pt" type="TH1F" title="z_{0} Track Resolution vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="#sigma(z_{0}^{rec} - z_{0}^{tru})"/> -</h> -<h id="reswidth_phi_vs_pt" type="TH1F" title="#phi Track Resolution vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="#sigma(#phi^{rec} - #phi^{tru})"/> -</h> -<h id="reswidth_theta_vs_pt" type="TH1F" title="#theta Track Resolution vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="#sigma(#theta^{rec} - #theta^{tru})"/> -</h> -<h id="reswidth_z0*sin(theta)_vs_pt" type="TH1F" title="z_{0}*sin(#theta) Track Resolution vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="#sigma(z_{0}*sin(#theta)^{rec} - z_{0}*sin(#theta)^{tru})"/> -</h> -<h id="reswidth_qopt_vs_pt" type="TH1F" title="q/pt Track Resolution vs log(Pt)"> - <x title="log(Pt) (GeV)" n="10" lo="-0.5" hi="2.0"/> - <y title="#sigma((q/pt)^{rec} - (q/pt)^{tru})"/> -</h> - -<!-- Basic Track Pulls --> -<h id="pull_d0" type="TH1F" title="Pull of d_{0}"> - <x title="pull" n="200" lo="-5.0" hi="5.0"/> - <y title="counts"/> -</h> -<h id="pull_z0" type="TH1F" title="Pull of z_{0}"> - <x title="pull" n="200" lo="-5.0" hi="5.0"/> - <y title="counts"/> -</h> -<h id="pull_phi" type="TH1F" title="Pull of #phi"> - <x title="pull" n="200" lo="-5.0" hi="5.0"/> - <y title="counts"/> -</h> -<h id="pull_theta" type="TH1F" title="Pull of #theta"> - <x title="pull" n="200" lo="-5.0" hi="5.0"/> - <y title="counts"/> -</h> -<h id="pull_z0_sin_theta" type="TH1F" title="Pull of z0*sin(#theta)"> - <x title="pull" n="200" lo="-5.0" hi="5.0"/> - <y title="counts"/> -</h> -<h id="pull_qopt" type="TH1F" title="Pull of qopt"> - <x title="pull" n="200" lo="-5.0" hi="5.0"/> - <y title="counts"/> -</h> - -<!-- Track Pull TH2s vs eta --> -<h id="pull_d0_vs_eta" type="TH2" title="d_{0}: Pull vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="(d_{0}^{rec} - d_{0}^{tru})/#sigma_d_0" n="200" lo="-5.0" hi="5.0"/> -</h> -<h id="pull_z0_vs_eta" type="TH2" title="z0: Pull vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="(z_{0}^{rec} - z_{0}^{tru})/#sigma_z_0" n="200" lo="-5.0" hi="5.0"/> -</h> -<h id="pull_phi_vs_eta" type="TH2" title="#phi: Pull vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="(#phi^{rec} - #phi^{tru})/#sigma_#phi" n="200" lo="-5.0" hi="5.0"/> -</h> -<h id="pull_theta_vs_eta" type="TH2" title="#theta: Pull vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="(#theta^{rec} - #theta^{tru})/#sigma_#theta" n="200" lo="-5.0" hi="5.0"/> -</h> -<h id="pull_z0*sin(theta)_vs_eta" type="TH2" title="z0*sin(theta): Pull vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="(z_{0}*sin(#theta)^{rec} - z_{0}*sin(#theta)^{tru})/#sigma_z_{0}*sin(#theta)" n="200" lo="-5.0" hi="5.0"/> -</h> -<h id="pull_qopt_vs_eta" type="TH2" title="q/pt: Pull vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="((q/pt)^{rec} - (q/pt)^{tru})/#sigma_(q/pt)" n="200" lo="-5.0" hi="5.0"/> -</h> - -<!-- Track Pull Means vs eta --> -<h id="pullmean_d0_vs_eta" type="TH1F" title="d_{0} Track Pull Mean vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="d_{0}^{rec} - d_{0}^{tru}"/> -</h> -<h id="pullmean_z0_vs_eta" type="TH1F" title="z_{0} Track Pull Mean vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="z_{0}^{rec} - z_{0}^{tru}"/> -</h> -<h id="pullmean_phi_vs_eta" type="TH1F" title="#phi Track Pull Mean vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#phi^{rec} - #phi^{tru}"/> -</h> -<h id="pullmean_theta_vs_eta" type="TH1F" title="#theta Track Pull Mean vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#theta^{rec} - #theta^{tru}"/> -</h> -<h id="pullmean_z0*sin(theta)_vs_eta" type="TH1F" title="z_{0}*sin(#theta) Track Pull Mean vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="z_{0}*sin(#theta)^{rec} - z_{0}*sin(#theta)^{tru}"/> -</h> -<h id="pullmean_qopt_vs_eta" type="TH1F" title="q/pt Track Pull Mean vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="(q/pt)^{rec} - (q/pt)^{tru}"/> -</h> - -<!-- Track Pull Resolutions vs eta --> -<h id="pullwidth_d0_vs_eta" type="TH1F" title="d_{0} Track Pull Resolution vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#sigma(d_{0}^{rec} - d_{0}^{tru})"/> -</h> -<h id="pullwidth_z0_vs_eta" type="TH1F" title="z_{0} Track Pull Resolution vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#sigma(z_{0}^{rec} - z_{0}^{tru})"/> -</h> -<h id="pullwidth_phi_vs_eta" type="TH1F" title="#phi Track Pull Resolution vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#sigma(#phi^{rec} - #phi^{tru})"/> -</h> -<h id="pullwidth_theta_vs_eta" type="TH1F" title="#theta Track Pull Resolution vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#sigma(#theta^{rec} - #theta^{tru})"/> -</h> -<h id="pullwidth_z0*sin(theta)_vs_eta" type="TH1F" title="z_{0}*sin(#theta) Track Pull Resolution vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#sigma(z_{0}*sin(#theta)^{rec} - z_{0}*sin(#theta)^{tru})"/> -</h> -<h id="pullwidth_qopt_vs_eta" type="TH1F" title="q/pt Track Pull Resolution vs #eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="#sigma((q/pt)^{rec} - (q/pt)^{tru})"/> -</h> - - - - -<!-- hitResidual plots --> -<!-- x residuals --> -<h id="residualx_pixel_barrel" type="TH1F" title="Residual: Pixel Barrel X"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> <!-- 4-22-16 ORIGINAL: -3000 to 3000 range --> - <y title="Entries"/> -</h> -<h id="residualx_pixel_barrel_1hit" type="TH1F" title="Residual: Pixel Barrel X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_pixel_barrel_2ormorehits" type="TH1F" title="Residual: Pixel Barrel X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_sct_barrel" type="TH1F" title="Residual: SCT Barrel X"> - <x title="x residual(#mum)" n="140" lo="-70" hi="70"/> <!-- 4-22-16 ORIGINAL: 120 bins, -50 to 50 range --> - <y title="Entries"/> -</h> -<h id="residualx_sct_barrel_1hit" type="TH1F" title="Residual: SCT Barrel X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-70" hi="70"/> - <y title="Entries"/> -</h> -<h id="residualx_sct_barrel_2ormorehits" type="TH1F" title="Residual: SCT Barrel X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-70" hi="70"/> - <y title="Entries"/> -</h> -<h id="residualx_ibl_barrel" type="TH1F" title="Residual: IBL Barrel X"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_ibl_barrel_1hit" type="TH1F" title="Residual: IBL Barrel X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_ibl_barrel_2ormorehits" type="TH1F" title="Residual: IBL Barrel X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_trt_barrel" type="TH1F" title="Residual: TRT Barrel X"> - <x title="x residual(#mum)" n="200" lo="-500" hi="500"/> <!-- 4-22-16 ORIGINAL: 120 bins, -3000 to 3000 range --> - <y title="Entries"/> -</h> -<!-- endcaps --> -<h id="residualx_pixel_endcap" type="TH1F" title="Residual: Pixel Endcap X"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> <!-- 4-22-16 ORIGINAL: -3000 to 3000 range --> - <y title="Entries"/> -</h> -<h id="residualx_pixel_endcap_1hit" type="TH1F" title="Residual: Pixel Endcap X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_pixel_endcap_2ormorehits" type="TH1F" title="Residual: Pixel Endcap X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualx_sct_endcap" type="TH1F" title="Residual: SCT Endcap X"> - <x title="x residual(#mum)" n="140" lo="-70" hi="70"/> <!-- 4-22-16 ORIGINAL: 120 bins, -3000 to 3000 range --> - <y title="Entries"/> -</h> -<h id="residualx_sct_endcap_1hit" type="TH1F" title="Residual: SCT Endcap X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-70" hi="70"/> - <y title="Entries"/> -</h> -<h id="residualx_sct_endcap_2ormorehits" type="TH1F" title="Residual: SCT Endcap X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-70" hi="70"/> - <y title="Entries"/> -</h> -<h id="residualx_blayer_endcap" type="TH1F" title="Residual: B-Layer Endcap X"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_blayer_endcap_1hit" type="TH1F" title="Residual: B-Layer Endcap X 1 hit"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_blayer_endcap_2ormorehits" type="TH1F" title="Residual: B-Layer Endcap X >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_trt_endcap" type="TH1F" title="Residual: TRT Endcap X"> - <x title="x residual(#mum)" n="200" lo="-500" hi="500"/> <!-- 4-22-16 ORIGINAL: 120 bins, -50 to 50 range --> - <y title="Entries"/> -</h> -<h id="residualx_dbm_neg" type="TH1F" title="Residual: DBM -side X"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<h id="residualx_dbm_pos" type="TH1F" title="Residual: DBM +side X"> - <x title="x residual(#mum)" n="120" lo="-3000" hi="3000"/> - <y title="Entries"/> -</h> -<!-- y residuals --> -<h id="residualy_pixel_barrel" type="TH1F" title="Residual: Pixel Barrel Y"> - <x title="y residual(#mum)" n="120" lo="-300" hi="300"/> <!--4-22-16 ORIGINAL: -50 to 50 range --> - <y title="Entries"/> -</h> -<h id="residualy_pixel_barrel_1hit" type="TH1F" title="Residual: Pixel Barrel Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_pixel_barrel_2ormorehits" type="TH1F" title="Residual: Pixel Barrel Y >=2 hits"> - <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_sct_barrel" type="TH1F" title="Residual: SCT Barrel Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_sct_barrel_1hit" type="TH1F" title="Residual: SCT Barrel Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_sct_barrel_2ormorehits" type="TH1F" title="Residual: SCT Barrel Y >=2 hits"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_ibl_barrel" type="TH1F" title="Residual: IBL Barrel Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_ibl_barrel_1hit" type="TH1F" title="Residual: IBL Barrel Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_ibl_barrel_2ormorehits" type="TH1F" title="Residual: IBL Barrel Y >=2 hits"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_trt_barrel" type="TH1F" title="Residual: TRT Barrel Y"> - <x title="y residual(#mum)" n="120" lo="0" hi="2500"/> - <y title="Entries"/> -</h> -<!-- endcaps --> -<h id="residualy_pixel_endcap" type="TH1F" title="Residual: Pixel Endcap Y"> - <x title="y residual(#mum)" n="120" lo="-300" hi="300"/> <!-- 4-22-16 ORIGINAL: -50 to 50 range --> - <y title="Entries"/> -</h> -<h id="residualy_pixel_endcap_1hit" type="TH1F" title="Residual: Pixel Endcap Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_pixel_endcap_2ormorehits" type="TH1F" title="Residual: Pixel Endcap Y >=2 hits"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_sct_endcap" type="TH1F" title="Residual: SCT Endcap Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_sct_endcap_1hit" type="TH1F" title="Residual: SCT Endcap Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_sct_endcap_2ormorehits" type="TH1F" title="Residual: SCT Endcap Y >=2 hits"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_blayer_endcap" type="TH1F" title="Residual: B-Layer Endcap Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_blayer_endcap_1hit" type="TH1F" title="Residual: B-Layer Endcap Y 1 hit"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_blayer_endcap_2ormorehits" type="TH1F" title="Residual: B-Layer Endcap Y >=2 hits"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_trt_endcap" type="TH1F" title="Residual: TRT Endcap Y"> - <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> - <y title="Entries"/> -</h> -<h id="residualy_dbm_neg" type="TH1F" title="Residual: DBM -side Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualy_dbm_pos" type="TH1F" title="Residual: DBM +side Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<!-- pulls --> -<!-- barrel, x --> -<h id="residualpullx_ibl_barrel" type="TH1F" title="Residualpull: B-Layer Barrel X"> - <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_pixel_barrel" type="TH1F" title="Residualpull: Pixel Barrel X"> - <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_sct_barrel" type="TH1F" title="Residualpull: SCT Barrel X"> - <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_trt_barrel" type="TH1F" title="Residualpull: TRT Barrel X"> - <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_dbm_barrel" type="TH1F" title="Residualpull: DBM -side X"> - <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<!-- endcap, x --> -<h id="residualpullx_ibl_endcap" type="TH1F" title="Residualpull: B-Layer Endcap X"> - <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_pixel_endcap" type="TH1F" title="Residualpull: Pixel Endcap X"> - <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_sct_endcap" type="TH1F" title="Residualpull: SCT Endcap X"> - <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_trt_endcap" type="TH1F" title="Residualpull: TRT Endcap X"> - <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpullx_dbm_endcap" type="TH1F" title="Residualpull: DBM +side X"> - <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<!-- barrel, y --> -<h id="residualpully_ibl_barrel" type="TH1F" title="Residualpull: B-Layer Barrel Y"> - <x title="y residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_pixel_barrel" type="TH1F" title="Residualpull: Pixel Barrel Y"> - <x title="y residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_sct_barrel" type="TH1F" title="Residualpull: SCT Barrel Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_trt_barrel" type="TH1F" title="Residualpull: TRT Barrel Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_dbm_barrel" type="TH1F" title="Residualpull: DBM -side Y"> - <x title="y residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<!-- endcap,y --> -<h id="residualpully_ibl_endcap" type="TH1F" title="Residualpull: B-Layer Endcap Y"> - <x title="y residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_pixel_endcap" type="TH1F" title="Residualpull: Pixel Endcap Y"> - <x title="y residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_sct_endcap" type="TH1F" title="Residualpull: SCT Endcap Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_trt_endcap" type="TH1F" title="Residualpull: TRT Endcap Y"> - <x title="y residual(#mum)" n="10" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<h id="residualpully_dbm_endcap" type="TH1F" title="Residualpull: DBM +side Y"> - <x title="y residual(#mum)" n="100" lo="-5" hi="5"/> - <y title="Entries"/> -</h> -<!-- cluster width plots --> -<h id="clusterPhiWidth_pixel_barrel" type="TH1F" title="Cluster width in phi: Pixel Barrel"> - <x title="Pixels" n="10" lo="0" hi="10"/> - <y title="Entries"/> -</h> -<h id="clusterPhiWidth_pixel_endcap" type="TH1F" title="Cluster width in phi: Pixel Endcap"> - <x title="Pixels" n="10" lo="0" hi="10"/> - <y title="Entries"/> -</h> -<h id="clusterEtaWidth_pixel_barrel" type="TH1F" title="Cluster width in eta: Pixel Barrel"> - <x title="Pixels" n="10" lo="0" hi="10"/> - <y title="Entries"/> -</h> -<h id="clusterEtaWidth_pixel_endcap" type="TH1F" title="Cluster width in eta: Pixel Endcap"> - <x title="Pixels" n="10" lo="0" hi="10"/> - <y title="Entries"/> -</h> -<h id="clusterPhiWidth_sct_barrel" type="TH1F" title="Cluster width in phi: SCT Barrel"> - <x title="num. strips" n="10" lo="0" hi="10"/> - <y title="Entries"/> -</h> -<h id="clusterPhiWidth_sct_endcap" type="TH1F" title="Cluster width in phi: SCT Endcap"> - <x title="num. strips" n="10" lo="0" hi="10"/> - <y title="Entries"/> -</h> -<!-- --> -<!-- TrackInJets --> -<h id="recInJetpT" type="TH1F" title="p_{T} of selected rec tracks in jets(in GeV)"> - <x title="p_{T}(GeV/c)" n="200" lo="0." hi="200"/> - <y title="Entries"/> -</h> -<h id="nTrackInJet" type="TH1F" title="Number of Tracks in Jet"> - <x title="N Tracks" n="50" lo="0." hi="50"/> - <y title="Entries"/> -</h> -<h id="sumPtinJet" type="TH1F" title="Sum p_{T} of Tracks in Jet"> - <x title="sum p_{T}(GeV/c)" n="25" lo="0" hi="500"/> - <y title="Entries"/> -</h> -<h id="fracPtInJet" type="TH1F" title="Sum p_{T} of Tracks over jet p_{T}"> - <x title="sum Track p_{T}/jet p_{T}" n="60" lo="0" hi="3"/> - <y title="Entries"/> -</h> -<!-- spectrum plots --> -<h id="nSCTHits" type="TH1F" title="# SCT hits"> - <x title="# SCT Hits" n="20" lo="0." hi="20"/> - <y title="Entries"/> -</h> -<h id="nPixHits" type="TH1F" title="# Pix hits"> - <x title="# Pix Hits" n="20" lo="0." hi="20"/> - <y title="Entries"/> -</h> -<h id="nTotHits" type="TH1F" title="# Total hits"> - <x title="# Totat Hits" n="20" lo="0." hi="20"/> - <y title="Entries"/> -</h> -<h id="nSCTDeadSensors" type="TH1F" title="# SCT DeadSensors"> - <x title="# SCT DeadSensors" n="20" lo="0." hi="20"/> - <y title="Entries"/> -</h> -<h id="nPixDeadSensors" type="TH1F" title="# Pix DeadSensors"> - <x title="# Pix DeadSensors" n="20" lo="0." hi="20"/> - <y title="Entries"/> -</h> -<h id="nTotDeadSensors" type="TH1F" title="# Total DeadSensors"> - <x title="# Total DeadSensors" n="20" lo="0." hi="20"/> - <y title="Entries"/> -</h> -<h id="nSCTHits_vs_eta" type="TProfile" title="# SCT hits vs Eta"> - <x title="#eta" n="80" lo="-4" hi="4"/> - <y title="# SCT Hits" lo="0" hi="20"/> -</h> -<h id="nPixHits_vs_eta" type="TProfile" title="# Pix hits vs Eta"> - <x title="#eta" n="80" lo="-4" hi="4"/> - <y title="# Pix Hits" lo="0" hi="20"/> -</h> -<h id="nTotHits_vs_eta" type="TProfile" title="# total hits vs Eta"> - <x title="#eta" n="80" lo="-4" hi="4"/> - <y title="# total Hits" lo="0" hi="20"/> -</h> -<h id="nSCTDeadSensors_vs_eta" type="TProfile" title="# SCT deadsensors vs Eta"> - <x title="#eta" n="80" lo="-4" hi="4"/> - <y title="# SCT deadsensors" lo="0" hi="20"/> -</h> -<h id="nPixDeadSensors_vs_eta" type="TProfile" title="# pix deadsensors vs Eta"> - <x title="#eta" n="80" lo="-4" hi="4"/> - <y title="# pix deadsensors" lo="0" hi="20"/> -</h> -<h id="nTotDeadSensors_vs_eta" type="TProfile" title="# total deadsensors vs Eta"> - <x title="#eta" n="80" lo="-4" hi="4"/> - <y title="# total deadsensors" lo="0" hi="20"/> -</h> -<h id="recoMatchProbabilitySpectrum" type="TH1F" title="truth match probability spectrum"> - <x title="truth match probability" n="40" lo="0." hi="1"/> - <y title="Entries"/> -</h> -<h id="recoEtaSpectrum" type="TH1F" title="reco eta spectrum"> - <x title="#eta" n="80" lo="-4" hi="4"/> - <y title="Entries"/> -</h> -<h id="recoPhiSpectrum" type="TH1F" title="reco phi spectrum"> - <x title="#phi" n="60" lo="-3" hi="3"/> - <y title="Entries"/> -</h> -<h id="recoPtSpectrum" type="TH1F" title="reco pt spectrum"> - <x title="pt (GeV/c)" n="100" lo="0." hi="100"/> - <y title="Entries"/> -</h> -<h id="truthEtaSpectrum" type="TH1F" title="truth eta spectrum"> - <x title="#eta" n="80" lo="-4" hi="4"/> - <y title="Entries"/> -</h> -<h id="truthPhiSpectrum" type="TH1F" title="truth phi spectrum"> - <x title="#phi" n="60" lo="-3" hi="3"/> - <y title="Entries"/> -</h> -<h id="truthPtSpectrum" type="TH1F" title="truth pt spectrum"> - <x title="pt (GeV/c)" n="100" lo="0." hi="100"/> - <y title="Entries"/> -</h> -<!-- HitContent plots --> -<h id="HitContent_vs_eta_NBlayerHits" type="TProfile" title="Number of B-Layer clusters"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of B-layer clusters>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelHits" type="TProfile" title="Number of Pixel clusters"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of Pixel clusters>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_DBMHitsNeg" type="TProfile" title="Number of DBM Clusters"> - <x title="#eta" n="20" lo="-3.8" hi="-2.5"/> - <y title="<Number of DBM clusters, - side>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_DBMHitsPos" type="TProfile" title="Number of DBM Clusters"> - <x title="#eta" n="20" lo="2.5" hi="3.8"/> - <y title="<Number of DBM Clusters, + side>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelHoles" type="TProfile" title="Number of Pixel Holes"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of Pixel Holes>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NSCTHits" type="TProfile" title="Number of SCT Clusters"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of SCT Clusters>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NSCTHoles" type="TProfile" title="Number of SCT Holes"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of SCT Holes>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NTRTHits" type="TProfile" title="Number of TRT Clusters"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of TRT Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NTRTHighThresholdHits" type="TProfile" title="Number of TRT high threshold clusters"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of High Thresh TRT Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NBlayerOutliers" type="TProfile" title="Number of B-layer outliers"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of B-layer Outliers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NBlayerSharedHits" type="TProfile" title="Number of shared B-layer clusters"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of B-layer Shared Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NBLayerSplitHits" type="TProfile" title="Number of split B-layer clusters"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of B-layer Split Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelOutliers" type="TProfile" title="Number of Pixel outliers"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of Pixel Outliers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelContribLayers" type="TProfile" title="Number of contributed Pixel layers"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of Pixel Layers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelSharedHits" type="TProfile" title="Number of shared Pixel clusters"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of Pixel Shared Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelSplitHits" type="TProfile" title="Number of split Pixel clusters"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of Pixel Split Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NPixelGangedHits" type="TProfile" title="Number of ganged Pixel clusters"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of Pixel Ganged Hits>" lo="0" hi="100"/> -</h> - -<h id="HitContent_vs_eta_NPixelGangedHitsFlaggedFakes" type="TProfile" title="Number of ganged flagged fake Pixel hits vs eta"> - <x title="#eta" n="20" lo="-2.5" hi="2.5" /> - <y title="Flagged Fakes in Pixel" lo="0" hi="2" /> -</h> - -<h id="HitContent_vs_eta_NSCTOutliers" type="TProfile" title="Number of SCT Outliers"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of SCT Outliers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NSCTDoubleHoles" type="TProfile" title="Number of SCT double holes"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of SCT Double Holes>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NSCTSharedHits" type="TProfile" title="Number of SCT Shared clusters"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of SCT Shared Hits>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NTRTOutliers" type="TProfile" title="Number of TRT outliers"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of TRT Outliers>" lo="0" hi="100"/> -</h> -<h id="HitContent_vs_eta_NTRTHighThresholdOutliers" type="TProfile" title="Number of TRT High Threshold outliers"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="<Number of TRT High Thresh Outliers>" lo="0" hi="100"/> -</h> - -<!-- --> -<!-- Track in Jet efficiencies --> -<h id="trackinjeteff_vs_eta" type="TProfile" title="Track in jets efficiency vs #eta (Det. Paper def.)"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackinjeteff_vs_phi" type="TProfile" title="Track in jets efficiency vs #phi (Det. Paper def.)"> - <x title="#eta" n="24" lo="-1.5708" hi="1.5708"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackinjeteff_vs_pt" type="TProfile" title="Track in jets efficiency vs p_{T} for |#eta| < 2.5 (Det. Paper def.)"> - <x title="p_{T} (GeV/c)" n="25" lo="0" hi="50"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackinjeteff_vs_dr" type="TProfile" title="Track in jets efficiency vs #DeltaR for |#eta| < 2.5 (Det. Paper def.)"> - <x title="#DeltaR" n="10" lo="0.0" hi="0.4"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackinjeteff_vs_dr_lt_j50" type="TProfile" title="Track in jets efficiency vs #DeltaR for |#eta| < 2.5 (E_{T}(jet) < 50 GeV)"> - <x title="#DeltaR" n="10" lo="0.0" hi="0.2"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackinjeteff_vs_dr_gr_j100" type="TProfile" title="Track in jets efficiency vs #DeltaR for |#eta| < 2.5 (E_{T}(jet) > 100 GeV)"> - <x title="#DeltaR" n="10" lo="0.0" hi="0.2"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> -<h id="trackinjeteff_vs_jetet" type="TProfile" title="Track in jets efficiency vs jet E_{T} for |#eta| < 2.5 "> - <x title="E_{jet} (GeV)" n="10" lo="0.0" hi="250"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - -<!-- --> -<!-- Track in Jet Bad Match Rates --> -<h id="trackinjet_badmatchrate_vs_dr_gr_j100" type="TProfile" title="Fraction of tracks with < 80% truth matching probability in Jets with E_{T} > 100 GeV"> - <x title="#DeltaR" n="10" lo="0.0" hi="0.2"/> - <y title="Bad Match Rate" lo="0.0" hi="2.0"/> -</h> - -<!-- --> -<!-- Unsorted : todo: sort --> -<h id="incFakevsTracks" type="TProfile" title="Selected Reco Tracks / Selected Truth Tracks vs # of reco tracks"> - <x title="tracks" n="200" lo="0" hi="2000"/> - <y title="Inclusive Fake Rate" lo="0" hi="2"/> -</h> -<h id="selectedTracks_vs_nTracks" type="TH2F" title="Selected Reco Tracks vs # Reco Tracks "> - <x title="Reco Tracks" n="200" lo="0" hi="2000"/> - <y title="Selected Reco Tracks" n="80" lo="0" hi="1600"/> -</h> -<h id="nSCTHits_phi_vs_eta" type="TH2F" title="# SCT hits phi vs Eta"> - <x title="#etaphi" n="80" lo="-4" hi="4"/> - <y title="# SCT Hits" n="60" lo="-3" hi="3"/> -</h> -<h id="nPixHits_phi_vs_eta" type="TH2F" title="# Pix hits phi vs Eta"> - <x title="#etaphi" n="80" lo="-4" hi="4"/> - <y title="# Pix Hits" n="60" lo="-3" hi="3"/> -</h> -<h id="nTotHits_phi_vs_eta" type="TH2F" title="# total hits phi vs Eta"> - <x title="#etaphi" n="80" lo="-4" hi="4"/> - <y title="# total Hits" n="60" lo="-3" hi="3"/> -</h> -<h id="recoMatchProbabilitySpectrumUNLINKED" type="TH1F" title="truth match probability spectrum"> - <x title="truth match probability" n="110" lo="0." hi="1.1"/> - <y title="Entries"/> -</h> -<h id="recoMatchProbabilitySpectrumLINKED" type="TH1F" title="truth match probability spectrum"> - <x title="truth match probability" n="110" lo="0." hi="1.1"/> - <y title="Entries"/> -</h> -<h id="recod0Spectrum" type="TH1F" title="reco d0 spectrum"> - <x title="d0" n="200" lo="-5." hi="5."/> - <y title="Entries"/> -</h> -<h id="recoz0Spectrum" type="TH1F" title="reco z0 spectrum"> - <x title="z0" n="500" lo="-250." hi="250."/> - <y title="Entries"/> -</h> -<h id="recoz0sinSpectrum" type="TH1F" title="reco z0sin spectrum"> - <x title="z0sintheta" n="500" lo="-250." hi="250."/> - <y title="Entries"/> -</h> -<h id="recod0TVRSpectrum" type="TH1F" title="reco d0-TruthVtxR spectrum"> - <x title="d0-TrVtR" n="200" lo="-5." hi="5."/> - <y title="Entries"/> -</h> -<h id="recoz0TVZSpectrum" type="TH1F" title="reco z0-TruthVtxZ spectrum"> - <x title="d0-TrVtZ" n="200" lo="-10." hi="10."/> - <y title="Entries"/> -</h> -<h id="recoz0TVZsinSpectrum" type="TH1F" title="reco (z0-TruthVtxZ)sin spectrum"> - <x title="(d0-TrVtZ)sin" n="200" lo="-10." hi="10."/> - <y title="Entries"/> -</h> -<h id="ptvsEtaUnlinked_postSelect" type="TH2F" title="PT vs Eta Spectrum"> - <x title="#eta" n="80" lo="-4" hi="4"/> - <y title="Fake Rate" n="200" lo="0" hi="200"/> -</h> -<h id="probvsSCTUnlinked_postSelect" type="TH2F" title="Truth Match Probability vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="truth match probability" n="55" lo="0" hi="1.1"/> -</h> -<h id="probvsPixUnlinked_postSelect" type="TH2F" title="Truth Match Probability vs Pix Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="truth match probability" n="55" lo="0" hi="1.1"/> -</h> -<h id="sharedHitsvsSCTUnlinked_postSelect" type="TH2F" title="Shared Hits vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Shared Hits" n="20" lo="0" hi="20"/> -</h> -<h id="sharedHitsvsPixUnlinked_postSelect" type="TH2F" title="Shared Hits vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Shared Hits" n="20" lo="0" hi="20"/> -</h> -<h id="holesvsPixUnlinked_postSelect" type="TH2F" title="Holes vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="pixholesvsPixUnlinked_postSelect" type="TH2F" title="Pixel Holes vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="holesvsSCTUnlinked_postSelect" type="TH2F" title="Holes vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="sctholesvsSCTUnlinked_postSelect" type="TH2F" title="SCT Holes vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="outliersvsPixUnlinked_postSelect" type="TH2F" title="Outliers vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="pixoutliersvsPixUnlinked_postSelect" type="TH2F" title="Pixel Outliers vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="outliersvsSCTUnlinked_postSelect" type="TH2F" title="Outliers vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="sctoutliersvsSCTUnlinked_postSelect" type="TH2F" title="SCT Outliers vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="hitsvsEtaUnlinked_postSelect" type="TProfile" title="Hits vs Eta"> - <x title="#eta" n="40" lo="-4" hi="4"/> - <y title="Hits" lo="0" hi="20"/> -</h> -<h id="pixHolesvsEtaUnlinked_postSelect" type="TProfile" title="Pixel Holes vs Eta"> - <x title="#eta" n="40" lo="-4" hi="4"/> - <y title="Pixel Holes" lo="0" hi="5"/> -</h> -<h id="sctHolesvsEtaUnlinked_postSelect" type="TProfile" title="SCT Holes vs Eta"> - <x title="#eta" n="40" lo="-4" hi="4"/> - <y title="Pixel Holes" lo="0" hi="5"/> -</h> -<h id="sctHitsvsPixHitsUnlinked_postSelect" type="TH2F" title="SCT Hits vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="SCT Hits" n="20" lo="0" hi="20"/> -</h> -<h id="sctHitsvsEtaUnlinked_postSelect" type="TProfile" title="SCT Hits vs Eta"> - <x title="#eta" n="40" lo="-4" hi="4"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="pixHitsvsEtaUnlinked_postSelect" type="TProfile" title="Pixel Hits vs Eta"> - <x title="#eta" n="40" lo="-4" hi="4"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="sctOutliersvsEtaUnlinked_postSelect" type="TProfile" title="SCT Outliers vs Eta"> - <x title="#eta" n="40" lo="-4" hi="4"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="pixOutliersvsEtaUnlinked_postSelect" type="TProfile" title="Pixel Outliers vs Eta"> - <x title="#eta" n="40" lo="-4" hi="4"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="ptvsEtaLinked_postSelect" type="TH2F" title="PT vs Eta Spectrum"> - <x title="#eta" n="80" lo="-4" hi="4"/> - <y title="Fake Rate" n="200" lo="0" hi="200"/> -</h> -<h id="probvsSCTLinked_postSelect" type="TH2F" title="Truth Match Probability vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="truth match probability" n="55" lo="0" hi="1.1"/> -</h> -<h id="probvsPixLinked_postSelect" type="TH2F" title="Truth Match Probability vs Pix Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="truth match probability" n="55" lo="0" hi="1.1"/> -</h> -<h id="sharedHitsvsSCTLinked_postSelect" type="TH2F" title="Shared Hits vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Shared Hits" n="20" lo="0" hi="20"/> -</h> -<h id="sharedHitsvsPixLinked_postSelect" type="TH2F" title="Shared Hits vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Shared Hits" n="20" lo="0" hi="20"/> -</h> -<h id="holesvsPixLinked_postSelect" type="TH2F" title="Holes vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="pixholesvsPixLinked_postSelect" type="TH2F" title="Pixel Holes vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="holesvsSCTLinked_postSelect" type="TH2F" title="Holes vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="sctholesvsSCTLinked_postSelect" type="TH2F" title="SCT Holes vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Holes" n="10" lo="0" hi="10"/> -</h> -<h id="outliersvsPixLinked_postSelect" type="TH2F" title="Outliers vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="pixoutliersvsPixLinked_postSelect" type="TH2F" title="Pixel Outliers vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="outliersvsSCTLinked_postSelect" type="TH2F" title="Outliers vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="sctoutliersvsSCTLinked_postSelect" type="TH2F" title="SCT Outliers vs SCT Hits"> - <x title="SCT Hits" n="20" lo="0" hi="20"/> - <y title="Outliers" n="10" lo="0" hi="10"/> -</h> -<h id="hitsvsEtaLinked_postSelect" type="TProfile" title="Hits vs Eta"> - <x title="#eta" n="40" lo="-4" hi="4"/> - <y title="Hits" lo="0" hi="20"/> -</h> -<h id="pixHolesvsEtaLinked_postSelect" type="TProfile" title="Pixel Holes vs Eta"> - <x title="#eta" n="40" lo="-4" hi="4"/> - <y title="Pixel Holes" lo="0" hi="5"/> -</h> -<h id="sctHolesvsEtaLinked_postSelect" type="TProfile" title="SCT Holes vs Eta"> - <x title="#eta" n="40" lo="-4" hi="4"/> - <y title="Pixel Holes" lo="0" hi="5"/> -</h> -<h id="sctHitsvsPixHitsLinked_postSelect" type="TH2F" title="SCT Hits vs Pixel Hits"> - <x title="Pixel Hits" n="20" lo="0" hi="20"/> - <y title="SCT Hits" n="20" lo="0" hi="20"/> -</h> -<h id="sctHitsvsEtaLinked_postSelect" type="TProfile" title="SCT Hits vs Eta"> - <x title="#eta" n="40" lo="-4" hi="4"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="pixHitsvsEtaLinked_postSelect" type="TProfile" title="Pixel Hits vs Eta"> - <x title="#eta" n="40" lo="-4" hi="4"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="sctOutliersvsEtaLinked_postSelect" type="TProfile" title="SCT Outliers vs Eta"> - <x title="#eta" n="40" lo="-4" hi="4"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="pixOutliersvsEtaLinked_postSelect" type="TProfile" title="Pixel Outliers vs Eta"> - <x title="#eta" n="40" lo="-4" hi="4"/> - <y title="SCT Hits" lo="0" hi="20"/> -</h> -<h id="recoMatchvsSiHitsUNLINKED_postSelect" type="TH2F" title="truth match probability vs Silicon hits (UNLINKED)"> - <x title="Si Hits" n="25" lo="0" hi="25"/> - <y title="truth match probability" n="40" lo="0" hi="1.1"/> -</h> -<h id="recoMatchvsSCTHitsUNLINKED_postSelect" type="TH2F" title="truth match probability vs SCT hits (UNLINKED)"> - <x title="SCT Hits" n="25" lo="0" hi="25"/> - <y title="truth match probability" n="40" lo="0" hi="1.1"/> -</h> -<h id="recoMatchvsPixHitsUNLINKED_postSelect" type="TH2F" title="truth match probability vs Pixel hits (UNLINKED)"> - <x title="Pixel Hits" n="25" lo="0" hi="25"/> - <y title="truth match probability" n="40" lo="0" hi="1.1"/> -</h> -<h id="recoMatchvsSiHitsLINKED_postSelect" type="TH2F" title="truth match probability vs Silicon hits (LINKED)"> - <x title="Si Hits" n="25" lo="0" hi="25"/> - <y title="truth match probability" n="40" lo="0" hi="1.1"/> -</h> -<h id="recoMatchvsSCTHitsLINKED_postSelect" type="TH2F" title="truth match probability vs SCT hits (LINKED)"> - <x title="SCT Hits" n="25" lo="0" hi="25"/> - <y title="truth match probability" n="40" lo="0" hi="1.1"/> -</h> -<h id="recoMatchvsPixHitsLINKED_postSelect" type="TH2F" title="truth match probability vs Pixel hits (LINKED)"> - <x title="Pixel Hits" n="25" lo="0" hi="25"/> - <y title="truth match probability" n="40" lo="0" hi="1.1"/> -</h> -<!-- --> -<!-- VTX-related --> -<h id="TVXspectrum" type="TH1F" title="TruthVtxX spectrum"> - <x title="TrVtxX" n="500" lo="-0.5" hi="0.5"/> - <y title="Entries"/> -</h> -<h id="TVYspectrum" type="TH1F" title="TruthVtxY spectrum"> - <x title="TrVtxY" n="500" lo="-0.5" hi="0.5"/> - <y title="Entries"/> -</h> -<h id="TVRspectrum" type="TH1F" title="TruthVtxR spectrum"> - <x title="TrVtxR" n="500" lo="0." hi="0.5"/> - <y title="Entries"/> -</h> -<h id="TVZspectrum" type="TH1F" title="TruthVtxZ spectrum"> - <x title="TrVtxZ" n="500" lo="-250." hi="250."/> - <y title="Entries"/> -</h> -<h id="TVR_vs_Z" type="TH2F" title="Truth Vtx R vs Z"> - <x title="TrVtxR" n="500" lo="0.0" hi="0.5"/> - <y title="TrVtxZ" n="500" lo="-250." hi="250."/> -</h> -<h id="recod0_vs_z0_good" type="TH2F" title="Reco d0 vs z0 good"> - <x title="Reco d0" n="200" lo="-10." hi="10."/> - <y title="Reco z0" n="200" lo="-10." hi="10."/> -</h> -<h id="recod0_vs_z0_crazy" type="TH2F" title="Reco d0 vs z0 crazy"> - <x title="Reco d0" n="200" lo="-10." hi="10."/> - <y title="Reco z0" n="200" lo="-10." hi="10."/> -</h> - -<h id="recod0PVRSpectrum" type="TH1F" title="reco d0-PrimVtxR spectrum"> - <x title="d0-PrVtR" n="200" lo="-10." hi="10."/> - <y title="Entries"/> -</h> -<h id="recoz0PVZSpectrum" type="TH1F" title="reco z0-PrimVtxZ spectrum"> - <x title="d0-PrVtZ" n="200" lo="-20." hi="20."/> - <y title="Entries"/> -</h> -<h id="recoz0PVZsinSpectrum" type="TH1F" title="reco (z0-PrimVtxZ)sin spectrum"> - <x title="(d0-PrVtZ)sin" n="200" lo="-20." hi="20."/> - <y title="Entries"/> -</h> -<h id="PVXspectrum" type="TH1F" title="PrimVtxX spectrum"> - <x title="PrVtxX" n="500" lo="-0.25" hi="0.25"/> - <y title="Entries"/> -</h> -<h id="PVYspectrum" type="TH1F" title="PrimVtxY spectrum"> - <x title="PrVtxY" n="500" lo="-0.25" hi="0.25"/> - <y title="Entries"/> -</h> -<h id="PVRspectrum" type="TH1F" title="PrimVtxR spectrum"> - <x title="PrVtxR" n="100" lo="0." hi="0.25"/> - <y title="Entries"/> -</h> -<h id="PVZspectrum" type="TH1F" title="PrimVtxZ spectrum"> - <x title="PrVtxZ" n="500" lo="-250." hi="250."/> - <y title="Entries"/> -</h> -<h id="PVR_vs_Z" type="TH2F" title="PrimVtx R vs Z"> - <x title="PrVtxZ" n="500" lo="-250." hi="250."/> - <y title="PrVtxR" n="100" lo="0.0" hi="0.25"/> -</h> -<!-- --> - -<!-- stuff pilfered from old backtracking script --> -<h id="eff_vs_eta_of_daughters" type="TProfile" title="Efficiency vs #eta of daughter particles"> - <x title="#eta" n="20" lo="-2.5" hi="2.5"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - -<h id="eff_vs_theta_of_daughters" type="TProfile" title="Efficiency vs #theta of daughter particles"> - <x title="#theta" n="28" lo="0.0" hi="&PI;"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - -<h id="eff_vs_theta_tan_of_daughters" type="TProfile" title="Efficiency vs tan(#theta) of daughter particles"> - <x title="tan(#theta)" n="32" lo="-8" hi="8"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - -<h id="eff_vs_theta_cotan_of_daughters" type="TProfile" title="Efficiency vs cotan(#theta) of daughter particles"> - <x title="cotan(#theta)" n="32" lo="-8" hi="8"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - -<h id="eff_vs_phi_of_daughters" type="TProfile" title="Efficiency vs #phi of daughter particles"> - <x title="#phi" n="16" lo="-&PI;" hi="&PI;"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - -<h id="eff_vs_phi_sin_of_daughters" type="TProfile" title="Efficiency vs sin(#phi) of daughter particles"> - <x title="sin(#phi)" n="14" lo="-1.2" hi="1.2"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - -<h id="eff_vs_phi_cos_of_daughters" type="TProfile" title="Efficiency vs cos(#phi) of daughter particles"> - <x title="cos(#phi)" n="14" lo="-1.2" hi="1.2"/> - <y title="Efficiency" lo="0.0" hi="2.0"/> -</h> - - -<!-- --> - -</hdef> diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/LargeD0PlotDefinitions.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/LargeD0PlotDefinitions.xml index de50ee5f6bc6a33d6b2909865029d83d5a8fe1ad..00e96042c2ede2d12ec4c550318bf1cc575d3260 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/LargeD0PlotDefinitions.xml +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/LargeD0PlotDefinitions.xml @@ -574,31 +574,31 @@ </h> <!-- Layer-by-Layer Efficiencies --> -<h id="eff_hit_vs_eta_ibl_barrel" type="TProfile" title="Cluster Efficiency: Pixel Barrel IBL"> +<h id="eff_hit_vs_eta_l0pix_barrel" type="TEfficiency" title="Cluster Efficiency: Pixel Barrel IBL"> <x title="#eta" n="10" lo="0" hi="2.5"/> <y title="Cluster Efficiency" lo="0.95" hi="1.02"/> </h> -<h id="eff_hit_vs_eta_pix_barrel" type="TProfile" title="Cluster Efficiency: Pixel Barrel"> +<h id="eff_hit_vs_eta_pix_barrel" type="TEfficiency" title="Cluster Efficiency: Pixel Barrel"> <x title="#eta" n="10" lo="0" hi="2.5"/> <y title="Cluster Efficiency" lo="0.95" hi="1.02"/> </h> -<h id="eff_hit_vs_eta_pix_endcap" type="TProfile" title="Cluster Efficiency: Pixel Endcaps"> +<h id="eff_hit_vs_eta_pix_endcap" type="TEfficiency" title="Cluster Efficiency: Pixel Endcaps"> <x title="#eta" n="4" lo="1.5" hi="2.5"/> <y title="Cluster Efficiency" lo="0.95" hi="1.02"/> </h> -<h id="eff_hit_vs_eta_sct_barrel" type="TProfile" title="Cluster Efficiency: SCT Barrel"> +<h id="eff_hit_vs_eta_sct_barrel" type="TEfficiency" title="Cluster Efficiency: SCT Barrel"> <x title="#eta" n="7" lo="0" hi="1.75"/> <y title="Cluster Efficiency" lo="0.95" hi="1.02"/> </h> -<h id="eff_hit_vs_eta_sct_endcap" type="TProfile" title="Cluster Efficiency: SCT Endcaps"> +<h id="eff_hit_vs_eta_sct_endcap" type="TEfficiency" title="Cluster Efficiency: SCT Endcaps"> <x title="#eta" n="6" lo="1.0" hi="2.5"/> <y title="Cluster Efficiency" lo="0.95" hi="1.02"/> </h> -<h id="eff_hit_vs_eta_trt_barrel" type="TProfile" title="Cluster Efficiency: TRT Barrel"> +<h id="eff_hit_vs_eta_trt_barrel" type="TEfficiency" title="Cluster Efficiency: TRT Barrel"> <x title="#eta" n="5" lo="0" hi="1.25"/> <y title="Cluster Efficiency" lo="0.95" hi="1.02"/> </h> -<h id="eff_hit_vs_eta_trt_endcap" type="TProfile" title="Cluster Efficiency: TRT Endcaps"> +<h id="eff_hit_vs_eta_trt_endcap" type="TEfficiency" title="Cluster Efficiency: TRT Endcaps"> <x title="#eta" n="6" lo="0.75" hi="2.25"/> <y title="Cluster Efficiency" lo="0.95" hi="1.02"/> </h> @@ -806,15 +806,15 @@ <x title="x residual(#mum)" n="120" lo="-70" hi="70"/> <y title="Entries"/> </h> -<h id="residualx_ibl_barrel" type="TH1F" title="Residual: IBL Barrel X"> +<h id="residualx_l0pix_barrel" type="TH1F" title="Residual: IBL Barrel X"> <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> <y title="Entries"/> </h> -<h id="residualx_ibl_barrel_1hit" type="TH1F" title="Residual: IBL Barrel X 1 hit"> +<h id="residualx_l0pix_barrel_1hit" type="TH1F" title="Residual: IBL Barrel X 1 hit"> <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> <y title="Entries"/> </h> -<h id="residualx_ibl_barrel_2ormorehits" type="TH1F" title="Residual: IBL Barrel X >=2 hits"> +<h id="residualx_l0pix_barrel_2ormorehits" type="TH1F" title="Residual: IBL Barrel X >=2 hits"> <x title="x residual(#mum)" n="120" lo="-50" hi="50"/> <y title="Entries"/> </h> @@ -896,15 +896,15 @@ <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> <y title="Entries"/> </h> -<h id="residualy_ibl_barrel" type="TH1F" title="Residual: IBL Barrel Y"> +<h id="residualy_l0pix_barrel" type="TH1F" title="Residual: IBL Barrel Y"> <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> <y title="Entries"/> </h> -<h id="residualy_ibl_barrel_1hit" type="TH1F" title="Residual: IBL Barrel Y 1 hit"> +<h id="residualy_l0pix_barrel_1hit" type="TH1F" title="Residual: IBL Barrel Y 1 hit"> <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> <y title="Entries"/> </h> -<h id="residualy_ibl_barrel_2ormorehits" type="TH1F" title="Residual: IBL Barrel Y >=2 hits"> +<h id="residualy_l0pix_barrel_2ormorehits" type="TH1F" title="Residual: IBL Barrel Y >=2 hits"> <x title="y residual(#mum)" n="120" lo="-50" hi="50"/> <y title="Entries"/> </h> @@ -963,7 +963,7 @@ </h> <!-- pulls --> <!-- barrel, x --> -<h id="residualpullx_ibl_barrel" type="TH1F" title="Residualpull: B-Layer Barrel X"> +<h id="residualpullx_l0pix_barrel" type="TH1F" title="Residualpull: B-Layer Barrel X"> <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> <y title="Entries"/> </h> @@ -984,7 +984,7 @@ <y title="Entries"/> </h> <!-- endcap, x --> -<h id="residualpullx_ibl_endcap" type="TH1F" title="Residualpull: B-Layer Endcap X"> +<h id="residualpullx_l0pix_endcap" type="TH1F" title="Residualpull: B-Layer Endcap X"> <x title="x residual(#mum)" n="100" lo="-5" hi="5"/> <y title="Entries"/> </h> @@ -1005,7 +1005,7 @@ <y title="Entries"/> </h> <!-- barrel, y --> -<h id="residualpully_ibl_barrel" type="TH1F" title="Residualpull: B-Layer Barrel Y"> +<h id="residualpully_l0pix_barrel" type="TH1F" title="Residualpull: B-Layer Barrel Y"> <x title="y residual(#mum)" n="100" lo="-5" hi="5"/> <y title="Entries"/> </h> @@ -1026,7 +1026,7 @@ <y title="Entries"/> </h> <!-- endcap,y --> -<h id="residualpully_ibl_endcap" type="TH1F" title="Residualpull: B-Layer Endcap Y"> +<h id="residualpully_l0pix_endcap" type="TH1F" title="Residualpull: B-Layer Endcap Y"> <x title="y residual(#mum)" n="100" lo="-5" hi="5"/> <y title="Entries"/> </h> diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/inDetPhysValMonitoringPlotDefinitions.hdef b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/inDetPhysValMonitoringPlotDefinitions.hdef index a48a321999da3e462ff7ef4fd5924124b399dac6..93402e02239b90850c1bbaea30ecf4491b4acce4 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/inDetPhysValMonitoringPlotDefinitions.hdef +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/share/inDetPhysValMonitoringPlotDefinitions.hdef @@ -96,13 +96,13 @@ TProfile trackeff_vs_prodZ "Track Efficiency vs Production Vertex Z" 100 0 2000 TProfile low_Pt_lepton_frac "Fraction of Primary Leptons with Pt below 3 GeV" 100 0 1500 0 2 "prod_R" "Efficiency" default #layer-by-layer efficiencies -TProfile eff_hit_vs_eta_ibl_barrel "Cluster Efficiency: Pixel Barrel IBL" 10 0 2.5 0 2 "#eta" "Cluster Efficiency" default -TProfile eff_hit_vs_eta_pix_barrel "Cluster Efficiency: Pixel Barrel" 10 0 2.5 0 2 "#eta" "Cluster Efficiency" default -TProfile eff_hit_vs_eta_pix_endcap "Cluster Efficiency: Pixel Endcap" 4 1.5 2.5 0 2 "#eta" "Cluster Efficiency" default -TProfile eff_hit_vs_eta_sct_barrel "Cluster Efficiency: SCT Barrel" 7 0 1.75 0 2 "#eta" "Cluster Efficiency" default -TProfile eff_hit_vs_eta_sct_endcap "Cluster Efficiency: SCT Endcap" 6 1 2.5 0 2 "#eta" "Cluster Efficiency" default -TProfile eff_hit_vs_eta_trt_barrel "Cluster Efficiency: TRT Barrel" 5 0 1.25 0 2 "#eta" "Cluster Efficiency" default -TProfile eff_hit_vs_eta_trt_endcap "Cluster Efficiency: TRT Endcap" 6 0.75 2.25 0 2 "#eta" "Cluster Efficiency" default +TEfficiency eff_hit_vs_eta_l0pix_barrel "Cluster Efficiency: Pixel Barrel IBL" 10 0 2.5 0 2 "#eta" "Cluster Efficiency" default +TEfficiency eff_hit_vs_eta_pix_barrel "Cluster Efficiency: Pixel Barrel" 10 0 2.5 0 2 "#eta" "Cluster Efficiency" default +TEfficiency eff_hit_vs_eta_pix_endcap "Cluster Efficiency: Pixel Endcap" 4 1.5 2.5 0 2 "#eta" "Cluster Efficiency" default +TEfficiency eff_hit_vs_eta_sct_barrel "Cluster Efficiency: SCT Barrel" 7 0 1.75 0 2 "#eta" "Cluster Efficiency" default +TEfficiency eff_hit_vs_eta_sct_endcap "Cluster Efficiency: SCT Endcap" 6 1 2.5 0 2 "#eta" "Cluster Efficiency" default +TEfficiency eff_hit_vs_eta_trt_barrel "Cluster Efficiency: TRT Barrel" 5 0 1.25 0 2 "#eta" "Cluster Efficiency" default +TEfficiency eff_hit_vs_eta_trt_endcap "Cluster Efficiency: TRT Endcap" 6 0.75 2.25 0 2 "#eta" "Cluster Efficiency" default #vertices TH1F vx_x "X position of vertex" 200 -1.0 1.0 "X (mm)" "Entries" default @@ -131,6 +131,24 @@ TProfile BadMatchRate_vs_logpt "Fraction of Tracks with < 50.1% TMP vs Log(Pt)" TProfile ReallyFakeRate "Fraction of Tracks with < 50.0% Truth Matching Probability" 20 -2.5 2.5 0 2 "x" "Really Fake Rate" default # +# Dummy Plots +TH2 primary_photon_eta_vs_conversion_radius "Primary Photon #eta vs Conversion Radius" 100 0 1500 20 -2.5 2.5 "Conversion Radius [mm]" "#eta" default +TH2 primary_photon_pt_vs_decay_radius "Primary Photon p_{T} vs Decay Radius" 100 0 1500 100 0 500 "Decay Radius [mm]" "p_{T} (GeV)" default +TH1F primary_photon_pt "Primary Photon p_{T}" 100 0 500 "p_{T} (GeV)" "Entries" default +TH2 brem_photon_eta_vs_radius_of_conversion "Brem Photon #eta vs Radius of Conversion" 100 0 1500 20 -2.5 2.5 "Radius of Conversion [mm]" "#eta" default +TH2 brem_photon_pt_vs_radius_of_origin_of_conversion "Brem Photon p_{T} vs Radius of Origin of Conversion" 100 0 1500 100 0 500 "Radius of Origin of Conversion [mm]" "p_{T} (GeV)" default +TH1F lepton_disappearance_radius "Radius at which electrons and positrons from the primary disappear" 100 0 1500 "Radius of Disappearance [mm]" "Entries" default +TH1F nOut_of_lepdeath "Number of Particles out of the electron/positron endpoint" 6 0 5 "Number of Particles" "Entries" default +TH2 brem_spectrum "log of the Energy of Brem Photons vs Radius of Emission" 100 0 1500 100 -3 3 "Radius of Emission [mm]" "log(Energy (GeV))" default +TH2 energy_remaining "Fraction of electron/positron energy left at ECal vs production radius" 100 0 1500 100 0 1.25 "Radius of Initial Conversion [mm]" "Fraction of Energy Remaining" default +TH2 energy_remaining_vs_eta "Fraction of electron/positron energy left at ECal vs Initial #eta" 20 -2.5 2.5 100 0 1.25 "#eta" "Fraction of Energy Remaining" default +TH2 energy_remaining_vs_prodR_TRT_barrel "Fraction of electron/positron energy left at ECal vs production radius (0 < |#eta| < 0.625)" 100 0 1500 100 0 1.25 "Radius of Initial Conversion [mm]" "Fraction of Energy Remaining" default +TH2 energy_remaining_vs_prodR_type_A_endcap "Fraction of electron/positron energy left at ECal vs production radius (1.070 < |#eta| < 1.304)" 100 0 1500 100 0 1.25 "Radius of Initial Conversion [mm]" "Fraction of Energy Remaining" default +TH2 energy_remaining_vs_prodR_type_A_and_B "Fraction of electron/positron energy left at ECal vs production radius (1.304 < |#eta| < 1.752)" 100 0 1500 100 0 1.25 "Radius of Initial Conversion [mm]" "Fraction of Energy Remaining" default +TH2 energy_remaining_vs_prodR_type_B_endcap "Fraction of electron/positron energy left at ECal vs production radius (1.752 < |#eta| < 2.0)" 100 0 1500 100 0 1.25 "Radius of Initial Conversion [mm]" "Fraction of Energy Remaining" default +TH2 truthMatchProbability_vs_delta_R "Truth Matching Probability of electron/positron vs #DeltaR" 50 0 1.0 100 0 1.0 "#DeltaR" "Truth Matching Probability" default +TH1 minimum_delta_R "Minimum #DeltaR for primary conversions within 100 mm of the origin" 50 0 1.0 "#DeltaR" "Entries" default + # Track Parameter Resolution Plots #Track Parameter TH2s vs eta TH2 res_d0_vs_eta "d_{0}: deviation vs #eta" 20 -2.5 2.5 2000 -1.0 1.0 "#eta" "d_{0}^{rec} - d_{0}^{tru}" default diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AlgTestHistoDefSvc.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AlgTestHistoDefSvc.cxx index 7f4f4eb59ffd12ff670cde1d9e5286365196c05c..ba07d88e2b4432658450f39644b1cf9efbd5d045 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AlgTestHistoDefSvc.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AlgTestHistoDefSvc.cxx @@ -24,7 +24,7 @@ using namespace std; -AlgTestHistoDefSvc::AlgTestHistoDefSvc (const std::string &name, ISvcLocator *pSvcLocator) : AthAlgorithm(name, +AlgTestHistoDefSvc::AlgTestHistoDefSvc (const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator), m_histoDefSvc("HistogramDefinitionSvc", name) { // nop } @@ -65,7 +65,7 @@ AlgTestHistoDefSvc::initialize() { ATH_MSG_INFO("Printing histogram definition for non-existent definition"); definition = m_histoDefSvc->definition("utterRubbish", "").str(); ATH_MSG_INFO(definition); - + return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx index 5eacdc0a167bc42b5be3948dc83d5a1e41ef0bde..6d2a978a342c2ff23ec8c6623963bd1cd6bda1aa 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.cxx @@ -7,7 +7,7 @@ * implementation file for truth selection in this package * @author shaun roe * @date 10 October 2016 -**/ + **/ #include "AthTruthSelectionTool.h" #include "xAODTruth/TruthVertex.h" @@ -15,90 +15,133 @@ #include <vector> #include <cmath> +namespace { + constexpr int electronId(11); + constexpr int gammaId(22); +} -AthTruthSelectionTool::AthTruthSelectionTool(const std::string &type, const std::string &name, - const IInterface *parent) : +AthTruthSelectionTool::AthTruthSelectionTool(const std::string& type, const std::string& name, + const IInterface* parent) : AthAlgTool(type, name, parent), - m_counters{}{ - //declare interface from base class - declareInterface<IAthSelectionTool>(this); - // declareProperty( "Property", m_nProperty ); set defaults - declareProperty("maxEta", m_maxEta = 2.5); - declareProperty("minPt", m_minPt = 400); - declareProperty("maxPt", m_maxPt = -1); - declareProperty("maxBarcode", m_maxBarcode = 200e3); - declareProperty("requireCharged", m_requireCharged = true); - declareProperty("requireStatus1", m_requireStatus1 = true); - declareProperty("maxProdVertRadius", m_maxProdVertRadius = 110.); - declareProperty("pdgId", m_pdgId = -1); - declareProperty("hasNoGrandparent", m_grandparent = false); - -} + m_counters{} { + // declare interface from base class + declareInterface<IAthSelectionTool>(this); + // declareProperty( "Property", m_nProperty ); set defaults + declareProperty("maxEta", m_maxEta = 2.5); + declareProperty("minPt", m_minPt = 400); + declareProperty("maxPt", m_maxPt = -1); + declareProperty("maxBarcode", m_maxBarcode = 200e3); + declareProperty("requireCharged", m_requireCharged = true); + declareProperty("requireStatus1", m_requireStatus1 = true); + declareProperty("maxProdVertRadius", m_maxProdVertRadius = 110.); + declareProperty("pdgId", m_pdgId = -1); + declareProperty("hasNoGrandparent", m_grandparent = false); + declareProperty("poselectronfromgamma", m_poselectronfromgamma = false); +} StatusCode -AthTruthSelectionTool::initialize(){ - //can set cut properties now - typedef xAOD::TruthParticle P_t; +AthTruthSelectionTool::initialize() { + // can set cut properties now + typedef xAOD::TruthParticle P_t; typedef Accept<P_t> Accept_t; typedef Accept_t::func_type F_t; // - const std::vector<Accept_t> filters={ - // if p.pt=0, TVector3 generates an error when querying p.eta(); a limit of 1e-7 was not found to be enough to prevent this - // the following also vetoes the case where the p.pt()=NaN, as any inequality with NaN evaluates to false - Accept_t([this](const P_t &p)->bool{ return ( (p.pt() > 0.1)? (std::abs(p.eta()) < m_maxEta):false );}, std::string("eta")), - Accept_t([this](const P_t &p)->bool{ return (p.pt() > m_minPt);}, std::string("min_pt")), - Accept_t([this](const P_t &p)->bool{ return ((not (p.hasProdVtx())) or (p.prodVtx()->perp() < m_maxProdVertRadius));},"decay_before_"+std::to_string(m_maxProdVertRadius)) + const std::vector<Accept_t> filters = { + // if p.pt=0, TVector3 generates an error when querying p.eta(); a limit of 1e-7 was not found to be enough to + // prevent this + // the following also vetoes the case where the p.pt()=NaN, as any inequality with NaN evaluates to false + Accept_t([this](const P_t& p) -> bool { + return((p.pt() > 0.1) ? (std::abs(p.eta()) < m_maxEta) : false); + }, std::string("eta")), + Accept_t([this](const P_t& p) -> bool { + return(p.pt() > m_minPt); + }, std::string("min_pt")), + Accept_t([this](const P_t& p) -> bool { + return((not (p.hasProdVtx()))or(p.prodVtx()->perp() < m_maxProdVertRadius)); + }, "decay_before_" + std::to_string(m_maxProdVertRadius)) }; // - m_cutFlow=CutFlow<P_t>(filters); - if (m_maxPt > 0) m_cutFlow.add(Accept_t([this](const P_t &p){ return (p.pt() < m_maxPt);}, "max_pt")); - if (m_maxBarcode > -1) m_cutFlow.add(Accept_t([this](const P_t &p){ return (p.barcode() < m_maxBarcode);}, "barcode < "+std::to_string(m_maxBarcode) )); - if (m_requireCharged) m_cutFlow.add(Accept_t([](const P_t &p){ return(not (p.isNeutral()) );},"charged")); - if (m_requireStatus1) m_cutFlow.add(Accept_t([](const P_t &p){ return(p.status()==1);},"status1")); - if (m_pdgId > 0) m_cutFlow.add(Accept_t([this](const P_t &p){ return (std::abs(p.pdgId())==m_pdgId);},"pdgId")); - if (m_grandparent) m_cutFlow.add(Accept_t([](const P_t &p){ return ((p.nParents() == 0) || ( (p.nParents() == 1) and ((p.parent(0))->nParents() == 0)) ); }, "hasNoGrandparent")); - m_counters=std::vector<unsigned int>(m_cutFlow.size(),0); - std::string msg=std::to_string(m_cutFlow.size())+" truth acceptance cuts are used:\n"; - for (const auto & i:m_cutFlow.names()){ - msg+=i+"\n"; + m_cutFlow = CutFlow<P_t>(filters); + if (m_maxPt > 0) { + m_cutFlow.add(Accept_t([this](const P_t& p) { + return(p.pt() < m_maxPt); + }, "max_pt")); + } + if (m_maxBarcode > -1) { + m_cutFlow.add(Accept_t([this](const P_t& p) { + return(p.barcode() < m_maxBarcode); + }, "barcode < " + std::to_string(m_maxBarcode))); + } + if (m_requireCharged) { + m_cutFlow.add(Accept_t([](const P_t& p) { + return(not (p.isNeutral())); + }, "charged")); + } + if (m_requireStatus1) { + m_cutFlow.add(Accept_t([](const P_t& p) { + return(p.status() == 1); + }, "status1")); + } + if (m_pdgId > 0) { + m_cutFlow.add(Accept_t([this](const P_t& p) { + return(std::abs(p.pdgId()) == m_pdgId); + }, "pdgId")); + } + if (m_grandparent) { + m_cutFlow.add(Accept_t([](const P_t& p) { + return((p.nParents() == 0) || ((p.nParents() == 1)and((p.parent(0))->nParents() == 0))); + }, "hasNoGrandparent")); + } + if (m_poselectronfromgamma) { + m_cutFlow.add(Accept_t([](const P_t& p) { + return((p.absPdgId() == electronId)and(p.nParents() >= 1) and(p.parent(0)) and(p.parent(0)->pdgId() == gammaId)); + }, "poselectronfromgamma")); + } + m_counters = std::vector<unsigned int>(m_cutFlow.size(), 0); + std::string msg = std::to_string(m_cutFlow.size()) + " truth acceptance cuts are used:\n"; + for (const auto& i:m_cutFlow.names()) { + msg += i + "\n"; } ATH_MSG_INFO(msg); clearCounters(); - + return StatusCode::SUCCESS; } StatusCode -AthTruthSelectionTool::finalize(){ - //nop +AthTruthSelectionTool::finalize() { + // nop return StatusCode::SUCCESS; } void -AthTruthSelectionTool::clearCounters(){ +AthTruthSelectionTool::clearCounters() { m_cutFlow.clear(); - m_counters=m_cutFlow.counters(); + m_counters = m_cutFlow.counters(); } -std::vector<unsigned int> +std::vector<unsigned int> AthTruthSelectionTool::counters() const { return m_cutFlow.counters(); } -std::vector<std::string> +std::vector<std::string> AthTruthSelectionTool::names() const { return m_cutFlow.names(); } bool -AthTruthSelectionTool::accept(const xAOD::IParticle *particle){ - const xAOD::TruthParticle * pTruth= dynamic_cast<const xAOD::TruthParticle*>(particle); - if (not pTruth) return false; +AthTruthSelectionTool::accept(const xAOD::IParticle* particle) { + const xAOD::TruthParticle* pTruth = dynamic_cast<const xAOD::TruthParticle*>(particle); + + if (not pTruth) { + return false; + } return m_cutFlow.accept(*pTruth); } std::string -AthTruthSelectionTool::str() const{ +AthTruthSelectionTool::str() const { return m_cutFlow.report(); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.h index 94449e128479768a33a6499511b8e8b05bfc19da..5ee6e6eb5edf41f10f75d106a702c7ff9f0336df 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/AthTruthSelectionTool.h @@ -10,12 +10,12 @@ * header file for truth selection in this package * @author shaun roe * @date 10 October 2016 -**/ + **/ // STL includes #include <string> #include "InDetPhysValMonitoring/IAthSelectionTool.h" -#include "xAODTruth/TruthParticle.h" //typedef, can't fwd declare +#include "xAODTruth/TruthParticle.h" // typedef, can't fwd declare #include "AthenaBaseComps/AthAlgTool.h" #include "CutFlow.h" @@ -24,13 +24,13 @@ /// class to apply selection to xAOD::TruthParticles,required by validation class AthTruthSelectionTool: virtual public IAthSelectionTool, public AthAlgTool { public: - AthTruthSelectionTool(const std::string &type, const std::string &name, const IInterface *parent); + AthTruthSelectionTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~AthTruthSelectionTool () { /*nop*/ }; StatusCode initialize() final; StatusCode finalize() final; - bool accept(const xAOD::IParticle *particle) final; + bool accept(const xAOD::IParticle* particle) final; void clearCounters() final; std::vector<unsigned int> counters() const final; std::vector<std::string> names() const final; @@ -38,17 +38,18 @@ public: private: CutFlow<xAOD::TruthParticle> m_cutFlow; // Cut values; - float m_maxEta; - float m_maxPt; - float m_minPt; - int m_maxBarcode; - bool m_requireCharged; - bool m_requireStatus1; + float m_maxEta; + float m_maxPt; + float m_minPt; + int m_maxBarcode; + bool m_requireCharged; + bool m_requireStatus1; // max decay radius for secondaries [mm]; // set to within (Run2) pixel by default double m_maxProdVertRadius; - int m_pdgId; - bool m_grandparent; + int m_pdgId; + bool m_grandparent; + bool m_poselectronfromgamma; std::vector<unsigned int> m_counters; }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CachedGetAssocTruth.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CachedGetAssocTruth.cxx index 54c33754714c6bddaf0b1d570b070ea2240322fa..f4f77ac6979c379d5f8648af24792507f95b82c6 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CachedGetAssocTruth.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CachedGetAssocTruth.cxx @@ -7,42 +7,45 @@ * @author shaun roe * @date 11 October 2016 **/ - + #include "CachedGetAssocTruth.h" #include "xAODTruth/TruthParticleContainer.h" - -namespace IDPVM{ - CachedGetAssocTruth::CachedGetAssocTruth():m_cache{}{ + +namespace IDPVM { + CachedGetAssocTruth::CachedGetAssocTruth() : m_cache{} { #ifndef NDEBUG - m_nCalls=0; m_nCacheHits=0; + m_nCalls = 0; + m_nCacheHits = 0; #endif - //nop + // nop } - + void - CachedGetAssocTruth::clear(){ + CachedGetAssocTruth::clear() { #ifndef NDEBUG - m_nCalls=0; - m_nCacheHits=0; + m_nCalls = 0; + m_nCacheHits = 0; #endif m_cache.clear(); } - - const xAOD::TruthParticle * - CachedGetAssocTruth::getTruth(const xAOD::TrackParticle * trackParticle){ + + const xAOD::TruthParticle* + CachedGetAssocTruth::getTruth(const xAOD::TrackParticle* trackParticle) { #ifndef NDEBUG - m_nCalls++; + m_nCalls++; #endif - if (not trackParticle) return nullptr; + if (not trackParticle) { + return nullptr; + } auto pCache = m_cache.find(trackParticle); - if (pCache!=m_cache.end()){ + if (pCache != m_cache.end()) { #ifndef NDEBUG - m_nCacheHits++; + m_nCacheHits++; #endif return pCache->second; } typedef ElementLink<xAOD::TruthParticleContainer> ElementTruthLink_t; - const xAOD::TruthParticle *result(nullptr); + const xAOD::TruthParticle* result(nullptr); // 0. is there any truth? if (trackParticle->isAvailable<ElementTruthLink_t>("truthParticleLink")) { // 1. ..then get link @@ -51,25 +54,23 @@ namespace IDPVM{ result = *ptruthContainer; } } - m_cache[trackParticle]=result; + m_cache[trackParticle] = result; return result; } - - const xAOD::TruthParticle * - CachedGetAssocTruth::operator()(const xAOD::TrackParticle * trackParticle){ + + const xAOD::TruthParticle* + CachedGetAssocTruth::operator () (const xAOD::TrackParticle* trackParticle) { return getTruth(trackParticle); } - + std::string - CachedGetAssocTruth::report() const{ + CachedGetAssocTruth::report() const { std::string op("No cache report from 'CachedGetAssocTruth' is available in OPT builds."); #ifndef NDEBUG - op="\nCache report\nNum. calls = "+std::to_string(m_nCalls); - op+="\nNum. cache hits = "+std::to_string(m_nCacheHits); - op+="\nCache size = "+std::to_string(m_cache.size()); + op = "\nCache report\nNum. calls = " + std::to_string(m_nCalls); + op += "\nNum. cache hits = " + std::to_string(m_nCacheHits); + op += "\nCache size = " + std::to_string(m_cache.size()); #endif return op; } - - } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CachedGetAssocTruth.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CachedGetAssocTruth.h index 08fec264cd9260512e285897f941447b4bfc69ed..d69c64230ea05291293733c37445e635832a9e9a 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CachedGetAssocTruth.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CachedGetAssocTruth.h @@ -10,42 +10,37 @@ * @author shaun roe * @date 11 October 2016 **/ - -//#include <map> + +// #include <map> #include <unordered_map> #include <string> #include "xAODTruth/TruthParticle.h" #include "xAODTracking/TrackParticle.h" ///Class to retrieve associated truth from a track, implementing a cached response -namespace IDPVM{ - class CachedGetAssocTruth{ +namespace IDPVM { + class CachedGetAssocTruth { public: CachedGetAssocTruth(); ///copy and assignment are not possible - CachedGetAssocTruth & operator=(const CachedGetAssocTruth &) =delete; - CachedGetAssocTruth(const CachedGetAssocTruth &) =delete; + CachedGetAssocTruth& operator = (const CachedGetAssocTruth&) = delete; + CachedGetAssocTruth(const CachedGetAssocTruth&) = delete; ///clear the cache void clear(); ///Get the associated truth particle, given a track particle - const xAOD::TruthParticle * operator()(const xAOD::TrackParticle * trackParticle); - const xAOD::TruthParticle * getTruth(const xAOD::TrackParticle * const trackParticle); + const xAOD::TruthParticle* operator () (const xAOD::TrackParticle* trackParticle); + const xAOD::TruthParticle* getTruth(const xAOD::TrackParticle* const trackParticle); ///Report statistics std::string report() const; - - private: ///private cache container; map or unordered_map could be used - std::unordered_map<const xAOD::TrackParticle *, const xAOD::TruthParticle *> m_cache; + std::unordered_map<const xAOD::TrackParticle*, const xAOD::TruthParticle*> m_cache; #ifndef NDEBUG - ///number of calls - unsigned int m_nCalls; - ///number of cache hits - unsigned int m_nCacheHits; + ///number of calls + unsigned int m_nCalls; + ///number of cache hits + unsigned int m_nCacheHits; #endif - }; -}//end of namespace +}// end of namespace #endif - - \ No newline at end of file diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CutFlow.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CutFlow.h index b7010de57f2d86d928a196148e66e1748d137c16..3517e8270f9b222b6859fb493f0d8cdd07b4b472 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CutFlow.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/CutFlow.h @@ -15,53 +15,79 @@ /** Templated class containing a cut, name of cut and description of cut(optional) - * Typically, the class will be templated on <xAOD::TruthParticle> or <xAOD::TrackParticle>. - * The cut is passed in as any predicate function, the type is declared as function<bool(A)> - * although typically these will be lambda functions. - * The cut is an 'accept' cut, i.e. the value passes if it is true. - * These predicate functions are called each time the 'pass' method is called. - * The class keeps an internal count of how many values passed, and may be used - * as a functional due to the overloaded () operator. - */ + * Typically, the class will be templated on <xAOD::TruthParticle> or <xAOD::TrackParticle>. + * The cut is passed in as any predicate function, the type is declared as function<bool(A)> + * although typically these will be lambda functions. + * The cut is an 'accept' cut, i.e. the value passes if it is true. + * These predicate functions are called each time the 'pass' method is called. + * The class keeps an internal count of how many values passed, and may be used + * as a functional due to the overloaded () operator. + */ template<class A> -class Accept{ +class Accept { public: ///Default constructor with a simple predicate returning false - Accept():m_predicate([](A){return false;}),m_name{},m_desc{},m_nPassed(0){ - //nop + Accept() : m_predicate([](A) { + return false; + }), m_name {}, m_desc {}, m_nPassed(0) { + // nop } /** @brief Normal constructor - * @param predicate any function taking the templated value and returning a bool - * @param name optional name for this cut - * @param description optional description for this cut - */ - Accept(const std::function<bool(const A &)> & predicate, const std::string & name="", const std::string & description=""):m_predicate(predicate), m_name(name),m_desc(description),m_nPassed(0){ - //nop + * @param predicate any function taking the templated value and returning a bool + * @param name optional name for this cut + * @param description optional description for this cut + */ + Accept(const std::function<bool(const A&)>& predicate, const std::string& name = "", + const std::string& description = "") : m_predicate(predicate), m_name(name), m_desc(description), + m_nPassed(0) { + // nop } + ///Overloading the () operator allows the class to be used as a functional - bool operator()(const A & i) { - return pass(i); + bool + operator () (const A& i) { + return pass(i); } + ///Apply the predicate function and return the value, also updating an internal counter - bool pass(const A & i) { - const bool passed=m_predicate(i); - m_nPassed+=(int)passed; - return passed; + bool + pass(const A& i) { + const bool passed = m_predicate(i); + + m_nPassed += (int) passed; + return passed; } + ///Clear internal counter - void clearCount(){ m_nPassed=0;} + void + clearCount() { + m_nPassed = 0; + } + ///Return internal counter - unsigned int getCount() const { return m_nPassed;} + unsigned int + getCount() const { + return m_nPassed; + } + ///Return cut name - std::string name() const { return m_name;} + std::string + name() const { + return m_name; + } + ///Return cut description - std::string description() const { return m_desc;} + std::string + description() const { + return m_desc; + } + ///Utility typedefs to help callers: the value type typedef A value_type; ///Utility typedefs to help callers: the function type - typedef const std::function<bool(const A &)> func_type; + typedef const std::function<bool (const A&)> func_type; private: - //std::function<bool(A)> m_predicate; + // std::function<bool(A)> m_predicate; func_type m_predicate; std::string m_name; std::string m_desc; @@ -69,114 +95,139 @@ private: }; /** Templated CutFlow class to contain a group of cuts. - * The CutFlow is typically instantiated with a vector of Accept objects, although - * additional cuts may be added with the 'add' method. - * Cuts may be applied in one of two ways, determined by the 'mode' parameter: - * ALL: Always apply every cut - * UNTIL_FAIL: Apply cuts until the first one fails - * The 'accept' method applies the cuts and keeps internal count of how many times it is called. - */ + * The CutFlow is typically instantiated with a vector of Accept objects, although + * additional cuts may be added with the 'add' method. + * Cuts may be applied in one of two ways, determined by the 'mode' parameter: + * ALL: Always apply every cut + * UNTIL_FAIL: Apply cuts until the first one fails + * The 'accept' method applies the cuts and keeps internal count of how many times it is called. + */ template<class A> -class CutFlow{ +class CutFlow { public: ///Cut mode: Apply ALL cuts, or until the first failure - enum CutFlowMode{ALL,UNTIL_FAIL}; + enum CutFlowMode { + ALL, UNTIL_FAIL + }; ///Normal constructor takes a vector<Accept>. Note default mode is 'ALL'. - CutFlow(const std::vector<Accept<A> > & cuts):m_cuts(cuts),m_mode(ALL), - m_passed(0), m_processed(0){ - //nop + CutFlow(const std::vector<Accept<A> >& cuts) : m_cuts(cuts), m_mode(ALL), + m_passed(0), m_processed(0) { + // nop } + ///Default constructor with no cuts implemented - CutFlow():m_cuts{},m_mode(ALL),m_passed(0),m_processed(0){ - //nop + CutFlow() : m_cuts{}, m_mode(ALL), m_passed(0), m_processed(0) { + // nop } + ///Add one cut - void - add(const Accept<A> & newCut){ + void + add(const Accept<A>& newCut) { m_cuts.push_back(newCut); } + ///Clear internal counters - void - clear(){ - m_processed=0; - m_passed=0; - for (auto & i:m_cuts) i.clearCount(); + void + clear() { + m_processed = 0; + m_passed = 0; + for (auto& i:m_cuts) { + i.clearCount(); + } } + ///set the accept mode according to the CutFlowMode - void - setMode(const CutFlowMode m){ - m_mode=m; + void + setMode(const CutFlowMode m) { + m_mode = m; } + ///get the accept mode - CutFlowMode getMode() const{ - return m_mode; + CutFlowMode + getMode() const { + return m_mode; } + ///Apply cuts and return the boolean result; keep count of number of calls and passes - bool - accept(const A & value){ - bool result(true); - if (m_mode==ALL){ - for (auto &thisCut:m_cuts){ - const bool passed=thisCut.pass(value); - result &= passed; - } - } else { - for (auto &thisCut:m_cuts){ - const bool passed=thisCut.pass(value); - if (not passed){ - result=false; - break; - } } + bool + accept(const A& value) { + bool result(true); + + if (m_mode == ALL) { + for (auto& thisCut:m_cuts) { + const bool passed = thisCut.pass(value); + result &= passed; + } + } else { + for (auto& thisCut:m_cuts) { + const bool passed = thisCut.pass(value); + if (not passed) { + result = false; + break; + } } - m_processed++; - m_passed+=(int) result; - return result; + } + m_processed++; + m_passed += (int) result; + return result; } + ///Return the number of cuts unsigned int - size() const{ return m_cuts.size(); } + size() const { + return m_cuts.size(); + } + ///Return the number of times the 'accept' method was called - unsigned int - nProcessed() const {return m_processed;} + unsigned int + nProcessed() const { + return m_processed; + } + ///Returnn the number of values which passed all cuts - unsigned int - nPassed() const {return m_passed;} + unsigned int + nPassed() const { + return m_passed; + } + ///Return a vector of individual counters for each cut std::vector<unsigned int> - counters() const{ - std::vector<unsigned int> result(m_cuts.size(),0); + counters() const { + std::vector<unsigned int> result(m_cuts.size(), 0); unsigned int idx(0); - for (const auto & i:m_cuts){ - result[idx++]=i.getCount(); + for (const auto& i:m_cuts) { + result[idx++] = i.getCount(); } - return result; //return-value-optimisation is invoked + return result; // return-value-optimisation is invoked } + ///Return a vector of the cut names std::vector<std::string> - names() const{ + names() const { std::vector<std::string> result(m_cuts.size()); unsigned int idx(0); - for (const auto &i:m_cuts){ - result[idx++]=i.name(); + for (const auto& i:m_cuts) { + result[idx++] = i.name(); } - return result; //return-value-optimisation is invoked + return result; // return-value-optimisation is invoked } + ///Produce a formatted string report of the results - std::string + std::string report() const { - std::string op="\nCutFlow Report; Total processed: "+std::to_string(m_processed); - op+="\nTotal passed: "+std::to_string(m_passed); - std::string modeString=(m_mode==ALL)?"\nAll cuts were applied\n":"\nCuts were applied until one fails\n"; - op+=modeString; - for (const auto & thisCut:m_cuts){ - op+=thisCut.name()+": "+std::to_string(thisCut.getCount())+" passed\n"; - } - return op; + std::string op = "\nCutFlow Report; Total processed: " + std::to_string(m_processed); + op += "\nTotal passed: " + std::to_string(m_passed); + std::string modeString = (m_mode == ALL) ? "\nAll cuts were applied\n" : "\nCuts were applied until one fails\n"; + op += modeString; + for (const auto& thisCut:m_cuts) { + op += thisCut.name() + ": " + std::to_string(thisCut.getCount()) + " passed\n"; + } + return op; } + private: - std::vector<Accept<A>> m_cuts; - CutFlowMode m_mode; - unsigned int m_passed; - unsigned int m_processed; + std::vector<Accept<A> > m_cuts; + CutFlowMode m_mode; + unsigned int m_passed; + unsigned int m_processed; }; - diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/DummyTrackSlimmingTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/DummyTrackSlimmingTool.cxx index 90dfcbc4d2d120af81e3632224f115ecdf97cdff..6d77eb82c209fbf1abeae9a9dd9d30f0ec8726f7 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/DummyTrackSlimmingTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/DummyTrackSlimmingTool.cxx @@ -5,7 +5,7 @@ #include "DummyTrackSlimmingTool.h" #include "TrkTrack/Track.h" -DummyTrackSlimmingTool::DummyTrackSlimmingTool(const std::string &type, const std::string &name, const IInterface *p) +DummyTrackSlimmingTool::DummyTrackSlimmingTool(const std::string& type, const std::string& name, const IInterface* p) : AthAlgTool(type, name, p) { declareInterface<Trk::ITrackSlimmingTool>(this); } @@ -16,7 +16,7 @@ DummyTrackSlimmingTool::DummyTrackSlimmingTool(const std::string &type, const st @return A 'slimmed' version of 'track', where exactly what information is copied depends on how the tool is configured */ -Trk::Track * -DummyTrackSlimmingTool::slim(const Trk::Track &track) { +Trk::Track* +DummyTrackSlimmingTool::slim(const Trk::Track& track) { return new Trk::Track(track); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/DummyTrackSlimmingTool.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/DummyTrackSlimmingTool.h index 1b6f665c1a680083c56246a2d2f026b3d4c57378..61245643040186f434067c293c54a21d6a11ccca 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/DummyTrackSlimmingTool.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/DummyTrackSlimmingTool.h @@ -12,7 +12,7 @@ class DummyTrackSlimmingTool: virtual public Trk::ITrackSlimmingTool, public AthAlgTool { public: - DummyTrackSlimmingTool(const std::string &, const std::string &, const IInterface *); + DummyTrackSlimmingTool(const std::string&, const std::string&, const IInterface*); /** default destructor */ virtual ~DummyTrackSlimmingTool () { } @@ -35,7 +35,7 @@ public: @return A 'slimmed' version of 'track', where exactly what information is copied depends on how the tool is configured */ - Trk::Track *slim(const Trk::Track &track); + Trk::Track* slim(const Trk::Track& track); private: }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ErrorHandler.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ErrorHandler.h index e53bf722bd6892c5c153c1d55fa7bab9d6ba0f58..b2218a428cefd37b8226297205ca0416ef53856b 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ErrorHandler.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ErrorHandler.h @@ -13,17 +13,17 @@ class XmlErrorHandler: public xercesc::DefaultHandler { public: void - warning(const xercesc::SAXParseException &e) { + warning(const xercesc::SAXParseException& e) { std::cout << "warning: " << toNative(e.getMessage()) << std::endl; } void - error(const xercesc::SAXParseException &e) { + error(const xercesc::SAXParseException& e) { throw std::runtime_error(toNative(e.getMessage())); } void - fatalError(const xercesc::SAXParseException &e) { + fatalError(const xercesc::SAXParseException& e) { error(e); } }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/HistogramDefinitionSvc.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/HistogramDefinitionSvc.cxx index 38e0af5c8efc8ef260e43e15a74f859c770cd259..0facf58b02cac6f0dbc18bf68f754ebbf4944f4c 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/HistogramDefinitionSvc.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/HistogramDefinitionSvc.cxx @@ -22,7 +22,7 @@ namespace { } -HistogramDefinitionSvc::HistogramDefinitionSvc(const std::string &name, ISvcLocator *pSvcLocator) : +HistogramDefinitionSvc::HistogramDefinitionSvc(const std::string& name, ISvcLocator* pSvcLocator) : AthService(name, pSvcLocator), m_format{UNKNOWN}, m_reader{} { declareProperty("DefinitionSource", m_source); declareProperty("DefinitionFormat", m_formatString = "text/plain"); @@ -59,16 +59,18 @@ HistogramDefinitionSvc::initialize() { } ok = m_reader->histoDefinitionMap(m_histoDefMap); bool allDefsOk(true); - for (auto &h:m_histoDefMap) { + for (auto& h:m_histoDefMap) { if (not h.second.isValid()) { ATH_MSG_WARNING("Invalid histogram definition: " << h.second.str()); allDefsOk = false; } } if (ok and(not allDefsOk)) { + ATH_MSG_WARNING("Some histogram definitions were bad."); return StatusCode::RECOVERABLE; } if (not ok) { + ATH_MSG_ERROR("The definition reader failed to read the histogram definitions."); return StatusCode::FAILURE; } return StatusCode::SUCCESS; @@ -81,7 +83,7 @@ HistogramDefinitionSvc::finalize() { } SingleHistogramDefinition -HistogramDefinitionSvc::definition(const std::string &name, const std::string &dirName) const { +HistogramDefinitionSvc::definition(const std::string& name, const std::string& dirName) const { SingleHistogramDefinition result; const auto pthisHistoPair(m_histoDefMap.find(SingleHistogramDefinition::stringIndex(name, dirName))); @@ -92,7 +94,7 @@ HistogramDefinitionSvc::definition(const std::string &name, const std::string &d } std::string -HistogramDefinitionSvc::histoType(const std::string &name, const std::string &dirName) const { +HistogramDefinitionSvc::histoType(const std::string& name, const std::string& dirName) const { std::string result {}; const auto pthisHistoPair(m_histoDefMap.find(SingleHistogramDefinition::stringIndex(name, dirName))); @@ -103,7 +105,7 @@ HistogramDefinitionSvc::histoType(const std::string &name, const std::string &di } std::string -HistogramDefinitionSvc::title(const std::string &name, const std::string &dirName) const { +HistogramDefinitionSvc::title(const std::string& name, const std::string& dirName) const { std::string result {}; const auto pthisHistoPair(m_histoDefMap.find(SingleHistogramDefinition::stringIndex(name, dirName))); @@ -114,7 +116,7 @@ HistogramDefinitionSvc::title(const std::string &name, const std::string &dirNam } unsigned int -HistogramDefinitionSvc::nBinsX(const std::string &name, const std::string &dirName) const { +HistogramDefinitionSvc::nBinsX(const std::string& name, const std::string& dirName) const { unsigned int nbins(0); const auto pthisHistoPair(m_histoDefMap.find(SingleHistogramDefinition::stringIndex(name, dirName))); @@ -125,7 +127,7 @@ HistogramDefinitionSvc::nBinsX(const std::string &name, const std::string &dirNa } unsigned int -HistogramDefinitionSvc::nBinsY(const std::string &name, const std::string &dirName) const { +HistogramDefinitionSvc::nBinsY(const std::string& name, const std::string& dirName) const { unsigned int nbins(0); const auto pthisHistoPair(m_histoDefMap.find(SingleHistogramDefinition::stringIndex(name, dirName))); @@ -136,7 +138,7 @@ HistogramDefinitionSvc::nBinsY(const std::string &name, const std::string &dirNa } IHistogramDefinitionSvc::axesLimits_t -HistogramDefinitionSvc::xLimits(const std::string &name, const std::string &dirName) const { +HistogramDefinitionSvc::xLimits(const std::string& name, const std::string& dirName) const { axesLimits_t result(invalidLimits); const auto pthisHistoPair(m_histoDefMap.find(SingleHistogramDefinition::stringIndex(name, dirName))); @@ -147,7 +149,7 @@ HistogramDefinitionSvc::xLimits(const std::string &name, const std::string &dirN } IHistogramDefinitionSvc::axesLimits_t -HistogramDefinitionSvc::yLimits(const std::string &name, const std::string &dirName) const { +HistogramDefinitionSvc::yLimits(const std::string& name, const std::string& dirName) const { axesLimits_t result(invalidLimits); const auto pthisHistoPair(m_histoDefMap.find(SingleHistogramDefinition::stringIndex(name, dirName))); @@ -158,7 +160,7 @@ HistogramDefinitionSvc::yLimits(const std::string &name, const std::string &dirN } std::string -HistogramDefinitionSvc::xTitle(const std::string &name, const std::string &dirName) const { +HistogramDefinitionSvc::xTitle(const std::string& name, const std::string& dirName) const { std::string result {}; const auto pthisHistoPair(m_histoDefMap.find(SingleHistogramDefinition::stringIndex(name, dirName))); @@ -169,10 +171,9 @@ HistogramDefinitionSvc::xTitle(const std::string &name, const std::string &dirNa } std::string -HistogramDefinitionSvc::yTitle(const std::string &name, const std::string &dirName) const { +HistogramDefinitionSvc::yTitle(const std::string& name, const std::string& dirName) const { std::string result {}; const auto pthisHistoPair(m_histoDefMap.find(SingleHistogramDefinition::stringIndex(name, dirName))); - if (pthisHistoPair != m_histoDefMap.end()) { result = pthisHistoPair->second.yTitle; } @@ -190,11 +191,11 @@ HistogramDefinitionSvc::formatOk() { } StatusCode -HistogramDefinitionSvc::queryInterface(const InterfaceID &riid, void * *ppvInterface) { +HistogramDefinitionSvc::queryInterface(const InterfaceID& riid, void** ppvInterface) { if (IIncidentListener::interfaceID().versionMatch(riid)) { - *ppvInterface = dynamic_cast<IIncidentListener *>(this); + *ppvInterface = dynamic_cast<IIncidentListener*>(this); } else if (IHistogramDefinitionSvc::interfaceID().versionMatch(riid)) { - *ppvInterface = dynamic_cast<IHistogramDefinitionSvc *>(this); + *ppvInterface = dynamic_cast<IHistogramDefinitionSvc*>(this); } else { // Interface is not directly available : try out a base class return AthService::queryInterface(riid, ppvInterface); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/IReadHistoDef.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/IReadHistoDef.h index 2c5dfcaddee1ecf19c15ba6a37af70cd2f129d0a..a547a2018d6e0a8f483c7e2ef5d0983344cfc6c3 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/IReadHistoDef.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/IReadHistoDef.h @@ -19,11 +19,11 @@ public: }; virtual std::string source() const = 0; virtual std::string format() const = 0; - virtual bool histoDefinitionMap(std::map<std::string, SingleHistogramDefinition> &usersMap) const = 0; + virtual bool histoDefinitionMap(std::map<std::string, SingleHistogramDefinition>& usersMap) const = 0; virtual bool initialize() = 0; virtual bool sourceExists() const = 0; private: - virtual bool insertDefinition(const SingleHistogramDefinition &oneDefinition) = 0; + virtual bool insertDefinition(const SingleHistogramDefinition& oneDefinition) = 0; std::map<std::string, SingleHistogramDefinition> m_histoDefinitionMap; }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetBasicPlot.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetBasicPlot.cxx index 069f551367cdc93b6a3c924f7b7cd54e1191f0ff..59e2bfd26e6a9d824bee8782053f3e96cdbd8b36 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetBasicPlot.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetBasicPlot.cxx @@ -7,16 +7,24 @@ * @author shaun roe **/ -#include "InDetBasicPlot.h" +#include "InDetPhysValMonitoringUtilities.h" + +#include "InDetBasicPlot.h" +#include <cmath> +using namespace IDPVM; -InDetBasicPlot::InDetBasicPlot(InDetPlotBase *pParent, const std::string &sDir) : +InDetBasicPlot::InDetBasicPlot(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase(pParent, sDir), - m_paramNames{"d0", "z0", "phi", "theta", "eta", "qOverP"}, + m_paramNames{"d0", "z0", "phi", "theta", "eta", "qOverP", "pt"}, m_truthParamNames{"z0st", "prodR", "prodZ"}, m_basicTruthPlots{nullptr}, m_extraTruthPlots{nullptr}, m_basicTrackPlots{nullptr}, + m_basic_pt_vs_eta(nullptr), + m_basic_phi_vs_eta(nullptr), + m_truth_pt_vs_eta(nullptr), + m_truth_phi_vs_eta(nullptr), m_d0IsExactlyZeroInTrackCounter(0), m_d0IsExactlyZeroInTruthCounter(0), m_numCallsToFillTruth(0), @@ -29,57 +37,65 @@ InDetBasicPlot::initializePlots() { const std::string prefix("basic"); const std::string truthPrefix("truth"); - for (const auto &p:m_paramNames) { + for (const auto& p:m_paramNames) { const std::string particleHistoId = prefix + p; const std::string truthHistoId = truthPrefix + p; book(m_basicTruthPlots[i], truthHistoId); book(m_basicTrackPlots[i], particleHistoId); ++i; } + book(m_basic_pt_vs_eta, prefix + "_pt_vs_eta"); + book(m_basic_phi_vs_eta, prefix + "_phi_vs_eta"); i = 0; - for (const auto &p:m_truthParamNames) { + for (const auto& p:m_truthParamNames) { const std::string truthHistoId = truthPrefix + p; book(m_extraTruthPlots[i], truthHistoId); ++i; } + book(m_truth_pt_vs_eta, truthPrefix + "_pt_vs_eta"); + book(m_truth_phi_vs_eta, truthPrefix + "_phi_vs_eta"); } void -InDetBasicPlot::fill(const xAOD::TruthParticle &particle) { - static const std::array<bool,NPARAMS> available{ - particle.isAvailable<float>("d0"), - particle.isAvailable<float>("z0"), - particle.isAvailable<float>("phi"), - particle.isAvailable<float>("theta"), - particle.isAvailable<float>("eta"), - particle.isAvailable<float>("qOverP") - }; - unsigned int i(0); - +InDetBasicPlot::fill(const xAOD::TruthParticle& particle) { ++m_numCallsToFillTruth; + float truthPartParams[NPARAMS]; + // initalize values with NaN + std::fill_n(truthPartParams, NPARAMS, std::numeric_limits<float>::quiet_NaN()); + // quantities with xAOD::TruthParticle accessors: + truthPartParams[PHI] = particle.phi(); + truthPartParams[ETA] = particle.eta(); + truthPartParams[PT] = particle.pt() * 1_GeV; + // quantities that do not have accesors & histograms unsigned int idx(0); - for (const auto &p:m_paramNames) { - if (available[idx++]) { - const auto thisParameterValue = particle.auxdata< float >(p); - if ((i == 0) and thisParameterValue == 0.) { - ++m_d0IsExactlyZeroInTruthCounter; + for (const auto& p:m_paramNames) { + // fill only values that are at initial values (were not yet filled via accessors) + if (std::isnan(truthPartParams[idx]) && particle.isAvailable<float>(p)) { + float pVal = particle.auxdata< float >(p); + if (0 == idx && 0. == pVal) { + ++m_d0IsExactlyZeroInTrackCounter; } - fillHisto(m_basicTruthPlots[i],thisParameterValue); + truthPartParams[idx] = pVal; } - ++i; + fillHisto(m_basicTruthPlots[idx], truthPartParams[idx]); + ++idx; } - i = 0; - for (const auto &p:m_truthParamNames) { + // extra truth-only parameters + idx = 0; + for (const auto& p:m_truthParamNames) { if (particle.isAvailable<float>(p)) { const auto thisParameterValue = particle.auxdata< float >(p); - fillHisto(m_extraTruthPlots[i],thisParameterValue); + fillHisto(m_extraTruthPlots[idx], thisParameterValue); } - ++i; + ++idx; } + // 2D histograms + fillHisto(m_truth_pt_vs_eta, truthPartParams[PT], truthPartParams[ETA]); + fillHisto(m_truth_phi_vs_eta, truthPartParams[PHI], truthPartParams[ETA]); } void -InDetBasicPlot::fill(const xAOD::TrackParticle &particle) { +InDetBasicPlot::fill(const xAOD::TrackParticle& particle) { ++m_numCallsToFillTrack; float trkParticleParams[NPARAMS]; trkParticleParams[D0] = particle.d0(); @@ -91,18 +107,21 @@ InDetBasicPlot::fill(const xAOD::TrackParticle &particle) { trkParticleParams[THETA] = particle.theta(); trkParticleParams[ETA] = particle.eta(); trkParticleParams[QOVERP] = particle.qOverP(); + trkParticleParams[PT] = particle.pt() * 1_GeV; for (unsigned int i(0); i < NPARAMS; ++i) { - const auto &thisParameterValue = trkParticleParams[i]; - fillHisto(m_basicTrackPlots[i],thisParameterValue); + const auto& thisParameterValue = trkParticleParams[i]; + fillHisto(m_basicTrackPlots[i], thisParameterValue); } + fillHisto(m_basic_pt_vs_eta, trkParticleParams[PT], trkParticleParams[ETA]); + fillHisto(m_basic_phi_vs_eta, trkParticleParams[PHI], trkParticleParams[ETA]); } void InDetBasicPlot::finalizePlots() { ATH_MSG_DEBUG( "Number of exact zero values for d0 in tracks: " << m_d0IsExactlyZeroInTrackCounter << " out of " << - m_numCallsToFillTrack); + m_numCallsToFillTrack); ATH_MSG_DEBUG( "Number of exact zero values for d0 in truth: " << m_d0IsExactlyZeroInTruthCounter << " out of " << - m_numCallsToFillTruth); + m_numCallsToFillTruth); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetBasicPlot.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetBasicPlot.h index 7a4c856fb4291b902b206e7227d0ee4690d66108..b166717112ceeaeb7e2b15cf526366d3e142205b 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetBasicPlot.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetBasicPlot.h @@ -23,20 +23,22 @@ class InDetBasicPlot: public InDetPlotBase { public: enum BasicParam { - D0, Z0, PHI, THETA, ETA, QOVERP, NPARAMS + D0, Z0, PHI, THETA, ETA, QOVERP, PT, NPARAMS }; enum AdditionalTruthParameters { Z0ST, PRODR, PRODZ, NTRUTHPARAMS }; - InDetBasicPlot(InDetPlotBase *pParent, const std::string &dirName); - void fill(const xAOD::TrackParticle &particle); - void fill(const xAOD::TruthParticle &particle); + InDetBasicPlot(InDetPlotBase* pParent, const std::string& dirName); + void fill(const xAOD::TrackParticle& particle); + void fill(const xAOD::TruthParticle& particle); private: std::array<std::string, NPARAMS> m_paramNames; std::array<std::string, NTRUTHPARAMS> m_truthParamNames; - std::array<TH1 *, NPARAMS> m_basicTruthPlots; - std::array<TH1 *, NTRUTHPARAMS> m_extraTruthPlots; - std::array<TH1 *, NPARAMS> m_basicTrackPlots; + std::array<TH1*, NPARAMS> m_basicTruthPlots; + std::array<TH1*, NTRUTHPARAMS> m_extraTruthPlots; + std::array<TH1*, NPARAMS> m_basicTrackPlots; + TH2* m_basic_pt_vs_eta, * m_basic_phi_vs_eta; + TH2* m_truth_pt_vs_eta, * m_truth_phi_vs_eta; unsigned int m_d0IsExactlyZeroInTrackCounter; unsigned int m_d0IsExactlyZeroInTruthCounter; unsigned int m_numCallsToFillTruth; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetDummyPlots.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetDummyPlots.cxx new file mode 100644 index 0000000000000000000000000000000000000000..cf0767a8dce938a1a3e931295c94617de25ffb62 --- /dev/null +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetDummyPlots.cxx @@ -0,0 +1,235 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "InDetDummyPlots.h" +#include "xAODTruth/TruthVertex.h" +#include "InDetPhysValMonitoringUtilities.h" +#include <cmath> +using namespace IDPVM; + +InDetDummyPlots::InDetDummyPlots(InDetPlotBase* pParent, const std::string& sDir) : + InDetPlotBase(pParent, sDir), + m_lepton_disappearance_radius{}, + m_low_Pt_lepton_frac{}, + m_nOut_of_lepdeath{}, + m_brem_spectrum{}, + m_energy_remaining{}, + m_energy_remaining_vs_eta{}, + m_energy_remaining_vs_prodR_TRT_barrel{}, + m_energy_remaining_vs_prodR_type_A_endcap{}, + m_energy_remaining_vs_prodR_type_A_and_B{}, + m_energy_remaining_vs_prodR_type_B_endcap{}, + m_primary_photon_eta_vs_conversion_radius{}, + m_primary_photon_pt_vs_decay_radius{}, + m_primary_photon_pt{}, + m_brem_photon_eta_vs_radius_of_conversion{}, + m_brem_photon_pt_vs_radius_of_origin_of_conversion{}, + m_truthMatchProbability_vs_delta_R{}, + m_minimum_delta_R{}, + m_minimum_delta_R_2{}, + m_minimum_delta_R_3{}, + m_minimum_delta_R_not_found{}, + m_minimum_delta_R_2_not_found{}, + m_minimum_delta_R_3_not_found{}, + m_delta_inverse_pt{} { + // nop +} + +void +InDetDummyPlots::initializePlots() { + book(m_lepton_disappearance_radius, "lepton_disappearance_radius"); + book(m_low_Pt_lepton_frac, "low_Pt_lepton_frac"); + book(m_nOut_of_lepdeath, "nOut_of_lepdeath"); + book(m_brem_spectrum, "brem_spectrum"); + book(m_energy_remaining, "energy_remaining"); + book(m_energy_remaining_vs_eta, "energy_remaining_vs_eta"); + book(m_energy_remaining_vs_prodR_TRT_barrel, "energy_remaining_vs_prodR_TRT_barrel"); + book(m_energy_remaining_vs_prodR_type_A_endcap, "energy_remaining_vs_prodR_type_A_endcap"); + book(m_energy_remaining_vs_prodR_type_A_and_B, "energy_remaining_vs_prodR_type_A_and_B"); + book(m_energy_remaining_vs_prodR_type_B_endcap, "energy_remaining_vs_prodR_type_B_endcap"); + book(m_primary_photon_eta_vs_conversion_radius, "primary_photon_eta_vs_conversion_radius"); + book(m_primary_photon_pt_vs_decay_radius, "primary_photon_pt_vs_decay_radius"); + book(m_primary_photon_pt, "primary_photon_pt"); + book(m_brem_photon_eta_vs_radius_of_conversion, "brem_photon_eta_vs_radius_of_conversion"); + book(m_brem_photon_pt_vs_radius_of_origin_of_conversion, "brem_photon_pt_vs_radius_of_origin_of_conversion"); + book(m_truthMatchProbability_vs_delta_R, "truthMatchProbability_vs_delta_R"); + book(m_minimum_delta_R, "minimum_delta_R"); + book(m_minimum_delta_R_2, "minimum_delta_R_2"); + book(m_minimum_delta_R_3, "minimum_delta_R_3"); + book(m_minimum_delta_R_not_found, "minimum_delta_R_not_found"); + book(m_minimum_delta_R_2_not_found, "minimum_delta_R_2_not_found"); + book(m_minimum_delta_R_3_not_found, "minimum_delta_R_3_not_found"); + book(m_delta_inverse_pt, "delta_inverse_pt"); +} + +void +InDetDummyPlots::lepton_fill(const xAOD::TruthParticle& truth, float weight) { + double R = truth.auxdata<float>("prodR"); + double eta = truth.eta(); + double abseta = fabs(eta); + + fillHisto(m_low_Pt_lepton_frac, R, weight); + if (truth.hasProdVtx()) { + const xAOD::TruthVertex* vtx = truth.prodVtx(); + double prod_rad = vtx->perp(); + // double prod_z = vtx->z(); unused + if (truth.hasDecayVtx()) { + const xAOD::TruthVertex* decay_vtx = truth.decayVtx(); + double decay_rad = decay_vtx->perp(); + int nOut = decay_vtx->nOutgoingParticles(); + if (prod_rad < 150) { + fillHisto(m_lepton_disappearance_radius, decay_rad); + } + fillHisto(m_nOut_of_lepdeath, nOut); + for (int i = 0; i < nOut; i++) { + const xAOD::TruthParticle* out = decay_vtx->outgoingParticle(i); + double brem_e = out->e() * 0.001; // convert MeV to GeV + double log_e = std::log10(brem_e); + if (out->pdgId() == 22) { + fillHisto(m_brem_spectrum, decay_rad, log_e); + } + } + } + double ECal(1000); //Inner radius of the ECal, not sure this is correct + double e_init = truth.e(); //initial electron/positron total energy + double e_lost(0); //energy the electron/positron has lost so far + + std::vector<const xAOD::TruthParticle*> pers_truth; //Not sure if this is right + pers_truth.push_back(&truth); + + std::vector<double> decays; + + std::cout<<"Tarkin: You may fire when ready \n"; + if(prod_rad < ECal){ + do { + if(pers_truth.back()->hasDecayVtx()){ + const xAOD::TruthVertex * decay = pers_truth.back()->decayVtx(); + double dec_rad = decay->perp(); + decays.push_back(dec_rad); + int temp_nOut = decay->nOutgoingParticles(); + std::vector<const xAOD::TruthParticle*> outs; + for(int i=0; i<temp_nOut; i++){ + const xAOD::TruthParticle * temp_out = decay->outgoingParticle(i); + outs.push_back(temp_out); + } + if(temp_nOut == 2){ + if(outs[0]->pdgId() == 22){ + e_lost += outs[0]->e(); + pers_truth.push_back(outs[1]); //Adding electron/positron to pers_truth vector + }else if(outs[1]->pdgId() == 22){ + e_lost += outs[1]->e(); + pers_truth.push_back(outs[0]); + }else{ + break; + } + }else{ + break; + } + outs.clear(); + }else{ + break; + } + }while(decays.back() < ECal); + } + double e_left = ((e_init - e_lost)/e_init); //fraction of origina electron/positron energy left when it reaches the ECal + std::cout<<"Fraction of electron/positron energy remaining: "<<e_left<<"\n"; + fillHisto(m_energy_remaining, prod_rad, e_left); + fillHisto(m_energy_remaining_vs_eta, eta, e_left); + if(abseta < 0.625){ + fillHisto(m_energy_remaining_vs_prodR_TRT_barrel, prod_rad, e_left); + }else if((1.070 < abseta) and (abseta < 1.304)){ + fillHisto(m_energy_remaining_vs_prodR_type_A_endcap, prod_rad, e_left); + }else if((1.304 < abseta) and (abseta < 1.752)){ + fillHisto(m_energy_remaining_vs_prodR_type_A_and_B, prod_rad, e_left); + }else if((1.752 < abseta) and (abseta < 2.0)){ + fillHisto(m_energy_remaining_vs_prodR_type_B_endcap, prod_rad, e_left); + } + } +} + +void +InDetDummyPlots::prim_photon_fill(const xAOD::TruthParticle& truth) { + double eta = truth.eta(); + double pt = truth.pt() * 0.001; // convert MeV to GeV + double log_pt = std::log10(pt); + + fillHisto(m_primary_photon_pt, pt); + if (truth.hasDecayVtx()) { + const xAOD::TruthVertex* vtx = truth.decayVtx(); + double decay_rad = vtx->perp(); + fillHisto(m_primary_photon_eta_vs_conversion_radius, decay_rad, eta); + fillHisto(m_primary_photon_pt_vs_decay_radius, decay_rad, log_pt); + } +} + +void +InDetDummyPlots::brem_photon_fill(const xAOD::TruthParticle& truth) { + double eta = truth.eta(); + double pt = truth.pt() * 0.001; // convert MeV to GeV + double log_pt = std::log10(pt); + const xAOD::TruthVertex* vtx = truth.prodVtx(); + + if (truth.hasDecayVtx()) { + double decay_rad = vtx->perp(); + fillHisto(m_brem_photon_eta_vs_radius_of_conversion, decay_rad, eta); + fillHisto(m_brem_photon_pt_vs_radius_of_origin_of_conversion, decay_rad, log_pt); + } +} + +void +InDetDummyPlots::track_vs_truth(const xAOD::TrackParticle& track, const xAOD::TruthParticle& truth, float tmp){ + double track_theta = track.theta(); + double truth_theta = truth.auxdata< float >("theta"); + //double track_pt = track.pt(); unused + //double truth_pt = truth.pt(); unused + double truth_eta = truth.eta(); + double track_eta = -std::log(std::tan(track_theta*0.5)); + + double delta_eta = track_eta - truth_eta; + double delta_theta = track_theta - truth_theta; + + double delta_R = sqrt(delta_eta * delta_eta + delta_theta * delta_theta); + + fillHisto(m_truthMatchProbability_vs_delta_R, delta_R, tmp); + /* + if(truth.hasProdVtx()){ + const xAOD::TruthVertex* vtx = truth.prodVtx(); + double prod_rad = vtx->perp(); + if(prod_rad < 100){ + fillHisto(m_minimum_delta_R, delta_R); + + } + } + */ +} + +void +InDetDummyPlots::minDR(float min_dR, float prod_rad, float bestmatch, double BIDPt){ + + if(bestmatch > 0.50){ + if(prod_rad < 100){ + fillHisto(m_minimum_delta_R, min_dR); + }else if(prod_rad < 200){ + fillHisto(m_minimum_delta_R_2, min_dR); + }else{ + fillHisto(m_minimum_delta_R_3, min_dR); + } + }else{ + std::cout<<"Rey: the match probability is "<<bestmatch<<"\n"; + if(prod_rad < 100){ + fillHisto(m_minimum_delta_R_not_found, min_dR); + }else if(prod_rad < 200){ + fillHisto(m_minimum_delta_R_2_not_found, min_dR); + }else{ + fillHisto(m_minimum_delta_R_3_not_found, min_dR); + } + } + + fillHisto(m_delta_inverse_pt, BIDPt); + +} + +void +InDetDummyPlots::finalizePlots() { +} diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetDummyPlots.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetDummyPlots.h new file mode 100644 index 0000000000000000000000000000000000000000..b7a77f9f15d6166d480667bb8bc8da979ea35d77 --- /dev/null +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetDummyPlots.h @@ -0,0 +1,72 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef INDETPHYSVALMONITORING_INDETDUMMYPLOTS +#define INDETPHYSVALMONITORING_INDETDUMMYPLOTS +/** + * @file InDetDummyPlots.cxx + * + **/ + + + +// local includes +#include "InDetPlotBase.h" +#include "xAODTruth/TruthParticle.h" +#include "xAODTracking/TrackParticle.h" +// std includes +#include <string> + +// fwd includes +class TH1; +class TProfile; +class TH2; + +///class holding dummy plots +class InDetDummyPlots: public InDetPlotBase { +public: + InDetDummyPlots(InDetPlotBase* pParent, const std::string& dirName); + + void lepton_fill(const xAOD::TruthParticle& truth, float weight); + void prim_photon_fill(const xAOD::TruthParticle& truth); + void brem_photon_fill(const xAOD::TruthParticle& truth); + void BT_fill(const xAOD::TruthParticle& truth, float weight); + void track_vs_truth(const xAOD::TrackParticle& track, const xAOD::TruthParticle& truth, float tmp); + void minDR(float min_dR, float prod_rad, float prob, double BIDPt); + +private: + TH1* m_lepton_disappearance_radius; + + TProfile* m_low_Pt_lepton_frac; + + TH1* m_nOut_of_lepdeath; + + TH2* m_brem_spectrum; + TH2* m_energy_remaining; + TH2* m_energy_remaining_vs_eta; + TH2* m_energy_remaining_vs_prodR_TRT_barrel; + TH2* m_energy_remaining_vs_prodR_type_A_endcap; + TH2* m_energy_remaining_vs_prodR_type_A_and_B; + TH2* m_energy_remaining_vs_prodR_type_B_endcap; + TH2* m_primary_photon_eta_vs_conversion_radius; + TH2* m_primary_photon_pt_vs_decay_radius; + TH1* m_primary_photon_pt; + TH2* m_brem_photon_eta_vs_radius_of_conversion; + TH2* m_brem_photon_pt_vs_radius_of_origin_of_conversion; + + TH2* m_truthMatchProbability_vs_delta_R; + TH1* m_minimum_delta_R; + TH1* m_minimum_delta_R_2; + TH1* m_minimum_delta_R_3; + TH1* m_minimum_delta_R_not_found; + TH1* m_minimum_delta_R_2_not_found; + TH1* m_minimum_delta_R_3_not_found; + TH1* m_delta_inverse_pt; + + // plot base has nop default implementation of this; we use it to book the histos + void initializePlots(); + void finalizePlots(); +}; + +#endif diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Eff.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Eff.cxx index 0aae1e97b72362f7fdad014b9fc9b5498aeec7fe..e2b914765317d5db0c3d9dd96e2b066556e68d1b 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Eff.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Eff.cxx @@ -3,13 +3,14 @@ */ #include "InDetPerfPlot_Eff.h" -//#include "TrkValHistUtils/EfficiencyPurityCalculator.h" +// #include "TrkValHistUtils/EfficiencyPurityCalculator.h" #include "xAODTruth/TruthParticle.h" #include "xAODTruth/TruthVertex.h" +#include "InDetPhysValMonitoringUtilities.h" +#include <cmath> +using namespace IDPVM; -using namespace TMath; - -InDetPerfPlot_Eff::InDetPerfPlot_Eff(InDetPlotBase *pParent, const std::string &sDir) : +InDetPerfPlot_Eff::InDetPerfPlot_Eff(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase(pParent, sDir), m_trackeff_vs_eta{}, m_trackeff_vs_pt{}, @@ -20,7 +21,6 @@ InDetPerfPlot_Eff::InDetPerfPlot_Eff(InDetPlotBase *pParent, const std::string & m_trackeff_vs_Z{}, m_trackeff_vs_prodR{}, m_trackeff_vs_prodZ{}, - m_low_Pt_lepton_frac{}, m_eff_vs_eta_of_daughters{}, m_eff_vs_theta_of_daughters{}, m_eff_vs_theta_tan_of_daughters{}, @@ -51,8 +51,6 @@ InDetPerfPlot_Eff::initializePlots() { book(m_trackeff_vs_prodR, "trackeff_vs_prodR"); book(m_trackeff_vs_prodZ, "trackeff_vs_prodZ"); - book(m_low_Pt_lepton_frac, "low_Pt_lepton_frac"); - book(m_eff_vs_eta_of_daughters, "eff_vs_eta_of_daughters"); book(m_eff_vs_theta_of_daughters, "eff_vs_theta_of_daughters"); book(m_eff_vs_theta_tan_of_daughters, "eff_vs_theta_tan_of_daughters"); @@ -71,78 +69,73 @@ InDetPerfPlot_Eff::initializePlots() { } void -InDetPerfPlot_Eff::pro_fill(const xAOD::TruthParticle &truth, float weight) { +InDetPerfPlot_Eff::fill(const xAOD::TruthParticle& truth, const bool isGood) { double eta = truth.eta(); - double pt = truth.pt() *0.001; // convert MeV to GeV + double pt = truth.pt() * 1_GeV; // convert MeV to GeV double phi = truth.phi(); + + fillHisto(m_trackeff_vs_eta, eta, isGood); + fillHisto(m_trackeff_vs_pt, pt, isGood); + fillHisto(m_trackeff_vs_phi, phi, isGood); + double d0 = truth.auxdata<float>("d0"); double z0 = truth.auxdata<float>("z0"); double R = truth.auxdata<float>("prodR"); double Z = truth.auxdata<float>("prodZ"); - - fillHisto(m_trackeff_vs_eta,eta, weight); - fillHisto(m_trackeff_vs_pt,pt, weight); - fillHisto(m_trackeff_vs_phi,phi, weight); - fillHisto(m_trackeff_vs_d0,d0, weight); - fillHisto(m_trackeff_vs_z0,z0, weight); - fillHisto(m_trackeff_vs_R,R, weight); - fillHisto(m_trackeff_vs_Z,Z, weight); + fillHisto(m_trackeff_vs_d0, d0, isGood); + fillHisto(m_trackeff_vs_z0, z0, isGood); + fillHisto(m_trackeff_vs_R, R, isGood); + fillHisto(m_trackeff_vs_Z, Z, isGood); if (truth.hasProdVtx()) { - const xAOD::TruthVertex *vtx = truth.prodVtx(); + const xAOD::TruthVertex* vtx = truth.prodVtx(); double prod_rad = vtx->perp(); double prod_z = vtx->z(); - fillHisto(m_trackeff_vs_prodR,prod_rad, weight); - fillHisto(m_trackeff_vs_prodZ,prod_z, weight); + fillHisto(m_trackeff_vs_prodR, prod_rad, isGood); + fillHisto(m_trackeff_vs_prodZ, prod_z, isGood); } } void -InDetPerfPlot_Eff::lepton_fill(const xAOD::TruthParticle &truth, float weight){ - double R = truth.auxdata<float>("prodR"); - fillHisto(m_low_Pt_lepton_frac, R, weight); -} - -void -InDetPerfPlot_Eff::BT_fill(const xAOD::TruthParticle &truth, float weight) { - double eta = truth.eta(); +InDetPerfPlot_Eff::BT_fill(const xAOD::TruthParticle& truth, float weight) { + double eta = safelyGetEta(truth); double theta = truth.auxdata< float >("theta"); double phi = truth.phi(); double tan_theta = std::tan(theta); - double cot_theta = (std::cos(theta) / std::sin(theta)); + double cot_theta = (1.0 / tan_theta); double sin_phi = std::sin(phi); double cos_phi = std::cos(phi); - fillHisto(m_eff_vs_eta_of_daughters,eta, weight); - fillHisto(m_eff_vs_theta_of_daughters,theta, weight); - fillHisto(m_eff_vs_theta_tan_of_daughters,tan_theta, weight); - fillHisto(m_eff_vs_theta_cotan_of_daughters,cot_theta, weight); - fillHisto(m_eff_vs_phi_of_daughters,phi, weight); - fillHisto(m_eff_vs_phi_sin_of_daughters,sin_phi, weight); - fillHisto(m_eff_vs_phi_cos_of_daughters,cos_phi, weight); + fillHisto(m_eff_vs_eta_of_daughters, eta, weight); + fillHisto(m_eff_vs_theta_of_daughters, theta, weight); + fillHisto(m_eff_vs_theta_tan_of_daughters, tan_theta, weight); + fillHisto(m_eff_vs_theta_cotan_of_daughters, cot_theta, weight); + fillHisto(m_eff_vs_phi_of_daughters, phi, weight); + fillHisto(m_eff_vs_phi_sin_of_daughters, sin_phi, weight); + fillHisto(m_eff_vs_phi_cos_of_daughters, cos_phi, weight); } void -InDetPerfPlot_Eff::jet_fill(const xAOD::TrackParticle &track, const xAOD::Jet &jet, float weight) { +InDetPerfPlot_Eff::jet_fill(const xAOD::TrackParticle& track, const xAOD::Jet& jet, float weight) { double trketa = track.eta(); double trkphi = track.phi(); - double trkpt = track.pt() / 1000.; + double trkpt = track.pt() * 1_GeV; double dR = jet.p4().DeltaR(track.p4()); - double jetet = jet.pt() / 1000.; + double jetet = jet.pt() * 1_GeV; - fillHisto(m_trackinjeteff_vs_eta,trketa, weight); - fillHisto(m_trackinjeteff_vs_phi,trkphi, weight); - fillHisto(m_trackinjeteff_vs_pt,trkpt, weight); - fillHisto(m_trackinjeteff_vs_dr,dR, weight); + fillHisto(m_trackinjeteff_vs_eta, trketa, weight); + fillHisto(m_trackinjeteff_vs_phi, trkphi, weight); + fillHisto(m_trackinjeteff_vs_pt, trkpt, weight); + fillHisto(m_trackinjeteff_vs_dr, dR, weight); if (jetet < 50) { - fillHisto(m_trackinjeteff_vs_dr_lt_j50,dR, weight); - }else if (jetet > 100) { - fillHisto(m_trackinjeteff_vs_dr_gr_j100,dR, weight); + fillHisto(m_trackinjeteff_vs_dr_lt_j50, dR, weight); + } else if (jetet > 100) { + fillHisto(m_trackinjeteff_vs_dr_gr_j100, dR, weight); } - fillHisto(m_trackinjeteff_vs_jetet,jetet, weight); + fillHisto(m_trackinjeteff_vs_jetet, jetet, weight); } void diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Eff.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Eff.h index 1a1f4595d858f951fc7932c75689f52c236b41c3..3400cb6aa47038d6c395ff691671a2ee6baaab73 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Eff.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Eff.h @@ -15,57 +15,52 @@ **/ -// std includes -#include <string> // local includes #include "InDetPlotBase.h" -#include "TrkValHistUtils/ParamPlots.h" -#include "xAODBase/IParticle.h" #include "xAODTracking/TrackParticle.h" +#include "xAODTruth/TruthParticle.h" #include "xAODJet/Jet.h" -#include "InDetPhysValMonitoring/IInDetPhysValDecoratorTool.h" +// std includes +#include <string> ///class holding Pt plots for Inner Detector RTT Validation and implementing fill methods class InDetPerfPlot_Eff: public InDetPlotBase { public: - InDetPerfPlot_Eff(InDetPlotBase *pParent, const std::string &dirName); + InDetPerfPlot_Eff(InDetPlotBase* pParent, const std::string& dirName); - void pro_fill(const xAOD::TruthParticle &truth, float weight); - void lepton_fill(const xAOD::TruthParticle &truth, float weight); - void BT_fill(const xAOD::TruthParticle &truth, float weight); - void jet_fill(const xAOD::TrackParticle &track, const xAOD::Jet &jet, float weight); + void fill(const xAOD::TruthParticle& truth, const bool isGood); + void BT_fill(const xAOD::TruthParticle& truth, float weight); + void jet_fill(const xAOD::TrackParticle& track, const xAOD::Jet& jet, float weight); private: - TProfile *m_trackeff_vs_eta; - TProfile *m_trackeff_vs_pt; - TProfile *m_trackeff_vs_phi; - TProfile *m_trackeff_vs_d0; - TProfile *m_trackeff_vs_z0; - TProfile *m_trackeff_vs_R; - TProfile *m_trackeff_vs_Z; - - TProfile *m_trackeff_vs_prodR; - TProfile *m_trackeff_vs_prodZ; + TEfficiency* m_trackeff_vs_eta; + TEfficiency* m_trackeff_vs_pt; + TEfficiency* m_trackeff_vs_phi; + TEfficiency* m_trackeff_vs_d0; + TEfficiency* m_trackeff_vs_z0; + TEfficiency* m_trackeff_vs_R; + TEfficiency* m_trackeff_vs_Z; - TProfile *m_low_Pt_lepton_frac; + TEfficiency* m_trackeff_vs_prodR; + TEfficiency* m_trackeff_vs_prodZ; - TProfile *m_eff_vs_eta_of_daughters; - TProfile *m_eff_vs_theta_of_daughters; - TProfile *m_eff_vs_theta_tan_of_daughters; - TProfile *m_eff_vs_theta_cotan_of_daughters; - TProfile *m_eff_vs_phi_of_daughters; - TProfile *m_eff_vs_phi_sin_of_daughters; - TProfile *m_eff_vs_phi_cos_of_daughters; + TProfile* m_eff_vs_eta_of_daughters; + TProfile* m_eff_vs_theta_of_daughters; + TProfile* m_eff_vs_theta_tan_of_daughters; + TProfile* m_eff_vs_theta_cotan_of_daughters; + TProfile* m_eff_vs_phi_of_daughters; + TProfile* m_eff_vs_phi_sin_of_daughters; + TProfile* m_eff_vs_phi_cos_of_daughters; - TProfile *m_trackinjeteff_vs_eta; - TProfile *m_trackinjeteff_vs_phi; - TProfile *m_trackinjeteff_vs_pt; - TProfile *m_trackinjeteff_vs_dr; - TProfile *m_trackinjeteff_vs_dr_lt_j50; - TProfile *m_trackinjeteff_vs_dr_gr_j100; - TProfile *m_trackinjeteff_vs_jetet; + TProfile* m_trackinjeteff_vs_eta; + TProfile* m_trackinjeteff_vs_phi; + TProfile* m_trackinjeteff_vs_pt; + TProfile* m_trackinjeteff_vs_dr; + TProfile* m_trackinjeteff_vs_dr_lt_j50; + TProfile* m_trackinjeteff_vs_dr_gr_j100; + TProfile* m_trackinjeteff_vs_jetet; // plot base has nop default implementation of this; we use it to book the histos void initializePlots(); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ExtendedFakes.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ExtendedFakes.cxx index 42adfa9b10c9f1b358ded951edf330154212518c..ad224d4fb925b5044c8332cb7e51b4556bc8c013 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ExtendedFakes.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ExtendedFakes.cxx @@ -8,12 +8,12 @@ **/ #include "InDetPerfPlot_ExtendedFakes.h" -#include <math.h> // for M_PI +#include <cmath> // for M_PI -InDetPerfPlot_ExtendedFakes::InDetPerfPlot_ExtendedFakes (InDetPlotBase *pParent, const std::string &sDir) : +InDetPerfPlot_ExtendedFakes::InDetPerfPlot_ExtendedFakes (InDetPlotBase* pParent, const std::string& sDir) : InDetPerfPlot_fakes(pParent, sDir) { // nop } @@ -23,9 +23,7 @@ InDetPerfPlot_ExtendedFakes::initializePlots() { InDetPerfPlot_fakes::initializePlots(); // - for (const std::string &var : m_variables) { - std::cout << "<InDetPerfPlot_ExtendedFakes::initializePlots> Booking 'track_fakerate_vs_" << var << "'." << - std::endl; + for (const std::string& var : m_variables) { book(m_HitInfoFakerates[var], "track_fakerate_vs_" + var); } @@ -35,8 +33,8 @@ InDetPerfPlot_ExtendedFakes::initializePlots() { } void -InDetPerfPlot_ExtendedFakes::fill(const xAOD::TrackParticle &trk, const bool isFake, - const InDetPerfPlot_fakes::Category & /*f*/) { +InDetPerfPlot_ExtendedFakes::fill(const xAOD::TrackParticle& trk, const bool isFake, + const InDetPerfPlot_fakes::Category& /*f*/) { InDetPerfPlot_fakes::fill(trk, isFake); unsigned int fakeNum = (unsigned int) isFake; @@ -49,11 +47,11 @@ InDetPerfPlot_ExtendedFakes::fill(const xAOD::TrackParticle &trk, const bool isF double x = parameters(0); double y = parameters(1); double z = parameters(2); - double R = sqrt(x * x + y * y); + double R = std::sqrt(x * x + y * y); // double za = fabs(z); unused - fillHisto(m_KinematicFakerates["RfirstHit"],R, fakeNum); - fillHisto(m_KinematicFakerates["ZfirstHit"],z, fakeNum); + fillHisto(m_KinematicFakerates["RfirstHit"], R, fakeNum); + fillHisto(m_KinematicFakerates["ZfirstHit"], z, fakeNum); } // Hit information. @@ -66,70 +64,70 @@ InDetPerfPlot_ExtendedFakes::fill(const xAOD::TrackParticle &trk, const bool isF if (trk.summaryValue(iBLayerHits, xAOD::numberOfBLayerHits)) { - fillHisto(m_HitInfoFakerates["nBLayerHits" ],iBLayerHits, fakeNum); + fillHisto(m_HitInfoFakerates["nBLayerHits" ], iBLayerHits, fakeNum); } if (trk.summaryValue(iBLayerOutliers, xAOD::numberOfBLayerOutliers)) { - fillHisto(m_HitInfoFakerates["nBLayerOutliers" ],iBLayerOutliers, fakeNum); + fillHisto(m_HitInfoFakerates["nBLayerOutliers" ], iBLayerOutliers, fakeNum); } if (trk.summaryValue(iBLayerSharedHits, xAOD::numberOfBLayerSharedHits)) { - fillHisto(m_HitInfoFakerates["nBLayerSharedHits"],iBLayerSharedHits, fakeNum); + fillHisto(m_HitInfoFakerates["nBLayerSharedHits"], iBLayerSharedHits, fakeNum); } if (trk.summaryValue(iBLayerSplitHits, xAOD::numberOfBLayerSplitHits)) { - fillHisto(m_HitInfoFakerates["nBLayerSplitHits" ],iBLayerSplitHits, fakeNum); + fillHisto(m_HitInfoFakerates["nBLayerSplitHits" ], iBLayerSplitHits, fakeNum); } if (trk.summaryValue(iPixHits, xAOD::numberOfPixelHits)) { - fillHisto(m_HitInfoFakerates["nPixHits" ],iPixHits, fakeNum); + fillHisto(m_HitInfoFakerates["nPixHits" ], iPixHits, fakeNum); } if (trk.summaryValue(iPixHoles, xAOD::numberOfPixelHoles)) { - fillHisto(m_HitInfoFakerates["nPixHoles" ],iPixHoles, fakeNum); + fillHisto(m_HitInfoFakerates["nPixHoles" ], iPixHoles, fakeNum); } if (trk.summaryValue(iPixOutliers, xAOD::numberOfPixelOutliers)) { - fillHisto(m_HitInfoFakerates["nPixOutliers" ],iPixOutliers, fakeNum); + fillHisto(m_HitInfoFakerates["nPixOutliers" ], iPixOutliers, fakeNum); } if (trk.summaryValue(iPixContribLayers, xAOD::numberOfContribPixelLayers)) { - fillHisto(m_HitInfoFakerates["nPixContribLayers"],iPixContribLayers, fakeNum); + fillHisto(m_HitInfoFakerates["nPixContribLayers"], iPixContribLayers, fakeNum); } if (trk.summaryValue(iPixSharedHits, xAOD::numberOfPixelSharedHits)) { - fillHisto(m_HitInfoFakerates["nPixSharedHits" ],iPixSharedHits, fakeNum); + fillHisto(m_HitInfoFakerates["nPixSharedHits" ], iPixSharedHits, fakeNum); } if (trk.summaryValue(iPixSplitHits, xAOD::numberOfPixelSplitHits)) { - fillHisto( m_HitInfoFakerates["nPixSplitHits" ],iPixSplitHits, fakeNum); + fillHisto(m_HitInfoFakerates["nPixSplitHits" ], iPixSplitHits, fakeNum); } if (trk.summaryValue(iPixGangedHits, xAOD::numberOfGangedPixels)) { - fillHisto(m_HitInfoFakerates["nPixGangedHits" ],iPixGangedHits, fakeNum); + fillHisto(m_HitInfoFakerates["nPixGangedHits" ], iPixGangedHits, fakeNum); } if (trk.summaryValue(iSCTHits, xAOD::numberOfSCTHits)) { - fillHisto(m_HitInfoFakerates["nSCTHits" ],iSCTHits, fakeNum); + fillHisto(m_HitInfoFakerates["nSCTHits" ], iSCTHits, fakeNum); } if (trk.summaryValue(iSCTHoles, xAOD::numberOfSCTHoles)) { - fillHisto(m_HitInfoFakerates["nSCTHoles" ],iSCTHoles, fakeNum); + fillHisto(m_HitInfoFakerates["nSCTHoles" ], iSCTHoles, fakeNum); } if (trk.summaryValue(iSCTOutliers, xAOD::numberOfSCTOutliers)) { - fillHisto(m_HitInfoFakerates["nSCTOutliers" ],iSCTOutliers, fakeNum); + fillHisto(m_HitInfoFakerates["nSCTOutliers" ], iSCTOutliers, fakeNum); } if (trk.summaryValue(iSCTDoubleHoles, xAOD::numberOfSCTDoubleHoles)) { - fillHisto(m_HitInfoFakerates["nSCTDoubleHoles"],iSCTDoubleHoles, fakeNum); + fillHisto(m_HitInfoFakerates["nSCTDoubleHoles"], iSCTDoubleHoles, fakeNum); } if (trk.summaryValue(iSCTSharedHits, xAOD::numberOfSCTSharedHits)) { - fillHisto(m_HitInfoFakerates["nSCTSharedHits" ],iSCTSharedHits, fakeNum); + fillHisto(m_HitInfoFakerates["nSCTSharedHits" ], iSCTSharedHits, fakeNum); } iSiHits = iPixHits + iSCTHits; - fillHisto(m_HitInfoFakerates["nSiHits"],iSiHits, fakeNum); + fillHisto(m_HitInfoFakerates["nSiHits"], iSiHits, fakeNum); if (trk.summaryValue(iTRTOutliers, xAOD::numberOfTRTOutliers)) { - fillHisto(m_HitInfoFakerates["nTRTOutliers" ],iTRTOutliers, fakeNum); + fillHisto(m_HitInfoFakerates["nTRTOutliers" ], iTRTOutliers, fakeNum); } if (trk.summaryValue(iTRTHighThresholdOutliers, xAOD::numberOfTRTHighThresholdOutliers)) { - fillHisto(m_HitInfoFakerates["nTRTHighThresholdOutliers"],iTRTHighThresholdOutliers, fakeNum); + fillHisto(m_HitInfoFakerates["nTRTHighThresholdOutliers"], iTRTHighThresholdOutliers, fakeNum); } if (trk.summaryValue(iTRTHits, xAOD::numberOfTRTHits)) { - fillHisto(m_HitInfoFakerates["nTRTHits" ],iTRTHits, fakeNum); + fillHisto(m_HitInfoFakerates["nTRTHits" ], iTRTHits, fakeNum); } if (trk.summaryValue(iTRTHighThresholdHits, xAOD::numberOfTRTHighThresholdHits)) { - fillHisto(m_HitInfoFakerates["nTRTHighThresholdHits" ],iTRTHighThresholdHits, fakeNum); + fillHisto(m_HitInfoFakerates["nTRTHighThresholdHits" ], iTRTHighThresholdHits, fakeNum); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ExtendedFakes.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ExtendedFakes.h index 0c3ca5800774563df30ac11895c58cd815403399..1797dbac10d0a9d1512a6f788451806bcd4048c9 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ExtendedFakes.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_ExtendedFakes.h @@ -8,23 +8,26 @@ * @file InDetPerfPlot_ExtendedFakes.h * @author shaun roe **/ +// local includes +#include "InDetPerfPlot_fakes.h" // std includes #include <string> #include <map> +#include <vector> + +class TProfile; -// local includes -#include "InDetPerfPlot_fakes.h" ///class holding fake plots for Inner Detector RTT Validation and implementing fill methods class InDetPerfPlot_ExtendedFakes: public InDetPerfPlot_fakes { public: - InDetPerfPlot_ExtendedFakes (InDetPlotBase *pParent, const std::string &dirName); - void fill(const xAOD::TrackParticle &trkprt, const bool isFake, const InDetPerfPlot_fakes::Category &f = ALL); + InDetPerfPlot_ExtendedFakes (InDetPlotBase* pParent, const std::string& dirName); + void fill(const xAOD::TrackParticle& trkprt, const bool isFake, const InDetPerfPlot_fakes::Category& f = ALL); private: // fake rates as TProfiles - std::map< std::string, TProfile * > m_HitInfoFakerates; - std::map< std::string, TProfile * > m_KinematicFakerates; + std::map< std::string, TProfile* > m_HitInfoFakerates; + std::map< std::string, TProfile* > m_KinematicFakerates; // Variables (for easy access). std::vector< std::string > m_variables = { diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitDetailed.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitDetailed.cxx index 57c07d6985a1516773488b04e31ec9bd77356411..793d499e747a98ba637eeec1f9dd535fa45795cc 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitDetailed.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitDetailed.cxx @@ -8,14 +8,35 @@ -InDetPerfPlot_HitDetailed::InDetPerfPlot_HitDetailed(InDetPlotBase *pParent, std::string sDir) : InDetPlotBase(pParent, +InDetPerfPlot_HitDetailed::InDetPerfPlot_HitDetailed(InDetPlotBase* pParent, std::string sDir) : InDetPlotBase(pParent, sDir), + // 1D hit hisrograms + nBLayerHits{}, + nBLayerOutliers{}, + nBLayerSharedHits{}, + nBLayerSplitHits{}, + nPixelHits{}, + nPixelHoles{}, + nPixelOutliers{}, + nPixelContribLayers{}, + nPixelSharedHits{}, + nPixelSplitHits{}, + nPixelGangedHits{}, + nPixelGangedHitsFlaggedFakes{}, + nSCTHits{}, + nSCTHoles{}, + nSCTOutliers{}, + nSCTDoubleHoles{}, + nSCTSharedHits{}, + nTRTHits{}, + nTRTHighThresholdHits{}, + nTRTOutliers{}, + nTRTHighThresholdOutliers{}, + // eta profiles n_vs_eta_BLayerHits{}, n_vs_eta_BLayerOutliers{}, n_vs_eta_BLayerSharedHits{}, n_vs_eta_BLayerSplitHits{}, - n_vs_eta_DBMHitsNeg{}, - n_vs_eta_DBMHitsPos{}, n_vs_eta_PixelHits{}, n_vs_eta_PixelHoles{}, n_vs_eta_PixelOutliers{}, @@ -33,32 +54,43 @@ InDetPerfPlot_HitDetailed::InDetPerfPlot_HitDetailed(InDetPlotBase *pParent, std n_vs_eta_TRTHighThresholdHits{}, n_vs_eta_TRTOutliers{}, n_vs_eta_TRTHighThresholdOutliers{} { - m_etaNBins = 20; - m_etaMin = -2.5; - m_etaMax = 2.5; - m_etaMinDBM = 2.5; - m_etaMaxDBM = 3.8; -} - -void -InDetPerfPlot_HitDetailed::setEtaBinning(int nbins, float eta_min, float eta_max) { - m_etaNBins = nbins; - m_etaMin = eta_min; - m_etaMax = eta_max; } void InDetPerfPlot_HitDetailed::initializePlots() { + // 1D histograms + book(nBLayerHits, "HitContent_NBlayerHits"); + book(nPixelHits, "HitContent_NPixelHits"); + book(nPixelHoles, "HitContent_NPixelHoles"); + book(nSCTHits, "HitContent_NSCTHits"); + book(nSCTHoles, "HitContent_NSCTHoles"); + book(nTRTHits, "HitContent_NTRTHits"); + book(nTRTHighThresholdHits, "HitContent_NTRTHighThresholdHits"); + // eta profiles book(n_vs_eta_BLayerHits, "HitContent_vs_eta_NBlayerHits"); book(n_vs_eta_PixelHits, "HitContent_vs_eta_NPixelHits"); - book(n_vs_eta_DBMHitsNeg, "HitContent_vs_eta_DBMHitsNeg"); - book(n_vs_eta_DBMHitsPos, "HitContent_vs_eta_DBMHitsPos"); book(n_vs_eta_PixelHoles, "HitContent_vs_eta_NPixelHoles"); book(n_vs_eta_SCTHits, "HitContent_vs_eta_NSCTHits"); book(n_vs_eta_SCTHoles, "HitContent_vs_eta_NSCTHoles"); book(n_vs_eta_TRTHits, "HitContent_vs_eta_NTRTHits"); book(n_vs_eta_TRTHighThresholdHits, "HitContent_vs_eta_NTRTHighThresholdHits"); if (m_iDetailLevel >= 100) { + // 1D histograms + book(nBLayerOutliers, "HitContent_NBlayerOutliers"); + book(nBLayerSharedHits, "HitContent_NBlayerSharedHits"); + book(nBLayerSplitHits, "HitContent_NBLayerSplitHits"); + book(nPixelOutliers, "HitContent_NPixelOutliers"); + book(nPixelContribLayers, "HitContent_NPixelContribLayers"); + book(nPixelSharedHits, "HitContent_NPixelSharedHits"); + book(nPixelSplitHits, "HitContent_NPixelSplitHits"); + book(nPixelGangedHits, "HitContent_NPixelGangedHits"); + book(nPixelGangedHitsFlaggedFakes, "HitContent_NPixelGangedHitsFlaggedFakes"); + book(nSCTOutliers, "HitContent_NSCTOutliers"); + book(nSCTDoubleHoles, "HitContent_NSCTDoubleHoles"); + book(nSCTSharedHits, "HitContent_NSCTSharedHits"); + book(nTRTOutliers, "HitContent_NTRTOutliers"); + book(nTRTHighThresholdOutliers, "HitContent_NTRTHighThresholdOutliers"); + // eta profiles book(n_vs_eta_BLayerOutliers, "HitContent_vs_eta_NBlayerOutliers"); book(n_vs_eta_BLayerSharedHits, "HitContent_vs_eta_NBlayerSharedHits"); book(n_vs_eta_BLayerSplitHits, "HitContent_vs_eta_NBLayerSplitHits"); @@ -77,32 +109,39 @@ InDetPerfPlot_HitDetailed::initializePlots() { } void -InDetPerfPlot_HitDetailed::fill(const xAOD::TrackParticle &trk) { +InDetPerfPlot_HitDetailed::fill(const xAOD::TrackParticle& trk) { float eta = trk.eta(); uint8_t iBLayerHits(0), iPixHits(0), iSctHits(0), iTrtHits(0); uint8_t iPixHoles(0), iSCTHoles(0), iTrtHTHits(0); if (trk.summaryValue(iBLayerHits, xAOD::numberOfBLayerHits)) { - fillHisto(n_vs_eta_BLayerHits,eta, iBLayerHits); + fillHisto(nBLayerHits, iBLayerHits); + fillHisto(n_vs_eta_BLayerHits, eta, iBLayerHits); } if (trk.summaryValue(iPixHits, xAOD::numberOfPixelHits)) { - fillHisto(n_vs_eta_PixelHits,eta, iPixHits); + fillHisto(nPixelHits, iPixHits); + fillHisto(n_vs_eta_PixelHits, eta, iPixHits); } if (trk.summaryValue(iSctHits, xAOD::numberOfSCTHits)) { - fillHisto(n_vs_eta_SCTHits,eta, iSctHits); + fillHisto(nSCTHits, iSctHits); + fillHisto(n_vs_eta_SCTHits, eta, iSctHits); } if (trk.summaryValue(iTrtHits, xAOD::numberOfTRTHits)) { - fillHisto(n_vs_eta_TRTHits,eta, iTrtHits); + fillHisto(nTRTHits, iTrtHits); + fillHisto(n_vs_eta_TRTHits, eta, iTrtHits); } if (trk.summaryValue(iPixHoles, xAOD::numberOfPixelHoles)) { - fillHisto(n_vs_eta_PixelHoles,eta, iPixHoles); + fillHisto(nPixelHoles, iPixHoles); + fillHisto(n_vs_eta_PixelHoles, eta, iPixHoles); } if (trk.summaryValue(iSCTHoles, xAOD::numberOfSCTHoles)) { - fillHisto(n_vs_eta_SCTHoles,eta, iSCTHoles); + fillHisto(nSCTHoles, iSCTHoles); + fillHisto(n_vs_eta_SCTHoles, eta, iSCTHoles); } if (trk.summaryValue(iTrtHTHits, xAOD::numberOfTRTHighThresholdHits)) { - fillHisto(n_vs_eta_TRTHighThresholdHits,eta, iTrtHTHits); + fillHisto(nTRTHighThresholdHits, iTrtHTHits); + fillHisto(n_vs_eta_TRTHighThresholdHits, eta, iTrtHTHits); } // expert plots @@ -113,46 +152,60 @@ InDetPerfPlot_HitDetailed::fill(const xAOD::TrackParticle &trk) { uint8_t iSCTOutliers(0), iSCTDoubleHoles(0), iSCTShared(0); uint8_t iTRTOutliers(0), iTRTHTOutliers(0); if (trk.summaryValue(iBLayerOutliers, xAOD::numberOfBLayerOutliers)) { - fillHisto(n_vs_eta_BLayerOutliers,eta, iBLayerOutliers); + fillHisto(nBLayerOutliers, iBLayerOutliers); + fillHisto(n_vs_eta_BLayerOutliers, eta, iBLayerOutliers); } if (trk.summaryValue(iBLayerShared, xAOD::numberOfBLayerSharedHits)) { - fillHisto(n_vs_eta_BLayerSharedHits,eta, iBLayerShared); + fillHisto(nBLayerSharedHits, iBLayerShared); + fillHisto(n_vs_eta_BLayerSharedHits, eta, iBLayerShared); } if (trk.summaryValue(iBLayerSplit, xAOD::numberOfBLayerSplitHits)) { - fillHisto(n_vs_eta_BLayerSplitHits,eta, iBLayerSplit); + fillHisto(nBLayerSplitHits, iBLayerSplit); + fillHisto(n_vs_eta_BLayerSplitHits, eta, iBLayerSplit); } if (trk.summaryValue(iPixelOutliers, xAOD::numberOfPixelOutliers)) { - fillHisto(n_vs_eta_PixelOutliers,eta, iPixelOutliers); + fillHisto(nPixelOutliers, iPixelOutliers); + fillHisto(n_vs_eta_PixelOutliers, eta, iPixelOutliers); } if (trk.summaryValue(iPixelContribLayers, xAOD::numberOfContribPixelLayers)) { - fillHisto(n_vs_eta_PixelContribLayers,eta, iPixelContribLayers); + fillHisto(nPixelContribLayers, iPixelContribLayers); + fillHisto(n_vs_eta_PixelContribLayers, eta, iPixelContribLayers); } if (trk.summaryValue(iPixelShared, xAOD::numberOfPixelSharedHits)) { - fillHisto(n_vs_eta_PixelSharedHits,eta, iPixelShared); + fillHisto(nPixelSharedHits, iPixelShared); + fillHisto(n_vs_eta_PixelSharedHits, eta, iPixelShared); } if (trk.summaryValue(iPixelSplit, xAOD::numberOfPixelSplitHits)) { - fillHisto(n_vs_eta_PixelSplitHits,eta, iPixelSplit); + fillHisto(nPixelSplitHits, iPixelSplit); + fillHisto(n_vs_eta_PixelSplitHits, eta, iPixelSplit); } if (trk.summaryValue(iPixelGanged, xAOD::numberOfGangedPixels)) { - fillHisto(n_vs_eta_PixelGangedHits,eta, iPixelGanged); + fillHisto(nPixelGangedHits, iPixelGanged); + fillHisto(n_vs_eta_PixelGangedHits, eta, iPixelGanged); } if (trk.summaryValue(iPixelGangedFF, xAOD::numberOfGangedFlaggedFakes)) { - fillHisto(n_vs_eta_PixelGangedHitsFlaggedFakes,eta, iPixelGangedFF); + fillHisto(nPixelGangedHitsFlaggedFakes, iPixelGangedFF); + fillHisto(n_vs_eta_PixelGangedHitsFlaggedFakes, eta, iPixelGangedFF); } if (trk.summaryValue(iSCTOutliers, xAOD::numberOfSCTOutliers)) { - fillHisto(n_vs_eta_SCTOutliers,eta, iSCTOutliers); + fillHisto(nSCTOutliers, iSCTOutliers); + fillHisto(n_vs_eta_SCTOutliers, eta, iSCTOutliers); } if (trk.summaryValue(iSCTDoubleHoles, xAOD::numberOfSCTDoubleHoles)) { - fillHisto(n_vs_eta_SCTDoubleHoles,eta, iSCTDoubleHoles); + fillHisto(nSCTDoubleHoles, iSCTDoubleHoles); + fillHisto(n_vs_eta_SCTDoubleHoles, eta, iSCTDoubleHoles); } if (trk.summaryValue(iSCTShared, xAOD::numberOfSCTSharedHits)) { - fillHisto(n_vs_eta_SCTSharedHits,eta, iSCTShared); + fillHisto(nSCTSharedHits, iSCTShared); + fillHisto(n_vs_eta_SCTSharedHits, eta, iSCTShared); } if (trk.summaryValue(iTRTOutliers, xAOD::numberOfTRTOutliers)) { - fillHisto(n_vs_eta_TRTOutliers,eta, iTRTOutliers); + fillHisto(nTRTOutliers, iTRTOutliers); + fillHisto(n_vs_eta_TRTOutliers, eta, iTRTOutliers); } if (trk.summaryValue(iTRTHTOutliers, xAOD::numberOfTRTHighThresholdOutliers)) { - fillHisto(n_vs_eta_TRTHighThresholdOutliers,eta, iTRTHTOutliers); + fillHisto(nTRTHighThresholdOutliers, iTRTHTOutliers); + fillHisto(n_vs_eta_TRTHighThresholdOutliers, eta, iTRTHTOutliers); } } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitDetailed.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitDetailed.h index c5a6cb2faf83d9707fd494b88c3e84d91383e585..56e25d03b5dc2531f238528d6a3c9eb6e077b466 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitDetailed.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_HitDetailed.h @@ -6,56 +6,61 @@ #define INDETPERFPLOT_HITDETAILED_H #include "InDetPlotBase.h" -// #include "TProfile.h" #include "xAODTracking/TrackParticleFwd.h" -#include "xAODTruth/TruthParticle.h" - - -// #include "TrkValHistUtils/ParamPlots.h" -#include "TrkValHistUtils/EfficiencyPlots.h" -#include "TrkValHistUtils/EfficiencyPurityCalculator.h" +class TH1; +class TProfile; class InDetPerfPlot_HitDetailed: public InDetPlotBase { public: - InDetPerfPlot_HitDetailed(InDetPlotBase *pParent, std::string sDir); - void fill(const xAOD::TrackParticle &trk); - - ///@name Hit content of xAOD::TrackParticle as function of eta - ///@{ - void setEtaBinning(int nbins, float eta_min, float eta_max); - - TProfile *n_vs_eta_BLayerHits; - TProfile *n_vs_eta_BLayerOutliers; - TProfile *n_vs_eta_BLayerSharedHits; - TProfile *n_vs_eta_BLayerSplitHits; - TProfile *n_vs_eta_DBMHitsNeg; - TProfile *n_vs_eta_DBMHitsPos; - TProfile *n_vs_eta_PixelHits; - TProfile *n_vs_eta_PixelHoles; - TProfile *n_vs_eta_PixelOutliers; - TProfile *n_vs_eta_PixelContribLayers; - TProfile *n_vs_eta_PixelSharedHits; - TProfile *n_vs_eta_PixelSplitHits; - TProfile *n_vs_eta_PixelGangedHits; - TProfile *n_vs_eta_PixelGangedHitsFlaggedFakes; - TProfile *n_vs_eta_SCTHits; - TProfile *n_vs_eta_SCTHoles; - TProfile *n_vs_eta_SCTOutliers; - TProfile *n_vs_eta_SCTDoubleHoles; - TProfile *n_vs_eta_SCTSharedHits; - TProfile *n_vs_eta_TRTHits; - TProfile *n_vs_eta_TRTHighThresholdHits; - TProfile *n_vs_eta_TRTOutliers; - TProfile *n_vs_eta_TRTHighThresholdOutliers; - - - ///@} + InDetPerfPlot_HitDetailed(InDetPlotBase* pParent, std::string sDir); + void fill(const xAOD::TrackParticle& trk); + // 1D histograms + TH1* nBLayerHits; + TH1* nBLayerOutliers; + TH1* nBLayerSharedHits; + TH1* nBLayerSplitHits; + TH1* nPixelHits; + TH1* nPixelHoles; + TH1* nPixelOutliers; + TH1* nPixelContribLayers; + TH1* nPixelSharedHits; + TH1* nPixelSplitHits; + TH1* nPixelGangedHits; + TH1* nPixelGangedHitsFlaggedFakes; + TH1* nSCTHits; + TH1* nSCTHoles; + TH1* nSCTOutliers; + TH1* nSCTDoubleHoles; + TH1* nSCTSharedHits; + TH1* nTRTHits; + TH1* nTRTHighThresholdHits; + TH1* nTRTOutliers; + TH1* nTRTHighThresholdOutliers; + // eta profiles + TProfile* n_vs_eta_BLayerHits; + TProfile* n_vs_eta_BLayerOutliers; + TProfile* n_vs_eta_BLayerSharedHits; + TProfile* n_vs_eta_BLayerSplitHits; + TProfile* n_vs_eta_PixelHits; + TProfile* n_vs_eta_PixelHoles; + TProfile* n_vs_eta_PixelOutliers; + TProfile* n_vs_eta_PixelContribLayers; + TProfile* n_vs_eta_PixelSharedHits; + TProfile* n_vs_eta_PixelSplitHits; + TProfile* n_vs_eta_PixelGangedHits; + TProfile* n_vs_eta_PixelGangedHitsFlaggedFakes; + TProfile* n_vs_eta_SCTHits; + TProfile* n_vs_eta_SCTHoles; + TProfile* n_vs_eta_SCTOutliers; + TProfile* n_vs_eta_SCTDoubleHoles; + TProfile* n_vs_eta_SCTSharedHits; + TProfile* n_vs_eta_TRTHits; + TProfile* n_vs_eta_TRTHighThresholdHits; + TProfile* n_vs_eta_TRTOutliers; + TProfile* n_vs_eta_TRTHighThresholdOutliers; private: void initializePlots(); - - int m_etaNBins; - float m_etaMin, m_etaMax, m_etaMinDBM, m_etaMaxDBM; }; #endif diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Pt.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Pt.cxx index 82e7e758771970bd3df0323b754ed5ac5bc977e3..4d4ef4a7733e5ecf23eb0899ccace8777236d840 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Pt.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Pt.cxx @@ -11,7 +11,7 @@ #include "InDetPerfPlot_Pt.h" -InDetPerfPlot_Pt::InDetPerfPlot_Pt(InDetPlotBase *pParent, const std::string &sDir) : InDetPlotBase(pParent, sDir), +InDetPerfPlot_Pt::InDetPerfPlot_Pt(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase(pParent, sDir), m_recPt{}, m_recPtLow{} { // nop @@ -24,17 +24,17 @@ InDetPerfPlot_Pt::initializePlots() { } void -InDetPerfPlot_Pt::fill(const xAOD::IParticle &particle) { - const float pt(particle.pt() / 1000.); +InDetPerfPlot_Pt::fill(const xAOD::IParticle& particle) { + const float pt(particle.pt() * .001); - fillHisto(m_recPt,pt); - fillHisto(m_recPtLow,pt); + fillHisto(m_recPt, pt); + fillHisto(m_recPtLow, pt); } void -InDetPerfPlot_Pt::fill(const xAOD::TruthParticle &particle) { - const float pt(particle.pt() / 1000.); +InDetPerfPlot_Pt::fill(const xAOD::TruthParticle& particle) { + const float pt(particle.pt() * 0.001); - fillHisto(m_recPt,pt); - fillHisto(m_recPtLow,pt); + fillHisto(m_recPt, pt); + fillHisto(m_recPtLow, pt); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Pt.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Pt.h index b482721a134c15f27483e5c3c7db99628b7c74b6..0340bb57fb64232d74a52dc1ef4d99623d26f5d8 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Pt.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Pt.h @@ -22,14 +22,14 @@ ///class holding Pt plots for Inner Detector RTT Validation and implementing fill methods class InDetPerfPlot_Pt: public InDetPlotBase { public: - InDetPerfPlot_Pt(InDetPlotBase *pParent, const std::string &dirName); - void fill(const xAOD::IParticle &particle); - void fill(const xAOD::TruthParticle &particle); + InDetPerfPlot_Pt(InDetPlotBase* pParent, const std::string& dirName); + void fill(const xAOD::IParticle& particle); + void fill(const xAOD::TruthParticle& particle); private: ///Pt Histogram with full pt range - TH1 *m_recPt; + TH1* m_recPt; ///Pt histogram with restricted range - TH1 *m_recPtLow; + TH1* m_recPtLow; // plot base has nop default implementation of this; we use it to book the histos void initializePlots(); }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.cxx index 369b80b9e3f07b0e6f38546a89a4fd1f923b35a1..4556d756cca76777c79cbf6aa6ff372a024a50f0 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.cxx @@ -16,7 +16,7 @@ #include <numeric> -InDetPerfPlot_TrkInJet::InDetPerfPlot_TrkInJet(InDetPlotBase *pParent, std::string sDir) : +InDetPerfPlot_TrkInJet::InDetPerfPlot_TrkInJet(InDetPlotBase* pParent, std::string sDir) : InDetPlotBase(pParent, sDir), m_jetPt{}, m_recPt{}, @@ -260,7 +260,7 @@ InDetPerfPlot_TrkInJet::clearEffCounters() { } bool -InDetPerfPlot_TrkInJet::fill(const xAOD::TrackParticle &trk, const xAOD::Jet &jet) { +InDetPerfPlot_TrkInJet::fill(const xAOD::TrackParticle& trk, const xAOD::Jet& jet) { ATH_MSG_VERBOSE("Reached track in jet fill"); float jetDR = jet.p4().DeltaR(trk.p4()); @@ -279,28 +279,28 @@ InDetPerfPlot_TrkInJet::fill(const xAOD::TrackParticle &trk, const xAOD::Jet &je uint8_t iBLayerHits(0), iPixHits(0), iSctHits(0), iTrtHits(0); uint8_t iPixHoles(0), iSCTHoles(0), iTrtHTHits(0); - fillHisto(m_recPt,trk.pt() / 1e3); + fillHisto(m_recPt, trk.pt() / 1e3); if (trk.summaryValue(iBLayerHits, xAOD::numberOfBLayerHits)) { - fillHisto(n_vs_jetDR_BLayerHits,jetDR, iBLayerHits); + fillHisto(n_vs_jetDR_BLayerHits, jetDR, iBLayerHits); } if (trk.summaryValue(iPixHits, xAOD::numberOfPixelHits)) { - fillHisto(n_vs_jetDR_PixelHits,jetDR, iPixHits); + fillHisto(n_vs_jetDR_PixelHits, jetDR, iPixHits); } if (trk.summaryValue(iSctHits, xAOD::numberOfSCTHits)) { - fillHisto(n_vs_jetDR_SCTHits,jetDR, iSctHits); + fillHisto(n_vs_jetDR_SCTHits, jetDR, iSctHits); } if (trk.summaryValue(iTrtHits, xAOD::numberOfTRTHits)) { - fillHisto(n_vs_jetDR_TRTHits,jetDR, iTrtHits); + fillHisto(n_vs_jetDR_TRTHits, jetDR, iTrtHits); } if (trk.summaryValue(iPixHoles, xAOD::numberOfPixelHoles)) { - fillHisto(n_vs_jetDR_PixelHoles,jetDR, iPixHoles); + fillHisto(n_vs_jetDR_PixelHoles, jetDR, iPixHoles); } if (trk.summaryValue(iSCTHoles, xAOD::numberOfSCTHoles)) { - fillHisto(n_vs_jetDR_SCTHoles,jetDR, iSCTHoles); + fillHisto(n_vs_jetDR_SCTHoles, jetDR, iSCTHoles); } if (trk.summaryValue(iTrtHTHits, xAOD::numberOfTRTHighThresholdHits)) { - fillHisto(n_vs_jetDR_TRTHighThresholdHits,jetDR, iTrtHTHits); + fillHisto(n_vs_jetDR_TRTHighThresholdHits, jetDR, iTrtHTHits); } // expert plots @@ -310,43 +310,43 @@ InDetPerfPlot_TrkInJet::fill(const xAOD::TrackParticle &trk, const xAOD::Jet &je uint8_t iSCTOutliers(0), iSCTDoubleHoles(0), iSCTShared(0); uint8_t iTRTOutliers(0), iTRTHTOutliers(0); if (trk.summaryValue(iBLayerOutliers, xAOD::numberOfBLayerOutliers)) { - fillHisto(n_vs_jetDR_BLayerOutliers,jetDR, iBLayerOutliers); + fillHisto(n_vs_jetDR_BLayerOutliers, jetDR, iBLayerOutliers); } if (trk.summaryValue(iBLayerShared, xAOD::numberOfBLayerSharedHits)) { - fillHisto(n_vs_jetDR_BLayerSharedHits,jetDR, iBLayerShared); + fillHisto(n_vs_jetDR_BLayerSharedHits, jetDR, iBLayerShared); } if (trk.summaryValue(iBLayerSplit, xAOD::numberOfBLayerSplitHits)) { - fillHisto(n_vs_jetDR_BLayerSplitHits,jetDR, iBLayerSplit); + fillHisto(n_vs_jetDR_BLayerSplitHits, jetDR, iBLayerSplit); } if (trk.summaryValue(iPixelOutliers, xAOD::numberOfPixelOutliers)) { - fillHisto(n_vs_jetDR_PixelOutliers,jetDR, iPixelOutliers); + fillHisto(n_vs_jetDR_PixelOutliers, jetDR, iPixelOutliers); } if (trk.summaryValue(iPixelContribLayers, xAOD::numberOfContribPixelLayers)) { - fillHisto(n_vs_jetDR_PixelContribLayers,jetDR, iPixelContribLayers); + fillHisto(n_vs_jetDR_PixelContribLayers, jetDR, iPixelContribLayers); } if (trk.summaryValue(iPixelShared, xAOD::numberOfPixelSharedHits)) { - fillHisto(n_vs_jetDR_PixelSharedHits,jetDR, iPixelShared); + fillHisto(n_vs_jetDR_PixelSharedHits, jetDR, iPixelShared); } if (trk.summaryValue(iPixelSplit, xAOD::numberOfPixelSplitHits)) { - fillHisto(n_vs_jetDR_PixelSplitHits,jetDR, iPixelSplit); + fillHisto(n_vs_jetDR_PixelSplitHits, jetDR, iPixelSplit); } if (trk.summaryValue(iPixelGanged, xAOD::numberOfGangedPixels)) { - fillHisto(n_vs_jetDR_PixelGangedHits,jetDR, iPixelGanged); + fillHisto(n_vs_jetDR_PixelGangedHits, jetDR, iPixelGanged); } if (trk.summaryValue(iSCTOutliers, xAOD::numberOfSCTOutliers)) { - fillHisto(n_vs_jetDR_PixelOutliers,jetDR, iSCTOutliers); + fillHisto(n_vs_jetDR_PixelOutliers, jetDR, iSCTOutliers); } if (trk.summaryValue(iSCTDoubleHoles, xAOD::numberOfSCTDoubleHoles)) { - fillHisto(n_vs_jetDR_SCTDoubleHoles,jetDR, iSCTDoubleHoles); + fillHisto(n_vs_jetDR_SCTDoubleHoles, jetDR, iSCTDoubleHoles); } if (trk.summaryValue(iSCTShared, xAOD::numberOfSCTSharedHits)) { - fillHisto(n_vs_jetDR_SCTSharedHits,jetDR, iSCTShared); + fillHisto(n_vs_jetDR_SCTSharedHits, jetDR, iSCTShared); } if (trk.summaryValue(iTRTOutliers, xAOD::numberOfTRTOutliers)) { - fillHisto(n_vs_jetDR_TRTOutliers,jetDR, iTRTOutliers); + fillHisto(n_vs_jetDR_TRTOutliers, jetDR, iTRTOutliers); } if (trk.summaryValue(iTRTHTOutliers, xAOD::numberOfTRTHighThresholdOutliers)) { - fillHisto(n_vs_jetDR_TRTHighThresholdOutliers,jetDR, iTRTHTOutliers); + fillHisto(n_vs_jetDR_TRTHighThresholdOutliers, jetDR, iTRTHTOutliers); } } ATH_MSG_VERBOSE("Exiting track in jet fill"); @@ -354,7 +354,7 @@ InDetPerfPlot_TrkInJet::fill(const xAOD::TrackParticle &trk, const xAOD::Jet &je } bool -InDetPerfPlot_TrkInJet::fillCounter(const xAOD::Jet &jet) { +InDetPerfPlot_TrkInJet::fillCounter(const xAOD::Jet& jet) { ATH_MSG_VERBOSE("Filling jet counters"); constexpr float thousandth(1.0 / 1000.0); const float jetPt(jet.pt()); @@ -368,28 +368,28 @@ InDetPerfPlot_TrkInJet::fillCounter(const xAOD::Jet &jet) { // // Number of tracks in dR unsigned int i(0); - for (const auto &tracksInDr: m_tracksVsDr) { + for (const auto& tracksInDr: m_tracksVsDr) { const float binValue = binCentre(i++); - fillHisto(n_vs_jetDR,binValue, tracksInDr); + fillHisto(n_vs_jetDR, binValue, tracksInDr); } totalNTrk = std::accumulate(m_tracksVsDr.begin(), m_tracksVsDr.end(), 0.0); // Now Pt: i = 0; - for (const auto &ptInDr: m_sumPtVsDr) { + for (const auto& ptInDr: m_sumPtVsDr) { const float binValue = binCentre(i++); - fillHisto(sumPt_vs_jetDR,binValue, ptInDr * thousandth); // GeV - fillHisto(fracPt_vs_jetDR,binValue, ptInDr * inverseJetPt); + fillHisto(sumPt_vs_jetDR, binValue, ptInDr * thousandth); // GeV + fillHisto(fracPt_vs_jetDR, binValue, ptInDr * inverseJetPt); } totalSumPt = std::accumulate(m_sumPtVsDr.begin(), m_sumPtVsDr.end(), 0.0); - fillHisto(m_jetPt,jetPt * thousandth); - fillHisto(n_vs_jetPt,jetPt * thousandth, totalNTrk); - fillHisto(sumPt_vs_jetPt,jetPt * thousandth, totalSumPt * thousandth); // GeV - fillHisto(fracPt_vs_jetPt,jetPt * thousandth, totalSumPt * inverseJetPt); + fillHisto(m_jetPt, jetPt * thousandth); + fillHisto(n_vs_jetPt, jetPt * thousandth, totalNTrk); + fillHisto(sumPt_vs_jetPt, jetPt * thousandth, totalSumPt * thousandth); // GeV + fillHisto(fracPt_vs_jetPt, jetPt * thousandth, totalSumPt * inverseJetPt); - fillHisto(m_nTrack,totalNTrk); - fillHisto(m_sumPt,totalSumPt * thousandth); - fillHisto(m_fracPt,totalSumPt * inverseJetPt); + fillHisto(m_nTrack, totalNTrk); + fillHisto(m_sumPt, totalSumPt * thousandth); + fillHisto(m_fracPt, totalSumPt * inverseJetPt); clearCounters(); ATH_MSG_VERBOSE("Exit filling jet counters"); @@ -397,7 +397,7 @@ InDetPerfPlot_TrkInJet::fillCounter(const xAOD::Jet &jet) { } bool -InDetPerfPlot_TrkInJet::BookEffReco(const xAOD::TruthParticle &truth, const xAOD::Jet &jet) { +InDetPerfPlot_TrkInJet::BookEffReco(const xAOD::TruthParticle& truth, const xAOD::Jet& jet) { // fill vectors like above in bins of dR with number of tracks and sum track pT // for reco tracks @@ -415,7 +415,7 @@ InDetPerfPlot_TrkInJet::BookEffReco(const xAOD::TruthParticle &truth, const xAOD } bool -InDetPerfPlot_TrkInJet::BookEffTruth(const xAOD::TruthParticle &truth, const xAOD::Jet &jet) { +InDetPerfPlot_TrkInJet::BookEffTruth(const xAOD::TruthParticle& truth, const xAOD::Jet& jet) { // fill vectors like above in bins of dR with number of tracks and sum track pT // for truth particle float jetDR = jet.p4().DeltaR(truth.p4()); @@ -436,7 +436,7 @@ InDetPerfPlot_TrkInJet::BookEffTruth(const xAOD::TruthParticle &truth, const xAO } bool -InDetPerfPlot_TrkInJet::fillEff(const xAOD::Jet &jet) { +InDetPerfPlot_TrkInJet::fillEff(const xAOD::Jet& jet) { // fill plots vs dR with number of track and sum pt of tracks in this jet // do this for truth and reco tracks separately ( vectors filled about ) // need some way to get the efficiency from these two sets of histograms @@ -449,24 +449,24 @@ InDetPerfPlot_TrkInJet::fillEff(const xAOD::Jet &jet) { for (unsigned int i = 0; i < m_tracksVsDr_reco.size(); i++) { // hit the bin center float iDR = (i + 0.5) * m_dRWidth; - fillHisto(n_vs_jetDR_reco,iDR, m_tracksVsDr_reco.at(i)); - fillHisto(fracPt_vs_jetDR_reco,iDR, m_sumPtVsDr_reco.at(i) / jet.pt()); + fillHisto(n_vs_jetDR_reco, iDR, m_tracksVsDr_reco.at(i)); + fillHisto(fracPt_vs_jetDR_reco, iDR, m_sumPtVsDr_reco.at(i) / jet.pt()); totalNTrk_reco += m_tracksVsDr_reco.at(i); totalSumPt_reco += m_sumPtVsDr_reco.at(i); - fillHisto(n_vs_jetDR_truth,iDR, m_tracksVsDr_truth.at(i)); - fillHisto(fracPt_vs_jetDR_truth,iDR, m_sumPtVsDr_truth.at(i) / jet.pt()); + fillHisto(n_vs_jetDR_truth, iDR, m_tracksVsDr_truth.at(i)); + fillHisto(fracPt_vs_jetDR_truth, iDR, m_sumPtVsDr_truth.at(i) / jet.pt()); totalNTrk_truth += m_tracksVsDr_truth.at(i); totalSumPt_truth += m_sumPtVsDr_truth.at(i); } - fillHisto(n_vs_jetPt_reco,jet.pt() / 1e3, totalNTrk_reco); - fillHisto(sumPt_vs_jetPt_reco,jet.pt() / 1e3, totalSumPt_reco); - fillHisto(fracPt_vs_jetPt_reco,jet.pt() / 1e3, totalSumPt_reco / jet.pt()); + fillHisto(n_vs_jetPt_reco, jet.pt() / 1e3, totalNTrk_reco); + fillHisto(sumPt_vs_jetPt_reco, jet.pt() / 1e3, totalSumPt_reco); + fillHisto(fracPt_vs_jetPt_reco, jet.pt() / 1e3, totalSumPt_reco / jet.pt()); - fillHisto(n_vs_jetPt_truth,jet.pt() / 1e3, totalNTrk_truth); - fillHisto(sumPt_vs_jetPt_truth,jet.pt() / 1e3, totalSumPt_truth); - fillHisto(fracPt_vs_jetPt_truth,jet.pt() / 1e3, totalSumPt_truth / jet.pt()); + fillHisto(n_vs_jetPt_truth, jet.pt() / 1e3, totalNTrk_truth); + fillHisto(sumPt_vs_jetPt_truth, jet.pt() / 1e3, totalSumPt_truth); + fillHisto(fracPt_vs_jetPt_truth, jet.pt() / 1e3, totalSumPt_truth / jet.pt()); clearEffCounters(); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.h index 54e10ba582fc625a3e63408183d81946ec252b00..8da4090b8f0c90265a9bc2270b825bcbf5ca84e4 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrkInJet.h @@ -14,69 +14,69 @@ class InDetPerfPlot_TrkInJet: public InDetPlotBase { public: - InDetPerfPlot_TrkInJet(InDetPlotBase *pParent, std::string sDir); - bool fill(const xAOD::TrackParticle &trk, const xAOD::Jet &jet); - bool fillCounter(const xAOD::Jet &jet); + InDetPerfPlot_TrkInJet(InDetPlotBase* pParent, std::string sDir); + bool fill(const xAOD::TrackParticle& trk, const xAOD::Jet& jet); + bool fillCounter(const xAOD::Jet& jet); - bool BookEffReco(const xAOD::TruthParticle &truth, const xAOD::Jet &jet); - bool BookEffTruth(const xAOD::TruthParticle &truth, const xAOD::Jet &jet); - bool fillEff(const xAOD::Jet &jet); + bool BookEffReco(const xAOD::TruthParticle& truth, const xAOD::Jet& jet); + bool BookEffTruth(const xAOD::TruthParticle& truth, const xAOD::Jet& jet); + bool fillEff(const xAOD::Jet& jet); void clearCounters(); void clearEffCounters(); - TH1 *m_jetPt; - TH1 *m_recPt; - TH1 *m_nTrack; - TH1 *m_sumPt; - TH1 *m_fracPt; + TH1* m_jetPt; + TH1* m_recPt; + TH1* m_nTrack; + TH1* m_sumPt; + TH1* m_fracPt; - TProfile *n_vs_jetDR_BLayerHits; - TProfile *n_vs_jetDR_BLayerOutliers; - TProfile *n_vs_jetDR_BLayerSharedHits; - TProfile *n_vs_jetDR_BLayerSplitHits; - TProfile *n_vs_jetDR_PixelHits; - TProfile *n_vs_jetDR_PixelHoles; - TProfile *n_vs_jetDR_PixelOutliers; - TProfile *n_vs_jetDR_PixelContribLayers; - TProfile *n_vs_jetDR_PixelSharedHits; - TProfile *n_vs_jetDR_PixelSplitHits; - TProfile *n_vs_jetDR_PixelGangedHits; - TProfile *n_vs_jetDR_SCTHits; - TProfile *n_vs_jetDR_SCTHoles; - TProfile *n_vs_jetDR_SCTOutliers; - TProfile *n_vs_jetDR_SCTDoubleHoles; - TProfile *n_vs_jetDR_SCTSharedHits; - TProfile *n_vs_jetDR_TRTHits; - TProfile *n_vs_jetDR_TRTHighThresholdHits; - TProfile *n_vs_jetDR_TRTOutliers; - TProfile *n_vs_jetDR_TRTHighThresholdOutliers; + TProfile* n_vs_jetDR_BLayerHits; + TProfile* n_vs_jetDR_BLayerOutliers; + TProfile* n_vs_jetDR_BLayerSharedHits; + TProfile* n_vs_jetDR_BLayerSplitHits; + TProfile* n_vs_jetDR_PixelHits; + TProfile* n_vs_jetDR_PixelHoles; + TProfile* n_vs_jetDR_PixelOutliers; + TProfile* n_vs_jetDR_PixelContribLayers; + TProfile* n_vs_jetDR_PixelSharedHits; + TProfile* n_vs_jetDR_PixelSplitHits; + TProfile* n_vs_jetDR_PixelGangedHits; + TProfile* n_vs_jetDR_SCTHits; + TProfile* n_vs_jetDR_SCTHoles; + TProfile* n_vs_jetDR_SCTOutliers; + TProfile* n_vs_jetDR_SCTDoubleHoles; + TProfile* n_vs_jetDR_SCTSharedHits; + TProfile* n_vs_jetDR_TRTHits; + TProfile* n_vs_jetDR_TRTHighThresholdHits; + TProfile* n_vs_jetDR_TRTOutliers; + TProfile* n_vs_jetDR_TRTHighThresholdOutliers; - TProfile *n_vs_jetDR; - TProfile *sumPt_vs_jetDR; - TProfile *fracPt_vs_jetDR; - TProfile *n_vs_jetPt; - TProfile *sumPt_vs_jetPt; - TProfile *fracPt_vs_jetPt; + TProfile* n_vs_jetDR; + TProfile* sumPt_vs_jetDR; + TProfile* fracPt_vs_jetDR; + TProfile* n_vs_jetPt; + TProfile* sumPt_vs_jetPt; + TProfile* fracPt_vs_jetPt; - TProfile *n_vs_jetDR_reco; - TProfile *sumPt_vs_jetDR_reco; - TProfile *fracPt_vs_jetDR_reco; - TProfile *n_vs_jetPt_reco; - TProfile *sumPt_vs_jetPt_reco; - TProfile *fracPt_vs_jetPt_reco; - TProfile *n_vs_jetDR_truth; - TProfile *sumPt_vs_jetDR_truth; - TProfile *fracPt_vs_jetDR_truth; - TProfile *n_vs_jetPt_truth; - TProfile *sumPt_vs_jetPt_truth; - TProfile *fracPt_vs_jetPt_truth; + TProfile* n_vs_jetDR_reco; + TProfile* sumPt_vs_jetDR_reco; + TProfile* fracPt_vs_jetDR_reco; + TProfile* n_vs_jetPt_reco; + TProfile* sumPt_vs_jetPt_reco; + TProfile* fracPt_vs_jetPt_reco; + TProfile* n_vs_jetDR_truth; + TProfile* sumPt_vs_jetDR_truth; + TProfile* fracPt_vs_jetDR_truth; + TProfile* n_vs_jetPt_truth; + TProfile* sumPt_vs_jetPt_truth; + TProfile* fracPt_vs_jetPt_truth; - TH1 *n_vs_jetDR_eff; - TH1 *sumPt_vs_jetDR_eff; - TH1 *n_vs_jetPt_eff; - TH1 *sumPt_vs_jetPt_eff; + TH1* n_vs_jetDR_eff; + TH1* sumPt_vs_jetDR_eff; + TH1* n_vs_jetPt_eff; + TH1* sumPt_vs_jetPt_eff; ///@} private: void initializePlots(); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrtTest.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrtTest.cxx index 355598c1dd7785571f6f3d9c31f9c1dd920dff8f..84624ede9ba00a16fa8e4050735b6bbf4dcfac32 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrtTest.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrtTest.cxx @@ -17,41 +17,51 @@ #include "xAODEventInfo/EventInfo.h" // get truth/track matching probability -namespace{ +namespace { float - getMatchingProbability(const xAOD::TrackParticle &trackParticle) { + getMatchingProbability(const xAOD::TrackParticle& trackParticle) { float result(std::numeric_limits<float>::quiet_NaN()); + if (trackParticle.isAvailable<float>("truthMatchProbability")) { result = trackParticle.auxdata<float>("truthMatchProbability"); } return result; } + bool - inRange(const double eta){ - return ((eta >= -2.0) and (eta <= 2.0)); + inRange(const double eta) { + return((eta >= -2.0)and(eta <= 2.0)); } } -InDetPerfPlot_TrtTest::InDetPerfPlot_TrtTest(InDetPlotBase *pParent, const std::string &sDir) : InDetPlotBase(pParent, sDir), -m_mu{},m_nPV{},m_matchProb{},m_trtTubeFrac{}, -m_trackCategories{},m_slimTrackCategories{}, -m_pt{},m_pt_ext{},m_pt_trtHit{},m_pt_trtHitNoOut{},m_pt_trtOutlier{},m_pt_trtHitOut{},m_pt_noTrt{}, -m_eta{},m_eta_ext{},m_eta_trtHit{},m_eta_trtHitNoOut{},m_eta_trtOutlier{},m_eta_trtHitOut{},m_eta_noTrt{}, -m_phi{},m_phi_ext{},m_phi_trtHit{},m_phi_trtHitNoOut{},m_phi_trtOutlier{},m_phi_trtHitOut{},m_phi_noTrt{}, -m_d0{},m_d0_ext{},m_d0_trtHit{},m_d0_trtHitNoOut{},m_d0_trtOutlier{},m_d0_trtHitOut{},m_d0_noTrt{}, -m_z0{}, m_z0_ext{},m_z0_trtHit{},m_z0_trtHitNoOut{},m_z0_trtOutlier{},m_z0_trtHitOut{},m_z0_noTrt{}, -m_tube{},m_tube_ext{},m_tube_trtHit{},m_tube_trtHitNoOut{},m_tube_trtOutlier{},m_tube_trtHitOut{},m_tube_noTrt{}, +InDetPerfPlot_TrtTest::InDetPerfPlot_TrtTest(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase(pParent, + sDir), + m_mu{}, m_nPV{}, m_matchProb{}, m_trtTubeFrac{}, + m_trackCategories{}, m_slimTrackCategories{}, + m_pt{}, m_pt_ext{}, m_pt_trtHit{}, m_pt_trtHitNoOut{}, m_pt_trtOutlier{}, m_pt_trtHitOut{}, m_pt_noTrt{}, + m_eta{}, m_eta_ext{}, m_eta_trtHit{}, m_eta_trtHitNoOut{}, m_eta_trtOutlier{}, m_eta_trtHitOut{}, m_eta_noTrt{}, + m_phi{}, m_phi_ext{}, m_phi_trtHit{}, m_phi_trtHitNoOut{}, m_phi_trtOutlier{}, m_phi_trtHitOut{}, m_phi_noTrt{}, + m_d0{}, m_d0_ext{}, m_d0_trtHit{}, m_d0_trtHitNoOut{}, m_d0_trtOutlier{}, m_d0_trtHitOut{}, m_d0_noTrt{}, + m_z0{}, m_z0_ext{}, m_z0_trtHit{}, m_z0_trtHitNoOut{}, m_z0_trtOutlier{}, m_z0_trtHitOut{}, m_z0_noTrt{}, + m_tube{}, m_tube_ext{}, m_tube_trtHit{}, m_tube_trtHitNoOut{}, m_tube_trtOutlier{}, m_tube_trtHitOut{}, + m_tube_noTrt{}, -m_pt_tubeHitFrac_05_1{},m_eta_tubeHitFrac_05_1{},m_phi_tubeHitFrac_05_1{},m_d0_tubeHitFrac_05_1{},m_z0_tubeHitFrac_05_1{}, -m_pt_tubeHitFrac_04_05{},m_eta_tubeHitFrac_04_05{},m_phi_tubeHitFrac_04_05{},m_d0_tubeHitFrac_04_05{},m_z0_tubeHitFrac_04_05{}, -m_pt_tubeHitFrac_03_04{},m_eta_tubeHitFrac_03_04{},m_phi_tubeHitFrac_03_04{},m_d0_tubeHitFrac_03_04{},m_z0_tubeHitFrac_03_04{}, -m_pt_tubeHitFrac_0_03{},m_eta_tubeHitFrac_0_03{},m_phi_tubeHitFrac_0_03{},m_d0_tubeHitFrac_0_03{},m_z0_tubeHitFrac_0_03{}, + m_pt_tubeHitFrac_05_1{}, m_eta_tubeHitFrac_05_1{}, m_phi_tubeHitFrac_05_1{}, m_d0_tubeHitFrac_05_1{}, + m_z0_tubeHitFrac_05_1{}, + m_pt_tubeHitFrac_04_05{}, m_eta_tubeHitFrac_04_05{}, m_phi_tubeHitFrac_04_05{}, m_d0_tubeHitFrac_04_05{}, + m_z0_tubeHitFrac_04_05{}, + m_pt_tubeHitFrac_03_04{}, m_eta_tubeHitFrac_03_04{}, m_phi_tubeHitFrac_03_04{}, m_d0_tubeHitFrac_03_04{}, + m_z0_tubeHitFrac_03_04{}, + m_pt_tubeHitFrac_0_03{}, m_eta_tubeHitFrac_0_03{}, m_phi_tubeHitFrac_0_03{}, m_d0_tubeHitFrac_0_03{}, + m_z0_tubeHitFrac_0_03{}, -m_pt_vs_nTrtTubeHits{},m_eta_vs_nTrtTubeHits{},m_phi_vs_nTrtTubeHits{},m_d0_vs_nTrtTubeHits{},m_z0_vs_nTrtTubeHits{},m_mu_vs_nTrtTubeHits{},m_nPV_vs_nTrtTubeHits{}, -m_pt_vs_nTrtHits{},m_eta_vs_nTrtHits{},m_phi_vs_nTrtHits{},m_d0_vs_nTrtHits{},m_z0_vs_nTrtHits{},m_mu_vs_nTrtHits{},m_nPV_vs_nTrtHits{}, -m_pt_vs_tubeHitFrac{},m_eta_vs_tubeHitFrac{},m_phi_vs_tubeHitFrac{},m_d0_vs_tubeHitFrac{},m_z0_vs_tubeHitFrac{},m_mu_vs_tubeHitFrac{},m_nPV_vs_tubeHitFrac{}, -m_nTrtHit_vs_nTrtTubeHit{},m_nTrtHit_vs_trtTubeFrac{}, -m_d0_vs_eta{} -{ + m_pt_vs_nTrtTubeHits{}, m_eta_vs_nTrtTubeHits{}, m_phi_vs_nTrtTubeHits{}, m_d0_vs_nTrtTubeHits{}, + m_z0_vs_nTrtTubeHits{}, m_mu_vs_nTrtTubeHits{}, m_nPV_vs_nTrtTubeHits{}, + m_pt_vs_nTrtHits{}, m_eta_vs_nTrtHits{}, m_phi_vs_nTrtHits{}, m_d0_vs_nTrtHits{}, m_z0_vs_nTrtHits{}, + m_mu_vs_nTrtHits{}, m_nPV_vs_nTrtHits{}, + m_pt_vs_tubeHitFrac{}, m_eta_vs_tubeHitFrac{}, m_phi_vs_tubeHitFrac{}, m_d0_vs_tubeHitFrac{}, m_z0_vs_tubeHitFrac{}, + m_mu_vs_tubeHitFrac{}, m_nPV_vs_tubeHitFrac{}, + m_nTrtHit_vs_nTrtTubeHit{}, m_nTrtHit_vs_trtTubeFrac{}, + m_d0_vs_eta{} { // Filled with nothing (?) } @@ -132,13 +142,16 @@ InDetPerfPlot_TrtTest::initializePlots() { } void -InDetPerfPlot_TrtTest::fill(const xAOD::TrackParticle &particle, const xAOD::EventInfo& ei, const xAOD::VertexContainer& pv) { +InDetPerfPlot_TrtTest::fill(const xAOD::TrackParticle& particle, const xAOD::EventInfo& ei, + const xAOD::VertexContainer& pv) { uint8_t iTrtHits(0), iTrtOutliers(0), iTrtTubeHits(0); + std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternReco = particle.patternRecoInfo(); float prob = getMatchingProbability(particle); float mu = ei.actualInteractionsPerCrossing(); int nPV = pv.size(); - double pt = particle.pt()*0.001;; + double pt = particle.pt() * 0.001; + ; double eta = particle.eta(); double phi = particle.phi(); double d0 = particle.d0(); @@ -156,163 +169,221 @@ InDetPerfPlot_TrtTest::fill(const xAOD::TrackParticle &particle, const xAOD::Eve bool LRT = false; double tubeFrac = -1.0; - if (patternReco.test(0)) { SiSd = true; } - if (patternReco.test(3)) { Ext = true; } - if (patternReco.test(4)) { TRTSd = true; } - if (patternReco.test(19)) { Ambi = true; } - if (patternReco.test(20)) { TRTStdAl = true; } - if (patternReco.test(49)) { LRT = true; } + if (patternReco.test(0)) { + SiSd = true; + } + if (patternReco.test(3)) { + Ext = true; + } + if (patternReco.test(4)) { + TRTSd = true; + } + if (patternReco.test(19)) { + Ambi = true; + } + if (patternReco.test(20)) { + TRTStdAl = true; + } + if (patternReco.test(49)) { + LRT = true; + } if (particle.summaryValue(iTrtHits, xAOD::numberOfTRTHits)) { if (iTrtHits > 0) { TRTHit = true; - nTrtHits = (int)iTrtHits; } } + nTrtHits = (int) iTrtHits; + } + } if (particle.summaryValue(iTrtOutliers, xAOD::numberOfTRTOutliers)) { - if (iTrtOutliers > 0) { TRTOut = true; } } - if(particle.summaryValue(iTrtTubeHits,xAOD::numberOfTRTTubeHits)){ - if(iTrtTubeHits > 0) { nTubeHits = (int)iTrtTubeHits; } } + if (iTrtOutliers > 0) { + TRTOut = true; + } + } + if (particle.summaryValue(iTrtTubeHits, xAOD::numberOfTRTTubeHits)) { + if (iTrtTubeHits > 0) { + nTubeHits = (int) iTrtTubeHits; + } + } - if(TRTHit) { tubeFrac = ((double)nTubeHits)/((double)nTrtHits); } - // std::cout << "nTrtHits is " << nTrtHits << ", nTrtTubeHits is " << nTubeHits << ", and the fraction of trt tube hits is " << tubeFrac << std::endl; - - //Fill histograms for matching probability and µ, other general things// - fillHisto(m_mu,mu); - fillHisto(m_nPV,nPV); - fillHisto(m_matchProb,prob); + if (TRTHit) { + tubeFrac = ((double) nTubeHits) / ((double) nTrtHits); + } + // std::cout << "nTrtHits is " << nTrtHits << ", nTrtTubeHits is " << nTubeHits << ", and the fraction of trt tube + // hits is " << tubeFrac << std::endl; - if(TRTHit) { fillHisto(m_trtTubeFrac, tubeFrac); } - - //Fill histograms for track categories// - fillHisto(m_trackCategories,1); - if (SiSd || Ambi) { fillHisto(m_trackCategories,2); } - if (SiSd || Ambi || Ext) { fillHisto(m_trackCategories,3); } - if ((SiSd || Ambi) && Ext) { fillHisto(m_trackCategories,4); } - if (LRT) { fillHisto(m_trackCategories,5); } - if (LRT && Ext) { fillHisto(m_trackCategories,6); } - if (LRT && TRTHit) { fillHisto(m_trackCategories,7); } - if (LRT && TRTOut) { fillHisto(m_trackCategories,8); } - if (Ext && !TRTHit && !TRTOut) { fillHisto(m_trackCategories,9); } - if ((SiSd || Ambi) && LRT) { fillHisto(m_trackCategories,10); } - if (TRTHit && !Ext) { fillHisto(m_trackCategories,11); } - if (TRTOut && !Ext) { fillHisto(m_trackCategories,12); } - if (TRTOut && !Ext && !TRTSd && !TRTStdAl) { fillHisto(m_trackCategories,13); } - if (TRTHit) { fillHisto(m_trackCategories,14); } - if (TRTOut) { fillHisto(m_trackCategories,15); } + // Fill histograms for matching probability and µ, other general things// + fillHisto(m_mu, mu); + fillHisto(m_nPV, nPV); + fillHisto(m_matchProb, prob); - fillHisto(m_slimTrackCategories,1); - if (TRTHit) { fillHisto(m_slimTrackCategories,2); } - if (TRTOut && !TRTHit) { fillHisto(m_slimTrackCategories,3); } - if (!TRTOut && !TRTHit) { fillHisto(m_slimTrackCategories,4); } + if (TRTHit) { + fillHisto(m_trtTubeFrac, tubeFrac); + } - //Fill 1D histograms split by TRT hits// + // Fill histograms for track categories// + fillHisto(m_trackCategories, 1); + if (SiSd || Ambi) { + fillHisto(m_trackCategories, 2); + } + if (SiSd || Ambi || Ext) { + fillHisto(m_trackCategories, 3); + } + if ((SiSd || Ambi) && Ext) { + fillHisto(m_trackCategories, 4); + } + if (LRT) { + fillHisto(m_trackCategories, 5); + } + if (LRT && Ext) { + fillHisto(m_trackCategories, 6); + } + if (LRT && TRTHit) { + fillHisto(m_trackCategories, 7); + } + if (LRT && TRTOut) { + fillHisto(m_trackCategories, 8); + } + if (Ext && !TRTHit && !TRTOut) { + fillHisto(m_trackCategories, 9); + } + if ((SiSd || Ambi) && LRT) { + fillHisto(m_trackCategories, 10); + } + if (TRTHit && !Ext) { + fillHisto(m_trackCategories, 11); + } + if (TRTOut && !Ext) { + fillHisto(m_trackCategories, 12); + } + if (TRTOut && !Ext && !TRTSd && !TRTStdAl) { + fillHisto(m_trackCategories, 13); + } + if (TRTHit) { + fillHisto(m_trackCategories, 14); + } + if (TRTOut) { + fillHisto(m_trackCategories, 15); + } + + fillHisto(m_slimTrackCategories, 1); + if (TRTHit) { + fillHisto(m_slimTrackCategories, 2); + } + if (TRTOut && !TRTHit) { + fillHisto(m_slimTrackCategories, 3); + } + if (!TRTOut && !TRTHit) { + fillHisto(m_slimTrackCategories, 4); + } + + // Fill 1D histograms split by TRT hits// - fillHisto(m_eta,eta); - fillHisto(m_tube,nTubeHits); - if(inRange(eta)) { - fillHisto(m_pt,pt); - fillHisto(m_phi,phi); - fillHisto(m_d0,d0); - fillHisto(m_z0,z0); + fillHisto(m_eta, eta); + fillHisto(m_tube, nTubeHits); + if (inRange(eta)) { + fillHisto(m_pt, pt); + fillHisto(m_phi, phi); + fillHisto(m_d0, d0); + fillHisto(m_z0, z0); } if (Ext) { - fillHisto(m_eta_ext,eta); - fillHisto(m_tube_ext,nTubeHits); - if(inRange(eta)) { - fillHisto(m_pt_ext,pt); - fillHisto(m_phi_ext,phi); - fillHisto(m_d0_ext,d0); - fillHisto(m_z0_ext,z0); + fillHisto(m_eta_ext, eta); + fillHisto(m_tube_ext, nTubeHits); + if (inRange(eta)) { + fillHisto(m_pt_ext, pt); + fillHisto(m_phi_ext, phi); + fillHisto(m_d0_ext, d0); + fillHisto(m_z0_ext, z0); } } if (TRTHit) { - fillHisto(m_eta_trtHit,eta); - fillHisto(m_tube_trtHit,nTubeHits); - if(inRange(eta)) { - fillHisto(m_pt_trtHit,pt); - fillHisto(m_eta_trtHit,eta); - fillHisto(m_phi_trtHit,phi); - fillHisto(m_d0_trtHit,d0); - fillHisto(m_z0_trtHit,z0); + fillHisto(m_eta_trtHit, eta); + fillHisto(m_tube_trtHit, nTubeHits); + if (inRange(eta)) { + fillHisto(m_pt_trtHit, pt); + fillHisto(m_eta_trtHit, eta); + fillHisto(m_phi_trtHit, phi); + fillHisto(m_d0_trtHit, d0); + fillHisto(m_z0_trtHit, z0); } } if (TRTHit && !TRTOut) { - fillHisto(m_eta_trtHitNoOut,eta); - fillHisto(m_tube_trtHitNoOut,nTubeHits); - if(inRange(eta)) { - fillHisto(m_pt_trtHitNoOut,pt); - fillHisto(m_phi_trtHitNoOut,phi); - fillHisto(m_d0_trtHitNoOut,d0); - fillHisto(m_z0_trtHitNoOut,z0); + fillHisto(m_eta_trtHitNoOut, eta); + fillHisto(m_tube_trtHitNoOut, nTubeHits); + if (inRange(eta)) { + fillHisto(m_pt_trtHitNoOut, pt); + fillHisto(m_phi_trtHitNoOut, phi); + fillHisto(m_d0_trtHitNoOut, d0); + fillHisto(m_z0_trtHitNoOut, z0); } } if (TRTHit && TRTOut) { - fillHisto(m_eta_trtHitOut,eta); - fillHisto(m_tube_trtHitOut,nTubeHits); - if(inRange(eta)) { - fillHisto(m_pt_trtHitOut,pt); - fillHisto(m_phi_trtHitOut,phi); - fillHisto(m_d0_trtHitOut,d0); - fillHisto(m_z0_trtHitOut,z0); + fillHisto(m_eta_trtHitOut, eta); + fillHisto(m_tube_trtHitOut, nTubeHits); + if (inRange(eta)) { + fillHisto(m_pt_trtHitOut, pt); + fillHisto(m_phi_trtHitOut, phi); + fillHisto(m_d0_trtHitOut, d0); + fillHisto(m_z0_trtHitOut, z0); } } if (!TRTHit && TRTOut) { - fillHisto(m_eta_trtOutlier,eta); - fillHisto(m_tube_trtOutlier,nTubeHits); - if(inRange(eta)) { - fillHisto(m_pt_trtOutlier,pt); - fillHisto(m_phi_trtOutlier,phi); - fillHisto(m_d0_trtOutlier,d0); - fillHisto(m_z0_trtOutlier,z0); + fillHisto(m_eta_trtOutlier, eta); + fillHisto(m_tube_trtOutlier, nTubeHits); + if (inRange(eta)) { + fillHisto(m_pt_trtOutlier, pt); + fillHisto(m_phi_trtOutlier, phi); + fillHisto(m_d0_trtOutlier, d0); + fillHisto(m_z0_trtOutlier, z0); } } if (!TRTHit && !TRTOut) { - fillHisto(m_eta_noTrt,eta); - fillHisto(m_tube_noTrt,nTubeHits); - if(inRange(eta)) { - fillHisto(m_pt_noTrt,pt); - fillHisto(m_phi_noTrt,phi); - fillHisto(m_d0_noTrt,d0); - fillHisto(m_z0_noTrt,z0); + fillHisto(m_eta_noTrt, eta); + fillHisto(m_tube_noTrt, nTubeHits); + if (inRange(eta)) { + fillHisto(m_pt_noTrt, pt); + fillHisto(m_phi_noTrt, phi); + fillHisto(m_d0_noTrt, d0); + fillHisto(m_z0_noTrt, z0); } } - //Fill 2D histograms// + // Fill 2D histograms// // general things// - fillHisto(m_d0_vs_eta,d0,eta); + fillHisto(m_d0_vs_eta, d0, eta); - //trt things - fillHisto(m_eta_vs_nTrtTubeHits,eta,nTubeHits); - fillHisto(m_mu_vs_nTrtTubeHits,mu,nTubeHits); - fillHisto(m_nPV_vs_nTrtTubeHits,nPV,nTubeHits); - fillHisto(m_eta_vs_nTrtHits,eta,nTrtHits); - fillHisto(m_mu_vs_nTrtHits,mu,nTrtHits); - fillHisto(m_nPV_vs_nTrtHits,nPV,nTrtHits); - if(inRange(eta)) { - fillHisto(m_pt_vs_nTrtTubeHits,pt,nTubeHits); - fillHisto(m_phi_vs_nTrtTubeHits,phi,nTubeHits); - fillHisto(m_d0_vs_nTrtTubeHits,d0,nTubeHits); - fillHisto(m_z0_vs_nTrtTubeHits,z0,nTubeHits); - fillHisto(m_pt_vs_nTrtHits,pt,nTrtHits); - fillHisto(m_phi_vs_nTrtHits,phi,nTrtHits); - fillHisto(m_d0_vs_nTrtHits,d0,nTrtHits); - fillHisto(m_z0_vs_nTrtHits,z0,nTrtHits); - } - + // trt things + fillHisto(m_eta_vs_nTrtTubeHits, eta, nTubeHits); + fillHisto(m_mu_vs_nTrtTubeHits, mu, nTubeHits); + fillHisto(m_nPV_vs_nTrtTubeHits, nPV, nTubeHits); + fillHisto(m_eta_vs_nTrtHits, eta, nTrtHits); + fillHisto(m_mu_vs_nTrtHits, mu, nTrtHits); + fillHisto(m_nPV_vs_nTrtHits, nPV, nTrtHits); + if (inRange(eta)) { + fillHisto(m_pt_vs_nTrtTubeHits, pt, nTubeHits); + fillHisto(m_phi_vs_nTrtTubeHits, phi, nTubeHits); + fillHisto(m_d0_vs_nTrtTubeHits, d0, nTubeHits); + fillHisto(m_z0_vs_nTrtTubeHits, z0, nTubeHits); + fillHisto(m_pt_vs_nTrtHits, pt, nTrtHits); + fillHisto(m_phi_vs_nTrtHits, phi, nTrtHits); + fillHisto(m_d0_vs_nTrtHits, d0, nTrtHits); + fillHisto(m_z0_vs_nTrtHits, z0, nTrtHits); + } - if(TRTHit && !TRTStdAl && !TRTSd) { - fillHisto(m_nTrtHit_vs_nTrtTubeHit,nTrtHits,nTubeHits); - fillHisto(m_nTrtHit_vs_trtTubeFrac,nTrtHits,tubeFrac); - fillHisto(m_eta_vs_tubeHitFrac,eta,tubeFrac); - fillHisto(m_mu_vs_tubeHitFrac,mu,tubeFrac); - fillHisto(m_nPV_vs_tubeHitFrac,nPV,tubeFrac); - if(inRange(eta)) { - fillHisto(m_pt_vs_tubeHitFrac,pt,tubeFrac); - fillHisto(m_phi_vs_tubeHitFrac,phi,tubeFrac); - fillHisto(m_d0_vs_tubeHitFrac,d0,tubeFrac); - fillHisto(m_z0_vs_tubeHitFrac,z0,tubeFrac); + + if (TRTHit && !TRTStdAl && !TRTSd) { + fillHisto(m_nTrtHit_vs_nTrtTubeHit, nTrtHits, nTubeHits); + fillHisto(m_nTrtHit_vs_trtTubeFrac, nTrtHits, tubeFrac); + fillHisto(m_eta_vs_tubeHitFrac, eta, tubeFrac); + fillHisto(m_mu_vs_tubeHitFrac, mu, tubeFrac); + fillHisto(m_nPV_vs_tubeHitFrac, nPV, tubeFrac); + if (inRange(eta)) { + fillHisto(m_pt_vs_tubeHitFrac, pt, tubeFrac); + fillHisto(m_phi_vs_tubeHitFrac, phi, tubeFrac); + fillHisto(m_d0_vs_tubeHitFrac, d0, tubeFrac); + fillHisto(m_z0_vs_tubeHitFrac, z0, tubeFrac); } } - } void diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrtTest.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrtTest.h index 7f7af2f3ccda28ba4d1c8f596151966f155c82c8..32f5c0517c7e3e2f3465b37c39a53deef434daa3 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrtTest.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_TrtTest.h @@ -22,35 +22,44 @@ class InDetPerfPlot_TrtTest: public InDetPlotBase { public: - InDetPerfPlot_TrtTest(InDetPlotBase *pParent, const std::string &dirName); - void fill(const xAOD::TrackParticle &particle, const xAOD::EventInfo& ei, const xAOD::VertexContainer& pv); + InDetPerfPlot_TrtTest(InDetPlotBase* pParent, const std::string& dirName); + void fill(const xAOD::TrackParticle& particle, const xAOD::EventInfo& ei, const xAOD::VertexContainer& pv); private: ///////////////1D Histograms///////////////////// ///////////////////general stuff///////////////// - TH1 *m_mu, *m_nPV; - TH1 *m_matchProb; - TH1 *m_trtTubeFrac; + TH1* m_mu, * m_nPV; + TH1* m_matchProb; + TH1* m_trtTubeFrac; ///////////////track categories////////////////// - TH1 *m_trackCategories,*m_slimTrackCategories; - - TH1 *m_pt,*m_pt_ext,*m_pt_trtHit,*m_pt_trtHitNoOut,*m_pt_trtOutlier,*m_pt_trtHitOut,*m_pt_noTrt; - TH1 *m_eta,*m_eta_ext,*m_eta_trtHit,*m_eta_trtHitNoOut,*m_eta_trtOutlier,*m_eta_trtHitOut,*m_eta_noTrt; - TH1 *m_phi,*m_phi_ext,*m_phi_trtHit,*m_phi_trtHitNoOut,*m_phi_trtOutlier,*m_phi_trtHitOut,*m_phi_noTrt; - TH1 *m_d0,*m_d0_ext,*m_d0_trtHit,*m_d0_trtHitNoOut,*m_d0_trtOutlier,*m_d0_trtHitOut,*m_d0_noTrt; - TH1 *m_z0,*m_z0_ext,*m_z0_trtHit,*m_z0_trtHitNoOut,*m_z0_trtOutlier,*m_z0_trtHitOut,*m_z0_noTrt; - TH1 *m_tube,*m_tube_ext,*m_tube_trtHit,*m_tube_trtHitNoOut,*m_tube_trtOutlier,*m_tube_trtHitOut,*m_tube_noTrt; + TH1* m_trackCategories, * m_slimTrackCategories; + + TH1* m_pt, * m_pt_ext, * m_pt_trtHit, * m_pt_trtHitNoOut, * m_pt_trtOutlier, * m_pt_trtHitOut, * m_pt_noTrt; + TH1* m_eta, * m_eta_ext, * m_eta_trtHit, * m_eta_trtHitNoOut, * m_eta_trtOutlier, * m_eta_trtHitOut, * m_eta_noTrt; + TH1* m_phi, * m_phi_ext, * m_phi_trtHit, * m_phi_trtHitNoOut, * m_phi_trtOutlier, * m_phi_trtHitOut, * m_phi_noTrt; + TH1* m_d0, * m_d0_ext, * m_d0_trtHit, * m_d0_trtHitNoOut, * m_d0_trtOutlier, * m_d0_trtHitOut, * m_d0_noTrt; + TH1* m_z0, * m_z0_ext, * m_z0_trtHit, * m_z0_trtHitNoOut, * m_z0_trtOutlier, * m_z0_trtHitOut, * m_z0_noTrt; + TH1* m_tube, * m_tube_ext, * m_tube_trtHit, * m_tube_trtHitNoOut, * m_tube_trtOutlier, * m_tube_trtHitOut, + * m_tube_noTrt; ///////////split by tube fraction//////////////// ////////////not used at the moment/////////////////// - TH1 *m_pt_tubeHitFrac_05_1,*m_eta_tubeHitFrac_05_1,*m_phi_tubeHitFrac_05_1,*m_d0_tubeHitFrac_05_1,*m_z0_tubeHitFrac_05_1; - TH1 *m_pt_tubeHitFrac_04_05,*m_eta_tubeHitFrac_04_05,*m_phi_tubeHitFrac_04_05,*m_d0_tubeHitFrac_04_05,*m_z0_tubeHitFrac_04_05; - TH1 *m_pt_tubeHitFrac_03_04,*m_eta_tubeHitFrac_03_04,*m_phi_tubeHitFrac_03_04,*m_d0_tubeHitFrac_03_04,*m_z0_tubeHitFrac_03_04; - TH1 *m_pt_tubeHitFrac_0_03,*m_eta_tubeHitFrac_0_03,*m_phi_tubeHitFrac_0_03,*m_d0_tubeHitFrac_0_03,*m_z0_tubeHitFrac_0_03; + TH1* m_pt_tubeHitFrac_05_1, * m_eta_tubeHitFrac_05_1, * m_phi_tubeHitFrac_05_1, * m_d0_tubeHitFrac_05_1, + * m_z0_tubeHitFrac_05_1; + TH1* m_pt_tubeHitFrac_04_05, * m_eta_tubeHitFrac_04_05, * m_phi_tubeHitFrac_04_05, * m_d0_tubeHitFrac_04_05, + * m_z0_tubeHitFrac_04_05; + TH1* m_pt_tubeHitFrac_03_04, * m_eta_tubeHitFrac_03_04, * m_phi_tubeHitFrac_03_04, * m_d0_tubeHitFrac_03_04, + * m_z0_tubeHitFrac_03_04; + TH1* m_pt_tubeHitFrac_0_03, * m_eta_tubeHitFrac_0_03, * m_phi_tubeHitFrac_0_03, * m_d0_tubeHitFrac_0_03, + * m_z0_tubeHitFrac_0_03; ///////////////2D Histograms///////////////////// - TH2 *m_pt_vs_nTrtTubeHits,*m_eta_vs_nTrtTubeHits,*m_phi_vs_nTrtTubeHits,*m_d0_vs_nTrtTubeHits,*m_z0_vs_nTrtTubeHits,*m_mu_vs_nTrtTubeHits,*m_nPV_vs_nTrtTubeHits; - TH2 *m_pt_vs_nTrtHits,*m_eta_vs_nTrtHits,*m_phi_vs_nTrtHits,*m_d0_vs_nTrtHits,*m_z0_vs_nTrtHits,*m_mu_vs_nTrtHits,*m_nPV_vs_nTrtHits; - TH2 *m_pt_vs_tubeHitFrac,*m_eta_vs_tubeHitFrac,*m_phi_vs_tubeHitFrac,*m_d0_vs_tubeHitFrac,*m_z0_vs_tubeHitFrac,*m_mu_vs_tubeHitFrac,*m_nPV_vs_tubeHitFrac; - TH2 *m_nTrtHit_vs_nTrtTubeHit, *m_nTrtHit_vs_trtTubeFrac; + TH2* m_pt_vs_nTrtTubeHits, * m_eta_vs_nTrtTubeHits, * m_phi_vs_nTrtTubeHits, * m_d0_vs_nTrtTubeHits, + * m_z0_vs_nTrtTubeHits, * m_mu_vs_nTrtTubeHits, * m_nPV_vs_nTrtTubeHits; + TH2* m_pt_vs_nTrtHits, * m_eta_vs_nTrtHits, * m_phi_vs_nTrtHits, * m_d0_vs_nTrtHits, * m_z0_vs_nTrtHits, + * m_mu_vs_nTrtHits, * m_nPV_vs_nTrtHits; + TH2* m_pt_vs_tubeHitFrac, * m_eta_vs_tubeHitFrac, * m_phi_vs_tubeHitFrac, * m_d0_vs_tubeHitFrac, + * m_z0_vs_tubeHitFrac, + * m_mu_vs_tubeHitFrac, * m_nPV_vs_tubeHitFrac; + TH2* m_nTrtHit_vs_nTrtTubeHit, * m_nTrtHit_vs_trtTubeFrac; - TH2 *m_d0_vs_eta; + TH2* m_d0_vs_eta; // Plot base has no default implementation of this; we use it to book the histos diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.cxx index 39c26920e03b123406fc079005e804116d76f34b..7b83b689ebf94f3a309c2f2e55dfba92c0cbe8e3 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.cxx @@ -14,8 +14,11 @@ #include "xAODTracking/VertexContainer.h" #include "EventPrimitives/EventPrimitives.h" #include "EventPrimitives/EventPrimitivesHelpers.h" +#include "InDetPhysValMonitoringUtilities.h" -InDetPerfPlot_Vertex::InDetPerfPlot_Vertex(InDetPlotBase *pParent, const std::string &sDir) : +using namespace IDPVM; + +InDetPerfPlot_Vertex::InDetPerfPlot_Vertex(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase(pParent, sDir), m_vx_x(nullptr), m_vx_y(nullptr), m_vx_z(nullptr), m_vx_err_x(nullptr), m_vx_err_y(nullptr), m_vx_err_z(nullptr), @@ -57,57 +60,57 @@ InDetPerfPlot_Vertex::initializePlots() { } void -InDetPerfPlot_Vertex::fill(const xAOD::Vertex &vertex) { +InDetPerfPlot_Vertex::fill(const xAOD::Vertex& vertex) { // fill position plots - fillHisto(m_vx_x,vertex.x()); - fillHisto(m_vx_y,vertex.y()); - fillHisto(m_vx_z,vertex.z()); + fillHisto(m_vx_x, vertex.x()); + fillHisto(m_vx_y, vertex.y()); + fillHisto(m_vx_z, vertex.z()); // fill error plots - const AmgSymMatrix(3) &covariance = vertex.covariancePosition(); - fillHisto(m_vx_err_x,Amg::error(covariance, 0)); - fillHisto(m_vx_err_y,Amg::error(covariance, 1)); - fillHisto(m_vx_err_z,Amg::error(covariance, 2)); + const AmgSymMatrix(3)& covariance = vertex.covariancePosition(); + fillHisto(m_vx_err_x, Amg::error(covariance, 0)); + fillHisto(m_vx_err_y, Amg::error(covariance, 1)); + fillHisto(m_vx_err_z, Amg::error(covariance, 2)); // fill vertex quality and type - fillHisto(m_vx_type,vertex.vertexType()); + fillHisto(m_vx_type, vertex.vertexType()); float ndf = vertex.numberDoF(); if (ndf != 0) { - fillHisto(m_vx_chi2_over_ndf,vertex.chiSquared() / ndf); + fillHisto(m_vx_chi2_over_ndf, vertex.chiSquared() / ndf); } else { - fillHisto(m_vx_chi2_over_ndf,-1); + fillHisto(m_vx_chi2_over_ndf, -1); } // fill vertex tracks properties int nTracks = vertex.nTrackParticles(); - fillHisto(m_vx_nTracks,nTracks); - for (const float &weight : vertex.trackWeights()) { - fillHisto(m_vx_track_weights,weight); + fillHisto(m_vx_nTracks, nTracks); + for (const float& weight : vertex.trackWeights()) { + fillHisto(m_vx_track_weights, weight); } // fill expert plots: tracks properties at vertex if (m_iDetailLevel >= 100) { // loop over tracks at vertex - for (const auto &elTrk : vertex.trackParticleLinks()) { - const xAOD::TrackParticle *trk = *elTrk; - fillHisto(m_vx_track_pt,trk->pt() / 1000.); // MeV -> GeV - fillHisto(m_vx_track_eta,trk->eta()); + for (const auto& elTrk : vertex.trackParticleLinks()) { + const xAOD::TrackParticle* trk = *elTrk; + fillHisto(m_vx_track_pt, trk->pt() * 1_GeV); // MeV -> GeV + fillHisto(m_vx_track_eta, trk->eta()); const xAOD::ParametersCovMatrix_t covTrk = trk->definingParametersCovMatrix(); - fillHisto(m_vx_track_d0,trk->d0()); - fillHisto(m_vx_track_err_d0,Amg::error(covTrk, 0)); - fillHisto(m_vx_track_z0,trk->z0() - vertex.z()); - fillHisto(m_vx_track_err_z0,Amg::error(covTrk, 1)); + fillHisto(m_vx_track_d0, trk->d0()); + fillHisto(m_vx_track_err_d0, Amg::error(covTrk, 0)); + fillHisto(m_vx_track_z0, trk->z0() - vertex.z()); + fillHisto(m_vx_track_err_z0, Amg::error(covTrk, 1)); bool successfulRetrieval(false); uint8_t iPixHits, iSctHits, iPixHoles, iSctHoles; successfulRetrieval = trk->summaryValue(iPixHits, xAOD::numberOfPixelHits); successfulRetrieval &= trk->summaryValue(iSctHits, xAOD::numberOfSCTHits); if (successfulRetrieval) { - fillHisto(m_vx_track_nSiHits,iPixHits + iSctHits); + fillHisto(m_vx_track_nSiHits, iPixHits + iSctHits); } successfulRetrieval = trk->summaryValue(iPixHoles, xAOD::numberOfPixelHoles); successfulRetrieval &= trk->summaryValue(iSctHoles, xAOD::numberOfSCTHoles); if (successfulRetrieval) { - fillHisto(m_vx_track_nSiHoles,iPixHoles + iSctHoles); + fillHisto(m_vx_track_nSiHoles, iPixHoles + iSctHoles); } } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.h index dc14916fe0c2da480045a9a26d310585d82f6377..06da3e16c2ed42df9db4c267754c1aa15259ea3d 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_Vertex.h @@ -10,70 +10,73 @@ **/ -// std includes -#include <string> + // local includes #include "InDetPlotBase.h" #include "xAODTracking/VertexFwd.h" +// std includes +#include <string> + +class TH1; ///class holding general plots for xAOD::Vertex class InDetPerfPlot_Vertex: public InDetPlotBase { public: - InDetPerfPlot_Vertex(InDetPlotBase *pParent, const std::string &dirName); - void fill(const xAOD::Vertex &vertex); + InDetPerfPlot_Vertex(InDetPlotBase* pParent, const std::string& dirName); + void fill(const xAOD::Vertex& vertex); private: ///@name Position of vertex ///@{ ///Position x - TH1 *m_vx_x; + TH1* m_vx_x; ///Position y - TH1 *m_vx_y; + TH1* m_vx_y; ///Position z - TH1 *m_vx_z; + TH1* m_vx_z; ///@} ///@name Errors of vertex ///Error x - TH1 *m_vx_err_x; + TH1* m_vx_err_x; ///Error y - TH1 *m_vx_err_y; + TH1* m_vx_err_y; ///Error z - TH1 *m_vx_err_z; + TH1* m_vx_err_z; ///@} ///@name Vertex quality and type ///@{ /// chi^2/ndf - TH1 *m_vx_chi2_over_ndf; + TH1* m_vx_chi2_over_ndf; /// type - TH1 *m_vx_type; + TH1* m_vx_type; ///@} ///@name Track properties ///@{ ///Number of tracks at vertex - TH1 *m_vx_nTracks; + TH1* m_vx_nTracks; ///Sumpt2 - TH1 *m_vx_sumpt2; + TH1* m_vx_sumpt2; ///Distribution of tracks' weights - TH1 *m_vx_track_weights; + TH1* m_vx_track_weights; ///Tracks pT (iDetailLevel >= 100) - TH1 *m_vx_track_pt; + TH1* m_vx_track_pt; ///Tracks eta (iDetailLevel >= 100) - TH1 *m_vx_track_eta; + TH1* m_vx_track_eta; ///Tracks silicon hits (iDetailLevel >= 100) - TH1 *m_vx_track_nSiHits; + TH1* m_vx_track_nSiHits; ///Tracks silicon holes (iDetailLevel >= 100) - TH1 *m_vx_track_nSiHoles; + TH1* m_vx_track_nSiHoles; ///Tracks d0 (iDetailLevel >= 100) - TH1 *m_vx_track_d0; + TH1* m_vx_track_d0; ///Tracks d0 error (iDetailLevel >= 100) - TH1 *m_vx_track_err_d0; + TH1* m_vx_track_err_d0; ///Tracks z0 (iDetailLevel >= 100) - TH1 *m_vx_track_z0; + TH1* m_vx_track_z0; ///Tracks z0 error (iDetailLevel >= 100) - TH1 *m_vx_track_err_z0; + TH1* m_vx_track_err_z0; ///@} diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexContainer.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexContainer.cxx index 25681e991b6b563e61d548d2937826f10f4b4a03..ce3b225f45f5ee250cc47c64f3021be533d5fa4e 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexContainer.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexContainer.cxx @@ -15,8 +15,8 @@ #include "EventPrimitives/EventPrimitives.h" #include "EventPrimitives/EventPrimitivesHelpers.h" -InDetPerfPlot_VertexContainer::InDetPerfPlot_VertexContainer(InDetPlotBase *pParent, - const std::string &sDir) : InDetPlotBase(pParent, sDir), +InDetPerfPlot_VertexContainer::InDetPerfPlot_VertexContainer(InDetPlotBase* pParent, + const std::string& sDir) : InDetPlotBase(pParent, sDir), m_vx_n_vs_mu{} { // nop } @@ -30,15 +30,15 @@ InDetPerfPlot_VertexContainer::initializePlots() { } void -InDetPerfPlot_VertexContainer::fill(const xAOD::VertexContainer &vertices, const xAOD::EventInfo &ei) { +InDetPerfPlot_VertexContainer::fill(const xAOD::VertexContainer& vertices, const xAOD::EventInfo& ei) { // fill number of vertices int nGoodVertices(0); - for (const auto &vtx : vertices.stdcont()) { + for (const auto& vtx : vertices.stdcont()) { if (vtx->vertexType() == xAOD::VxType::NoVtx) { continue; // skip dummy vertex } nGoodVertices++; } - fillHisto(m_vx_n_vs_mu,nGoodVertices, ei.actualInteractionsPerCrossing()); + fillHisto(m_vx_n_vs_mu, nGoodVertices, ei.actualInteractionsPerCrossing()); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexContainer.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexContainer.h index f2f02c008a08aeabbb9708a355ef16fa6671b518..94249ff99296e7fd65804940c377fcb8191a3a98 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexContainer.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_VertexContainer.h @@ -19,17 +19,19 @@ #include "xAODTracking/VertexContainerFwd.h" #include "xAODEventInfo/EventInfo.h" +class TH2; + ///class holding general plots for xAOD::Vertex class InDetPerfPlot_VertexContainer: public InDetPlotBase { public: - InDetPerfPlot_VertexContainer(InDetPlotBase *pParent, const std::string &dirName); + InDetPerfPlot_VertexContainer(InDetPlotBase* pParent, const std::string& dirName); // Fills vertex container information; also uses EventInfo - void fill(const xAOD::VertexContainer &vertices, const xAOD::EventInfo &ei); + void fill(const xAOD::VertexContainer& vertices, const xAOD::EventInfo& ei); private: ///@name Number of vertices vs mu ///@{ - TH2 *m_vx_n_vs_mu; + TH2* m_vx_n_vs_mu; ///@} // plot base has nop default implementation of this; we use it to book the histos diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_duplicate.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_duplicate.cxx index ae7a0bb2b7aa8e6178acee0cf29bcf7e78895f40..81f8e5503a0ba0e171487d5a823c7f5d75a5415a 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_duplicate.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_duplicate.cxx @@ -15,9 +15,11 @@ #include "xAODTracking/TrackingPrimitives.h" #include "xAODTruth/TruthParticleContainer.h" #include "xAODTruth/TruthParticle.h" +#include "InDetPhysValMonitoringUtilities.h" +using namespace IDPVM; -InDetPerfPlot_duplicate::InDetPerfPlot_duplicate(InDetPlotBase *pParent, const std::string &sDir) : InDetPlotBase( +InDetPerfPlot_duplicate::InDetPerfPlot_duplicate(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase( pParent, sDir), m_duplicateDeltaPt{}, m_duplicateDeltaPtZoomed{}, @@ -59,89 +61,44 @@ InDetPerfPlot_duplicate::InDetPerfPlot_duplicate(InDetPlotBase *pParent, const s void InDetPerfPlot_duplicate::initializePlots() { - const bool prependDirectory(false); - - m_duplicateDeltaPt = Book1D("duplicateDeltaPt", "p_{T} difference of duplicate reco tracks (in GeV);p_{T}(GeV/c)", 50, - 0., 50, prependDirectory); - m_duplicateDeltaPtZoomed = Book1D("duplicateDeltaPtZoomed", - "p_{T} difference of duplicate reco tracks (in GeV);p_{T}(GeV/c)", 50, 0., 5, - prependDirectory); - m_duplicateDeltaEta = Book1D("duplicateDeltaEta", "eta difference of duplicate reco tracks", 60, -3, 3, - prependDirectory); - m_duplicateDeltaPhi = Book1D("duplicateDeltaPhi", "phi difference of duplicate reco tracks", 60, -3, 3, - prependDirectory); - - - m_duplicateDeltaPTvsTruthPT = Book2D("duplicateDeltaPTvsTruthPT", "delta pt vs truth pt ", 100, 0, 50, 100, 0, 50, - prependDirectory); - m_duplicateDeltaPTvsTruthPTZoomed = Book2D("duplicateDeltaPTvsTruthPTZoomed", "delta pt vs truth pt ", 50, 0, 10, 50, - 0, 10, prependDirectory); - - - - // spectrum plots lpt = lower pt track, hpt = higher pt track, truth = truth track spectrum - m_duplicateLPT = Book1D("duplicateLPT", "p_{T} of the duplicate lower pt reco track (in GeV);p_{T}(GeV/c)", 40, 0., - 40, prependDirectory); - m_duplicateLEta = Book1D("duplicateLEta", "eta of the duplicate lower pt reco track", 60, -3, 3, prependDirectory); - m_duplicateLPhi = Book1D("duplicateLPhi", "phi of the duplicate lower pt reco track", 60, -3, 3, prependDirectory); - - m_duplicateHPT = Book1D("duplicateHPT", "p_{T} of the duplicate higher pt reco track (in GeV);p_{T}(GeV/c)", 40, 0., - 40, prependDirectory); - m_duplicateHEta = Book1D("duplicateHEta", "eta of the duplicate higher pt reco track", 60, -3, 3, prependDirectory); - m_duplicateHPhi = Book1D("duplicateHPhi", "phi of the duplicate higher pt reco track", 60, -3, 3, prependDirectory); - - m_duplicateTruthPT = Book1D("duplicateAssociatedTruthPT", "p_{T} of the associated truth track (in GeV);p_{T}(GeV/c)", - 40, 0., 40, prependDirectory); - m_duplicateTruthEta = Book1D("duplicateAssociatedTruthEta", "eta of the associated truth track", 60, -3, 3, - prependDirectory); - m_duplicateTruthPhi = Book1D("duplicateAssociatedTruthPhi", "phi of the associated truth track", 60, -3, 3, - prependDirectory); - - // resolutions hpt - truth, lpt - truth - - m_duplicateResLPT = Book1D("duplicateResLPT", "p_{T} of the lower pt track minus truth pt (in GeV);p_{T}(GeV/c)", 60, - -15., 15, prependDirectory); - m_duplicateResLEta = Book1D("duplicateResLEta", "eta of the lower pt track minus truth eta", 60, -3, 3, - prependDirectory); - m_duplicateResLPhi = Book1D("duplicateResLPhi", "phi of the lower pt track minus truth phi", 60, -3, 3, - prependDirectory); - m_duplicateResHPT = Book1D("duplicateResHPT", "p_{T} of the higher pt track minus truth pt (in GeV);p_{T}(GeV/c)", 60, - -15., 15, prependDirectory); - m_duplicateResHEta = Book1D("duplicateResHEta", "eta of the higher pt track minus truth eta", 60, -3, 3, - prependDirectory); - m_duplicateResHPhi = Book1D("duplicateResHPhi", "phi of the higher pt track minus truth phi", 60, -3, 3, - prependDirectory); - - m_duplicateProbSpectrum = Book2D("duplicateProbSpectrum", "duplicate probability spectrum", 30, .8, 1.1, 30, .8, 1.1, - prependDirectory); - - - // chisq/dof - m_duplicateLPTHoles = Book1D("duplicateLPTvsHoles", " # of holes of the lower pt track", 10, 0, 10, prependDirectory); - m_duplicateHPTHoles = - Book1D("duplicateHPTvsHoles", " # of holes of the higher pt track", 10, 0, 10, prependDirectory); - m_singleMatchPTHoles = Book1D("singleMatchPTvsHoles", "# of holes of a single matched reco track", 10, 0, 10, - prependDirectory); - - m_duplicateHPixelvsSCTShared = Book2D("duplicateHPixelvsSCTShared", - "# of Pixel Shared Hits vs # of SCT Shared Hits for the higher pt track", 20, 0, - 20, 20, 0, 20, prependDirectory); - m_duplicateLPixelvsSCTShared = Book2D("duplicateLPixelvsSCTShared", - "# of Pixel Shared Hits vs # of SCT Shared Hits for the lower pt track", 20, 0, - 20, 20, 0, 20, prependDirectory); - m_singleMatchPixelvsSCTShared = Book2D("singleMatchPixelvsSCTShared", - "# of Pixel Shared Hits vs # of SCT Shared Hits for a single matched track", - 20, 0, 20, 20, 0, 20, prependDirectory); - m_twoMatchHPixelvsSCTShared = Book2D("twoMatchHPixelvsSCTShared", - "# of Pixel Shared Hits vs # of SCT Shared Hits for the higher pt track", 20, 0, - 20, 20, 0, 20, prependDirectory); - m_twoMatchLPixelvsSCTShared = Book2D("twoMatchLPixelvsSCTShared", - "# of Pixel Shared Hits vs # of SCT Shared Hits for the lower pt track", 20, 0, - 20, 20, 0, 20, prependDirectory); + book(m_duplicateDeltaPt, "duplicateDeltaPt"); + book(m_duplicateDeltaPtZoomed, "duplicateDeltaPtZoomed"); + // cant change the member variable name in the following if using the macros! + IDPVM_BOOK(m_duplicateDeltaEta); + IDPVM_BOOK(m_duplicateDeltaPhi); + IDPVM_BOOK(m_duplicateDeltaPTvsTruthPT); + IDPVM_BOOK(m_duplicateDeltaPTvsTruthPTZoomed); + // + IDPVM_BOOK(m_duplicateLPT); + IDPVM_BOOK(m_duplicateLEta); + IDPVM_BOOK(m_duplicateLPhi); + IDPVM_BOOK(m_duplicateHPT); + IDPVM_BOOK(m_duplicateHEta); + // + IDPVM_BOOK(m_duplicateHPhi); + IDPVM_BOOK(m_duplicateTruthPT); + IDPVM_BOOK(m_duplicateTruthEta); + IDPVM_BOOK(m_duplicateTruthPhi); + IDPVM_BOOK(m_duplicateResLPT); + IDPVM_BOOK(m_duplicateResLEta); + IDPVM_BOOK(m_duplicateResLPhi); + IDPVM_BOOK(m_duplicateResHPT); + IDPVM_BOOK(m_duplicateResHEta); + IDPVM_BOOK(m_duplicateResHPhi); + // + IDPVM_BOOK(m_duplicateProbSpectrum); + IDPVM_BOOK(m_duplicateLPTHoles); + IDPVM_BOOK(m_duplicateHPTHoles); + IDPVM_BOOK(m_singleMatchPTHoles); + IDPVM_BOOK(m_duplicateHPixelvsSCTShared); + IDPVM_BOOK(m_duplicateLPixelvsSCTShared); + IDPVM_BOOK(m_singleMatchPixelvsSCTShared); + IDPVM_BOOK(m_twoMatchHPixelvsSCTShared); + IDPVM_BOOK(m_twoMatchLPixelvsSCTShared); } void -InDetPerfPlot_duplicate::fillSingleMatch(const xAOD::TrackParticle &trackParticle) { +InDetPerfPlot_duplicate::fillSingleMatch(const xAOD::TrackParticle& trackParticle) { uint8_t iPixHoles, iSCTHoles, iPixShared, iSCTShared; int pixHoles = 0; @@ -163,21 +120,21 @@ InDetPerfPlot_duplicate::fillSingleMatch(const xAOD::TrackParticle &trackParticl sctShared = iSCTShared; } - fillHisto(m_singleMatchPixelvsSCTShared,pixShared, sctShared); + fillHisto(m_singleMatchPixelvsSCTShared, pixShared, sctShared); - fillHisto(m_singleMatchPTHoles,sctHoles + pixHoles); + fillHisto(m_singleMatchPTHoles, sctHoles + pixHoles); } void InDetPerfPlot_duplicate::fillTwoMatchDuplicate(const float prob1, const float prob2, - const xAOD::TrackParticle &trackParticle, - const xAOD::TrackParticle &particle, const xAOD::TruthParticle &tp) { - float pt1(trackParticle.pt() / 1000.); - float pt2(particle.pt() / 1000.); - float truthPt(tp.pt() / 1000); + const xAOD::TrackParticle& trackParticle, + const xAOD::TrackParticle& particle, const xAOD::TruthParticle& tp) { + float pt1(trackParticle.pt() * 1_GeV); + float pt2(particle.pt() * 1_GeV); + float truthPt(tp.pt() * 1_GeV); float eta1(trackParticle.eta()); float eta2(particle.eta()); - float truthEta((truthPt>1e-7)? tp.eta(): std::nanf("")); + float truthEta(safelyGetEta(tp)); float phi1(trackParticle.phi()); float phi2(particle.phi()); float truthPhi(tp.phi()); @@ -225,18 +182,18 @@ InDetPerfPlot_duplicate::fillTwoMatchDuplicate(const float prob1, const float pr totalHoles2 = pixHoles2 + sctHoles2; if (prob1 == prob2) { if (pt1 > pt2) { - fillHisto(m_duplicateLPTHoles,totalHoles2); - fillHisto(m_duplicateHPTHoles,totalHoles1); - fillHisto(m_duplicateHPixelvsSCTShared,pixShared1, sctShared1); - fillHisto(m_duplicateLPixelvsSCTShared,pixShared2, sctShared2); - fillHisto(m_duplicateHPTHoles,totalHoles1); + fillHisto(m_duplicateLPTHoles, totalHoles2); + fillHisto(m_duplicateHPTHoles, totalHoles1); + fillHisto(m_duplicateHPixelvsSCTShared, pixShared1, sctShared1); + fillHisto(m_duplicateLPixelvsSCTShared, pixShared2, sctShared2); + fillHisto(m_duplicateHPTHoles, totalHoles1); float deltaPT1 = pt1 - pt2; float deltaEta1 = eta1 - eta2; float deltaPhi1 = phi1 - phi2; - fillHisto(m_duplicateDeltaPTvsTruthPT,truthPt, deltaPT1); - fillHisto(m_duplicateDeltaPTvsTruthPTZoomed,truthPt, deltaPT1); + fillHisto(m_duplicateDeltaPTvsTruthPT, truthPt, deltaPT1); + fillHisto(m_duplicateDeltaPTvsTruthPTZoomed, truthPt, deltaPT1); // resolution plots float resHPT1 = pt1 - truthPt; @@ -246,48 +203,48 @@ InDetPerfPlot_duplicate::fillTwoMatchDuplicate(const float prob1, const float pr float resLEta1 = eta2 - truthEta; float resLPhi1 = phi2 - truthPhi; - fillHisto(m_duplicateResLPT,resLPT1); - fillHisto(m_duplicateResLEta,resLEta1); - fillHisto(m_duplicateResLPhi,resLPhi1); - fillHisto(m_duplicateResHPT,resHPT1); - fillHisto(m_duplicateResHEta,resHEta1); - fillHisto(m_duplicateResHPhi,resHPhi1); + fillHisto(m_duplicateResLPT, resLPT1); + fillHisto(m_duplicateResLEta, resLEta1); + fillHisto(m_duplicateResLPhi, resLPhi1); + fillHisto(m_duplicateResHPT, resHPT1); + fillHisto(m_duplicateResHEta, resHEta1); + fillHisto(m_duplicateResHPhi, resHPhi1); // spectrum plots - fillHisto(m_duplicateLPT,pt2); - fillHisto(m_duplicateLEta,eta2); - fillHisto(m_duplicateLPhi,phi2); - fillHisto(m_duplicateHPT,pt1); - fillHisto(m_duplicateHEta,eta1); - fillHisto(m_duplicateHPhi,phi1); - fillHisto(m_duplicateTruthPT,truthPt); - fillHisto(m_duplicateTruthEta,truthEta); - fillHisto(m_duplicateTruthPhi,truthPhi); + fillHisto(m_duplicateLPT, pt2); + fillHisto(m_duplicateLEta, eta2); + fillHisto(m_duplicateLPhi, phi2); + fillHisto(m_duplicateHPT, pt1); + fillHisto(m_duplicateHEta, eta1); + fillHisto(m_duplicateHPhi, phi1); + fillHisto(m_duplicateTruthPT, truthPt); + fillHisto(m_duplicateTruthEta, truthEta); + fillHisto(m_duplicateTruthPhi, truthPhi); // delta plots - fillHisto(m_duplicateDeltaPt,deltaPT1); - fillHisto(m_duplicateDeltaPtZoomed,deltaPT1); - fillHisto(m_duplicateDeltaEta,deltaEta1); - fillHisto(m_duplicateDeltaPhi,deltaPhi1); + fillHisto(m_duplicateDeltaPt, deltaPT1); + fillHisto(m_duplicateDeltaPtZoomed, deltaPT1); + fillHisto(m_duplicateDeltaEta, deltaEta1); + fillHisto(m_duplicateDeltaPhi, deltaPhi1); // lpt vs hpt // hpt & lpt vs truth - fillHisto(m_duplicateProbSpectrum,prob2, prob1); + fillHisto(m_duplicateProbSpectrum, prob2, prob1); } if (pt2 > pt1 || pt1 == pt2) { - fillHisto(m_duplicateHPTHoles,totalHoles2); - fillHisto(m_duplicateLPTHoles,totalHoles1); - fillHisto(m_duplicateLPixelvsSCTShared,pixShared1, sctShared1); - fillHisto(m_duplicateHPixelvsSCTShared,pixShared2, sctShared2); + fillHisto(m_duplicateHPTHoles, totalHoles2); + fillHisto(m_duplicateLPTHoles, totalHoles1); + fillHisto(m_duplicateLPixelvsSCTShared, pixShared1, sctShared1); + fillHisto(m_duplicateHPixelvsSCTShared, pixShared2, sctShared2); float deltaPT2 = pt2 - pt1; float deltaEta2 = eta2 - eta1; float deltaPhi2 = phi2 - phi1; // pt2 - pt1 vs truth - fillHisto(m_duplicateDeltaPTvsTruthPT,truthPt, deltaPT2); - fillHisto(m_duplicateDeltaPTvsTruthPTZoomed,truthPt, deltaPT2); + fillHisto(m_duplicateDeltaPTvsTruthPT, truthPt, deltaPT2); + fillHisto(m_duplicateDeltaPTvsTruthPTZoomed, truthPt, deltaPT2); @@ -299,44 +256,44 @@ InDetPerfPlot_duplicate::fillTwoMatchDuplicate(const float prob1, const float pr float resHPT2 = pt2 - truthPt; float resHEta2 = eta2 - truthEta; float resHPhi2 = phi2 - truthPhi; - fillHisto(m_duplicateResLPT,resLPT2); - fillHisto(m_duplicateResLEta,resLEta2); - fillHisto(m_duplicateResLPhi,resLPhi2); - fillHisto(m_duplicateResHPT,resHPT2); - fillHisto(m_duplicateResHEta,resHEta2); - fillHisto(m_duplicateResHPhi,resHPhi2); + fillHisto(m_duplicateResLPT, resLPT2); + fillHisto(m_duplicateResLEta, resLEta2); + fillHisto(m_duplicateResLPhi, resLPhi2); + fillHisto(m_duplicateResHPT, resHPT2); + fillHisto(m_duplicateResHEta, resHEta2); + fillHisto(m_duplicateResHPhi, resHPhi2); // spectrum plots - fillHisto(m_duplicateLPT,pt1); - fillHisto(m_duplicateLEta,eta1); - fillHisto(m_duplicateLPhi,phi1); - fillHisto(m_duplicateHPT,pt2); - fillHisto(m_duplicateHEta,eta2); - fillHisto(m_duplicateHPhi,phi2); - fillHisto(m_duplicateTruthPT,truthPt); - fillHisto(m_duplicateTruthEta,truthEta); - fillHisto(m_duplicateTruthPhi,truthPhi); + fillHisto(m_duplicateLPT, pt1); + fillHisto(m_duplicateLEta, eta1); + fillHisto(m_duplicateLPhi, phi1); + fillHisto(m_duplicateHPT, pt2); + fillHisto(m_duplicateHEta, eta2); + fillHisto(m_duplicateHPhi, phi2); + fillHisto(m_duplicateTruthPT, truthPt); + fillHisto(m_duplicateTruthEta, truthEta); + fillHisto(m_duplicateTruthPhi, truthPhi); // delta (hpt - lpt plots) & lpt vs hpt plts - fillHisto(m_duplicateDeltaPt,deltaPT2); - fillHisto(m_duplicateDeltaPtZoomed,deltaPT2); - fillHisto(m_duplicateDeltaEta,deltaEta2); - fillHisto(m_duplicateDeltaPhi,deltaPhi2); + fillHisto(m_duplicateDeltaPt, deltaPT2); + fillHisto(m_duplicateDeltaPtZoomed, deltaPT2); + fillHisto(m_duplicateDeltaEta, deltaEta2); + fillHisto(m_duplicateDeltaPhi, deltaPhi2); // lpt & hpt vs truth - fillHisto(m_duplicateProbSpectrum,prob1, prob2); + fillHisto(m_duplicateProbSpectrum, prob1, prob2); } } if (prob1 != prob2) { if (pt1 > pt2) { - fillHisto(m_twoMatchHPixelvsSCTShared,pixShared1, sctShared1); - fillHisto(m_twoMatchLPixelvsSCTShared,pixShared2, sctShared2); - fillHisto(m_duplicateProbSpectrum,prob2, prob1); + fillHisto(m_twoMatchHPixelvsSCTShared, pixShared1, sctShared1); + fillHisto(m_twoMatchLPixelvsSCTShared, pixShared2, sctShared2); + fillHisto(m_duplicateProbSpectrum, prob2, prob1); } else { - fillHisto(m_twoMatchLPixelvsSCTShared,pixShared1, sctShared1); - fillHisto(m_twoMatchHPixelvsSCTShared,pixShared2, sctShared2); + fillHisto(m_twoMatchLPixelvsSCTShared, pixShared1, sctShared1); + fillHisto(m_twoMatchHPixelvsSCTShared, pixShared2, sctShared2); - fillHisto(m_duplicateProbSpectrum,prob1, prob2); + fillHisto(m_duplicateProbSpectrum, prob1, prob2); } } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_duplicate.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_duplicate.h index 5be3e5bde8518bccb6978a6fab41618b5c35421e..eaef390f1e625dd3b81125c1e862f225d36f2a5d 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_duplicate.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_duplicate.h @@ -23,53 +23,53 @@ ///class holding Pt plots for Inner Detector RTT Validation and implementing fill methods class InDetPerfPlot_duplicate: public InDetPlotBase { public: - InDetPerfPlot_duplicate(InDetPlotBase *pParent, const std::string &dirName); + InDetPerfPlot_duplicate(InDetPlotBase* pParent, const std::string& dirName); // void fill1(const xAOD::TrackParticle_v1* & trackParticle); - void fillSingleMatch(const xAOD::TrackParticle &trackParticle); + void fillSingleMatch(const xAOD::TrackParticle& trackParticle); // void fillTwoMatch(Float_t prob1,Float_t prob2,const xAOD::TrackParticle & particle1,const xAOD::TrackParticle & // particle2); - void fillTwoMatchDuplicate(const float prob1, const float prob2, const xAOD::TrackParticle &trackParticle, - const xAOD::TrackParticle &particle, const xAOD::TruthParticle &tp); + void fillTwoMatchDuplicate(const float prob1, const float prob2, const xAOD::TrackParticle& trackParticle, + const xAOD::TrackParticle& particle, const xAOD::TruthParticle& tp); private: ///Pt Histogram with full pt range - TH1 *m_duplicateDeltaPt; - TH1 *m_duplicateDeltaPtZoomed; - TH1 *m_duplicateDeltaEta; - TH1 *m_duplicateDeltaPhi; - TH2 *m_duplicateLPTvsHPT; - TH2 *m_duplicateLEtavsHEta; - TH2 *m_duplicateLPhivsHPhi; - TH2 *m_duplicateDeltaPTvsTruthPT; - TH2 *m_duplicateDeltaPTvsTruthPTZoomed; + TH1* m_duplicateDeltaPt; + TH1* m_duplicateDeltaPtZoomed; + TH1* m_duplicateDeltaEta; + TH1* m_duplicateDeltaPhi; + TH2* m_duplicateLPTvsHPT; + TH2* m_duplicateLEtavsHEta; + TH2* m_duplicateLPhivsHPhi; + TH2* m_duplicateDeltaPTvsTruthPT; + TH2* m_duplicateDeltaPTvsTruthPTZoomed; // spectrum plots - TH1 *m_duplicateLPT; - TH1 *m_duplicateLEta; - TH1 *m_duplicateLPhi; - TH1 *m_duplicateHPT; - TH1 *m_duplicateHEta; - TH1 *m_duplicateHPhi; - TH1 *m_duplicateTruthPT; - TH1 *m_duplicateTruthEta; - TH1 *m_duplicateTruthPhi; + TH1* m_duplicateLPT; + TH1* m_duplicateLEta; + TH1* m_duplicateLPhi; + TH1* m_duplicateHPT; + TH1* m_duplicateHEta; + TH1* m_duplicateHPhi; + TH1* m_duplicateTruthPT; + TH1* m_duplicateTruthEta; + TH1* m_duplicateTruthPhi; // resolution plots - TH1 *m_duplicateResLPT; - TH1 *m_duplicateResLEta; - TH1 *m_duplicateResLPhi; - TH1 *m_duplicateResHPT; - TH1 *m_duplicateResHEta; - TH1 *m_duplicateResHPhi; + TH1* m_duplicateResLPT; + TH1* m_duplicateResLEta; + TH1* m_duplicateResLPhi; + TH1* m_duplicateResHPT; + TH1* m_duplicateResHEta; + TH1* m_duplicateResHPhi; - TH1 *m_duplicateLPTHoles; - TH1 *m_duplicateHPTHoles; - TH1 *m_singleMatchPTHoles; - TH2 *m_duplicateProbSpectrum; - TH2 *m_duplicateHPixelvsSCTShared; - TH2 *m_duplicateLPixelvsSCTShared; - TH2 *m_twoMatchHPixelvsSCTShared; - TH2 *m_twoMatchLPixelvsSCTShared; - TH2 *m_singleMatchPixelvsSCTShared; + TH1* m_duplicateLPTHoles; + TH1* m_duplicateHPTHoles; + TH1* m_singleMatchPTHoles; + TH2* m_duplicateProbSpectrum; + TH2* m_duplicateHPixelvsSCTShared; + TH2* m_duplicateLPixelvsSCTShared; + TH2* m_twoMatchHPixelvsSCTShared; + TH2* m_twoMatchLPixelvsSCTShared; + TH2* m_singleMatchPixelvsSCTShared; // plot base has nop default implementation of this; we use it to book the histos void initializePlots(); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_fakes.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_fakes.cxx index 71440220daf5eca66b3e19a452322cce15c6773e..4e18ca326c15931991c1bed28ab1b28256081ad5 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_fakes.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_fakes.cxx @@ -8,10 +8,11 @@ **/ #include "InDetPerfPlot_fakes.h" -#include <cmath> //for std::sqrt +#include <cmath> // for std::sqrt +#include "InDetPhysValMonitoringUtilities.h" +using namespace IDPVM; - -InDetPerfPlot_fakes::InDetPerfPlot_fakes(InDetPlotBase *pParent, const std::string &sDir) : +InDetPerfPlot_fakes::InDetPerfPlot_fakes(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase(pParent, sDir), m_fakepT{}, m_fakePtLow{}, @@ -58,8 +59,7 @@ InDetPerfPlot_fakes::InDetPerfPlot_fakes(InDetPlotBase *pParent, const std::stri m_nTracks_vs_mu3{}, m_nTruth_vs_mu3{}, m_incTrkRate_vs_mu3{}, - m_mu{} - { + m_mu{} { // nop } @@ -80,174 +80,198 @@ InDetPerfPlot_fakes::initializePlots() { book(m_track_fakerate_vs_d0, "track_fakerate_vs_d0"); book(m_track_fakerate_vs_z0, "track_fakerate_vs_z0"); - book(m_fakeEtaTotal,"fakeEtaTotal"); - book(m_fakePtPrimary, "fakePtPrimary"); + book(m_fakeEtaTotal, "fakeEtaTotal"); + book(m_fakePtPrimary, "fakePtPrimary"); book(m_fakeetaPrimary, "fakeetaPrimary"); book(m_fakePhiPrimary, "fakePhiPrimary"); - book(m_faked0Primary, "faked0Primary"); - book(m_fakez0Primary, "fakez0Primary"); + book(m_faked0Primary, "faked0Primary"); + book(m_fakez0Primary, "fakez0Primary"); - book(m_fakePtSecondary, "fakePtSecondary"); + book(m_fakePtSecondary, "fakePtSecondary"); book(m_fakeetaSecondary, "fakeetaSecondary"); book(m_fakePhiSecondary, "fakePhiSecondary"); - book(m_faked0Secondary, "faked0Secondary"); - book(m_fakez0Secondary, "fakez0Secondary"); + book(m_faked0Secondary, "faked0Secondary"); + book(m_fakez0Secondary, "fakez0Secondary"); m_incFakeNum_pt1 = Book1D("incFakeNum_pt1", "inclusive fake numerator p_{T} > 1 GeV ", 80, -4, 4, prependDirectory); m_incFakeNum_pt2 = Book1D("incFakeNum_pt2", "inclusive fake numerator p_{T} > 2 GeV ", 80, -4, 4, prependDirectory); m_incFakeNum_pt5 = Book1D("incFakeNum_pt5", "inclusive fake numerator p_{T} > 5 GeV ", 80, -4, 4, prependDirectory); - book(m_fakePtUnlinkedFrac, "fakePtUnlinkedFrac"); + book(m_fakePtUnlinkedFrac, "fakePtUnlinkedFrac"); book(m_fakeetaUnlinkedFrac, "fakeetaUnlinkedFrac"); book(m_fakePhiUnlinkedFrac, "fakePhiUnlinkedFrac"); - book(m_faked0UnlinkedFrac, "faked0UnlinkedFrac"); - book(m_fakez0UnlinkedFrac, "fakez0UnlinkedFrac"); - - m_incFakeDenomEta_pt1 = Book1D("incFakeDenomEta_pt1", "Inclusive FakeRate Denominator vs #eta (p_{T} > 1 GeV)", 80, -4, 4, prependDirectory); - m_incFakeDenomEta_pt2 = Book1D("incFakeDenomEta_pt2", "Inclusive FakeRate Denominator vs #eta (p_{T} > 2 GeV)", 80, -4, 4, prependDirectory); - m_incFakeDenomEta_pt5 = Book1D("incFakeDenomEta_pt5", "Inclusive FakeRate Denominator vs #eta (p_{T} > 5 GeV)", 80, -4, 4, prependDirectory); - m_incFakeEta_pt1 = Book1D("incFakeEta_pt1", "Inclusive FakeRate vs #eta (p_{T} > 1 GeV)", 80, -4, 4, prependDirectory); - m_incFakeEta_pt2 = Book1D("incFakeEta_pt2", "Inclusive FakeRate vs #eta (p_{T} > 2 GeV)", 80, -4, 4, prependDirectory); - m_incFakeEta_pt5 = Book1D("incFakeEta_pt5", "Inclusive FakeRate vs #eta (p_{T} > 5 GeV)", 80, -4, 4, prependDirectory); - - m_nTracks_vs_mu = Book1D("nTracks_vs_mu"," # tracks vs pileupEvents (#eta < 2.7)", 20, 150, 250, prependDirectory); - m_nTruth_vs_mu = Book1D("nTruth_vs_mu"," # truth vs pileupEvents (#eta < 2.7)", 20,150,250, prependDirectory); - m_incTrkRate_vs_mu = Book1D("incTrk_vs_mu"," inclusive track rate vs mu (#eta < 2.7)", 20,150,250, prependDirectory); - m_nTracks_vs_mu2 = Book1D("nTracks_vs_mu2"," # tracks vs pileupEvents (#eta > 2.8, #eta < 3.5)", 20, 150, 250, prependDirectory); - m_nTruth_vs_mu2 = Book1D("nTruth_vs_mu2"," # truth vs pileupEvents (#eta > 2.8, #eta < 3.5)", 20,150,250, prependDirectory); - m_incTrkRate_vs_mu2 = Book1D("incTrk_vs_mu2"," inclusive track rate vs mu (#eta > 2.8, #eta < 3.5)", 20,150,250, prependDirectory); - m_nTracks_vs_mu3 = Book1D("nTracks_vs_mu3"," # tracks vs pileupEvents (#eta > 3.5)", 20, 150, 250, prependDirectory); - m_nTruth_vs_mu3 = Book1D("nTruth_vs_mu3"," # truth vs pileupEvents (#eta > 3.5)", 20,150,250, prependDirectory); - m_incTrkRate_vs_mu3 = Book1D("incTrk_vs_mu3"," inclusive track rate vs mu (#eta > 3.5)", 20,150,250, prependDirectory); - m_mu = Book1D("mu"," <mu> " , 10, 150, 250, prependDirectory); - + book(m_faked0UnlinkedFrac, "faked0UnlinkedFrac"); + book(m_fakez0UnlinkedFrac, "fakez0UnlinkedFrac"); + + m_incFakeDenomEta_pt1 = Book1D("incFakeDenomEta_pt1", "Inclusive FakeRate Denominator vs #eta (p_{T} > 1 GeV)", 80, + -4, 4, prependDirectory); + m_incFakeDenomEta_pt2 = Book1D("incFakeDenomEta_pt2", "Inclusive FakeRate Denominator vs #eta (p_{T} > 2 GeV)", 80, + -4, 4, prependDirectory); + m_incFakeDenomEta_pt5 = Book1D("incFakeDenomEta_pt5", "Inclusive FakeRate Denominator vs #eta (p_{T} > 5 GeV)", 80, + -4, 4, prependDirectory); + m_incFakeEta_pt1 = + Book1D("incFakeEta_pt1", "Inclusive FakeRate vs #eta (p_{T} > 1 GeV)", 80, -4, 4, prependDirectory); + m_incFakeEta_pt2 = + Book1D("incFakeEta_pt2", "Inclusive FakeRate vs #eta (p_{T} > 2 GeV)", 80, -4, 4, prependDirectory); + m_incFakeEta_pt5 = + Book1D("incFakeEta_pt5", "Inclusive FakeRate vs #eta (p_{T} > 5 GeV)", 80, -4, 4, prependDirectory); + + m_nTracks_vs_mu = Book1D("nTracks_vs_mu", " # tracks vs pileupEvents (#eta < 2.7)", 20, 150, 250, prependDirectory); + m_nTruth_vs_mu = Book1D("nTruth_vs_mu", " # truth vs pileupEvents (#eta < 2.7)", 20, 150, 250, prependDirectory); + m_incTrkRate_vs_mu = + Book1D("incTrk_vs_mu", " inclusive track rate vs mu (#eta < 2.7)", 20, 150, 250, prependDirectory); + m_nTracks_vs_mu2 = Book1D("nTracks_vs_mu2", " # tracks vs pileupEvents (#eta > 2.8, #eta < 3.5)", 20, 150, 250, + prependDirectory); + m_nTruth_vs_mu2 = Book1D("nTruth_vs_mu2", " # truth vs pileupEvents (#eta > 2.8, #eta < 3.5)", 20, 150, 250, + prependDirectory); + m_incTrkRate_vs_mu2 = Book1D("incTrk_vs_mu2", " inclusive track rate vs mu (#eta > 2.8, #eta < 3.5)", 20, 150, 250, + prependDirectory); + m_nTracks_vs_mu3 = Book1D("nTracks_vs_mu3", " # tracks vs pileupEvents (#eta > 3.5)", 20, 150, 250, prependDirectory); + m_nTruth_vs_mu3 = Book1D("nTruth_vs_mu3", " # truth vs pileupEvents (#eta > 3.5)", 20, 150, 250, prependDirectory); + m_incTrkRate_vs_mu3 = Book1D("incTrk_vs_mu3", " inclusive track rate vs mu (#eta > 3.5)", 20, 150, 250, + prependDirectory); + m_mu = Book1D("mu", " <mu> ", 10, 150, 250, prependDirectory); } void -InDetPerfPlot_fakes::fill(const xAOD::TrackParticle &trkprt, const bool isFake, const Category /*f*/) { +InDetPerfPlot_fakes::fill(const xAOD::TrackParticle& trkprt, const bool isFake, const Category /*f*/) { const unsigned int fakeNum = (unsigned int) isFake; // constexpr double degreesPerRadian(180./M_PI); - double pt = trkprt.pt() * 0.001; + double pt = trkprt.pt() * 1_GeV; double eta(trkprt.eta()); double phi(trkprt.phi()); // double phi_degrees(phi * degreesPerRadian); double d0(trkprt.d0()); double z0(trkprt.z0()); - fillHisto(m_fakepT,pt); + fillHisto(m_fakepT, pt); if (isFake) { - fillHisto(m_fakePtLow,pt); - fillHisto(m_fakeeta,eta); - fillHisto(m_fakephi,phi); - fillHisto(m_faked0,d0); - fillHisto(m_fakez0,z0); + fillHisto(m_fakePtLow, pt); + fillHisto(m_fakeeta, eta); + fillHisto(m_fakephi, phi); + fillHisto(m_faked0, d0); + fillHisto(m_fakez0, z0); } - fillHisto(m_track_fakerate_vs_eta,eta, fakeNum); - fillHisto(m_track_fakerate_vs_pt,pt, fakeNum); - fillHisto(m_track_fakerate_vs_phi,phi, fakeNum); - fillHisto(m_track_fakerate_vs_d0,d0, fakeNum); - fillHisto(m_track_fakerate_vs_z0,z0, fakeNum); + fillHisto(m_track_fakerate_vs_eta, eta, fakeNum); + fillHisto(m_track_fakerate_vs_pt, pt, fakeNum); + fillHisto(m_track_fakerate_vs_phi, phi, fakeNum); + fillHisto(m_track_fakerate_vs_d0, d0, fakeNum); + fillHisto(m_track_fakerate_vs_z0, z0, fakeNum); } void -InDetPerfPlot_fakes::fillLinkedandUnlinked(const xAOD::TrackParticle &trkprt, float Prim_w, float Sec_w, float Unlinked_w) { - double pt = trkprt.pt() / 1000.; +InDetPerfPlot_fakes::fillLinkedandUnlinked(const xAOD::TrackParticle& trkprt, float Prim_w, float Sec_w, + float Unlinked_w) { + double pt = trkprt.pt() * 1_GeV; double eta(trkprt.eta()); double phi(trkprt.phi()); double d0(trkprt.d0()); double z0(trkprt.z0()); - - if(pt > 1) fillHisto(m_incFakeNum_pt1,eta); - if(pt > 2) fillHisto(m_incFakeNum_pt2,eta); - if(pt > 5) fillHisto(m_incFakeNum_pt5,eta); - - if(Unlinked_w == 0) fillHisto(m_fakeEtaTotal,eta,Prim_w+Sec_w); - - fillHisto(m_fakePtPrimary, pt, Prim_w); - fillHisto(m_fakeetaPrimary, eta, Prim_w); - fillHisto(m_fakePhiPrimary, phi, Prim_w); - fillHisto(m_faked0Primary, d0, Prim_w); - fillHisto(m_fakez0Primary, z0, Prim_w); - - fillHisto(m_fakePtSecondary, pt, Sec_w); - fillHisto(m_fakeetaSecondary, eta, Sec_w); - fillHisto(m_fakePhiSecondary, phi, Sec_w); - fillHisto(m_faked0Secondary, d0, Sec_w); - fillHisto(m_fakez0Secondary, z0, Sec_w); - - fillHisto(m_fakePtUnlinkedFrac, pt, Unlinked_w); - fillHisto(m_fakeetaUnlinkedFrac, eta, Unlinked_w); - fillHisto(m_fakePhiUnlinkedFrac, phi, Unlinked_w); - fillHisto(m_faked0UnlinkedFrac, d0, Unlinked_w); - fillHisto(m_fakez0UnlinkedFrac, z0, Unlinked_w); + + if (pt > 1) { + fillHisto(m_incFakeNum_pt1, eta); + } + if (pt > 2) { + fillHisto(m_incFakeNum_pt2, eta); + } + if (pt > 5) { + fillHisto(m_incFakeNum_pt5, eta); + } + + if (Unlinked_w == 0) { + fillHisto(m_fakeEtaTotal, eta, Prim_w + Sec_w); + } + + fillHisto(m_fakePtPrimary, pt, Prim_w); + fillHisto(m_fakeetaPrimary, eta, Prim_w); + fillHisto(m_fakePhiPrimary, phi, Prim_w); + fillHisto(m_faked0Primary, d0, Prim_w); + fillHisto(m_fakez0Primary, z0, Prim_w); + + fillHisto(m_fakePtSecondary, pt, Sec_w); + fillHisto(m_fakeetaSecondary, eta, Sec_w); + fillHisto(m_fakePhiSecondary, phi, Sec_w); + fillHisto(m_faked0Secondary, d0, Sec_w); + fillHisto(m_fakez0Secondary, z0, Sec_w); + + fillHisto(m_fakePtUnlinkedFrac, pt, Unlinked_w); + fillHisto(m_fakeetaUnlinkedFrac, eta, Unlinked_w); + fillHisto(m_fakePhiUnlinkedFrac, phi, Unlinked_w); + fillHisto(m_faked0UnlinkedFrac, d0, Unlinked_w); + fillHisto(m_fakez0UnlinkedFrac, z0, Unlinked_w); } void -InDetPerfPlot_fakes::fillIncFakeDenom(const xAOD::TruthParticle &particle) { +InDetPerfPlot_fakes::fillIncFakeDenom(const xAOD::TruthParticle& particle) { double eta = particle.eta(); - double pt = particle.pt()/1000; - - if(pt > 1) fillHisto(m_incFakeDenomEta_pt1,eta); - if(pt > 2) fillHisto(m_incFakeDenomEta_pt2,eta); - if(pt > 5) fillHisto(m_incFakeDenomEta_pt5,eta); + double pt = particle.pt() * 1_GeV; + if (pt > 1) { + fillHisto(m_incFakeDenomEta_pt1, eta); + } + if (pt > 2) { + fillHisto(m_incFakeDenomEta_pt2, eta); + } + if (pt > 5) { + fillHisto(m_incFakeDenomEta_pt5, eta); + } } void -InDetPerfPlot_fakes::fillIncTrkRate(const unsigned int nMuEvents,std::vector<int> incTrkNum, std::vector<int> incTrkDenom){ - - fillHisto(m_nTracks_vs_mu,nMuEvents,incTrkNum[0]); - fillHisto(m_nTruth_vs_mu,nMuEvents,incTrkDenom[0]); - fillHisto(m_nTracks_vs_mu2,nMuEvents,incTrkNum[1]); - fillHisto(m_nTruth_vs_mu2,nMuEvents,incTrkDenom[1]); - fillHisto(m_nTracks_vs_mu3,nMuEvents,incTrkNum[2]); - fillHisto(m_nTruth_vs_mu3,nMuEvents,incTrkDenom[2]); - fillHisto(m_mu,nMuEvents); +InDetPerfPlot_fakes::fillIncTrkRate(const unsigned int nMuEvents, std::vector<int> incTrkNum, + std::vector<int> incTrkDenom) { + fillHisto(m_nTracks_vs_mu, nMuEvents, incTrkNum[0]); + fillHisto(m_nTruth_vs_mu, nMuEvents, incTrkDenom[0]); + fillHisto(m_nTracks_vs_mu2, nMuEvents, incTrkNum[1]); + fillHisto(m_nTruth_vs_mu2, nMuEvents, incTrkDenom[1]); + fillHisto(m_nTracks_vs_mu3, nMuEvents, incTrkNum[2]); + fillHisto(m_nTruth_vs_mu3, nMuEvents, incTrkDenom[2]); + fillHisto(m_mu, nMuEvents); } - - - - - void InDetPerfPlot_fakes::finalizePlots() { - if(m_incFakeEta_pt1 && m_incFakeEta_pt2 && m_incFakeEta_pt5 && m_incTrkRate_vs_mu && m_incTrkRate_vs_mu2 && m_incTrkRate_vs_mu3){ - m_incFakeEta_pt1->Sumw2(); - m_incFakeEta_pt1->Divide(m_incFakeNum_pt1, m_incFakeDenomEta_pt1,1,1,"B"); - m_incFakeEta_pt2->Sumw2(); - m_incFakeEta_pt2->Divide(m_incFakeNum_pt2, m_incFakeDenomEta_pt2,1,1,"B"); - m_incFakeEta_pt5->Sumw2(); - m_incFakeEta_pt5->Divide(m_incFakeNum_pt5, m_incFakeDenomEta_pt5,1,1,"B"); - - m_incTrkRate_vs_mu->Divide(m_nTracks_vs_mu,m_nTruth_vs_mu,1,1,"B"); - m_incTrkRate_vs_mu2->Divide(m_nTracks_vs_mu2,m_nTruth_vs_mu2,1,1,"B"); - m_incTrkRate_vs_mu3->Divide(m_nTracks_vs_mu3,m_nTruth_vs_mu3,1,1,"B"); - }else { - ATH_MSG_INFO("InDetPerfPlot_fakes: some plots have null pointer, probably were not fully specified in the histogram definition xml file"); + if (m_incFakeEta_pt1 && m_incFakeEta_pt2 && m_incFakeEta_pt5 && m_incTrkRate_vs_mu && m_incTrkRate_vs_mu2 && + m_incTrkRate_vs_mu3) { + m_incFakeEta_pt1->Sumw2(); + m_incFakeEta_pt1->Divide(m_incFakeNum_pt1, m_incFakeDenomEta_pt1, 1, 1, "B"); + m_incFakeEta_pt2->Sumw2(); + m_incFakeEta_pt2->Divide(m_incFakeNum_pt2, m_incFakeDenomEta_pt2, 1, 1, "B"); + m_incFakeEta_pt5->Sumw2(); + m_incFakeEta_pt5->Divide(m_incFakeNum_pt5, m_incFakeDenomEta_pt5, 1, 1, "B"); + + m_incTrkRate_vs_mu->Divide(m_nTracks_vs_mu, m_nTruth_vs_mu, 1, 1, "B"); + m_incTrkRate_vs_mu2->Divide(m_nTracks_vs_mu2, m_nTruth_vs_mu2, 1, 1, "B"); + m_incTrkRate_vs_mu3->Divide(m_nTracks_vs_mu3, m_nTruth_vs_mu3, 1, 1, "B"); + } else { + ATH_MSG_INFO( + "InDetPerfPlot_fakes: some plots have null pointer, probably were not fully specified in the histogram definition xml file"); } - - static const int nPlot = 6; - TH1* incTrkNum[nPlot] = {m_nTracks_vs_mu,m_nTracks_vs_mu2,m_nTracks_vs_mu3,m_incFakeNum_pt1,m_incFakeNum_pt2,m_incFakeNum_pt5}; - TH1* incTrkDenom[nPlot] = {m_nTruth_vs_mu,m_nTruth_vs_mu2,m_nTruth_vs_mu3,m_incFakeDenomEta_pt1,m_incFakeDenomEta_pt2,m_incFakeDenomEta_pt5}; - TH1* incTrk[nPlot] = {m_incTrkRate_vs_mu,m_incTrkRate_vs_mu2,m_incTrkRate_vs_mu3,m_incFakeEta_pt1,m_incFakeEta_pt2,m_incFakeEta_pt5}; - for(int j = 0; j< nPlot; j++){ + static const int nPlot = 6; + TH1* incTrkNum[nPlot] = { + m_nTracks_vs_mu, m_nTracks_vs_mu2, m_nTracks_vs_mu3, m_incFakeNum_pt1, m_incFakeNum_pt2, m_incFakeNum_pt5 + }; + TH1* incTrkDenom[nPlot] = { + m_nTruth_vs_mu, m_nTruth_vs_mu2, m_nTruth_vs_mu3, m_incFakeDenomEta_pt1, m_incFakeDenomEta_pt2, + m_incFakeDenomEta_pt5 + }; + TH1* incTrk[nPlot] = { + m_incTrkRate_vs_mu, m_incTrkRate_vs_mu2, m_incTrkRate_vs_mu3, m_incFakeEta_pt1, m_incFakeEta_pt2, m_incFakeEta_pt5 + }; + + for (int j = 0; j < nPlot; j++) { int nBins = incTrkDenom[j]->GetNbinsX(); - for( int i = 0; i < nBins; i++){ + for (int i = 0; i < nBins; i++) { double binError = 0; double yBC = incTrkDenom[j]->GetBinContent(i); double xBC = incTrkNum[j]->GetBinContent(i); - incTrkDenom[j]->SetBinError(i,std::sqrt(yBC)); - incTrkNum[j]->SetBinError(i,std::sqrt(xBC)); - binError = std::sqrt((xBC*xBC/(yBC*yBC*yBC)) + (xBC)/(yBC*yBC)); - if(binError > 0){ - incTrk[j]->SetBinError(i,binError);} + incTrkDenom[j]->SetBinError(i, std::sqrt(yBC)); + incTrkNum[j]->SetBinError(i, std::sqrt(xBC)); + binError = std::sqrt((xBC * xBC / (yBC * yBC * yBC)) + (xBC) / (yBC * yBC)); + if (binError > 0) { + incTrk[j]->SetBinError(i, binError); + } } } } - - - - - diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_fakes.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_fakes.h index c7d71cb80570c2f4694a1a172214ffbea3881b75..5515ec5cc6974bdceee415a45f8bbdbc725ed428 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_fakes.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_fakes.h @@ -10,13 +10,17 @@ **/ -// std includes -#include <string> + // local includes #include "InDetPlotBase.h" #include "xAODTracking/TrackParticle.h" #include "xAODTruth/TruthParticleContainer.h" +// std includes +#include <string> +class TH1; +class TProfile; + ///class holding fake plots for Inner Detector RTT Validation and implementing fill methods class InDetPerfPlot_fakes: public InDetPlotBase { @@ -25,50 +29,50 @@ public: enum Category { ALL, IN_JETS, N_FAKETYPES }; - InDetPerfPlot_fakes(InDetPlotBase *pParent, const std::string &dirName); - void fill(const xAOD::TrackParticle &trkprt, const bool isFake, const Category f = ALL); - void fillLinkedandUnlinked(const xAOD::TrackParticle &trkprt, float Prim_w, float Sec_w, float Unlinked_w); - void fillIncFakeDenom(const xAOD::TruthParticle &particle); - void fillIncTrkRate(const unsigned int nMuEvents,std::vector<int> incTrkNum, std::vector<int> incTrkDenom); + InDetPerfPlot_fakes(InDetPlotBase* pParent, const std::string& dirName); + void fill(const xAOD::TrackParticle& trkprt, const bool isFake, const Category f = ALL); + void fillLinkedandUnlinked(const xAOD::TrackParticle& trkprt, float Prim_w, float Sec_w, float Unlinked_w); + void fillIncFakeDenom(const xAOD::TruthParticle& particle); + void fillIncTrkRate(const unsigned int nMuEvents, std::vector<int> incTrkNum, std::vector<int> incTrkDenom); private: ///fakes Histograms - TH1 *m_fakepT; - TH1 *m_fakePtLow; - TH1 *m_fakephi; - TH1 *m_fakeeta; - TH1 *m_faked0; - TH1 *m_fakez0; + TH1* m_fakepT; + TH1* m_fakePtLow; + TH1* m_fakephi; + TH1* m_fakeeta; + TH1* m_faked0; + TH1* m_fakez0; // fake rates as TProfiles - TProfile *m_track_fakerate_vs_pt; - TProfile *m_track_fakerate_vs_eta; - TProfile *m_track_fakerate_vs_phi; - TProfile *m_track_fakerate_vs_d0; - TProfile *m_track_fakerate_vs_z0; + TProfile* m_track_fakerate_vs_pt; + TProfile* m_track_fakerate_vs_eta; + TProfile* m_track_fakerate_vs_phi; + TProfile* m_track_fakerate_vs_d0; + TProfile* m_track_fakerate_vs_z0; TH1* m_incFakeNum_pt1; TH1* m_incFakeNum_pt2; TH1* m_incFakeNum_pt5; - TProfile *m_fakeEtaTotal; - TProfile *m_fakePtPrimary; - TProfile *m_fakeetaPrimary; - TProfile *m_fakePhiPrimary; - TProfile *m_faked0Primary; - TProfile *m_fakez0Primary; - TProfile *m_fakePtSecondary; - TProfile *m_fakeetaSecondary; - TProfile *m_fakePhiSecondary; - TProfile *m_faked0Secondary; - TProfile *m_fakez0Secondary; + TProfile* m_fakeEtaTotal; + TProfile* m_fakePtPrimary; + TProfile* m_fakeetaPrimary; + TProfile* m_fakePhiPrimary; + TProfile* m_faked0Primary; + TProfile* m_fakez0Primary; + TProfile* m_fakePtSecondary; + TProfile* m_fakeetaSecondary; + TProfile* m_fakePhiSecondary; + TProfile* m_faked0Secondary; + TProfile* m_fakez0Secondary; TH1* m_incFakeDenomEta_pt1; TH1* m_incFakeDenomEta_pt2; TH1* m_incFakeDenomEta_pt5; - TProfile *m_fakePtUnlinkedFrac; - TProfile *m_fakeetaUnlinkedFrac; - TProfile *m_fakePhiUnlinkedFrac; - TProfile *m_faked0UnlinkedFrac; - TProfile *m_fakez0UnlinkedFrac; - TH1 *m_incFakeEta_pt1; - TH1 *m_incFakeEta_pt2; - TH1 *m_incFakeEta_pt5; + TProfile* m_fakePtUnlinkedFrac; + TProfile* m_fakeetaUnlinkedFrac; + TProfile* m_fakePhiUnlinkedFrac; + TProfile* m_faked0UnlinkedFrac; + TProfile* m_fakez0UnlinkedFrac; + TH1* m_incFakeEta_pt1; + TH1* m_incFakeEta_pt2; + TH1* m_incFakeEta_pt5; TH1* m_nTracks_vs_mu; TH1* m_nTruth_vs_mu; TH1* m_incTrkRate_vs_mu; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitEff.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitEff.cxx index c98408a63022ffe13c074f0611c4ce035afc77b7..7e6b18c1b24773649ae99f21c0be498227026de8 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitEff.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitEff.cxx @@ -10,24 +10,25 @@ #include "InDetPerfPlot_hitEff.h" #include "InDetPhysHitDecoratorTool.h" #include "xAODTracking/TrackParticle.h" +#include "TProfile.h" +#include "TEfficiency.h" #include <vector> -#include <cmath> //for std::fabs +#include <cmath> // for std::fabs -InDetPerfPlot_hitEff::InDetPerfPlot_hitEff(InDetPlotBase *pParent, const std::string &sDir) : InDetPlotBase(pParent, - sDir), - m_eff_hit_vs_eta{}, m_debug{false} { +InDetPerfPlot_hitEff::InDetPerfPlot_hitEff(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase(pParent, sDir), m_hitEfficiencyVsEta{}, m_debug{false} { // } void InDetPerfPlot_hitEff::initializePlots() { // const bool prependDirectory(false); - // eff plots for IBL, PIXEL, SCT, TRT + // eff plots for L0PIXBARR, PIXEL, SCT, TRT // Barrel - book(m_eff_hit_vs_eta[IBL][BARREL], "eff_hit_vs_eta_ibl_barrel"); + /** + book(m_eff_hit_vs_eta[L0PIXBARR][BARREL], "eff_hit_vs_eta_l0pix_barrel"); book(m_eff_hit_vs_eta[PIXEL][BARREL], "eff_hit_vs_eta_pix_barrel"); book(m_eff_hit_vs_eta[SCT][BARREL], "eff_hit_vs_eta_sct_barrel"); book(m_eff_hit_vs_eta[TRT][BARREL], "eff_hit_vs_eta_trt_barrel"); @@ -35,10 +36,20 @@ InDetPerfPlot_hitEff::initializePlots() { book(m_eff_hit_vs_eta[PIXEL][ENDCAP], "eff_hit_vs_eta_pix_endcap"); book(m_eff_hit_vs_eta[SCT][ENDCAP], "eff_hit_vs_eta_sct_endcap"); book(m_eff_hit_vs_eta[TRT][ENDCAP], "eff_hit_vs_eta_trt_endcap"); + **/ + // + book(m_hitEfficiencyVsEta[L0PIXBARR][BARREL], "eff_hit_vs_eta_l0pix_barrel"); + book(m_hitEfficiencyVsEta[PIXEL][BARREL], "eff_hit_vs_eta_pix_barrel"); + book(m_hitEfficiencyVsEta[SCT][BARREL], "eff_hit_vs_eta_sct_barrel"); + book(m_hitEfficiencyVsEta[TRT][BARREL], "eff_hit_vs_eta_trt_barrel"); + + book(m_hitEfficiencyVsEta[PIXEL][ENDCAP], "eff_hit_vs_eta_pix_endcap"); + book(m_hitEfficiencyVsEta[SCT][ENDCAP], "eff_hit_vs_eta_sct_endcap"); + book(m_hitEfficiencyVsEta[TRT][ENDCAP], "eff_hit_vs_eta_trt_endcap"); } void -InDetPerfPlot_hitEff::fill(const xAOD::TrackParticle &trkprt) { +InDetPerfPlot_hitEff::fill(const xAOD::TrackParticle& trkprt) { if (m_debug) { ATH_MSG_INFO("Filling hitEff"); } @@ -46,28 +57,34 @@ InDetPerfPlot_hitEff::fill(const xAOD::TrackParticle &trkprt) { const bool hitDetailsAvailable = trkprt.isAvailable<std::vector<int> >("measurement_region"); static int warnCount(0); if (!hitDetailsAvailable) { - if (warnCount++<10){ + if (warnCount++ < 10) { ATH_MSG_WARNING("The hitEff plots dont see any data (note: only 10 warnings issued)"); } } else { - const std::vector<int> &result_det = trkprt.auxdata< std::vector<int> >("measurement_det"); + const std::vector<int>& result_det = trkprt.auxdata< std::vector<int> >("measurement_det"); if (!result_det.empty()) { - const std::vector<int> &result_measureType = trkprt.auxdata< std::vector<int> >("measurement_type"); - const std::vector<int> &result_region = trkprt.auxdata< std::vector<int> >("measurement_region"); + const std::vector<int>& result_measureType = trkprt.auxdata< std::vector<int> >("measurement_type"); + const std::vector<int>& result_region = trkprt.auxdata< std::vector<int> >("measurement_region"); // const std::vector<int> &result_iLayer = trkprt.auxdata< std::vector<int> >("hitResiduals_iLayer"); // NP: this should be fine... residual filled with -1 if not hit for (unsigned int idx = 0; idx < result_region.size(); ++idx) { const int measureType = result_measureType[idx]; - const bool isHit((measureType == 0) or (measureType == 4)); - const int det = result_det[idx]; // LAYER TYPE IBL / PIXEL / ... + const bool isHit((measureType == 0)or(measureType == 4)); + const int det = result_det[idx]; // LAYER TYPE L0PIXBARR / PIXEL / ... const int region = result_region[idx]; // BARREL OR ENDCAP float eta = std::fabs(trkprt.eta()); - if ((det == IBL && region == ENDCAP) || det == DBM) { - continue; // IBL have no endcaps! and ignore DBM + if (det == DBM) { + continue; // ignore DBM } - fillHisto(m_eff_hit_vs_eta[det][region],eta, int(isHit)); + //fillHisto(m_eff_hit_vs_eta[det][region], eta, int(isHit)); + fillHisto(m_hitEfficiencyVsEta[det][region], eta, isHit); } } } + /** for testing + const float binValue = std::rand() % 75; + const bool passed = (binValue - 5 + (std::rand() % 10)) > 30; + fillHisto(m_testEff, passed, binValue); + **/ } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitEff.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitEff.h index d530294753ad25456f43014df6f82aeebb72d97c..fe520d27a7cc2fd28607d6cb185ecc4668481b70 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitEff.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitEff.h @@ -10,9 +10,8 @@ **/ -// std includes -#include <string> -#include "TProfile.h" + + // local includes @@ -22,19 +21,25 @@ #include "xAODTruth/TruthParticle.h" +// std includes +#include <string> + +class TProfile; +class TEfficiency; + ///class holding res plots for Inner Detector RTT Validation and implementing fill methods class InDetPerfPlot_hitEff: public InDetPlotBase { public: - InDetPerfPlot_hitEff(InDetPlotBase *pParent, const std::string &dirName); + InDetPerfPlot_hitEff(InDetPlotBase* pParent, const std::string& dirName); - void fill(const xAOD::TrackParticle &trkprt); + void fill(const xAOD::TrackParticle& trkprt); ~InDetPerfPlot_hitEff() {/** nop **/ } private: // enum copied from the hitDecorator tool in InDetPhysValMonitoring enum Subdetector { - INVALID_DETECTOR=-1, IBL, PIXEL, SCT, TRT, DBM, N_SUBDETECTORS + INVALID_DETECTOR=-1, L0PIXBARR, PIXEL, SCT, TRT, DBM, N_SUBDETECTORS }; enum Region { INVALID_REGION=-1, BARREL, ENDCAP, N_REGIONS @@ -42,7 +47,8 @@ private: private: void initializePlots(); - TProfile *m_eff_hit_vs_eta[N_SUBDETECTORS][N_REGIONS]; + //TProfile* m_eff_hit_vs_eta[N_SUBDETECTORS][N_REGIONS]; + TEfficiency* m_hitEfficiencyVsEta[N_SUBDETECTORS][N_REGIONS]; bool m_debug; }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitResidual.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitResidual.cxx index 8b81b26bcff426c28e4bbb0207e2ff9744bcbef4..d2c43bbea508c4cbaeae71ab5fe3e2c93e20f883 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitResidual.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitResidual.cxx @@ -11,7 +11,7 @@ using namespace TMath; -InDetPerfPlot_hitResidual::InDetPerfPlot_hitResidual(InDetPlotBase *pParent, const std::string &sDir) : InDetPlotBase( +InDetPerfPlot_hitResidual::InDetPerfPlot_hitResidual(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase( pParent, sDir), m_residualx_1hit{}, m_residualx_2ormorehits{}, @@ -20,7 +20,7 @@ InDetPerfPlot_hitResidual::InDetPerfPlot_hitResidual(InDetPlotBase *pParent, con m_residualy_2ormorehits{}, m_residualy{}, m_residualpullx{}, - m_residualpully{} , + m_residualpully{}, m_phiWidth{}, m_etaWidth{} { // @@ -30,9 +30,9 @@ void InDetPerfPlot_hitResidual::initializePlots() { // const bool prependDirectory(false); // x residuals - book(m_residualx[IBL][BARREL], "residualx_ibl_barrel"); - book(m_residualx_1hit[IBL][BARREL], "residualx_ibl_barrel_1hit"); - book(m_residualx_2ormorehits[IBL][BARREL], "residualx_ibl_barrel_2ormorehits"); + book(m_residualx[L0PIXBARR][BARREL], "residualx_l0pix_barrel"); + book(m_residualx_1hit[L0PIXBARR][BARREL], "residualx_l0pix_barrel_1hit"); + book(m_residualx_2ormorehits[L0PIXBARR][BARREL], "residualx_l0pix_barrel_2ormorehits"); // book(m_residualx[PIXEL][BARREL], "residualx_pixel_barrel"); book(m_residualx_1hit[PIXEL][BARREL], "residualx_pixel_barrel_1hit"); @@ -51,10 +51,6 @@ InDetPerfPlot_hitResidual::initializePlots() { book(m_residualx[SCT][ENDCAP], "residualx_sct_endcap"); book(m_residualx_1hit[SCT][ENDCAP], "residualx_sct_endcap_1hit"); book(m_residualx_2ormorehits[SCT][ENDCAP], "residualx_sct_endcap_2ormorehits"); - // No IBL for ENDCAP (Can be added if need residuals / pulls for the first disk?) - // book(m_residualx[IBL][ENDCAP],"residualx_blayer_endcap"); - // book(m_residualx_1hit[IBL][ENDCAP],"residualx_blayer_endcap_1hit"); - // book(m_residualx_2ormorehits[IBL][ENDCAP],"residualx_blayer_endcap_2ormorehits"); // book(m_residualx[TRT][ENDCAP], "residualx_trt_endcap"); // DBM @@ -63,9 +59,9 @@ InDetPerfPlot_hitResidual::initializePlots() { // // y residuals - book(m_residualy[IBL][BARREL], "residualy_ibl_barrel"); - book(m_residualy_1hit[IBL][BARREL], "residualy_ibl_barrel_1hit"); - book(m_residualy_2ormorehits[IBL][BARREL], "residualy_ibl_barrel_2ormorehits"); + book(m_residualy[L0PIXBARR][BARREL], "residualy_l0pix_barrel"); + book(m_residualy_1hit[L0PIXBARR][BARREL], "residualy_l0pix_barrel_1hit"); + book(m_residualy_2ormorehits[L0PIXBARR][BARREL], "residualy_l0pix_barrel_2ormorehits"); // book(m_residualy[PIXEL][BARREL], "residualy_pixel_barrel"); book(m_residualy_1hit[PIXEL][BARREL], "residualy_pixel_barrel_1hit"); @@ -86,12 +82,6 @@ InDetPerfPlot_hitResidual::initializePlots() { // book(m_residualy[SCT][ENDCAP],"residualy_sct_endcap"); // book(m_residualy_1hit[SCT][ENDCAP],"residualy_sct_endcap_1hit"); // book(m_residualy_2ormorehits[SCT][ENDCAP],"residualy_sct_endcap_2ormorehits"); - // - // No IBL for ENDCAP (Can be added if need residuals / pulls for the first disk?) - // book(m_residualy[IBL][ENDCAP],"residualy_blayer_endcap"); - // book(m_residualy_1hit[IBL][ENDCAP],"residualy_blayer_endcap_1hit"); - // book(m_residualy_2ormorehits[IBL][ENDCAP],"residualy_blayer_endcap_2ormorehits"); - // // SCT and TRT do not have y-residuals/pulls // book(m_residualy[TRT][ENDCAP],"residualy_trt_endcap"); // DBM @@ -99,68 +89,65 @@ InDetPerfPlot_hitResidual::initializePlots() { book(m_residualy[DBM][1], "residualy_dbm_pos"); // pulls // barrel - book(m_residualpullx[IBL][BARREL], "residualpullx_ibl_barrel"); + book(m_residualpullx[L0PIXBARR][BARREL], "residualpullx_l0pix_barrel"); book(m_residualpullx[PIXEL][BARREL], "residualpullx_pixel_barrel"); book(m_residualpullx[SCT][BARREL], "residualpullx_sct_barrel"); book(m_residualpullx[TRT][BARREL], "residualpullx_trt_barrel"); book(m_residualpullx[DBM][0], "residualpullx_dbm_barrel"); // - // No IBL for ENDCAPS - // book(m_residualpullx[IBL][ENDCAP],"residualpullx_ibl_endcap"); book(m_residualpullx[PIXEL][ENDCAP], "residualpullx_pixel_endcap"); book(m_residualpullx[SCT][ENDCAP], "residualpullx_sct_endcap"); book(m_residualpullx[TRT][ENDCAP], "residualpullx_trt_endcap"); book(m_residualpullx[DBM][1], "residualpullx_dbm_endcap"); // // barrel - book(m_residualpully[IBL][BARREL], "residualpully_ibl_barrel"); + book(m_residualpully[L0PIXBARR][BARREL], "residualpully_l0pix_barrel"); book(m_residualpully[PIXEL][BARREL], "residualpully_pixel_barrel"); // // SCT and TRT do not have y-residuals/pulls // book(m_residualpully[SCT][BARREL],"residualpully_sct_barrel"); // book(m_residualpully[TRT][BARREL],"residualpully_trt_barrel"); book(m_residualpully[DBM][0], "residualpully_dbm_barrel"); - // No IBL for ENDCAPS - // book(m_residualpully[IBL][ENDCAP],"residualpully_ibl_endcap"); book(m_residualpully[PIXEL][ENDCAP], "residualpully_pixel_endcap"); // ////SCT and TRT do not have y-residuals/pulls // book(m_residualpully[SCT][ENDCAP],"residualpully_sct_endcap"); // book(m_residualpully[TRT][ENDCAP],"residualpully_trt_endcap"); book(m_residualpully[DBM][1], "residualpully_dbm_endcap"); - //introduce cluster width histograms - book(m_phiWidth[PIXEL][BARREL],"clusterPhiWidth_pixel_barrel"); - book(m_phiWidth[PIXEL][ENDCAP],"clusterPhiWidth_pixel_endcap"); - book(m_etaWidth[PIXEL][BARREL],"clusterEtaWidth_pixel_barrel"); - book(m_etaWidth[PIXEL][ENDCAP],"clusterEtaWidth_pixel_endcap"); - // - book(m_phiWidth[SCT][BARREL],"clusterPhiWidth_sct_barrel"); - book(m_phiWidth[SCT][ENDCAP],"clusterPhiWidth_sct_endcap"); - //book(m_etaWidth[SCT][BARREL],"clusterEtaWidth_sct_barrel"); - //book(m_etaWidth[SCT][ENDCAP],"clusterEtaWidth_sct_endcap"); + // introduce cluster width histograms + book(m_phiWidth[PIXEL][BARREL], "clusterPhiWidth_pixel_barrel"); + book(m_phiWidth[PIXEL][ENDCAP], "clusterPhiWidth_pixel_endcap"); + book(m_etaWidth[PIXEL][BARREL], "clusterEtaWidth_pixel_barrel"); + book(m_etaWidth[PIXEL][ENDCAP], "clusterEtaWidth_pixel_endcap"); + // + book(m_phiWidth[SCT][BARREL], "clusterPhiWidth_sct_barrel"); + book(m_phiWidth[SCT][ENDCAP], "clusterPhiWidth_sct_endcap"); + // book(m_etaWidth[SCT][BARREL],"clusterEtaWidth_sct_barrel"); + // book(m_etaWidth[SCT][ENDCAP],"clusterEtaWidth_sct_endcap"); } void -InDetPerfPlot_hitResidual::fill(const xAOD::TrackParticle &trkprt) { +InDetPerfPlot_hitResidual::fill(const xAOD::TrackParticle& trkprt) { const static bool hitDetailsAvailable = trkprt.isAvailable<std::vector<int> >("measurement_region"); static int warnCount(0); + if (!hitDetailsAvailable) { - if (warnCount++<10){ + if (warnCount++ < 10) { ATH_MSG_WARNING("The hit res plots dont see any data (note:only 10 warnings issued)"); } } else { - const std::vector<int> &result_det = trkprt.auxdata< std::vector<int> >("measurement_det"); + const std::vector<int>& result_det = trkprt.auxdata< std::vector<int> >("measurement_det"); if (!result_det.empty()) { - const std::vector<int> &result_measureType = trkprt.auxdata< std::vector<int> >("measurement_type"); - const std::vector<int> &result_region = trkprt.auxdata< std::vector<int> >("measurement_region"); + const std::vector<int>& result_measureType = trkprt.auxdata< std::vector<int> >("measurement_type"); + const std::vector<int>& result_region = trkprt.auxdata< std::vector<int> >("measurement_region"); // const std::vector<int> &result_iLayer = trkprt.auxdata< std::vector<int> >("hitResiduals_iLayer"); - const std::vector<float> &result_residualLocX = trkprt.auxdata< std::vector<float> >("hitResiduals_residualLocX"); - const std::vector<float> &result_pullLocX = trkprt.auxdata< std::vector<float> >("hitResiduals_pullLocX"); - const std::vector<float> &result_residualLocY = trkprt.auxdata< std::vector<float> >("hitResiduals_residualLocY"); - const std::vector<float> &result_pullLocY = trkprt.auxdata< std::vector<float> >("hitResiduals_pullLocY"); - const std::vector<int> &result_phiWidth = trkprt.auxdata< std::vector<int> >("hitResiduals_phiWidth"); - const std::vector<int> &result_etaWidth = trkprt.auxdata< std::vector<int> >("hitResiduals_etaWidth"); + const std::vector<float>& result_residualLocX = trkprt.auxdata< std::vector<float> >("hitResiduals_residualLocX"); + const std::vector<float>& result_pullLocX = trkprt.auxdata< std::vector<float> >("hitResiduals_pullLocX"); + const std::vector<float>& result_residualLocY = trkprt.auxdata< std::vector<float> >("hitResiduals_residualLocY"); + const std::vector<float>& result_pullLocY = trkprt.auxdata< std::vector<float> >("hitResiduals_pullLocY"); + const std::vector<int>& result_phiWidth = trkprt.auxdata< std::vector<int> >("hitResiduals_phiWidth"); + const std::vector<int>& result_etaWidth = trkprt.auxdata< std::vector<int> >("hitResiduals_etaWidth"); // NP: this should be fine... resiudal filled with -1 if not hit if (result_det.size() != result_residualLocX.size()) { @@ -181,37 +168,34 @@ InDetPerfPlot_hitResidual::fill(const xAOD::TrackParticle &trkprt) { const float pullLocX = result_pullLocX[idx]; const float residualLocY = result_residualLocY[idx]; const float pullLocY = result_pullLocY[idx]; - if ((det == INVALID_DETECTOR) or(region == INVALID_REGION)) { + if ((det == INVALID_DETECTOR)or(region == INVALID_REGION)) { continue; } - if ((region == ENDCAP)and(det == IBL)) { - continue; // Endcap does not have ibl - } if (width > 0) { - //introduce cluster width histograms - fillHisto(m_phiWidth[det][region],width); - fillHisto(m_etaWidth[det][region],etaWidth); - fillHisto(m_residualx[det][region],residualLocX); - const bool hasYCoordinate = (det != SCT) and (det != TRT); // SCT & TRT do not have LocY - if (hasYCoordinate) { - fillHisto(m_residualy[det][region],residualLocY); + // introduce cluster width histograms + fillHisto(m_phiWidth[det][region], width); + fillHisto(m_etaWidth[det][region], etaWidth); + fillHisto(m_residualx[det][region], residualLocX); + const bool hasYCoordinate = (det != SCT)and(det != TRT); // SCT & TRT do not have LocY + if (hasYCoordinate) { + fillHisto(m_residualy[det][region], residualLocY); } - fillHisto(m_residualpullx[det][region],pullLocX); + fillHisto(m_residualpullx[det][region], pullLocX); if (hasYCoordinate) { // SCT & TRT do not have LocY - fillHisto(m_residualpully[det][region],pullLocY); + fillHisto(m_residualpully[det][region], pullLocY); } - if ((det == TRT) or (det == DBM) or(width < 0)) { + if ((det == TRT)or(det == DBM) or(width < 0)) { continue; } if (width == 1) { - fillHisto(m_residualx_1hit[det][region],residualLocX); + fillHisto(m_residualx_1hit[det][region], residualLocX); if (hasYCoordinate) { - fillHisto(m_residualy_1hit[det][region],residualLocY); + fillHisto(m_residualy_1hit[det][region], residualLocY); } } else { - fillHisto(m_residualx_2ormorehits[det][region],residualLocX); + fillHisto(m_residualx_2ormorehits[det][region], residualLocX); if (hasYCoordinate) { - fillHisto(m_residualy_2ormorehits[det][region],residualLocY); + fillHisto(m_residualy_2ormorehits[det][region], residualLocY); } } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitResidual.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitResidual.h index 442fb399db39efd45c42227e86b6ae5f09e0efe8..fed51848c3afd42956f9a897e83d54bf7fed451e 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitResidual.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_hitResidual.h @@ -31,16 +31,16 @@ class IExtrapolator; ///class holding res plots for Inner Detector RTT Validation and implementing fill methods class InDetPerfPlot_hitResidual: public InDetPlotBase { public: - InDetPerfPlot_hitResidual(InDetPlotBase *pParent, const std::string &dirName); + InDetPerfPlot_hitResidual(InDetPlotBase* pParent, const std::string& dirName); - void fill(const xAOD::TrackParticle &trkprt); + void fill(const xAOD::TrackParticle& trkprt); ~InDetPerfPlot_hitResidual() {/** nop **/ } private: // enum copied from the hitDecorator tool in InDetPhysValMonitoring enum Subdetector { - INVALID_DETECTOR=-1, IBL, PIXEL, SCT, TRT, DBM, N_SUBDETECTORS + INVALID_DETECTOR=-1, L0PIXBARR, PIXEL, SCT, TRT, DBM, N_SUBDETECTORS }; enum Region { INVALID_REGION=-1, BARREL, ENDCAP, N_REGIONS @@ -48,18 +48,18 @@ private: void initializePlots(); - TH1 *m_residualx_1hit[TRT][N_REGIONS]; // excludes TRT, DBM - TH1 *m_residualx_2ormorehits[TRT][N_REGIONS]; // excludes TRT, DBM - TH1 *m_residualx[N_SUBDETECTORS][N_REGIONS]; + TH1* m_residualx_1hit[TRT][N_REGIONS]; // excludes TRT, DBM + TH1* m_residualx_2ormorehits[TRT][N_REGIONS]; // excludes TRT, DBM + TH1* m_residualx[N_SUBDETECTORS][N_REGIONS]; // - TH1 *m_residualy_1hit[TRT][N_REGIONS]; // excludes TRT, DBM - TH1 *m_residualy_2ormorehits[TRT][N_REGIONS]; // excludes TRT, DBM - TH1 *m_residualy[N_SUBDETECTORS][N_REGIONS]; + TH1* m_residualy_1hit[TRT][N_REGIONS]; // excludes TRT, DBM + TH1* m_residualy_2ormorehits[TRT][N_REGIONS]; // excludes TRT, DBM + TH1* m_residualy[N_SUBDETECTORS][N_REGIONS]; // - TH1 *m_residualpullx[N_SUBDETECTORS][N_REGIONS]; - TH1 *m_residualpully[N_SUBDETECTORS][N_REGIONS]; - TH1 *m_phiWidth[N_SUBDETECTORS][N_REGIONS]; - TH1 *m_etaWidth[N_SUBDETECTORS][N_REGIONS]; + TH1* m_residualpullx[N_SUBDETECTORS][N_REGIONS]; + TH1* m_residualpully[N_SUBDETECTORS][N_REGIONS]; + TH1* m_phiWidth[N_SUBDETECTORS][N_REGIONS]; + TH1* m_etaWidth[N_SUBDETECTORS][N_REGIONS]; }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.cxx index bd1819d61e4e65fd5184935ae4146843440b8984..116956a88bb628d53e75074da13ccc9cb3bc9c60 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.cxx @@ -10,7 +10,7 @@ #include "InDetPerfPlot_nTracks.h" -InDetPerfPlot_nTracks::InDetPerfPlot_nTracks(InDetPlotBase *pParent, const std::string &sDir) : InDetPlotBase(pParent, +InDetPerfPlot_nTracks::InDetPerfPlot_nTracks(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase(pParent, sDir), m_counters{0} { // nop @@ -34,6 +34,6 @@ InDetPerfPlot_nTracks::initializePlots() { void InDetPerfPlot_nTracks::fill(const unsigned int freq, const CounterCategory counter) { if (counter < N_COUNTERS) { - fillHisto((m_counters[counter]),freq); + fillHisto((m_counters[counter]), freq); } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.h index f845ee598f08d5c3645c81909f5a1bc329227236..4f0fe80f27f0c5c9db6e80ae9ac4c68410049b8a 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_nTracks.h @@ -18,13 +18,13 @@ ///Class to hold various counters used in RTT code class InDetPerfPlot_nTracks: public InDetPlotBase { public: - InDetPerfPlot_nTracks(InDetPlotBase *pParent, const std::string &dirName); + InDetPerfPlot_nTracks(InDetPlotBase* pParent, const std::string& dirName); enum CounterCategory { ALL, SELECTED, TRUTH, TRUTH_MATCHED, N_COUNTERS }; void fill(const unsigned int freq, const CounterCategory counter); private: - TH1 *m_counters[N_COUNTERS]; + TH1* m_counters[N_COUNTERS]; void initializePlots(); }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_res.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_res.cxx index b7278bf53149b3f25a8d261f9956be527758af0f..fb0baf315235b78d74d33f323c09678c71370a9b 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_res.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_res.cxx @@ -9,20 +9,25 @@ #include "InDetPerfPlot_res.h" #include "xAODTracking/TrackingPrimitives.h" -#include <vector> -#include <utility> -#include <cmath> + #include "TH1D.h" #include "TH2D.h" -namespace{ - constexpr float twoPi = 2*M_PI; +#include "TFitResultPtr.h" +#include "TFitResult.h" + +#include "InDetPhysValMonitoringUtilities.h" +#include <cmath> + +using namespace IDPVM; +namespace { + constexpr float twoPi = 2 * M_PI; } -//using namespace TMath; +// using namespace TMath; -InDetPerfPlot_res::InDetPerfPlot_res(InDetPlotBase *pParent, const std::string &sDir) : InDetPlotBase(pParent, sDir), +InDetPerfPlot_res::InDetPerfPlot_res(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase(pParent, sDir), m_meanbasePlots(NPARAMS, nullptr), m_meanbase_vs_eta_d0{}, m_meanbase_vs_eta_z0{}, @@ -43,7 +48,7 @@ InDetPerfPlot_res::InDetPerfPlot_res(InDetPlotBase *pParent, const std::string & m_reswidth_vs_eta_phi{}, m_reswidth_vs_eta_theta{}, m_reswidth_vs_eta_z0_sin_theta{}, - m_reswidth_vs_eta_qopt{}, + m_reswidth_vs_eta_qopt{}, m_mean_vs_ptbasePlots(NPARAMS, nullptr), m_base_vs_pt_d0{}, m_base_vs_pt_z0{}, @@ -93,20 +98,18 @@ InDetPerfPlot_res::InDetPerfPlot_res(InDetPlotBase *pParent, const std::string & m_pullwidth_theta{}, m_pullwidth_z0_sin_theta{}, m_pullwidth_qopt{}, - m_paramNames{"d0", "z0", "phi","theta","z0*sin(theta)","qopt"} -{ + m_paramNames{"d0", "z0", "phi", "theta", "z0*sin(theta)", "qopt"} { // } - void InDetPerfPlot_res::initializePlots() { - book(m_meanbase_vs_eta_d0, "res_d0_vs_eta"); - book(m_meanbase_vs_eta_z0, "res_z0_vs_eta"); - book(m_meanbase_vs_eta_phi, "res_phi_vs_eta"); - book(m_meanbase_vs_eta_theta, "res_theta_vs_eta"); - book(m_meanbase_vs_eta_z0_sin_theta, "res_z0*sin(theta)_vs_eta"); - book(m_meanbase_vs_eta_qopt, "res_qopt_vs_eta"); + book(m_meanbase_vs_eta_d0, "res_d0_vs_eta"); + book(m_meanbase_vs_eta_z0, "res_z0_vs_eta"); + book(m_meanbase_vs_eta_phi, "res_phi_vs_eta"); + book(m_meanbase_vs_eta_theta, "res_theta_vs_eta"); + book(m_meanbase_vs_eta_z0_sin_theta, "res_z0*sin(theta)_vs_eta"); + book(m_meanbase_vs_eta_qopt, "res_qopt_vs_eta"); m_meanbasePlots[0] = m_meanbase_vs_eta_d0; m_meanbasePlots[1] = m_meanbase_vs_eta_z0; @@ -115,12 +118,12 @@ InDetPerfPlot_res::initializePlots() { m_meanbasePlots[4] = m_meanbase_vs_eta_z0_sin_theta; m_meanbasePlots[5] = m_meanbase_vs_eta_qopt; - book(m_resmean_vs_eta_d0, "resmean_d0_vs_eta"); - book(m_resmean_vs_eta_z0, "resmean_z0_vs_eta"); - book(m_resmean_vs_eta_phi, "resmean_phi_vs_eta"); - book(m_resmean_vs_eta_theta, "resmean_theta_vs_eta"); + book(m_resmean_vs_eta_d0, "resmean_d0_vs_eta"); + book(m_resmean_vs_eta_z0, "resmean_z0_vs_eta"); + book(m_resmean_vs_eta_phi, "resmean_phi_vs_eta"); + book(m_resmean_vs_eta_theta, "resmean_theta_vs_eta"); book(m_resmean_vs_eta_z0_sin_theta, "resmean_z0*sin(theta)_vs_eta"); - book(m_resmean_vs_eta_qopt, "resmean_qopt_vs_eta"); + book(m_resmean_vs_eta_qopt, "resmean_qopt_vs_eta"); m_meanPlots[0] = m_resmean_vs_eta_d0; m_meanPlots[1] = m_resmean_vs_eta_z0; @@ -129,12 +132,12 @@ InDetPerfPlot_res::initializePlots() { m_meanPlots[4] = m_resmean_vs_eta_z0_sin_theta; m_meanPlots[5] = m_resmean_vs_eta_qopt; - book(m_reswidth_vs_eta_d0, "reswidth_d0_vs_eta"); - book(m_reswidth_vs_eta_z0, "reswidth_z0_vs_eta"); - book(m_reswidth_vs_eta_phi, "reswidth_phi_vs_eta"); - book(m_reswidth_vs_eta_theta, "reswidth_theta_vs_eta"); + book(m_reswidth_vs_eta_d0, "reswidth_d0_vs_eta"); + book(m_reswidth_vs_eta_z0, "reswidth_z0_vs_eta"); + book(m_reswidth_vs_eta_phi, "reswidth_phi_vs_eta"); + book(m_reswidth_vs_eta_theta, "reswidth_theta_vs_eta"); book(m_reswidth_vs_eta_z0_sin_theta, "reswidth_z0*sin(theta)_vs_eta"); - book(m_reswidth_vs_eta_qopt, "reswidth_qopt_vs_eta"); + book(m_reswidth_vs_eta_qopt, "reswidth_qopt_vs_eta"); m_resoPlots[0] = m_reswidth_vs_eta_d0; m_resoPlots[1] = m_reswidth_vs_eta_z0; @@ -143,12 +146,12 @@ InDetPerfPlot_res::initializePlots() { m_resoPlots[4] = m_reswidth_vs_eta_z0_sin_theta; m_resoPlots[5] = m_reswidth_vs_eta_qopt; - book(m_base_vs_pt_d0, "res_d0_vs_pt"); - book(m_base_vs_pt_z0, "res_z0_vs_pt"); - book(m_base_vs_pt_phi, "res_phi_vs_pt"); - book(m_base_vs_pt_theta, "res_theta_vs_pt"); + book(m_base_vs_pt_d0, "res_d0_vs_pt"); + book(m_base_vs_pt_z0, "res_z0_vs_pt"); + book(m_base_vs_pt_phi, "res_phi_vs_pt"); + book(m_base_vs_pt_theta, "res_theta_vs_pt"); book(m_base_vs_pt_z0_sin_theta, "res_z0*sin(theta)_vs_pt"); - book(m_base_vs_pt_qopt, "res_qopt_vs_pt"); + book(m_base_vs_pt_qopt, "res_qopt_vs_pt"); m_mean_vs_ptbasePlots[0] = m_base_vs_pt_d0; m_mean_vs_ptbasePlots[1] = m_base_vs_pt_z0; @@ -157,12 +160,12 @@ InDetPerfPlot_res::initializePlots() { m_mean_vs_ptbasePlots[4] = m_base_vs_pt_z0_sin_theta; m_mean_vs_ptbasePlots[5] = m_base_vs_pt_qopt; - book(m_resmean_vs_pt_d0, "resmean_d0_vs_pt"); - book(m_resmean_vs_pt_z0, "resmean_z0_vs_pt"); - book(m_resmean_vs_pt_phi, "resmean_phi_vs_pt"); - book(m_resmean_vs_pt_theta, "resmean_theta_vs_pt"); + book(m_resmean_vs_pt_d0, "resmean_d0_vs_pt"); + book(m_resmean_vs_pt_z0, "resmean_z0_vs_pt"); + book(m_resmean_vs_pt_phi, "resmean_phi_vs_pt"); + book(m_resmean_vs_pt_theta, "resmean_theta_vs_pt"); book(m_resmean_vs_pt_z0_sin_theta, "resmean_z0*sin(theta)_vs_pt"); - book(m_resmean_vs_pt_qopt, "resmean_qopt_vs_pt"); + book(m_resmean_vs_pt_qopt, "resmean_qopt_vs_pt"); m_mean_vs_ptPlots[0] = m_resmean_vs_pt_d0; m_mean_vs_ptPlots[1] = m_resmean_vs_pt_z0; @@ -171,12 +174,12 @@ InDetPerfPlot_res::initializePlots() { m_mean_vs_ptPlots[4] = m_resmean_vs_pt_z0_sin_theta; m_mean_vs_ptPlots[5] = m_resmean_vs_pt_qopt; - book(m_reswidth_vs_pt_d0, "reswidth_d0_vs_pt"); - book(m_reswidth_vs_pt_z0, "reswidth_z0_vs_pt"); - book(m_reswidth_vs_pt_phi, "reswidth_phi_vs_pt"); - book(m_reswidth_vs_pt_theta, "reswidth_theta_vs_pt"); + book(m_reswidth_vs_pt_d0, "reswidth_d0_vs_pt"); + book(m_reswidth_vs_pt_z0, "reswidth_z0_vs_pt"); + book(m_reswidth_vs_pt_phi, "reswidth_phi_vs_pt"); + book(m_reswidth_vs_pt_theta, "reswidth_theta_vs_pt"); book(m_reswidth_vs_pt_z0_sin_theta, "reswidth_z0*sin(theta)_vs_pt"); - book(m_reswidth_vs_pt_qopt, "reswidth_qopt_vs_pt"); + book(m_reswidth_vs_pt_qopt, "reswidth_qopt_vs_pt"); m_resptPlots[0] = m_reswidth_vs_pt_d0; m_resptPlots[1] = m_reswidth_vs_pt_z0; @@ -185,12 +188,12 @@ InDetPerfPlot_res::initializePlots() { m_resptPlots[4] = m_reswidth_vs_pt_z0_sin_theta; m_resptPlots[5] = m_reswidth_vs_pt_qopt; - book(m_pullbase_d0, "pull_d0_vs_eta"); - book(m_pullbase_z0, "pull_z0_vs_eta"); - book(m_pullbase_phi, "pull_phi_vs_eta"); - book(m_pullbase_theta, "pull_theta_vs_eta"); + book(m_pullbase_d0, "pull_d0_vs_eta"); + book(m_pullbase_z0, "pull_z0_vs_eta"); + book(m_pullbase_phi, "pull_phi_vs_eta"); + book(m_pullbase_theta, "pull_theta_vs_eta"); book(m_pullbase_z0_sin_theta, "pull_z0*sin(theta)_vs_eta"); - book(m_pullbase_qopt, "pull_qopt_vs_eta"); + book(m_pullbase_qopt, "pull_qopt_vs_eta"); m_pullbasePlots[0] = m_pullbase_d0; m_pullbasePlots[1] = m_pullbase_z0; @@ -199,12 +202,12 @@ InDetPerfPlot_res::initializePlots() { m_pullbasePlots[4] = m_pullbase_z0_sin_theta; m_pullbasePlots[5] = m_pullbase_qopt; - book(m_pullmean_d0, "pullmean_d0_vs_eta"); - book(m_pullmean_z0, "pullmean_z0_vs_eta"); - book(m_pullmean_phi, "pullmean_phi_vs_eta"); - book(m_pullmean_theta, "pullmean_theta_vs_eta"); + book(m_pullmean_d0, "pullmean_d0_vs_eta"); + book(m_pullmean_z0, "pullmean_z0_vs_eta"); + book(m_pullmean_phi, "pullmean_phi_vs_eta"); + book(m_pullmean_theta, "pullmean_theta_vs_eta"); book(m_pullmean_z0_sin_theta, "pullmean_z0*sin(theta)_vs_eta"); - book(m_pullmean_qopt, "pullmean_qopt_vs_eta"); + book(m_pullmean_qopt, "pullmean_qopt_vs_eta"); m_pullmeanPlots[0] = m_pullmean_d0; m_pullmeanPlots[1] = m_pullmean_z0; @@ -213,12 +216,12 @@ InDetPerfPlot_res::initializePlots() { m_pullmeanPlots[4] = m_pullmean_z0_sin_theta; m_pullmeanPlots[5] = m_pullmean_qopt; - book(m_pullwidth_d0, "pullwidth_d0_vs_eta"); - book(m_pullwidth_z0, "pullwidth_z0_vs_eta"); - book(m_pullwidth_phi, "pullwidth_phi_vs_eta"); - book(m_pullwidth_theta, "pullwidth_theta_vs_eta"); + book(m_pullwidth_d0, "pullwidth_d0_vs_eta"); + book(m_pullwidth_z0, "pullwidth_z0_vs_eta"); + book(m_pullwidth_phi, "pullwidth_phi_vs_eta"); + book(m_pullwidth_theta, "pullwidth_theta_vs_eta"); book(m_pullwidth_z0_sin_theta, "pullwidth_z0*sin(theta)_vs_eta"); - book(m_pullwidth_qopt, "pullwidth_qopt_vs_eta"); + book(m_pullwidth_qopt, "pullwidth_qopt_vs_eta"); m_pullwidthPlots[0] = m_pullwidth_d0; m_pullwidthPlots[1] = m_pullwidth_z0; @@ -227,31 +230,32 @@ InDetPerfPlot_res::initializePlots() { m_pullwidthPlots[4] = m_pullwidth_z0_sin_theta; m_pullwidthPlots[5] = m_pullwidth_qopt; - book(m_pull_d0, "pull_d0"); - book(m_pull_z0, "pull_z0"); - book(m_pull_phi, "pull_phi"); - book(m_pull_theta, "pull_theta"); + book(m_pull_d0, "pull_d0"); + book(m_pull_z0, "pull_z0"); + book(m_pull_phi, "pull_phi"); + book(m_pull_theta, "pull_theta"); book(m_pull_z0_sin_theta, "pull_z0_sin_theta"); - book(m_pull_qopt, "pull_qopt"); - + book(m_pull_qopt, "pull_qopt"); + m_pullPlots[0] = m_pull_d0; m_pullPlots[1] = m_pull_z0; m_pullPlots[2] = m_pull_phi; m_pullPlots[3] = m_pull_theta; m_pullPlots[4] = m_pull_z0_sin_theta; - m_pullPlots[5] = m_pull_qopt; + m_pullPlots[5] = m_pull_qopt; } void -InDetPerfPlot_res::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt) { - static const std::array<bool, NPARAMS> truthAvailable{ +InDetPerfPlot_res::fill(const xAOD::TrackParticle& trkprt, const xAOD::TruthParticle& truthprt) { + static const std::array<bool, NPARAMS> truthAvailable { truthprt.isAvailable<float>("d0"), truthprt.isAvailable<float>("z0"), truthprt.isAvailable<float>("phi"), truthprt.isAvailable<float>("theta"), truthprt.isAvailable<float>("z0*sin(theta)"), - truthprt.isAvailable<float>("qOverP")}; //! Careful - // + truthprt.isAvailable<float>("qOverP") + }; // ! Careful + // const double truth_eta = truthprt.eta(); // eta of the truthParticle const double truth_pt = truthprt.pt(); // pt of the truthParticle const double log_trupt = std::log10(truth_pt) - 3.0; @@ -264,22 +268,23 @@ InDetPerfPlot_res::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthPart trkParticleParams[Z0] = trkprt.z0(); trkParticleParams[PHI] = trkprt.phi0(); trkParticleParams[THETA] = trkprt.theta(); - const float trkSinTheta=std::sin(trkprt.theta()); //track sin(theta) + const float trkSinTheta = std::sin(trkprt.theta()); // track sin(theta) float truthSinTheta(NAN); - //static bool truthThetaAvailable(false), truthZ0SinTheta_OK(false), truthZ0SinThetaErr_OK(false); - const static bool truthThetaAvailable=truthAvailable[THETA]; - const static bool truthZ0SinTheta_OK=(truthAvailable[Z0] and truthThetaAvailable); - const static bool truthZ0SinThetaErr_OK= (trkprt.isAvailable<float>("z0err") and trkprt.isAvailable<float>("thetaerr")); - - if (truthThetaAvailable){ - truthSinTheta= std::sin(truthprt.auxdata< float >("theta")); + // static bool truthThetaAvailable(false), truthZ0SinTheta_OK(false), truthZ0SinThetaErr_OK(false); + const static bool truthThetaAvailable = truthAvailable[THETA]; + const static bool truthZ0SinTheta_OK = (truthAvailable[Z0] and truthThetaAvailable); + const static bool truthZ0SinThetaErr_OK = + (trkprt.isAvailable<float>("z0err") and trkprt.isAvailable<float>("thetaerr")); + + if (truthThetaAvailable) { + truthSinTheta = std::sin(truthprt.auxdata< float >("theta")); } // trkParticleParams[Z0SIN_THETA] = trkprt.z0() * trkSinTheta; // trkParticleParams[QOVERP] = trkprt.qOverP(); - + trkParticleParams[QOPT] = (trkprt.qOverP() * 1000. / trkSinTheta); // This switches it to the "qOverPt" PRTT - // uses + // uses if (trkParticleParams[PHI] < 0) { trkParticleParams[PHI] += twoPi; // Add in the 2*pi correction for negative phi, as in PRTT @@ -303,36 +308,37 @@ InDetPerfPlot_res::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthPart if (truthParameter < 0) { truth_charge = -1; } - deviation = (trackParameter - truthParameter) * fabs(truth_pt *0.001 ) * truth_charge; // Used to match PRTT - // version - }else if (var == Z0SIN_THETA) { + deviation = (trackParameter - truthParameter) * std::fabs(truth_pt * 1_GeV) * truth_charge; // Used to match + // PRTT + // version + } else if (var == Z0SIN_THETA) { truthParameter = truthprt.auxdata< float >("z0") * truthSinTheta; deviation = trackParameter - truthParameter; - }else { + } else { truthParameter = (truthprt.auxdata< float >(varName)); if ((var == PHI)and(truthParameter < 0)) { truthParameter += twoPi; // add in 2*pi correction for negative phi, as in PRTT } deviation = trackParameter - truthParameter; } - fillHisto(m_meanbasePlots[var],truth_eta, deviation); - fillHisto(m_mean_vs_ptbasePlots[var],log_trupt, deviation); + fillHisto(m_meanbasePlots[var], truth_eta, deviation); + fillHisto(m_mean_vs_ptbasePlots[var], log_trupt, deviation); } if (sigmaIsAvailable) { float sigma(0); if (var == Z0SIN_THETA) { float z0_sigma = (trkprt.auxdata< float >("z0err")); float theta_sigma = (trkprt.auxdata< float >("thetaerr")); - //const float theta = trkprt.theta(); + // const float theta = trkprt.theta(); const float cosTheta = std::cos(trkParticleParams[THETA]); const float sinTheta = trkSinTheta; const float z0 = trkParticleParams[Z0]; const float term1 = z0_sigma * sinTheta; const float term2 = z0 * theta_sigma * cosTheta; - //const float sigmaSq = ((z0_sigma * sinTheta) * (z0_sigma * sinTheta)) + + // const float sigmaSq = ((z0_sigma * sinTheta) * (z0_sigma * sinTheta)) + // ((z0 * theta_sigma * cosTheta) * (z0 * theta_sigma * cosTheta)); - //sigma = std::sqrt(sigmaSq); - sigma=std::sqrt( (term1 * term1) + (term2 * term2) ); + // sigma = std::sqrt(sigmaSq); + sigma = std::sqrt((term1 * term1) + (term2 * term2)); } else { sigma = (trkprt.auxdata< float >(errName)); } @@ -340,11 +346,11 @@ InDetPerfPlot_res::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthPart float pull(0); if (var == QOPT) { pull = ((trackParameter - truthParameter) * truth_charge / sigma); // used to match PRTT version - }else { + } else { pull = ((trackParameter - truthParameter) / sigma); } - fillHisto(m_pullPlots[var],pull); - fillHisto(m_pullbasePlots[var],truth_eta, pull); + fillHisto(m_pullPlots[var], pull); + fillHisto(m_pullbasePlots[var], truth_eta, pull); } } }// REAL END OF IF(TRUTHISAVAILABLE) STATEMENT @@ -352,8 +358,8 @@ InDetPerfPlot_res::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthPart } void -InDetPerfPlot_res::Refinement(TH1D *temp, const std::string & width, int var, int j, const std::vector<TH1 *> &tvec, - const std::vector<TH1 *> &rvec) { +InDetPerfPlot_res::Refinement(TH1D* temp, const std::string& width, int var, int j, const std::vector<TH1*>& tvec, + const std::vector<TH1*>& rvec) { if (temp->GetXaxis()->TestBit(TAxis::kAxisRange)) { // remove range if set previously temp->GetXaxis()->SetRange(); @@ -367,7 +373,8 @@ InDetPerfPlot_res::Refinement(TH1D *temp, const std::string & width, int var, in RMS_error = temp->GetRMSError(); if (width == "iterative_convergence") { sec_RMS = prim_RMS + 1.0; - while (fabs(sec_RMS - prim_RMS) > 0.001) { + unsigned int withinLoopLimit(10); + while ((std::fabs(sec_RMS - prim_RMS) > 0.001) and (--withinLoopLimit)) { prim_RMS = temp->GetRMS(); double aymin = -3.0 * prim_RMS; double aymax = 3.0 * prim_RMS; @@ -381,9 +388,11 @@ InDetPerfPlot_res::Refinement(TH1D *temp, const std::string & width, int var, in mean = temp->GetMean(); sec_RMS = temp->GetRMS(); } + //ATH_MSG_INFO("Final loop limit count: "<<loopLimit); + if (not withinLoopLimit) ATH_MSG_WARNING("Loop limit reached in <<iterative>> refinement of resolution"); mean_error = temp->GetMeanError(); RMS_error = temp->GetRMSError(); - }else if (width == "gaussian") { + } else if (width == "gaussian") { TFitResultPtr r = temp->Fit("gaus", "QS0"); if (r.Get() and r->Status() % 1000 == 0) { mean = r->Parameter(1); @@ -391,11 +400,12 @@ InDetPerfPlot_res::Refinement(TH1D *temp, const std::string & width, int var, in sec_RMS = r->Parameter(2); RMS_error = r->ParError(2); } - }else if (width == "fusion") { + } else if (width == "fusion") { sec_RMS = prim_RMS + 1.0; double aymin = temp->GetBinLowEdge(1); double aymax = temp->GetBinCenter(temp->GetNbinsX()); - while ((fabs(sec_RMS - prim_RMS) > 0.001)) { + unsigned int withinLoopLimit(10); + while ((std::fabs(sec_RMS - prim_RMS) > 0.001) and (--withinLoopLimit)) { prim_RMS = temp->GetRMS(); aymin = -3.0 * prim_RMS; aymax = 3.0 * prim_RMS; @@ -409,6 +419,8 @@ InDetPerfPlot_res::Refinement(TH1D *temp, const std::string & width, int var, in mean = temp->GetMean(); sec_RMS = temp->GetRMS(); } + //ATH_MSG_INFO("Final loop limit count: "<<loopLimit); + if (not withinLoopLimit) ATH_MSG_WARNING("Loop limit reached in <<fusion>> refinement of resolution"); TFitResultPtr r = temp->Fit("gaus", "QS0", "", aymin, aymax); if (r.Get() and r->Status() % 1000 == 0) { mean = r->Parameter(1); @@ -434,26 +446,27 @@ InDetPerfPlot_res::finalizePlots() { if (m_mean_vs_ptbasePlots[0]) { ptBins = m_mean_vs_ptPlots[0]->GetNbinsX(); } else { - ATH_MSG_WARNING("InDetPerfPlot_res::finalizePlots(): null pointer for histogram, likely it wasn't booked, possibly due to missing histogram definition"); + ATH_MSG_WARNING( + "InDetPerfPlot_res::finalizePlots(): null pointer for histogram, likely it wasn't booked, possibly due to missing histogram definition"); return; } for (unsigned int var(0); var != NPARAMS; ++var) { - if (m_meanPlots[var]){ + if (m_meanPlots[var]) { unsigned int etaBins = m_meanPlots[var]->GetNbinsX(); - auto & meanbasePlot = m_meanbasePlots[var]; - auto & pullbasePlot = m_pullbasePlots[var]; + auto& meanbasePlot = m_meanbasePlots[var]; + auto& pullbasePlot = m_pullbasePlots[var]; for (unsigned int j = 1; j <= etaBins; j++) { // Create dummy histo w/ content from TH2 in relevant eta bin - TH1D *temp = meanbasePlot->ProjectionY(Form("%s_projy_bin%d", "Big_Histo", j), j, j); - TH1D *temp_pull = pullbasePlot->ProjectionY(Form("%s_projy_bin%d", "Pull_Histo", j), j, j); + TH1D* temp = meanbasePlot->ProjectionY(Form("%s_projy_bin%d", "Big_Histo", j), j, j); + TH1D* temp_pull = pullbasePlot->ProjectionY(Form("%s_projy_bin%d", "Pull_Histo", j), j, j); Refinement(temp, width_method, var, j, m_meanPlots, m_resoPlots); Refinement(temp_pull, pull_width_method, var, j, m_pullmeanPlots, m_pullwidthPlots); } - auto & mean_vs_ptbasePlot = m_mean_vs_ptbasePlots[var]; + auto& mean_vs_ptbasePlot = m_mean_vs_ptbasePlots[var]; for (unsigned int i = 1; i <= ptBins; i++) { - TH1D *temp = mean_vs_ptbasePlot->ProjectionY(Form("%s_projy_bin%d", "Big_Histo", i), i, i); + TH1D* temp = mean_vs_ptbasePlot->ProjectionY(Form("%s_projy_bin%d", "Big_Histo", i), i, i); Refinement(temp, width_method, var, i, m_mean_vs_ptPlots, m_resptPlots); } - } + } } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_res.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_res.h index c030be9201bcdfbe29191dc47414ba31cdcedccd..e7509d489e135a756bba4b0a13da91ae6826024a 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_res.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_res.h @@ -10,25 +10,21 @@ **/ -// std includes -#include <string> -#include <vector> -#include "TProfile.h" + // local includes -#include "TFitResultPtr.h" -#include "TFitResult.h" #include "InDetPlotBase.h" // could be fwd declared? #include "xAODTracking/TrackParticle.h" #include "xAODTruth/TruthParticle.h" +// std includes +#include <string> +#include <vector> // fwd declaration -class IToolSvc; -class IExtrapolator; class TH1; class TH2; @@ -39,99 +35,99 @@ public: enum Param { D0, Z0, PHI, THETA, Z0SIN_THETA, QOPT, NPARAMS }; - InDetPerfPlot_res(InDetPlotBase *pParent, const std::string &dirName); + InDetPerfPlot_res(InDetPlotBase* pParent, const std::string& dirName); - void fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt); + void fill(const xAOD::TrackParticle& trkprt, const xAOD::TruthParticle& truthprt); virtual ~InDetPerfPlot_res() {/** nop **/ } private: - std::vector<TH2 *> m_meanbasePlots; - TH2 * m_meanbase_vs_eta_d0; - TH2 * m_meanbase_vs_eta_z0; - TH2 * m_meanbase_vs_eta_phi; - TH2 * m_meanbase_vs_eta_theta; - TH2 * m_meanbase_vs_eta_z0_sin_theta; - TH2 * m_meanbase_vs_eta_qopt; - - std::vector<TH1 *> m_meanPlots; - TH1 * m_resmean_vs_eta_d0; - TH1 * m_resmean_vs_eta_z0; - TH1 * m_resmean_vs_eta_phi; - TH1 * m_resmean_vs_eta_theta; - TH1 * m_resmean_vs_eta_z0_sin_theta; - TH1 * m_resmean_vs_eta_qopt; - - std::vector<TH1 *> m_resoPlots; - TH1 * m_reswidth_vs_eta_d0; - TH1 * m_reswidth_vs_eta_z0; - TH1 * m_reswidth_vs_eta_phi; - TH1 * m_reswidth_vs_eta_theta; - TH1 * m_reswidth_vs_eta_z0_sin_theta; - TH1 * m_reswidth_vs_eta_qopt; - - std::vector<TH2 *> m_mean_vs_ptbasePlots; - TH2 * m_base_vs_pt_d0; - TH2 * m_base_vs_pt_z0; - TH2 * m_base_vs_pt_phi; - TH2 * m_base_vs_pt_theta; - TH2 * m_base_vs_pt_z0_sin_theta; - TH2 * m_base_vs_pt_qopt; - - std::vector<TH1 *> m_mean_vs_ptPlots; - TH1 * m_resmean_vs_pt_d0; - TH1 * m_resmean_vs_pt_z0; - TH1 * m_resmean_vs_pt_phi; - TH1 * m_resmean_vs_pt_theta; - TH1 * m_resmean_vs_pt_z0_sin_theta; - TH1 * m_resmean_vs_pt_qopt; - - std::vector<TH1 *> m_resptPlots; - TH1 * m_reswidth_vs_pt_d0; - TH1 * m_reswidth_vs_pt_z0; - TH1 * m_reswidth_vs_pt_phi; - TH1 * m_reswidth_vs_pt_theta; - TH1 * m_reswidth_vs_pt_z0_sin_theta; - TH1 * m_reswidth_vs_pt_qopt; - - std::vector<TH1 *> m_pullPlots; - TH1 * m_pull_d0; - TH1 * m_pull_z0; - TH1 * m_pull_phi; - TH1 * m_pull_theta; - TH1 * m_pull_z0_sin_theta; - TH1 * m_pull_qopt; - - std::vector<TH2 *> m_pullbasePlots; - TH2 * m_pullbase_d0; - TH2 * m_pullbase_z0; - TH2 * m_pullbase_phi; - TH2 * m_pullbase_theta; - TH2 * m_pullbase_z0_sin_theta; - TH2 * m_pullbase_qopt; - - std::vector<TH1 *> m_pullmeanPlots; - TH1 * m_pullmean_d0; - TH1 * m_pullmean_z0; - TH1 * m_pullmean_phi; - TH1 * m_pullmean_theta; - TH1 * m_pullmean_z0_sin_theta; - TH1 * m_pullmean_qopt; - - std::vector<TH1 *> m_pullwidthPlots; - TH1 * m_pullwidth_d0; - TH1 * m_pullwidth_z0; - TH1 * m_pullwidth_phi; - TH1 * m_pullwidth_theta; - TH1 * m_pullwidth_z0_sin_theta; - TH1 * m_pullwidth_qopt; + std::vector<TH2*> m_meanbasePlots; + TH2* m_meanbase_vs_eta_d0; + TH2* m_meanbase_vs_eta_z0; + TH2* m_meanbase_vs_eta_phi; + TH2* m_meanbase_vs_eta_theta; + TH2* m_meanbase_vs_eta_z0_sin_theta; + TH2* m_meanbase_vs_eta_qopt; + + std::vector<TH1*> m_meanPlots; + TH1* m_resmean_vs_eta_d0; + TH1* m_resmean_vs_eta_z0; + TH1* m_resmean_vs_eta_phi; + TH1* m_resmean_vs_eta_theta; + TH1* m_resmean_vs_eta_z0_sin_theta; + TH1* m_resmean_vs_eta_qopt; + + std::vector<TH1*> m_resoPlots; + TH1* m_reswidth_vs_eta_d0; + TH1* m_reswidth_vs_eta_z0; + TH1* m_reswidth_vs_eta_phi; + TH1* m_reswidth_vs_eta_theta; + TH1* m_reswidth_vs_eta_z0_sin_theta; + TH1* m_reswidth_vs_eta_qopt; + + std::vector<TH2*> m_mean_vs_ptbasePlots; + TH2* m_base_vs_pt_d0; + TH2* m_base_vs_pt_z0; + TH2* m_base_vs_pt_phi; + TH2* m_base_vs_pt_theta; + TH2* m_base_vs_pt_z0_sin_theta; + TH2* m_base_vs_pt_qopt; + + std::vector<TH1*> m_mean_vs_ptPlots; + TH1* m_resmean_vs_pt_d0; + TH1* m_resmean_vs_pt_z0; + TH1* m_resmean_vs_pt_phi; + TH1* m_resmean_vs_pt_theta; + TH1* m_resmean_vs_pt_z0_sin_theta; + TH1* m_resmean_vs_pt_qopt; + + std::vector<TH1*> m_resptPlots; + TH1* m_reswidth_vs_pt_d0; + TH1* m_reswidth_vs_pt_z0; + TH1* m_reswidth_vs_pt_phi; + TH1* m_reswidth_vs_pt_theta; + TH1* m_reswidth_vs_pt_z0_sin_theta; + TH1* m_reswidth_vs_pt_qopt; + + std::vector<TH1*> m_pullPlots; + TH1* m_pull_d0; + TH1* m_pull_z0; + TH1* m_pull_phi; + TH1* m_pull_theta; + TH1* m_pull_z0_sin_theta; + TH1* m_pull_qopt; + + std::vector<TH2*> m_pullbasePlots; + TH2* m_pullbase_d0; + TH2* m_pullbase_z0; + TH2* m_pullbase_phi; + TH2* m_pullbase_theta; + TH2* m_pullbase_z0_sin_theta; + TH2* m_pullbase_qopt; + + std::vector<TH1*> m_pullmeanPlots; + TH1* m_pullmean_d0; + TH1* m_pullmean_z0; + TH1* m_pullmean_phi; + TH1* m_pullmean_theta; + TH1* m_pullmean_z0_sin_theta; + TH1* m_pullmean_qopt; + + std::vector<TH1*> m_pullwidthPlots; + TH1* m_pullwidth_d0; + TH1* m_pullwidth_z0; + TH1* m_pullwidth_phi; + TH1* m_pullwidth_theta; + TH1* m_pullwidth_z0_sin_theta; + TH1* m_pullwidth_qopt; std::vector<std::string> m_paramNames; void initializePlots(); - void Refinement(TH1D *temp, const std::string & width, int var, int j, const std::vector<TH1 *> &tvec, - const std::vector<TH1 *> &rvec); + void Refinement(TH1D* temp, const std::string& width, int var, int j, const std::vector<TH1*>& tvec, + const std::vector<TH1*>& rvec); void finalizePlots(); }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_resITk.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_resITk.cxx index 343a77db9c21ef29689e0f366e506518bd4ff2c1..e98ff829020eaee882438cc58baeb3eaa06a8ad0 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_resITk.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_resITk.cxx @@ -8,13 +8,13 @@ **/ #include "InDetPerfPlot_resITk.h" -//#include <iostream> +// #include <iostream> #include <map> -InDetPerfPlot_resITk::InDetPerfPlot_resITk(PlotBase *pParent, const std::string &sDir) : PlotBase(pParent, sDir), - m_primTrk (false), +InDetPerfPlot_resITk::InDetPerfPlot_resITk(PlotBase* pParent, const std::string& sDir) : PlotBase(pParent, sDir), + m_primTrk(false), m_secdTrk(false), - m_allTrk (false), + m_allTrk(false), m_trkP{}, m_truetrkP{}, m_trkErrP{}, @@ -58,8 +58,8 @@ InDetPerfPlot_resITk::InDetPerfPlot_resITk(PlotBase *pParent, const std::string m_resITk_resHelperpt_neg{}, m_resITk_Resolution_vs_pt_neg{}, - m_resITk_resHelperetapt{}, - m_resITk_pullHelperpt{}, +// m_resITk_resHelperetapt{}, + m_resITk_pullHelperpt{}, m_resITk_pullHelpereta{}, m_resITk_pullResolution_vs_pt{}, @@ -97,12 +97,12 @@ InDetPerfPlot_resITk::InDetPerfPlot_resITk(PlotBase *pParent, const std::string m_fix_d0_res{}, m_fix_d0resolutionRMS_vs_eta{}, m_fix_z0_res{}, - m_fix_z0resolutionRMS_vs_eta{} - { + m_fix_z0resolutionRMS_vs_eta{} { TString tsDir = (TString) sDir; + if (tsDir.Contains("Primary")) { m_primTrk = true; // control if sec/prim from init - }else if (tsDir.Contains("Secondary")) { + } else if (tsDir.Contains("Secondary")) { m_secdTrk = true; } else { m_allTrk = true; @@ -257,21 +257,27 @@ InDetPerfPlot_resITk::initializePlots() { int nBinsEta = 50.0; float nMinEta = -5.0; float nMaxEta = fabs(nMinEta); - int nBinsPt = 500.0; + int nBinsPt = 50.0; float nMinPt = 0.0; float nMaxPt = 500.0; + Float_t ptlimits[50]; + for (int i=0; i<50; ++i) { + ptlimits[i] = 1000.0* TMath::Exp((i-49.0)/6.804); + } for (unsigned int iparam = 0; iparam < NPARAMS; iparam++) { ///pull std::string tmpName = "pull_" + m_paramProp[iparam].paraName; - std::string tmpTitle = tmpName + "; (" + m_paramProp[iparam].paraLabel + "^{reco}-" + m_paramProp[iparam].paraLabel + + std::string tmpTitle = tmpName + "; (" + m_paramProp[iparam].paraLabel + "^{reco}-" + + m_paramProp[iparam].paraLabel + "^{true})/#sigma_{" + m_paramProp[iparam].paraLabel + "}"; m_resITk_pull[iparam] = Book1D(tmpName, tmpTitle, 200, -5.0, 5.0, false); // res tmpName = "res_" + m_paramProp[iparam].paraName; - tmpTitle = tmpName + "; " + m_paramProp[iparam].paraLabel + "^{reco}-" + m_paramProp[iparam].paraLabel + "^{true} / " + m_paramProp[iparam].paraLabel + "^{true}"; - // paramProp[iparam].paraUnit; + tmpTitle = tmpName + "; " + m_paramProp[iparam].paraLabel + "^{reco}-" + m_paramProp[iparam].paraLabel + + "^{true} / " + m_paramProp[iparam].paraLabel + "^{true}"; + // paramProp[iparam].paraUnit; m_resITk_res[iparam] = Book1D(tmpName, tmpTitle, m_paramProp[iparam].nBinsRes, m_paramProp[iparam].limRes.at( 0), m_paramProp[iparam].limRes.at(1), false); // reco @@ -294,10 +300,12 @@ InDetPerfPlot_resITk::initializePlots() { tmpTitle = tmpName + "; true track #eta; " + m_paramProp[iparam].paraLabel + "^{reco}-" + m_paramProp[iparam].paraLabel + "^{true} " + m_paramProp[iparam].paraUnit; m_resITk_resHelpereta[iparam] = - Book2D(tmpName, tmpTitle, nBinsEta, nMinEta, nMaxEta, m_paramProp[iparam].nBinsRes, m_paramProp[iparam].limRes.at(0), m_paramProp[iparam].limRes.at(1),false); + Book2D(tmpName, tmpTitle, nBinsEta, nMinEta, nMaxEta, m_paramProp[iparam].nBinsRes, + m_paramProp[iparam].limRes.at(0), m_paramProp[iparam].limRes.at(1), false); for (unsigned int ibins = 0; ibins < m_nEtaBins; ibins++) { tmpName = "EtaProjections_resProjection_" + m_paramProp[iparam].paraName + std::to_string(ibins + 1); - tmpTitle = "resProjection_" + m_paramProp[iparam].paraName + std::to_string(ibins + 1) + "; " + m_paramProp[iparam].paraLabel + "^{reco}-" + m_paramProp[iparam].paraLabel + "^{true} " + + tmpTitle = "resProjection_" + m_paramProp[iparam].paraName + std::to_string(ibins + 1) + "; " + + m_paramProp[iparam].paraLabel + "^{reco}-" + m_paramProp[iparam].paraLabel + "^{true} " + m_paramProp[iparam].paraUnit; m_resITk_ResProjections_vs_eta[iparam][ibins] = Book1D(tmpName, tmpTitle, m_paramProp[iparam].nBinsRes, m_paramProp[iparam].limRes.at(0), @@ -317,13 +325,13 @@ InDetPerfPlot_resITk::initializePlots() { m_resITk_Resolution_vs_eta[iparam][ires] = Book1D(tmpName, tmpTitle, m_nEtaBins, -4.0, 4.0, false); } - + tmpName = "resHelpereta_pos" + m_paramProp[iparam].paraName; tmpTitle = tmpName + "; true track #eta; " + m_paramProp[iparam].paraLabel + "^{reco}-" + m_paramProp[iparam].paraLabel + "^{true} " + m_paramProp[iparam].paraUnit; m_resITk_resHelpereta_pos[iparam] = Book2D(tmpName, tmpTitle, nBinsEta, nMinEta, nMaxEta, m_paramProp[iparam].nBinsRes, m_paramProp[iparam].limRes.at(0), - m_paramProp[iparam].limRes.at(1),false); + m_paramProp[iparam].limRes.at(1), false); for (unsigned int ires = 0; ires < m_nResHist; ires++) { tmpName = m_paramProp[iparam].paraName + m_resHisto[ires] + "_vs_eta_pos"; tmpTitle = tmpName + "; true track #eta; " + m_paramProp[iparam].paraLabel + ytitle[ires] + @@ -335,7 +343,7 @@ InDetPerfPlot_resITk::initializePlots() { m_paramProp[iparam].paraLabel + "^{true} " + m_paramProp[iparam].paraUnit; m_resITk_resHelpereta_neg[iparam] = Book2D(tmpName, tmpTitle, nBinsEta, nMinEta, nMaxEta, m_paramProp[iparam].nBinsRes, m_paramProp[iparam].limRes.at(0), - m_paramProp[iparam].limRes.at(1),false); + m_paramProp[iparam].limRes.at(1), false); for (unsigned int ires = 0; ires < m_nResHist; ires++) { tmpName = m_paramProp[iparam].paraName + m_resHisto[ires] + "_vs_eta_neg"; tmpTitle = tmpName + "; true track #eta; " + m_paramProp[iparam].paraLabel + ytitle[ires] + @@ -349,16 +357,17 @@ InDetPerfPlot_resITk::initializePlots() { m_paramProp[iparam].paraLabel + "^{true} " + m_paramProp[iparam].paraUnit; m_resITk_resHelperpt[iparam] = Book2D(tmpName, tmpTitle, nBinsPt, nMinPt, nMaxPt, m_paramProp[iparam].nBinsRes, m_paramProp[iparam].limRes.at( - 0), m_paramProp[iparam].limRes.at(1),false); + 0), m_paramProp[iparam].limRes.at(1), false); + m_resITk_resHelperpt[iparam]->GetXaxis()->Set(49,ptlimits); tmpName = "pullHelperpt_" + m_paramProp[iparam].paraName; tmpTitle = tmpName + "; true track p_{T} [GeV]; (" + m_paramProp[iparam].paraLabel + "^{reco}-" + m_paramProp[iparam].paraLabel + "^{true})/#sigma_{" + m_paramProp[iparam].paraLabel + "}"; - m_resITk_pullHelperpt[iparam] = Book2D(tmpName, tmpTitle, nBinsPt, nMinPt, nMaxPt, 200, -10.0, 10.0,false); - + m_resITk_pullHelperpt[iparam] = Book2D(tmpName, tmpTitle, nBinsPt, nMinPt, nMaxPt, 200, -10.0, 10.0, false); + m_resITk_pullHelperpt[iparam]->GetXaxis()->Set(49,ptlimits); tmpName = "pullHelpereta_" + m_paramProp[iparam].paraName; tmpTitle = tmpName + "; true track #eta; (" + m_paramProp[iparam].paraLabel + "^{reco}-" + m_paramProp[iparam].paraLabel + "^{true})/#sigma_{" + m_paramProp[iparam].paraLabel + "}"; - m_resITk_pullHelpereta[iparam] = Book2D(tmpName, tmpTitle, nBinsEta, nMinEta, nMaxEta, 200, -10.0, 10.0,false); + m_resITk_pullHelpereta[iparam] = Book2D(tmpName, tmpTitle, nBinsEta, nMinEta, nMaxEta, 200, -10.0, 10.0, false); for (unsigned int ires = 0; ires < m_nResHist; ires++) { @@ -391,7 +400,8 @@ InDetPerfPlot_resITk::initializePlots() { } for (unsigned int ibins = 0; ibins < m_nPtBins; ibins++) { tmpName = "PtProjections/resProjection_" + m_paramProp[iparam].paraName + std::to_string(ibins + 1); - tmpTitle = tmpName + "; " + m_paramProp[iparam].paraLabel + "^{reco}-" + m_paramProp[iparam].paraLabel + "^{true} " + + tmpTitle = tmpName + "; " + m_paramProp[iparam].paraLabel + "^{reco}-" + m_paramProp[iparam].paraLabel + + "^{true} " + m_paramProp[iparam].paraUnit; m_resITk_ResProjections_vs_pt[iparam][ibins] = Book1D(tmpName, tmpTitle, m_paramProp[iparam].nBinsRes, m_paramProp[iparam].limRes.at(0), @@ -409,7 +419,8 @@ InDetPerfPlot_resITk::initializePlots() { m_paramProp[iparam].paraLabel + "^{true} " + m_paramProp[iparam].paraUnit; m_resITk_resHelperpt_pos[iparam] = Book2D(tmpName, tmpTitle, nBinsPt, nMinPt, nMaxPt, m_paramProp[iparam].nBinsRes, m_paramProp[iparam].limRes.at( - 0), m_paramProp[iparam].limRes.at(1),false); + 0), m_paramProp[iparam].limRes.at(1), false); + m_resITk_resHelperpt_pos[iparam]->GetXaxis()->Set(49,ptlimits); for (unsigned int ires = 0; ires < m_nResHist; ires++) { tmpName = m_paramProp[iparam].paraName + m_resHisto[ires] + "_vs_pt_pos"; tmpTitle = tmpName + "; true track p_{T} [GeV]; " + m_paramProp[iparam].paraLabel + ytitle[ires] + @@ -422,7 +433,8 @@ InDetPerfPlot_resITk::initializePlots() { m_paramProp[iparam].paraLabel + "^{true} " + m_paramProp[iparam].paraUnit; m_resITk_resHelperpt_neg[iparam] = Book2D(tmpName, tmpTitle, nBinsPt, nMinPt, nMaxPt, m_paramProp[iparam].nBinsRes, m_paramProp[iparam].limRes.at( - 0), m_paramProp[iparam].limRes.at(1),false); + 0), m_paramProp[iparam].limRes.at(1), false); + m_resITk_resHelperpt_neg[iparam]->GetXaxis()->Set(49,ptlimits); for (unsigned int ires = 0; ires < m_nResHist; ires++) { tmpName = m_paramProp[iparam].paraName + m_resHisto[ires] + "_vs_pt_neg"; tmpTitle = tmpName + "; true track p_{T} [GeV]; " + m_paramProp[iparam].paraLabel + ytitle[ires] + @@ -434,10 +446,10 @@ InDetPerfPlot_resITk::initializePlots() { tmpName = "resHelperetapt_" + m_paramProp[iparam].paraName; tmpTitle = tmpName + "; true track p_{T}; true track #eta; " + m_paramProp[iparam].paraLabel + "^{reco}-" + m_paramProp[iparam].paraLabel + "^{true} " + m_paramProp[iparam].paraUnit; - m_resITk_resHelperetapt[iparam] = Book3D(tmpName, tmpTitle, nBinsPt, nMinPt, nMaxPt, nBinsEta, nMinEta, nMaxEta, +/* m_resITk_resHelperetapt[iparam] = Book3D(tmpName, tmpTitle, nBinsPt, nMinPt, nMaxPt, nBinsEta, nMinEta, nMaxEta, m_paramProp[iparam].nBinsRes, m_paramProp[iparam].limRes.at(0), m_paramProp[iparam].limRes.at(1), false); - +*/ for (unsigned int ires = 0; ires < 2; ires++) { for (int ibin = 0; ibin < 4; ibin++) { int tmpInt = ibin + 1; @@ -471,10 +483,12 @@ InDetPerfPlot_resITk::initializePlots() { tmpTitle = tmpName + "; true track p_{T}; #sigma_{" + m_paramProp[iparam].paraLabel + "} " + m_paramProp[iparam].paraUnit; m_resITk_meanProfpt[iparam] = BookTProfile(tmpName, tmpTitle, nBinsPt, nMinPt, nMaxPt, -1.0, 1.0, false); - m_resITk_meanProfpt[iparam]->GetXaxis()->Set(m_nPtBins, m_PtBins); + m_resITk_meanProfpt[iparam]->GetXaxis()->Set(49,ptlimits); +// m_resITk_meanProfpt[iparam]->GetXaxis()->Set(m_nPtBins, m_PtBins); tmpName = "DEBUG_D0dep_" + m_paramProp[iparam].paraName; - tmpTitle = tmpName + "; " + m_paramProp[iparam].paraLabel + "^{reco} " + m_paramProp[iparam].paraUnit + "; d_{0} [mm]"; + tmpTitle = tmpName + "; " + m_paramProp[iparam].paraLabel + "^{reco} " + m_paramProp[iparam].paraUnit + + "; d_{0} [mm]"; m_DEBUG_D0dep[iparam] = BookTProfile(tmpName, tmpTitle, m_paramProp[iparam].nBinsPrp, m_paramProp[iparam].limPrp.at( 0), m_paramProp[iparam].limPrp.at(1), -0.1, 0.1, false); } @@ -489,7 +503,8 @@ InDetPerfPlot_resITk::initializePlots() { nBinsEta, nMinEta, nMaxEta, false); m_resITk_chargeID_vs_pt = Book1D("chargeID_vs_pt", "chargeID_vs_pt; truth track p_{T} [GeV]; Fraction of misID [%]", nBinsPt, nMaxPt, nMaxPt, false); - m_resITk_chargeID_vs_pt->GetXaxis()->Set(m_nPtBins, m_PtBins); + m_resITk_chargeID_vs_pt->GetXaxis()->Set(49,ptlimits); +// m_resITk_chargeID_vs_pt->GetXaxis()->Set(m_nPtBins, m_PtBins); m_resITk_momTail = Book1D("momTail", "momTail", 2, 0., 2., false); m_resITk_momTail->GetXaxis()->SetBinLabel(1, "Core"); @@ -499,6 +514,7 @@ InDetPerfPlot_resITk::initializePlots() { nBinsEta, nMinEta, nMaxEta, false); m_resITk_momTail_vs_pt = Book1D("momTail_vs_pt", "momTail_vs_pt; truth track p_{T} [GeV]; Fraction of p_{T}-tail [%]", nBinsPt, nMinPt, nMaxPt, false); + m_resITk_momTail_vs_pt->GetXaxis()->Set(49,ptlimits); m_resITk_momTail_vs_pt->GetXaxis()->Set(m_nPtBins, m_PtBins); m_resITk_momTail_vs_phi = Book1D("momTail_vs_phi", "momTail_vs_phi; truth track #phi; Fraction of p_{T}-tail [%]", nBinsEta, nMinEta, nMaxEta, false); @@ -514,82 +530,100 @@ InDetPerfPlot_resITk::initializePlots() { m_DEBUG_FirstHitR_d0 = BookTProfile("DEBUG_FirstHitR_d0", "DEBUG_FirstHitR_d0; R [mm]", 150, 0., 10., -1.0, 1.0, false); - m_trk_chi2ndof = Book1D("trk_chi2ndof","trk_chi2ndof; #chi_{0}/ndof", 200, 0., 20,false); - m_trk_chi2 = Book1D("trk_chi2","trk_chi2; #chi^{2}/ndof", 200, 0., 200,false); - m_trk_ndof = Book1D("trk_ndof","trk_ndof; #chi^{2}/ndof", 200, 0., 200,false); - m_trk_chi2ndof_vs_eta = BookTProfile("trk_chi2ndof_vs_eta","trk_chi2ndof_vs_eta; #eta; #chi^{2}/ndof", nBinsEta, nMinEta, nMaxEta, -1.0, 1.0, false); - m_trk_chi2ndof_vs_totHits = BookTProfile("trk_chi2ndof_vs_totHits","trk_chi2ndof_vs_totHits; number of Total Hits; #chi^{2}/ndof", 30, 0, 30, -1.0, 1.0, false); - m_trk_chi2ndof_vs_totHits_prob = BookTProfile("trk_chi2ndof_vs_totHits_prob","trk_chi2ndof_vs_totHits_prob; number of Total Hits; #chi^{2}/ndof", 30, 0, 30, -1.0, 1.0, false); - - m_significance_d0 = Book2D("significance_d0","d0 significance w.r.t pv; #eta; d_{0}/#sigma_{d_{0}}",320,-4.0,4.0,150,-5.0,5.0,false); - m_significance_z0 = Book2D("significance_z0","z0 significance w.r.t pv; #eta; z_{0}/#sigma_{z_{0}}",320,-4.0,4.0,150,-5.0,5.0,false); - - m_significance_d0_vs_eta = Book1D("significance_d0_vs_eta","d0 significance with w.r.t pv; #eta; d_{0} sign width",m_nEtaBins,-4.0,4.0,false); - m_significance_z0_vs_eta = Book1D("significance_z0_vs_eta","z0 significance with w.r.t pv; #eta; z_{0} sign width",m_nEtaBins,-4.0,4.0,false); - -//tmp fix for pT resolution - //16 eta bins + m_trk_chi2ndof = Book1D("trk_chi2ndof", "trk_chi2ndof; #chi_{0}/ndof", 200, 0., 20, false); + m_trk_chi2 = Book1D("trk_chi2", "trk_chi2; #chi^{2}/ndof", 200, 0., 200, false); + m_trk_ndof = Book1D("trk_ndof", "trk_ndof; #chi^{2}/ndof", 200, 0., 200, false); + m_trk_chi2ndof_vs_eta = BookTProfile("trk_chi2ndof_vs_eta", "trk_chi2ndof_vs_eta; #eta; #chi^{2}/ndof", nBinsEta, + nMinEta, nMaxEta, -1.0, 1.0, false); + m_trk_chi2ndof_vs_totHits = BookTProfile("trk_chi2ndof_vs_totHits", + "trk_chi2ndof_vs_totHits; number of Total Hits; #chi^{2}/ndof", 30, 0, 30, + -1.0, 1.0, false); + m_trk_chi2ndof_vs_totHits_prob = BookTProfile("trk_chi2ndof_vs_totHits_prob", + "trk_chi2ndof_vs_totHits_prob; number of Total Hits; #chi^{2}/ndof", 30, + 0, 30, -1.0, 1.0, false); + + m_significance_d0 = Book2D("significance_d0", "d0 significance w.r.t pv; #eta; d_{0}/#sigma_{d_{0}}", 320, -4.0, 4.0, + 150, -5.0, 5.0, false); + m_significance_z0 = Book2D("significance_z0", "z0 significance w.r.t pv; #eta; z_{0}/#sigma_{z_{0}}", 320, -4.0, 4.0, + 150, -5.0, 5.0, false); + + m_significance_d0_vs_eta = Book1D("significance_d0_vs_eta", "d0 significance with w.r.t pv; #eta; d_{0} sign width", + m_nEtaBins, -4.0, 4.0, false); + m_significance_z0_vs_eta = Book1D("significance_z0_vs_eta", "z0 significance with w.r.t pv; #eta; z_{0} sign width", + m_nEtaBins, -4.0, 4.0, false); + +// tmp fix for pT resolution +// 16 eta bins std::string fixName = "fix_qoverpt_res1"; - m_fix_qoverpt_res[0] = Book1D(fixName,fixName,600,-15.0,15.0,false); + m_fix_qoverpt_res[0] = Book1D(fixName, fixName, 600, -15.0, 15.0, false); fixName = "fix_qoverpt_res2"; - m_fix_qoverpt_res[1] = Book1D(fixName,fixName,600,-5.0,5.0,false); + m_fix_qoverpt_res[1] = Book1D(fixName, fixName, 600, -5.0, 5.0, false); fixName = "fix_qoverpt_res3"; - m_fix_qoverpt_res[2] = Book1D(fixName,fixName,600,-2.0,2.0,false); + m_fix_qoverpt_res[2] = Book1D(fixName, fixName, 600, -2.0, 2.0, false); fixName = "fix_qoverpt_res4"; - m_fix_qoverpt_res[3] = Book1D(fixName,fixName,600,-1.0,1.0,false); + m_fix_qoverpt_res[3] = Book1D(fixName, fixName, 600, -1.0, 1.0, false); fixName = "fix_qoverpt_res5"; - m_fix_qoverpt_res[4] = Book1D(fixName,fixName,600,-1.0,1.0,false); + m_fix_qoverpt_res[4] = Book1D(fixName, fixName, 600, -1.0, 1.0, false); fixName = "fix_qoverpt_res6"; - m_fix_qoverpt_res[5] = Book1D(fixName,fixName,600,-0.5,0.5,false); + m_fix_qoverpt_res[5] = Book1D(fixName, fixName, 600, -0.5, 0.5, false); fixName = "fix_qoverpt_res7"; - m_fix_qoverpt_res[6] = Book1D(fixName,fixName,600,-0.2,0.2,false); + m_fix_qoverpt_res[6] = Book1D(fixName, fixName, 600, -0.2, 0.2, false); fixName = "fix_qoverpt_res8"; - m_fix_qoverpt_res[7] = Book1D(fixName,fixName,600,-0.2,0.2,false); + m_fix_qoverpt_res[7] = Book1D(fixName, fixName, 600, -0.2, 0.2, false); fixName = "fix_qoverpt_res16"; - m_fix_qoverpt_res[15] = Book1D(fixName,fixName,600,-15.0,15.0,false); + m_fix_qoverpt_res[15] = Book1D(fixName, fixName, 600, -15.0, 15.0, false); fixName = "fix_qoverpt_res15"; - m_fix_qoverpt_res[14] = Book1D(fixName,fixName,600,-5.0,5.0,false); + m_fix_qoverpt_res[14] = Book1D(fixName, fixName, 600, -5.0, 5.0, false); fixName = "fix_qoverpt_res14"; - m_fix_qoverpt_res[13] = Book1D(fixName,fixName,600,-2.0,2.0,false); + m_fix_qoverpt_res[13] = Book1D(fixName, fixName, 600, -2.0, 2.0, false); fixName = "fix_qoverpt_res13"; - m_fix_qoverpt_res[12] = Book1D(fixName,fixName,600,-1.0,1.0,false); + m_fix_qoverpt_res[12] = Book1D(fixName, fixName, 600, -1.0, 1.0, false); fixName = "fix_qoverpt_res12"; - m_fix_qoverpt_res[11] = Book1D(fixName,fixName,600,-1.0,1.0,false); + m_fix_qoverpt_res[11] = Book1D(fixName, fixName, 600, -1.0, 1.0, false); fixName = "fix_qoverpt_res11"; - m_fix_qoverpt_res[10] = Book1D(fixName,fixName,600,-0.5,0.5,false); + m_fix_qoverpt_res[10] = Book1D(fixName, fixName, 600, -0.5, 0.5, false); fixName = "fix_qoverpt_res10"; - m_fix_qoverpt_res[9] = Book1D(fixName,fixName,600,-0.2,0.2,false); + m_fix_qoverpt_res[9] = Book1D(fixName, fixName, 600, -0.2, 0.2, false); fixName = "fix_qoverpt_res9"; - m_fix_qoverpt_res[8] = Book1D(fixName,fixName,600,-0.2,0.2,false); + m_fix_qoverpt_res[8] = Book1D(fixName, fixName, 600, -0.2, 0.2, false); - m_fix_qoverptresolutionRMS_vs_eta = Book1D("fix_qoverptresolutionRMS_vs_eta","fix_qoverptresolutionRMS_vseta; true particle #eta; p_{T} #times #sigma(1/p_{T})",m_nEtaBins, -4.0, 4.0, false); + m_fix_qoverptresolutionRMS_vs_eta = Book1D("fix_qoverptresolutionRMS_vs_eta", + "fix_qoverptresolutionRMS_vseta; true particle #eta; p_{T} #times #sigma(1/p_{T})", m_nEtaBins, -4.0, 4.0, + false); - float rangesd0[16] = { 1.5, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, - 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.5 }; + float rangesd0[16] = { + 1.5, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, + 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.0, 1.5 + }; - float rangesz0[16] = { 10.0, 10.0, 8.0, 6.0, 6.0, 4.0, 3.0, 2.0, - 2.0, 3.0, 4.0, 6.0, 6.0, 8.0, 10.0, 10.0 }; + float rangesz0[16] = { + 10.0, 10.0, 8.0, 6.0, 6.0, 4.0, 3.0, 2.0, + 2.0, 3.0, 4.0, 6.0, 6.0, 8.0, 10.0, 10.0 + }; - for(int ieta = 0; ieta < 16; ieta++){ - fixName = "fix_d0_res" + std::to_string(ieta+1); - m_fix_d0_res[ieta] = Book1D(fixName,fixName,600,-rangesd0[ieta],rangesd0[ieta],false); + for (int ieta = 0; ieta < 16; ieta++) { + fixName = "fix_d0_res" + std::to_string(ieta + 1); + m_fix_d0_res[ieta] = Book1D(fixName, fixName, 600, -rangesd0[ieta], rangesd0[ieta], false); } - m_fix_d0resolutionRMS_vs_eta = Book1D("fix_d0resolutionRMS_vs_eta","fix_d0resolutionRMS_vs_eta; true particle #eta; #sigma(d_{0}) [#mum]",m_nEtaBins,-4.0,4.0,false); + m_fix_d0resolutionRMS_vs_eta = Book1D("fix_d0resolutionRMS_vs_eta", + "fix_d0resolutionRMS_vs_eta; true particle #eta; #sigma(d_{0}) [#mum]", + m_nEtaBins, -4.0, 4.0, false); - for(int ieta = 0; ieta < 16; ieta++){ - fixName = "fix_z0_res" + std::to_string(ieta+1); - m_fix_z0_res[ieta] = Book1D(fixName,fixName,600,-rangesz0[ieta],rangesz0[ieta],false); + for (int ieta = 0; ieta < 16; ieta++) { + fixName = "fix_z0_res" + std::to_string(ieta + 1); + m_fix_z0_res[ieta] = Book1D(fixName, fixName, 600, -rangesz0[ieta], rangesz0[ieta], false); } - m_fix_z0resolutionRMS_vs_eta = Book1D("fix_z0resolutionRMS_vs_eta","fix_z0resolutionRMS_vs_eta; true particle #eta; #sigma(z_{0}) [#mum]",m_nEtaBins,-4.0,4.0,false); - + m_fix_z0resolutionRMS_vs_eta = Book1D("fix_z0resolutionRMS_vs_eta", + "fix_z0resolutionRMS_vs_eta; true particle #eta; #sigma(z_{0}) [#mum]", + m_nEtaBins, -4.0, 4.0, false); } void -InDetPerfPlot_resITk::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt) { +InDetPerfPlot_resITk::fill(const xAOD::TrackParticle& trkprt, const xAOD::TruthParticle& truthprt) { // Check whether the track is primary or secondary int trueBC = -9999; @@ -631,15 +665,16 @@ InDetPerfPlot_resITk::fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthP sctHits = iSCTHits; } float chi2ndof = 1e-7; - if(trkprt.chiSquared()/trkprt.numberDoF() > chi2ndof) chi2ndof = trkprt.chiSquared()/trkprt.numberDoF(); + if (trkprt.chiSquared() / trkprt.numberDoF() > chi2ndof) { + chi2ndof = trkprt.chiSquared() / trkprt.numberDoF(); + } m_trk_chi2ndof->Fill(chi2ndof); - m_trk_chi2ndof_vs_eta->Fill(trkprt.eta(),chi2ndof); - m_trk_chi2ndof_vs_totHits->Fill(pixHits+sctHits,chi2ndof); - m_trk_chi2ndof_vs_totHits_prob->Fill(pixHits+sctHits,TMath::Prob(trkprt.chiSquared(),trkprt.numberDoF())); + m_trk_chi2ndof_vs_eta->Fill(trkprt.eta(), chi2ndof); + m_trk_chi2ndof_vs_totHits->Fill(pixHits + sctHits, chi2ndof); + m_trk_chi2ndof_vs_totHits_prob->Fill(pixHits + sctHits, TMath::Prob(trkprt.chiSquared(), trkprt.numberDoF())); m_trk_chi2->Fill(trkprt.chiSquared()); m_trk_ndof->Fill(trkprt.numberDoF()); - } void @@ -659,7 +694,7 @@ InDetPerfPlot_resITk::getPlots() { m_resITk_meanProfpt[iparam]->Fill(m_truetrkP[PT], m_sigP[iparam]); m_resITk_resHelpereta[iparam]->Fill(eta, m_resP[iparam]); m_resITk_resHelperpt[iparam]->Fill(m_truetrkP[PT], m_resP[iparam]); - m_resITk_resHelperetapt[iparam]->Fill(m_truetrkP[PT], eta, m_resP[iparam]); +// m_resITk_resHelperetapt[iparam]->Fill(m_truetrkP[PT], eta, m_resP[iparam]); m_resITk_pullHelperpt[iparam]->Fill(m_truetrkP[PT], m_pullP[iparam]); m_resITk_pullHelpereta[iparam]->Fill(eta, m_pullP[iparam]); @@ -682,7 +717,8 @@ InDetPerfPlot_resITk::getPlots() { m_resITk_chargeID_vs_eta->Fill(eta); m_resITk_chargeID_vs_pt->Fill(m_truetrkP[PT]); - m_resITk_chargeID_chgvschg->Fill(m_trkP[QOVERP] / fabs(m_trkP[QOVERP]), m_truetrkP[QOVERP] / fabs(m_truetrkP[QOVERP])); + m_resITk_chargeID_chgvschg->Fill(m_trkP[QOVERP] / fabs(m_trkP[QOVERP]), + m_truetrkP[QOVERP] / fabs(m_truetrkP[QOVERP])); } } // Look at PT tails @@ -693,40 +729,40 @@ InDetPerfPlot_resITk::getPlots() { m_resITk_momTail_vs_phi->Fill(m_truetrkP[PHI]); m_resITk_momTail_vs_eta->Fill(eta); m_resITk_momTail_vs_pt->Fill(m_truetrkP[PT]); - }else { + } else { m_resITk_momTail->Fill(0.); } } m_DEBUG_D0dep[iparam]->Fill(m_trkP[iparam], m_trkP[D0]); } - for(int ieta = 0; ieta < m_nEtaBins; ieta++){ - //std::cout << eta << " " << m_EtaBins[ieta+1] << " " << m_EtaBins[ieta] << std::endl; - if( eta < m_EtaBins[ieta+1] && eta > m_EtaBins[ieta]) { + for (int ieta = 0; ieta < m_nEtaBins; ieta++) { + // std::cout << eta << " " << m_EtaBins[ieta+1] << " " << m_EtaBins[ieta] << std::endl; + if (eta < m_EtaBins[ieta + 1] && eta > m_EtaBins[ieta]) { m_fix_qoverpt_res[ieta]->Fill(m_resP[QOVERPT]); m_fix_d0_res[ieta]->Fill(m_resP[D0]); m_fix_z0_res[ieta]->Fill(m_resP[Z0]); - //std::cout << ieta << std::endl; + // std::cout << ieta << std::endl; } } - m_significance_d0->Fill(eta,m_trkP[D0]); - m_significance_z0->Fill(eta,m_trkP[Z0]); + m_significance_d0->Fill(eta, m_trkP[D0]); + m_significance_z0->Fill(eta, m_trkP[Z0]); } void InDetPerfPlot_resITk::getPlotParameters() { for (unsigned int iparam = 0; iparam < NPARAMS; iparam++) { m_resP[iparam] = m_trkP[iparam] - m_truetrkP[iparam]; - //if(iparam == PT) m_resP[iparam] = (trkP[iparam] - m_truetrkP[iparam]); + // if(iparam == PT) m_resP[iparam] = (trkP[iparam] - m_truetrkP[iparam]); m_sigP[iparam] = m_trkErrP[iparam]; (m_sigP[iparam] != 0) ? m_pullP[iparam] = m_resP[iparam] / m_sigP[iparam] : m_pullP[iparam] = -9999.; } - m_resP[QOVERPT] = (m_trkP[QOVERPT] - m_truetrkP[QOVERPT]) * (1/m_truetrkP[QOVERPT]); + m_resP[QOVERPT] = (m_trkP[QOVERPT] - m_truetrkP[QOVERPT]) * (1 / m_truetrkP[QOVERPT]); // std::cout << m_resP[QOVERPT] << std::endl; } void -InDetPerfPlot_resITk::getTrackParameters(const xAOD::TrackParticle &trkprt) { +InDetPerfPlot_resITk::getTrackParameters(const xAOD::TrackParticle& trkprt) { // std::cout << "---------------------------" << std::endl; // std::cout << trkprt.vx() << " " << trkprt.vy() << " " << trkprt.vz() << std::endl; // std::cout << trkprt.beamlineTiltX() << " " << trkprt.beamlineTiltY() << " " << trkprt.beamlineTiltX()<< @@ -755,7 +791,7 @@ InDetPerfPlot_resITk::getTrackParameters(const xAOD::TrackParticle &trkprt) { if (trkprt.track()->info().trackProperties(Trk::TrackInfo::BremFit) && trkprt.track()->info().trackProperties(Trk::TrackInfo::BremFitSuccessful)) { m_DEBUG_BREM_d0->Fill(m_trkP[D0]); - }else { + } else { m_DEBUG_NOBREM_d0->Fill(m_trkP[D0]); } } @@ -778,18 +814,18 @@ InDetPerfPlot_resITk::getTrackParameters(const xAOD::TrackParticle &trkprt) { if (std::abs(trkprt.qOverP()) < 0) { m_trkErrP[PT] = 0.0; throw std::runtime_error("q/p is zero"); - }else { + } else { double pt = trkprt.pt(); double diff_qp = -pt / std::abs(trkprt.qOverP()); double diff_theta = pt / tan(trkprt.theta()); - const std::vector<float> &cov = trkprt.definingParametersCovMatrixVec(); + const std::vector<float>& cov = trkprt.definingParametersCovMatrixVec(); double pt_err2 = diff_qp * (diff_qp * cov[14] + diff_theta * cov[13]) + diff_theta * diff_theta * cov[9]; m_trkErrP[PT] = sqrt(pt_err2) / 1000.; } } void -InDetPerfPlot_resITk::getTrackParameters(const xAOD::TruthParticle &truthprt) { +InDetPerfPlot_resITk::getTrackParameters(const xAOD::TruthParticle& truthprt) { // "d0", "z0", "phi", "theta" , "qOverP" // Perigee for truth particles are in aux container int nParams = 6; @@ -803,22 +839,24 @@ InDetPerfPlot_resITk::getTrackParameters(const xAOD::TruthParticle &truthprt) { (truthprt.isAvailable<float>("d0")) ? m_truetrkP[D0] = truthprt.auxdata<float>("d0") : m_truetrkP[D0] = -9999.; (truthprt.isAvailable<float>("z0")) ? m_truetrkP[Z0] = truthprt.auxdata<float>("z0") : m_truetrkP[Z0] = -9999.; - (truthprt.isAvailable<float>("qOverP")) ? m_truetrkP[QOVERP] = truthprt.auxdata<float>("qOverP") : m_truetrkP[QOVERP] = - -9999.; + (truthprt.isAvailable<float>("qOverP")) ? m_truetrkP[QOVERP] = + truthprt.auxdata<float>("qOverP") : m_truetrkP[QOVERP] = + -9999.; (truthprt.isAvailable<float>("theta")) ? m_truetrkP[THETA] = truthprt.auxdata<float>("theta") : m_truetrkP[THETA] = - -9999.; + -9999.; (truthprt.isAvailable<float>("phi")) ? m_truetrkP[PHI] = truthprt.auxdata<float>("phi") : m_truetrkP[PHI] = -9999.; (truthprt.isAvailable<float>("theta") && truthprt.isAvailable<float>("qOverP")) ? m_truetrkP[QOVERPT] = truthprt.auxdata<float>("qOverP") * - (1 / - TMath::Sin(truthprt.auxdata<float>("theta"))) : - m_truetrkP[QOVERPT] = -9999.; + (1 / + TMath::Sin(truthprt.auxdata<float>("theta"))) : + m_truetrkP[QOVERPT] = -9999.; m_truetrkP[PT] = truthprt.pt() / 1000.; (truthprt.isAvailable<float>("z0") && truthprt.isAvailable<float>("theta")) ? m_truetrkP[Z0SIN] = m_truetrkP[Z0] * - TMath::Sin(m_truetrkP[THETA]) : m_truetrkP[Z0SIN] = -9999.; + TMath::Sin(m_truetrkP[THETA]) : m_truetrkP[Z0SIN] = + -9999.; } void @@ -832,15 +870,14 @@ InDetPerfPlot_resITk::finalizePlots() { makeResolutions(m_resITk_resHelperpt_neg[iparam], m_resITk_Resolution_vs_pt_neg[iparam]); makeResolutions(m_resITk_resHelpereta_pos[iparam], m_resITk_Resolution_vs_eta_pos[iparam]); makeResolutions(m_resITk_resHelpereta_neg[iparam], m_resITk_Resolution_vs_eta_neg[iparam]); - makeResolutions(m_resITk_resHelperetapt[iparam], m_resITk_Resolution_vs_pt_EtaBin[iparam], +/* makeResolutions(m_resITk_resHelperetapt[iparam], m_resITk_Resolution_vs_pt_EtaBin[iparam], m_resITk_Resolution_vs_eta_PtBin[iparam]); - +*/ // add for the pull vs pT makeResolutions(m_resITk_pullHelperpt[iparam], m_resITk_pullResolution_vs_pt[iparam], m_resITk_pullProjections_vs_pt[iparam], true); makeResolutions(m_resITk_pullHelpereta[iparam], m_resITk_pullResolution_vs_eta[iparam], m_resITk_pullProjections_vs_eta[iparam], true); - } // Get total fraction of miss ID and Momentum tails @@ -850,46 +887,50 @@ InDetPerfPlot_resITk::finalizePlots() { m_resITk_momTail_vs_pt->Scale(1 / m_resITk_momTail->GetEntries()); m_resITk_momTail_vs_phi->Scale(1 / m_resITk_momTail->GetEntries()); m_resITk_momTail_vs_eta->Scale(1 / m_resITk_momTail->GetEntries()); - + for (unsigned int ieta = 0; ieta < m_nEtaBins; ieta++) { - TH1D *tmp = (TH1D*)m_significance_d0->ProjectionY("tmp_py",m_significance_d0->GetXaxis()->FindBin(m_EtaBins[ieta]),m_significance_d0->GetXaxis()->FindBin(m_EtaBins[ieta+1])); - m_significance_d0_vs_eta->SetBinContent(ieta+1,tmp->GetRMS()); - m_significance_d0_vs_eta->SetBinError(ieta+1,tmp->GetRMSError()); + TH1D* tmp = (TH1D*) m_significance_d0->ProjectionY("tmp_py", m_significance_d0->GetXaxis()->FindBin( + m_EtaBins[ieta]), + m_significance_d0->GetXaxis()->FindBin(m_EtaBins[ieta + 1])); + m_significance_d0_vs_eta->SetBinContent(ieta + 1, tmp->GetRMS()); + m_significance_d0_vs_eta->SetBinError(ieta + 1, tmp->GetRMSError()); } for (unsigned int ieta = 0; ieta < m_nEtaBins; ieta++) { - TH1D *tmp = (TH1D*)m_significance_z0->ProjectionY("tmp_py",m_significance_z0->GetXaxis()->FindBin(m_EtaBins[ieta]),m_significance_z0->GetXaxis()->FindBin(m_EtaBins[ieta+1])); - m_significance_z0_vs_eta->SetBinContent(ieta+1,tmp->GetRMS()); - m_significance_z0_vs_eta->SetBinError(ieta+1,tmp->GetRMSError()); + TH1D* tmp = (TH1D*) m_significance_z0->ProjectionY("tmp_py", m_significance_z0->GetXaxis()->FindBin( + m_EtaBins[ieta]), + m_significance_z0->GetXaxis()->FindBin(m_EtaBins[ieta + 1])); + m_significance_z0_vs_eta->SetBinContent(ieta + 1, tmp->GetRMS()); + m_significance_z0_vs_eta->SetBinError(ieta + 1, tmp->GetRMSError()); } - //m_fix_qoverpt_res[8] = Book1D(fixName,fixName,600,-0.2,0.2,false); + // m_fix_qoverpt_res[8] = Book1D(fixName,fixName,600,-0.2,0.2,false); - for(int ieta = 0; ieta < m_nEtaBins; ieta++){ - std::vector<float> result = getResolution(m_fix_qoverpt_res[ieta], std::string("RMS")); - m_fix_qoverptresolutionRMS_vs_eta->SetBinContent(ieta+1,result.at(0)); - m_fix_qoverptresolutionRMS_vs_eta->SetBinError(ieta+1,result.at(1)); + for (int ieta = 0; ieta < m_nEtaBins; ieta++) { + std::vector<float> result = getResolution(m_fix_qoverpt_res[ieta], std::string("RMS")); + m_fix_qoverptresolutionRMS_vs_eta->SetBinContent(ieta + 1, result.at(0)); + m_fix_qoverptresolutionRMS_vs_eta->SetBinError(ieta + 1, result.at(1)); } - for(int ieta = 0; ieta < m_nEtaBins; ieta++){ - std::vector<float> result = getResolution(m_fix_d0_res[ieta], std::string("RMS")); - m_fix_d0resolutionRMS_vs_eta->SetBinContent(ieta+1,result.at(0)); - m_fix_d0resolutionRMS_vs_eta->SetBinError(ieta+1,result.at(1)); + for (int ieta = 0; ieta < m_nEtaBins; ieta++) { + std::vector<float> result = getResolution(m_fix_d0_res[ieta], std::string("RMS")); + m_fix_d0resolutionRMS_vs_eta->SetBinContent(ieta + 1, result.at(0)); + m_fix_d0resolutionRMS_vs_eta->SetBinError(ieta + 1, result.at(1)); } - for(int ieta = 0; ieta < m_nEtaBins; ieta++){ - std::vector<float> result = getResolution(m_fix_z0_res[ieta], std::string("RMS")); - m_fix_z0resolutionRMS_vs_eta->SetBinContent(ieta+1,result.at(0)); - m_fix_z0resolutionRMS_vs_eta->SetBinError(ieta+1,result.at(1)); + for (int ieta = 0; ieta < m_nEtaBins; ieta++) { + std::vector<float> result = getResolution(m_fix_z0_res[ieta], std::string("RMS")); + m_fix_z0resolutionRMS_vs_eta->SetBinContent(ieta + 1, result.at(0)); + m_fix_z0resolutionRMS_vs_eta->SetBinError(ieta + 1, result.at(1)); } } void -InDetPerfPlot_resITk::makeResolutions(TH2 *h, TH1 *hres[4]) { +InDetPerfPlot_resITk::makeResolutions(TH2* h, TH1* hres[4]) { // Should fix this in a better way TString hname = h->GetName(); if (hname.Contains("Helpereta")) { for (unsigned int ieta = 0; ieta < m_nEtaBins; ieta++) { std::string tmpName = h->GetName() + std::string("py_bin") + std::to_string(ieta + 1); - TH1D *tmp = (TH1D *) h->ProjectionY(tmpName.c_str(), h->GetXaxis()->FindBin(m_EtaBins[ieta]), - h->GetXaxis()->FindBin(m_EtaBins[ieta + 1])); + TH1D* tmp = (TH1D*) h->ProjectionY(tmpName.c_str(), h->GetXaxis()->FindBin(m_EtaBins[ieta]), + h->GetXaxis()->FindBin(m_EtaBins[ieta + 1])); if (tmp->Integral() < 1) { continue; } @@ -906,11 +947,11 @@ InDetPerfPlot_resITk::makeResolutions(TH2 *h, TH1 *hres[4]) { hres[3]->SetBinError(ieta+1,result.at(3));*/ delete tmp; } - }else if (hname.Contains("Helperpt")) { + } else if (hname.Contains("Helperpt")) { for (unsigned int ipt = 0; ipt < m_nPtBins; ipt++) { std::string tmpName = h->GetName() + std::string("py_bin") + std::to_string(ipt + 1); - TH1D *tmp = (TH1D *) h->ProjectionY(tmpName.c_str(), h->GetXaxis()->FindBin(m_PtBins[ipt]), - h->GetXaxis()->FindBin(m_PtBins[ipt + 1])); + TH1D* tmp = (TH1D*) h->ProjectionY(tmpName.c_str(), h->GetXaxis()->FindBin(m_PtBins[ipt]), + h->GetXaxis()->FindBin(m_PtBins[ipt + 1])); if (tmp->Integral() < 1) { continue; } @@ -931,14 +972,14 @@ InDetPerfPlot_resITk::makeResolutions(TH2 *h, TH1 *hres[4]) { } void -InDetPerfPlot_resITk::makeResolutions(TH2 *h, TH1 *hres[4], TH1 *hproj[m_nEtaBins], bool save) { +InDetPerfPlot_resITk::makeResolutions(TH2* h, TH1* hres[4], TH1* hproj[m_nEtaBins], bool save) { TString hname = h->GetName(); if (hname.Contains("Helpereta")) { for (unsigned int ieta = 0; ieta < m_nEtaBins; ieta++) { std::string tmpName = h->GetName() + std::string("py_bin") + std::to_string(ieta + 1); - TH1D *tmp = (TH1D *) h->ProjectionY(tmpName.c_str(), h->GetXaxis()->FindBin(m_EtaBins[ieta]), - h->GetXaxis()->FindBin(m_EtaBins[ieta + 1])); + TH1D* tmp = (TH1D*) h->ProjectionY(tmpName.c_str(), h->GetXaxis()->FindBin(m_EtaBins[ieta]), + h->GetXaxis()->FindBin(m_EtaBins[ieta + 1]-0.05)); if (tmp->Integral() < 1) { continue; } @@ -958,11 +999,11 @@ InDetPerfPlot_resITk::makeResolutions(TH2 *h, TH1 *hres[4], TH1 *hproj[m_nEtaBin hres[3]->SetBinError(ieta+1,result.at(3));*/ delete tmp; } - }else if (hname.Contains("Helperpt")) { + } else if (hname.Contains("Helperpt")) { for (unsigned int ipt = 0; ipt < m_nPtBins; ipt++) { std::string tmpName = h->GetName() + std::string("py_bin") + std::to_string(ipt + 1); - TH1D *tmp = (TH1D *) h->ProjectionY(tmpName.c_str(), h->GetXaxis()->FindBin(m_PtBins[ipt]), - h->GetXaxis()->FindBin(m_PtBins[ipt + 1])); + TH1D* tmp = (TH1D*) h->ProjectionY(tmpName.c_str(), h->GetXaxis()->FindBin(m_PtBins[ipt]), + h->GetXaxis()->FindBin(m_PtBins[ipt + 1])); if (tmp->Integral() < 1) { continue; } @@ -986,7 +1027,7 @@ InDetPerfPlot_resITk::makeResolutions(TH2 *h, TH1 *hres[4], TH1 *hproj[m_nEtaBin } void -InDetPerfPlot_resITk::cloneHistogram(TH1D *h, TH1 *hcopy) { +InDetPerfPlot_resITk::cloneHistogram(TH1D* h, TH1* hcopy) { unsigned int nbin = h->GetNbinsX(); for (unsigned int ibin = 0; ibin < nbin; ibin++) { @@ -998,7 +1039,7 @@ InDetPerfPlot_resITk::cloneHistogram(TH1D *h, TH1 *hcopy) { } void -InDetPerfPlot_resITk::makeResolutions(TH3 *h, TH1 *hres_eta[4][4], TH1 *hres_pt[4][4]) { +InDetPerfPlot_resITk::makeResolutions(TH3* h, TH1* hres_eta[4][4], TH1* hres_pt[4][4]) { float BinEta[5] = { 0.0, 1.0, 1.5, 2.7, 5.0 }; @@ -1012,14 +1053,14 @@ InDetPerfPlot_resITk::makeResolutions(TH3 *h, TH1 *hres_eta[4][4], TH1 *hres_pt[ std::string("pz_binEta") + std::to_string(ieta + 1); std::string tmpName1 = tmpName + std::string("_neg"); std::string tmpName2 = tmpName + std::string("_pos"); - TH1D *tmp1 = (TH1D *) h->ProjectionZ(tmpName1.c_str(), h->GetXaxis()->FindBin(m_PtBins[ipt]), - h->GetXaxis()->FindBin(m_PtBins[ipt + 1]), - h->GetYaxis()->FindBin(-BinEta[ieta + 1]), - h->GetYaxis()->FindBin(-BinEta[ieta])); - TH1D *tmp2 = (TH1D *) h->ProjectionZ(tmpName2.c_str(), h->GetXaxis()->FindBin(m_PtBins[ipt]), - h->GetXaxis()->FindBin(m_PtBins[ipt + 1]), - h->GetYaxis()->FindBin(BinEta[ieta]), - h->GetYaxis()->FindBin(BinEta[ieta + 1])); + TH1D* tmp1 = (TH1D*) h->ProjectionZ(tmpName1.c_str(), h->GetXaxis()->FindBin(m_PtBins[ipt]), + h->GetXaxis()->FindBin(m_PtBins[ipt + 1]), + h->GetYaxis()->FindBin(-BinEta[ieta + 1]), + h->GetYaxis()->FindBin(-BinEta[ieta])); + TH1D* tmp2 = (TH1D*) h->ProjectionZ(tmpName2.c_str(), h->GetXaxis()->FindBin(m_PtBins[ipt]), + h->GetXaxis()->FindBin(m_PtBins[ipt + 1]), + h->GetYaxis()->FindBin(BinEta[ieta]), + h->GetYaxis()->FindBin(BinEta[ieta + 1])); tmp1->Add(tmp2); if (tmp1->Integral() < 1) { continue; @@ -1038,10 +1079,10 @@ InDetPerfPlot_resITk::makeResolutions(TH3 *h, TH1 *hres_eta[4][4], TH1 *hres_pt[ for (unsigned int ieta = 0; ieta < m_nEtaBins; ieta++) { std::string tmpName = h->GetName() + std::string("pz_binPt") + std::to_string(ipt + 1) + std::string("pz_binEta") + std::to_string(ieta + 1); - TH1D *tmp = - (TH1D *) h->ProjectionZ(tmpName.c_str(), h->GetXaxis()->FindBin(BinPt[ipt]), h->GetXaxis()->FindBin( - BinPt[ipt + 1]), h->GetYaxis()->FindBin(m_EtaBins[ieta]), - h->GetYaxis()->FindBin(m_EtaBins[ieta + 1])); + TH1D* tmp = + (TH1D*) h->ProjectionZ(tmpName.c_str(), h->GetXaxis()->FindBin(BinPt[ipt]), h->GetXaxis()->FindBin( + BinPt[ipt + 1]), h->GetYaxis()->FindBin(m_EtaBins[ieta]), + h->GetYaxis()->FindBin(m_EtaBins[ieta + 1])); if (tmp->Integral() < 1) { continue; } @@ -1055,10 +1096,11 @@ InDetPerfPlot_resITk::makeResolutions(TH3 *h, TH1 *hres_eta[4][4], TH1 *hres_pt[ } } -std::vector<float> InDetPerfPlot_resITk::getResolution(TH1 *h, std::string s) { +std::vector<float> +InDetPerfPlot_resITk::getResolution(TH1* h, std::string s) { std::vector<float> result; - if (h->GetEntries() == 0.0){// || h->Integral() < 100.0) { + if (h->GetEntries() == 0.0) {// || h->Integral() < 100.0) { result.push_back(0.0); result.push_back(0.0); result.push_back(0.0); @@ -1080,10 +1122,11 @@ std::vector<float> InDetPerfPlot_resITk::getResolution(TH1 *h, std::string s) { // Stolen from Max itr_rms = rms + 1.0; if (s == "RMS") { - while (fabs(itr_rms - rms) > 0.001) { + int tries = 0; + while (fabs(itr_rms - rms) > 0.001 && tries < 10) { rms = h->GetRMS(); - double min = -3.0 * rms; - double max = 3.0 * rms; + double min = -3.0 * rms + mean; + double max = 3.0 * rms + mean; if (min < h->GetBinLowEdge(1)) { min = h->GetBinLowEdge(1); } @@ -1098,6 +1141,7 @@ std::vector<float> InDetPerfPlot_resITk::getResolution(TH1 *h, std::string s) { rms = itr_rms; meanErr = h->GetMeanError(); rmsErr = h->GetRMSError(); + tries++; } else if (s == "GAUS") { int fitStatus = h->Fit("gaus", "QS0"); TFitResultPtr r = h->Fit("gaus", "QS0"); @@ -1134,7 +1178,7 @@ std::vector<float> InDetPerfPlot_resITk::getResolution(TH1 *h, std::string s) { } else { result.push_back(0.0); } - }else { + } else { result.push_back(0.); result.push_back(0.); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_resITk.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_resITk.h index f09fae68c53065aa0f4ae9d9339ae277239f58bd..50f3a22de82c044ec05ed46c01fdc4bba29fb494 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_resITk.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_resITk.h @@ -56,9 +56,9 @@ public: }; - InDetPerfPlot_resITk(PlotBase *pParent, const std::string &dirName); + InDetPerfPlot_resITk(PlotBase* pParent, const std::string& dirName); - void fill(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &truthprt); + void fill(const xAOD::TrackParticle& trkprt, const xAOD::TruthParticle& truthprt); // virtual bool isDefined(TString t); virtual ~InDetPerfPlot_resITk() {/** nop **/ } @@ -84,16 +84,16 @@ private: void initializePlots(); void finalizePlots(); - void makeResolutions(TH2 * h, TH1 * h2[m_nResHist], TH1 * h3[], bool s); - void makeResolutions(TH2 * h, TH1 * h2[m_nResHist]); + void makeResolutions(TH2* h, TH1* h2[m_nResHist], TH1* h3[], bool s); + void makeResolutions(TH2* h, TH1* h2[m_nResHist]); - void makeResolutions(TH3 * h, TH1 * h2[][m_nResHist], TH1 * h3[][m_nResHist]); - void getTrackParameters(const xAOD::TruthParticle &truthprt); - void getTrackParameters(const xAOD::TrackParticle &truthprt); + void makeResolutions(TH3* h, TH1* h2[][m_nResHist], TH1* h3[][m_nResHist]); + void getTrackParameters(const xAOD::TruthParticle& truthprt); + void getTrackParameters(const xAOD::TrackParticle& truthprt); void getPlotParameters(); void getPlots(); - void cloneHistogram(TH1D *h, TH1 *hcopy); - std::vector<float> getResolution(TH1 *h, std::string s); + void cloneHistogram(TH1D* h, TH1* hcopy); + std::vector<float> getResolution(TH1* h, std::string s); float m_trkP[NPARAMS]; float m_truetrkP[NPARAMS]; @@ -105,91 +105,90 @@ private: pCfg m_paramProp[NPARAMS]; - TH1 *m_resITk_pull[NPARAMS]; - TH1 *m_resITk_res[NPARAMS]; - TH1 *m_resITk_reco[NPARAMS]; - TH1 *m_resITk_true[NPARAMS]; - TH1 *m_resITk_sigma[NPARAMS]; + TH1* m_resITk_pull[NPARAMS]; + TH1* m_resITk_res[NPARAMS]; + TH1* m_resITk_reco[NPARAMS]; + TH1* m_resITk_true[NPARAMS]; + TH1* m_resITk_sigma[NPARAMS]; - TH1 *m_resITk_chargeID; - TH1 *m_resITk_chargeID_vs_eta; - TH1 *m_resITk_chargeID_vs_pt; - TH1 *m_resITk_chargeID_vs_phi; + TH1* m_resITk_chargeID; + TH1* m_resITk_chargeID_vs_eta; + TH1* m_resITk_chargeID_vs_pt; + TH1* m_resITk_chargeID_vs_phi; - TH1 *m_resITk_momTail; - TH1 *m_resITk_momTail_vs_eta; - TH1 *m_resITk_momTail_vs_pt; - TH1 *m_resITk_momTail_vs_phi; - TH1 *m_resITk_momTail_Frac; - TH2 *m_resITk_chargeID_chgvschg; + TH1* m_resITk_momTail; + TH1* m_resITk_momTail_vs_eta; + TH1* m_resITk_momTail_vs_pt; + TH1* m_resITk_momTail_vs_phi; + TH1* m_resITk_momTail_Frac; + TH2* m_resITk_chargeID_chgvschg; - TH2 *m_resITk_resHelpereta[NPARAMS]; - TH1 *m_resITk_Resolution_vs_eta[NPARAMS][m_nResHist]; - TH1 *m_resITk_ResProjections_vs_eta[NPARAMS][m_nEtaBins]; + TH2* m_resITk_resHelpereta[NPARAMS]; + TH1* m_resITk_Resolution_vs_eta[NPARAMS][m_nResHist]; + TH1* m_resITk_ResProjections_vs_eta[NPARAMS][m_nEtaBins]; - TH2 *m_resITk_resHelpereta_pos[NPARAMS]; - TH1 *m_resITk_Resolution_vs_eta_pos[NPARAMS][m_nResHist]; - TH2 *m_resITk_resHelpereta_neg[NPARAMS]; - TH1 *m_resITk_Resolution_vs_eta_neg[NPARAMS][m_nResHist]; + TH2* m_resITk_resHelpereta_pos[NPARAMS]; + TH1* m_resITk_Resolution_vs_eta_pos[NPARAMS][m_nResHist]; + TH2* m_resITk_resHelpereta_neg[NPARAMS]; + TH1* m_resITk_Resolution_vs_eta_neg[NPARAMS][m_nResHist]; - TH2 *m_resITk_resHelperpt[NPARAMS]; - TH1 *m_resITk_Resolution_vs_pt[NPARAMS][m_nResHist]; - TH1 *m_resITk_ResProjections_vs_pt[NPARAMS][m_nPtBins]; + TH2* m_resITk_resHelperpt[NPARAMS]; + TH1* m_resITk_Resolution_vs_pt[NPARAMS][m_nResHist]; + TH1* m_resITk_ResProjections_vs_pt[NPARAMS][m_nPtBins]; - TH2 *m_resITk_resHelperpt_pos[NPARAMS]; - TH1 *m_resITk_Resolution_vs_pt_pos[NPARAMS][m_nResHist]; - TH2 *m_resITk_resHelperpt_neg[NPARAMS]; - TH1 *m_resITk_Resolution_vs_pt_neg[NPARAMS][m_nResHist]; + TH2* m_resITk_resHelperpt_pos[NPARAMS]; + TH1* m_resITk_Resolution_vs_pt_pos[NPARAMS][m_nResHist]; + TH2* m_resITk_resHelperpt_neg[NPARAMS]; + TH1* m_resITk_Resolution_vs_pt_neg[NPARAMS][m_nResHist]; - TH3 *m_resITk_resHelperetapt[NPARAMS]; +// TH3* m_resITk_resHelperetapt[NPARAMS]; - TH2 *m_resITk_pullHelperpt[NPARAMS]; // pull width as a function of pT - TH2 *m_resITk_pullHelpereta[NPARAMS]; // pull width as a function of pT - - TH1 *m_resITk_pullResolution_vs_pt[NPARAMS][m_nResHist]; - TH1 *m_resITk_pullResolution_vs_eta[NPARAMS][m_nResHist]; - - TH1 *m_resITk_pullProjections_vs_pt[NPARAMS][m_nPtBins]; - TH1 *m_resITk_pullProjections_vs_eta[NPARAMS][m_nEtaBins]; + TH2* m_resITk_pullHelperpt[NPARAMS]; // pull width as a function of pT + TH2* m_resITk_pullHelpereta[NPARAMS]; // pull width as a function of pT + TH1* m_resITk_pullResolution_vs_pt[NPARAMS][m_nResHist]; + TH1* m_resITk_pullResolution_vs_eta[NPARAMS][m_nResHist]; - TH1 *m_resITk_Resolution_vs_pt_EtaBin[NPARAMS][4][m_nResHist]; - TH1 *m_resITk_Resolution_vs_eta_PtBin[NPARAMS][4][m_nResHist]; + TH1* m_resITk_pullProjections_vs_pt[NPARAMS][m_nPtBins]; + TH1* m_resITk_pullProjections_vs_eta[NPARAMS][m_nEtaBins]; - TProfile *m_resITk_meanProfeta[NPARAMS]; - TProfile *m_resITk_meanProfpt[NPARAMS]; - TH2 *m_resITk_sigmaVsEta[NPARAMS]; - TProfile *m_DEBUG_D0dep[NPARAMS]; - TProfile *m_DEBUG_FirstHitR_d0; - TH1 *m_DEBUG_NOBREM_d0; - TH1 *m_DEBUG_BREM_d0; - TH1 *m_trk_chi2ndof; - TProfile *m_trk_chi2ndof_vs_eta; - TProfile *m_trk_chi2ndof_vs_totHits; - TProfile *m_trk_chi2ndof_vs_totHits_prob; + TH1* m_resITk_Resolution_vs_pt_EtaBin[NPARAMS][4][m_nResHist]; + TH1* m_resITk_Resolution_vs_eta_PtBin[NPARAMS][4][m_nResHist]; - TH1 *m_trk_chi2; - TH1 *m_trk_ndof; + TProfile* m_resITk_meanProfeta[NPARAMS]; + TProfile* m_resITk_meanProfpt[NPARAMS]; + TH2* m_resITk_sigmaVsEta[NPARAMS]; + TProfile* m_DEBUG_D0dep[NPARAMS]; + TProfile* m_DEBUG_FirstHitR_d0; + TH1* m_DEBUG_NOBREM_d0; + TH1* m_DEBUG_BREM_d0; - TH2 *m_significance_d0; - TH2 *m_significance_z0; + TH1* m_trk_chi2ndof; + TProfile* m_trk_chi2ndof_vs_eta; + TProfile* m_trk_chi2ndof_vs_totHits; + TProfile* m_trk_chi2ndof_vs_totHits_prob; - TH1 *m_significance_d0_vs_eta; - TH1 *m_significance_z0_vs_eta; + TH1* m_trk_chi2; + TH1* m_trk_ndof; - TH1 *m_fix_qoverpt_res[16]; + TH2* m_significance_d0; + TH2* m_significance_z0; - TH1 *m_fix_qoverptresolutionRMS_vs_eta; + TH1* m_significance_d0_vs_eta; + TH1* m_significance_z0_vs_eta; + TH1* m_fix_qoverpt_res[16]; - TH1 *m_fix_d0_res[16]; - TH1 *m_fix_d0resolutionRMS_vs_eta; + TH1* m_fix_qoverptresolutionRMS_vs_eta; - TH1 *m_fix_z0_res[16]; - TH1 *m_fix_z0resolutionRMS_vs_eta; + TH1* m_fix_d0_res[16]; + TH1* m_fix_d0resolutionRMS_vs_eta; + + TH1* m_fix_z0_res[16]; + TH1* m_fix_z0resolutionRMS_vs_eta; }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_spectrum.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_spectrum.cxx index 08717613403a858dd2c15417f75304b05986eab9..da25067c8b9270efc917db884dfae47ebef7557d 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_spectrum.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_spectrum.cxx @@ -9,9 +9,12 @@ #include "InDetPerfPlot_spectrum.h" #include <cmath> // for M_PI +#include "InDetPhysValMonitoringUtilities.h" +using namespace IDPVM; -InDetPerfPlot_spectrum::InDetPerfPlot_spectrum(InDetPlotBase *pParent, const std::string &sDir) : + +InDetPerfPlot_spectrum::InDetPerfPlot_spectrum(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase(pParent, sDir), m_nSCTHits{}, m_nPixHits{}, @@ -132,7 +135,6 @@ InDetPerfPlot_spectrum::InDetPerfPlot_spectrum(InDetPlotBase *pParent, const std void InDetPerfPlot_spectrum::initializePlots() { - book(m_nSCTHits, "nSCTHits"); book(m_nPixHits, "nPixHits"); book(m_nTotHits, "nTotHits"); @@ -171,9 +173,9 @@ InDetPerfPlot_spectrum::initializePlots() { book(m_TruthVtxR, "TVRspectrum"); - book(m_TVR_vs_Z,"TVR_vs_Z"); - book(m_recod0_vs_z0_good,"recod0_vs_z0_good"); - book(m_recod0_vs_z0_crazy,"recod0_vs_z0_crazy"); + book(m_TVR_vs_Z, "TVR_vs_Z"); + book(m_recod0_vs_z0_good, "recod0_vs_z0_good"); + book(m_recod0_vs_z0_crazy, "recod0_vs_z0_crazy"); book(m_recod0_PrimVtxR, "recod0PVRSpectrum"); book(m_recoz0_PrimVtxZ, "recoz0PVZSpectrum"); @@ -184,7 +186,7 @@ InDetPerfPlot_spectrum::initializePlots() { book(m_PrimVtxZ, "PVZspectrum"); book(m_PrimVtxR, "PVRspectrum"); - book(m_PVR_vs_Z,"PVR_vs_Z"); + book(m_PVR_vs_Z, "PVR_vs_Z"); book(m_ptvsEtaUnlinked, "ptvsEtaUnlinked_postSelect"); book(m_probvsSCTUnlinked, "probvsSCTUnlinked_postSelect"); book(m_probvsPixUnlinked, "probvsPixUnlinked_postSelect"); @@ -231,8 +233,8 @@ InDetPerfPlot_spectrum::initializePlots() { } void -InDetPerfPlot_spectrum::fillSpectrum(const xAOD::TrackParticle &trkprt, Float_t prob) { - double pt = trkprt.pt() *0.001; +InDetPerfPlot_spectrum::fillSpectrum(const xAOD::TrackParticle& trkprt, Float_t prob) { + double pt = trkprt.pt() * 1_GeV; double eta = 0.0; if (trkprt.pt() > 0.1) { @@ -260,33 +262,33 @@ InDetPerfPlot_spectrum::fillSpectrum(const xAOD::TrackParticle &trkprt, Float_t if (trkprt.summaryValue(iSCTDead, xAOD::numberOfSCTDeadSensors)) { sctDead = iSCTDead; } - fillHisto(m_recoMatchProb,prob); - fillHisto(m_recoPt,pt); - fillHisto(m_recoEta,eta); - fillHisto(m_recoPhi,phi); - fillHisto(m_recod0,d0); - fillHisto(m_recoz0,z0); - fillHisto(m_recoz0sin,z0 * sinth); - - fillHisto(m_nSCTHits,sctHits); - fillHisto(m_nPixHits,pixHits); - fillHisto(m_nTotHits,sctHits + pixHits); - fillHisto(m_nSCTDeadSensors,sctDead); - fillHisto(m_nPixDeadSensors,pixDead); - fillHisto(m_nTotDeadSensors,sctDead + pixDead); - - - fillHisto(m_nSCTHits_vs_eta,eta, sctHits); - fillHisto(m_nPixHits_vs_eta,eta, pixHits); - fillHisto(m_nTotHits_vs_eta,eta, sctHits + pixHits); - fillHisto(m_nSCTDeadSensors_vs_eta,eta, sctDead); - fillHisto(m_nPixDeadSensors_vs_eta,eta, pixDead); - fillHisto(m_nTotDeadSensors_vs_eta,eta, sctDead + pixDead); + fillHisto(m_recoMatchProb, prob); + fillHisto(m_recoPt, pt); + fillHisto(m_recoEta, eta); + fillHisto(m_recoPhi, phi); + fillHisto(m_recod0, d0); + fillHisto(m_recoz0, z0); + fillHisto(m_recoz0sin, z0 * sinth); + + fillHisto(m_nSCTHits, sctHits); + fillHisto(m_nPixHits, pixHits); + fillHisto(m_nTotHits, sctHits + pixHits); + fillHisto(m_nSCTDeadSensors, sctDead); + fillHisto(m_nPixDeadSensors, pixDead); + fillHisto(m_nTotDeadSensors, sctDead + pixDead); + + + fillHisto(m_nSCTHits_vs_eta, eta, sctHits); + fillHisto(m_nPixHits_vs_eta, eta, pixHits); + fillHisto(m_nTotHits_vs_eta, eta, sctHits + pixHits); + fillHisto(m_nSCTDeadSensors_vs_eta, eta, sctDead); + fillHisto(m_nPixDeadSensors_vs_eta, eta, pixDead); + fillHisto(m_nTotDeadSensors_vs_eta, eta, sctDead + pixDead); } void -InDetPerfPlot_spectrum::fillSpectrum(const xAOD::TruthParticle &particle) { - double pt = particle.pt() / 1000; +InDetPerfPlot_spectrum::fillSpectrum(const xAOD::TruthParticle& particle) { + double pt = particle.pt() * 1_GeV; // double eta = particle.eta(); double eta = 0.0; @@ -296,34 +298,36 @@ InDetPerfPlot_spectrum::fillSpectrum(const xAOD::TruthParticle &particle) { double phi = particle.phi(); - fillHisto(m_truthPt,pt); - fillHisto(m_truthEta,eta); - fillHisto(m_truthPhi,phi); + fillHisto(m_truthPt, pt); + fillHisto(m_truthEta, eta); + fillHisto(m_truthPhi, phi); } void -InDetPerfPlot_spectrum::fillSpectrum(const xAOD::TrackParticle &trkprt, const xAOD::TruthVertex &truthVrt) { +InDetPerfPlot_spectrum::fillSpectrum(const xAOD::TrackParticle& trkprt, const xAOD::TruthVertex& truthVrt) { +//ATH_MSG_INFO("filling with truth vtx"); double d0(trkprt.d0()); double z0(trkprt.z0()); - double sinth = sin(trkprt.theta()); + double sinth = std::sin(trkprt.theta()); // double vtxX = truthVrt.x(); double vtxY = truthVrt.y(); double vtxZ = truthVrt.z(); - double vtxR = sqrt(vtxX * vtxX + vtxY * vtxY); + double vtxR = std::sqrt(vtxX * vtxX + vtxY * vtxY); - fillHisto(m_recod0_TruthVtxR,d0 - vtxR); - fillHisto(m_recoz0_TruthVtxZ,z0 - vtxZ); - fillHisto(m_recoz0_TruthVtxZsin,(z0 - vtxZ) * sinth); + fillHisto(m_recod0_TruthVtxR, d0 - vtxR); + fillHisto(m_recoz0_TruthVtxZ, z0 - vtxZ); + fillHisto(m_recoz0_TruthVtxZsin, (z0 - vtxZ) * sinth); // - fillHisto(m_TruthVtxX,vtxX); - fillHisto(m_TruthVtxY,vtxY); - fillHisto(m_TruthVtxZ,vtxZ); - fillHisto(m_TruthVtxR,vtxR); - - fillHisto(m_TVR_vs_Z,vtxZ, vtxR); - + + fillHisto(m_TruthVtxX, vtxX); + fillHisto(m_TruthVtxY, vtxY); + fillHisto(m_TruthVtxZ, vtxZ); + fillHisto(m_TruthVtxR, vtxR); + + fillHisto(m_TVR_vs_Z, vtxZ, vtxR); + if (vtxR > 0.1) { /* std::cout<<" "<<std::endl; @@ -331,14 +335,14 @@ InDetPerfPlot_spectrum::fillSpectrum(const xAOD::TrackParticle &trkprt, const xA std::cout<<"truth vtx. X/Y/R/Z "<<vtxX<<","<<vtxY<<","<<vtxR<<","<<vtxZ<<std::endl; std::cout<<"trk d0/z0 "<<d0<<","<<z0<<std::endl; */ - fillHisto(m_recod0_vs_z0_crazy,z0, d0); - }else { - fillHisto(m_recod0_vs_z0_good,z0, d0); + fillHisto(m_recod0_vs_z0_crazy, z0, d0); + } else { + fillHisto(m_recod0_vs_z0_good, z0, d0); } } void -InDetPerfPlot_spectrum::fillSpectrum(const xAOD::TrackParticle &trkprt, const xAOD::Vertex &vertex, bool fill) { +InDetPerfPlot_spectrum::fillSpectrum(const xAOD::TrackParticle& trkprt, const xAOD::Vertex& vertex, bool fill) { double d0(trkprt.d0()); double z0(trkprt.z0()); double sinth = std::sin(trkprt.theta()); @@ -347,19 +351,19 @@ InDetPerfPlot_spectrum::fillSpectrum(const xAOD::TrackParticle &trkprt, const xA double vtxY = vertex.y(); double vtxZ = vertex.z(); - double vtxR = std::hypot(vtxX,vtxY); + double vtxR = std::hypot(vtxX, vtxY); - fillHisto(m_recod0_PrimVtxR,d0 - vtxR); - fillHisto(m_recoz0_PrimVtxZ,z0 - vtxZ); - fillHisto(m_recoz0_PrimVtxZsin,(z0 - vtxZ) * sinth); + fillHisto(m_recod0_PrimVtxR, d0 - vtxR); + fillHisto(m_recoz0_PrimVtxZ, z0 - vtxZ); + fillHisto(m_recoz0_PrimVtxZsin, (z0 - vtxZ) * sinth); // if (fill) { - fillHisto(m_PrimVtxX,vtxX); - fillHisto(m_PrimVtxY,vtxY); - fillHisto(m_PrimVtxZ,vtxZ); - fillHisto(m_PrimVtxR,vtxR); + fillHisto(m_PrimVtxX, vtxX); + fillHisto(m_PrimVtxY, vtxY); + fillHisto(m_PrimVtxZ, vtxZ); + fillHisto(m_PrimVtxR, vtxR); - fillHisto(m_PVR_vs_Z,vtxZ, vtxR); + fillHisto(m_PVR_vs_Z, vtxZ, vtxR); } if (vtxR > 0.1) { /* @@ -368,18 +372,21 @@ InDetPerfPlot_spectrum::fillSpectrum(const xAOD::TrackParticle &trkprt, const xA std::cout<<"truth vtx. X/Y/R/Z "<<vtxX<<","<<vtxY<<","<<vtxR<<","<<vtxZ<<std::endl; std::cout<<"trk d0/z0 "<<d0<<","<<z0<<std::endl; */ - fillHisto(m_recod0_vs_z0_crazy,z0, d0); - }else { - fillHisto(m_recod0_vs_z0_good,z0, d0); + fillHisto(m_recod0_vs_z0_crazy, z0, d0); + } else { + fillHisto(m_recod0_vs_z0_good, z0, d0); } } void -InDetPerfPlot_spectrum::fillSpectrumUnlinked2(const xAOD::TrackParticle &trkprt, double prob) { +InDetPerfPlot_spectrum::fillSpectrumUnlinked2(const xAOD::TrackParticle& trkprt, double prob) { // unused constexpr double degreesPerRadian(180./M_PI); - double pt = trkprt.pt() *0.001; + double pt = trkprt.pt() * 1_GeV; double eta(0); - if (trkprt.pt()>0.1) eta = trkprt.eta(); + + if (trkprt.pt() > 0.1) { + eta = trkprt.eta(); + } // unused double phi(trkprt.phi()); uint8_t iPixOutliers, iSCTOutliers, iPixHoles, iSCTHoles, iPixHits, iSCTHits, iPixSharedHits, iSCTSharedHits; @@ -411,34 +418,34 @@ InDetPerfPlot_spectrum::fillSpectrumUnlinked2(const xAOD::TrackParticle &trkprt, SCTSharedHits = iSCTSharedHits; } - fillHisto(m_ptvsEtaUnlinked,eta, pt); - fillHisto(m_probvsSCTUnlinked,SCTHits, prob); - fillHisto(m_probvsPixUnlinked,pixHits, prob); - fillHisto(m_sharedHitsvsPixUnlinked,pixHits, pixSharedHits + SCTSharedHits); - fillHisto(m_sharedHitsvsSCTUnlinked,SCTHits, pixSharedHits + SCTSharedHits); - fillHisto(m_pixholesvsPixUnlinked,pixHits, pixHoles); - fillHisto(m_holesvsPixUnlinked,pixHits, pixHoles + SCTHoles); - fillHisto(m_sctholesvsSCTUnlinked,SCTHits, SCTHoles); - fillHisto(m_holesvsSCTUnlinked,SCTHits, pixHoles + SCTHoles); - fillHisto(m_outliersvsPixUnlinked,pixHits, pixOutliers + SCTOutliers); - fillHisto(m_pixoutliersvsPixUnlinked,pixHits, pixOutliers); - fillHisto(m_outliersvsSCTUnlinked,SCTHits, pixOutliers + SCTOutliers); - fillHisto(m_sctoutliersvsSCTUnlinked,SCTHits, SCTOutliers); - fillHisto(m_hitsvsEtaUnlinked,eta, pixHits + SCTHits); - fillHisto(m_pixHolesvsEtaUnlinked,eta, pixHoles); - fillHisto(m_sctHolesvsEtaUnlinked,eta, SCTHoles); - fillHisto(m_sctHitsvsPixHitsUnlinked,pixHits, SCTHits); - fillHisto(m_sctHitsvsEtaUnlinked,eta, SCTHits); - fillHisto(m_pixHitsvsEtaUnlinked,eta, pixHits); - fillHisto(m_sctOutliersvsEtaUnlinked,eta, SCTOutliers); - fillHisto(m_pixOutliersvsEtaUnlinked,eta, pixOutliers); + fillHisto(m_ptvsEtaUnlinked, eta, pt); + fillHisto(m_probvsSCTUnlinked, SCTHits, prob); + fillHisto(m_probvsPixUnlinked, pixHits, prob); + fillHisto(m_sharedHitsvsPixUnlinked, pixHits, pixSharedHits + SCTSharedHits); + fillHisto(m_sharedHitsvsSCTUnlinked, SCTHits, pixSharedHits + SCTSharedHits); + fillHisto(m_pixholesvsPixUnlinked, pixHits, pixHoles); + fillHisto(m_holesvsPixUnlinked, pixHits, pixHoles + SCTHoles); + fillHisto(m_sctholesvsSCTUnlinked, SCTHits, SCTHoles); + fillHisto(m_holesvsSCTUnlinked, SCTHits, pixHoles + SCTHoles); + fillHisto(m_outliersvsPixUnlinked, pixHits, pixOutliers + SCTOutliers); + fillHisto(m_pixoutliersvsPixUnlinked, pixHits, pixOutliers); + fillHisto(m_outliersvsSCTUnlinked, SCTHits, pixOutliers + SCTOutliers); + fillHisto(m_sctoutliersvsSCTUnlinked, SCTHits, SCTOutliers); + fillHisto(m_hitsvsEtaUnlinked, eta, pixHits + SCTHits); + fillHisto(m_pixHolesvsEtaUnlinked, eta, pixHoles); + fillHisto(m_sctHolesvsEtaUnlinked, eta, SCTHoles); + fillHisto(m_sctHitsvsPixHitsUnlinked, pixHits, SCTHits); + fillHisto(m_sctHitsvsEtaUnlinked, eta, SCTHits); + fillHisto(m_pixHitsvsEtaUnlinked, eta, pixHits); + fillHisto(m_sctOutliersvsEtaUnlinked, eta, SCTOutliers); + fillHisto(m_pixOutliersvsEtaUnlinked, eta, pixOutliers); } void -InDetPerfPlot_spectrum::fillSpectrumLinked(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle & /* particle*/, +InDetPerfPlot_spectrum::fillSpectrumLinked(const xAOD::TrackParticle& trkprt, const xAOD::TruthParticle& /* particle*/, double prob) { // unused constexpr double degreesPerRadian(180./M_PI); - double pt = trkprt.pt() *0.001; + double pt = trkprt.pt() * 1_GeV; double eta(trkprt.eta()); // unused double phi(trkprt.phi()); @@ -471,25 +478,25 @@ InDetPerfPlot_spectrum::fillSpectrumLinked(const xAOD::TrackParticle &trkprt, co SCTSharedHits = iSCTSharedHits; } - fillHisto(m_ptvsEtaLinked,eta, pt); - fillHisto(m_probvsSCTLinked,SCTHits, prob); - fillHisto(m_probvsPixLinked,pixHits, prob); - fillHisto(m_sharedHitsvsPixLinked,pixHits, pixSharedHits + SCTSharedHits); - fillHisto(m_sharedHitsvsSCTLinked,SCTHits, pixSharedHits + SCTSharedHits); - fillHisto(m_pixholesvsPixLinked,pixHits, pixHoles); - fillHisto(m_holesvsPixLinked,pixHits, pixHoles + SCTHoles); - fillHisto(m_sctholesvsSCTLinked,SCTHits, SCTHoles); - fillHisto(m_holesvsSCTLinked,SCTHits, pixHoles + SCTHoles); - fillHisto(m_outliersvsPixLinked,pixHits, pixOutliers + SCTOutliers); - fillHisto(m_pixoutliersvsPixLinked,pixHits, pixOutliers); - fillHisto(m_outliersvsSCTLinked,SCTHits, pixOutliers + SCTOutliers); - fillHisto(m_sctoutliersvsSCTLinked,SCTHits, SCTOutliers); - fillHisto(m_hitsvsEtaLinked,eta, pixHits + SCTHits); - fillHisto(m_sctHitsvsPixHitsLinked,pixHits, SCTHits); - fillHisto(m_pixHolesvsEtaLinked,eta, pixHoles); - fillHisto(m_sctHolesvsEtaLinked,eta, SCTHoles); - fillHisto(m_sctHitsvsEtaLinked,eta, SCTHits); - fillHisto(m_pixHitsvsEtaLinked,eta, pixHits); - fillHisto(m_sctOutliersvsEtaLinked,eta, SCTOutliers); - fillHisto(m_pixOutliersvsEtaLinked,eta, pixOutliers); + fillHisto(m_ptvsEtaLinked, eta, pt); + fillHisto(m_probvsSCTLinked, SCTHits, prob); + fillHisto(m_probvsPixLinked, pixHits, prob); + fillHisto(m_sharedHitsvsPixLinked, pixHits, pixSharedHits + SCTSharedHits); + fillHisto(m_sharedHitsvsSCTLinked, SCTHits, pixSharedHits + SCTSharedHits); + fillHisto(m_pixholesvsPixLinked, pixHits, pixHoles); + fillHisto(m_holesvsPixLinked, pixHits, pixHoles + SCTHoles); + fillHisto(m_sctholesvsSCTLinked, SCTHits, SCTHoles); + fillHisto(m_holesvsSCTLinked, SCTHits, pixHoles + SCTHoles); + fillHisto(m_outliersvsPixLinked, pixHits, pixOutliers + SCTOutliers); + fillHisto(m_pixoutliersvsPixLinked, pixHits, pixOutliers); + fillHisto(m_outliersvsSCTLinked, SCTHits, pixOutliers + SCTOutliers); + fillHisto(m_sctoutliersvsSCTLinked, SCTHits, SCTOutliers); + fillHisto(m_hitsvsEtaLinked, eta, pixHits + SCTHits); + fillHisto(m_sctHitsvsPixHitsLinked, pixHits, SCTHits); + fillHisto(m_pixHolesvsEtaLinked, eta, pixHoles); + fillHisto(m_sctHolesvsEtaLinked, eta, SCTHoles); + fillHisto(m_sctHitsvsEtaLinked, eta, SCTHits); + fillHisto(m_pixHitsvsEtaLinked, eta, pixHits); + fillHisto(m_sctOutliersvsEtaLinked, eta, SCTOutliers); + fillHisto(m_pixOutliersvsEtaLinked, eta, pixOutliers); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_spectrum.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_spectrum.h index bbbfad434a2e280c213df34d6eecc904e05a5c2b..8f6df0c67473c8340f804bd591d85ed04ce45801 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_spectrum.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPerfPlot_spectrum.h @@ -25,130 +25,130 @@ public: enum Category { ALL, IN_JETS, N_FAKETYPES }; - InDetPerfPlot_spectrum(InDetPlotBase *pParent, const std::string &dirName); - void fillSpectrum(const xAOD::TrackParticle &trkprt, Float_t prob); - void fillSpectrum(const xAOD::TruthParticle &particle); - void fillSpectrum(const xAOD::TrackParticle &trkprt, const xAOD::TruthVertex &truthVrt); - void fillSpectrum(const xAOD::TrackParticle &trkprt, const xAOD::Vertex &vertex, bool fill); - void fillSpectrumUnlinked(const xAOD::TrackParticle &trkprt, Float_t prob); - void fillSpectrumLinked(const xAOD::TrackParticle &trkprt, Float_t prob); - void fillSpectrumLinked(const xAOD::TrackParticle &trkprt, const xAOD::TruthParticle &particle, double prob); - void fillSpectrumUnlinked2(const xAOD::TrackParticle &trkprt, double prob); + InDetPerfPlot_spectrum(InDetPlotBase* pParent, const std::string& dirName); + void fillSpectrum(const xAOD::TrackParticle& trkprt, Float_t prob); + void fillSpectrum(const xAOD::TruthParticle& particle); + void fillSpectrum(const xAOD::TrackParticle& trkprt, const xAOD::TruthVertex& truthVrt); + void fillSpectrum(const xAOD::TrackParticle& trkprt, const xAOD::Vertex& vertex, bool fill); + void fillSpectrumUnlinked(const xAOD::TrackParticle& trkprt, Float_t prob); + void fillSpectrumLinked(const xAOD::TrackParticle& trkprt, Float_t prob); + void fillSpectrumLinked(const xAOD::TrackParticle& trkprt, const xAOD::TruthParticle& particle, double prob); + void fillSpectrumUnlinked2(const xAOD::TrackParticle& trkprt, double prob); private: - TH1 *m_nSCTHits; - TH1 *m_nPixHits; - TH1 *m_nTotHits; - TH1 *m_nSCTDeadSensors; - TH1 *m_nPixDeadSensors; - TH1 *m_nTotDeadSensors; - - TH1 *m_recoMatchProb; - TH1 *m_recoPt; - TH1 *m_recoEta; - TH1 *m_recoPhi; - TH1 *m_recod0; - TH1 *m_recoz0; - TH1 *m_recoz0sin; + TH1* m_nSCTHits; + TH1* m_nPixHits; + TH1* m_nTotHits; + TH1* m_nSCTDeadSensors; + TH1* m_nPixDeadSensors; + TH1* m_nTotDeadSensors; + + TH1* m_recoMatchProb; + TH1* m_recoPt; + TH1* m_recoEta; + TH1* m_recoPhi; + TH1* m_recod0; + TH1* m_recoz0; + TH1* m_recoz0sin; // - TH1 *m_recod0_TruthVtxR; - TH1 *m_recoz0_TruthVtxZ; - TH1 *m_recoz0_TruthVtxZsin; - TH1 *m_TruthVtxR; - TH1 *m_TruthVtxZ; - TH1 *m_TruthVtxX; - TH1 *m_TruthVtxY; - - TH2 *m_TVR_vs_Z; - TH2 *m_recod0_vs_z0_good; - TH2 *m_recod0_vs_z0_crazy; - - TH1 *m_truthPt; - TH1 *m_truthEta; - TH1 *m_truthPhi; + TH1* m_recod0_TruthVtxR; + TH1* m_recoz0_TruthVtxZ; + TH1* m_recoz0_TruthVtxZsin; + TH1* m_TruthVtxR; + TH1* m_TruthVtxZ; + TH1* m_TruthVtxX; + TH1* m_TruthVtxY; + + TH2* m_TVR_vs_Z; + TH2* m_recod0_vs_z0_good; + TH2* m_recod0_vs_z0_crazy; + + TH1* m_truthPt; + TH1* m_truthEta; + TH1* m_truthPhi; // PV plots - TH1 *m_recod0_PrimVtxR; - TH1 *m_recoz0_PrimVtxZ; - TH1 *m_recoz0_PrimVtxZsin; - TH1 *m_PrimVtxR; - TH1 *m_PrimVtxZ; - TH1 *m_PrimVtxX; - TH1 *m_PrimVtxY; - - TH2 *m_PVR_vs_Z; - - TProfile *m_nSCTHits_vs_eta; - TProfile *m_nPixHits_vs_eta; - TProfile *m_nTotHits_vs_eta; - TH2F *m_nSCTHits_phi_vs_eta; - TH2F *m_nPixHits_phi_vs_eta; - TH2F *m_nTotHits_phi_vs_eta; - - TProfile *m_nSCTDeadSensors_vs_eta; - TProfile *m_nPixDeadSensors_vs_eta; - TProfile *m_nTotDeadSensors_vs_eta; - TH2 *m_ptvsEtaUNLINKED; - TH2 *m_ptvsEtaLINKED; - - TH2 *m_recoMatchvsSiHitsUNLINKED; - TH2 *m_recoMatchvsSCTHitsUNLINKED; - TH2 *m_recoMatchvsPixHitsUNLINKED; - TH2 *m_recoMatchvsSiHitsLINKED; - TH2 *m_recoMatchvsSCTHitsLINKED; - TH2 *m_recoMatchvsPixHitsLINKED; - TProfile *m_nSCTHits_vs_etaUNLINKED; - TProfile *m_nPixHits_vs_etaUNLINKED; - TProfile *m_nTotHits_vs_etaUNLINKED; - TProfile *m_nSCTHits_vs_etaLINKED; - TProfile *m_nPixHits_vs_etaLINKED; - TProfile *m_nTotHits_vs_etaLINKED; - TH1 *m_recoMatchProbUNLINKED; - TH1 *m_recoMatchProbLINKED; - - - TH2 *m_ptvsEtaUnlinked; - TH2 *m_probvsSCTUnlinked; - TH2 *m_probvsPixUnlinked; - TH2 *m_sharedHitsvsSCTUnlinked; - TH2 *m_sharedHitsvsPixUnlinked; - TH2 *m_pixholesvsPixUnlinked; - TH2 *m_holesvsPixUnlinked; - TH2 *m_sctholesvsSCTUnlinked; - TH2 *m_holesvsSCTUnlinked; - TH2 *m_outliersvsPixUnlinked; - TH2 *m_pixoutliersvsPixUnlinked; - TH2 *m_outliersvsSCTUnlinked; - TH2 *m_sctoutliersvsSCTUnlinked; - TProfile *m_hitsvsEtaUnlinked; - TProfile *m_pixHolesvsEtaUnlinked; - TProfile *m_sctHolesvsEtaUnlinked; - TH2 *m_sctHitsvsPixHitsUnlinked; - TProfile *m_sctHitsvsEtaUnlinked; - TProfile *m_pixHitsvsEtaUnlinked; - TProfile *m_pixOutliersvsEtaUnlinked; - TProfile *m_sctOutliersvsEtaUnlinked; - - TH2 *m_ptvsEtaLinked; - TH2 *m_probvsSCTLinked; - TH2 *m_probvsPixLinked; - TH2 *m_sharedHitsvsSCTLinked; - TH2 *m_sharedHitsvsPixLinked; - TH2 *m_pixholesvsPixLinked; - TH2 *m_holesvsPixLinked; - TH2 *m_sctholesvsSCTLinked; - TH2 *m_holesvsSCTLinked; - TH2 *m_outliersvsPixLinked; - TH2 *m_pixoutliersvsPixLinked; - TH2 *m_sctoutliersvsSCTLinked; - TH2 *m_outliersvsSCTLinked; - TProfile *m_hitsvsEtaLinked; - TProfile *m_pixHolesvsEtaLinked; - TProfile *m_sctHolesvsEtaLinked; - TH2 *m_sctHitsvsPixHitsLinked; - TProfile *m_sctHitsvsEtaLinked; - TProfile *m_pixHitsvsEtaLinked; - TProfile *m_pixOutliersvsEtaLinked; - TProfile *m_sctOutliersvsEtaLinked; + TH1* m_recod0_PrimVtxR; + TH1* m_recoz0_PrimVtxZ; + TH1* m_recoz0_PrimVtxZsin; + TH1* m_PrimVtxR; + TH1* m_PrimVtxZ; + TH1* m_PrimVtxX; + TH1* m_PrimVtxY; + + TH2* m_PVR_vs_Z; + + TProfile* m_nSCTHits_vs_eta; + TProfile* m_nPixHits_vs_eta; + TProfile* m_nTotHits_vs_eta; + TH2F* m_nSCTHits_phi_vs_eta; + TH2F* m_nPixHits_phi_vs_eta; + TH2F* m_nTotHits_phi_vs_eta; + + TProfile* m_nSCTDeadSensors_vs_eta; + TProfile* m_nPixDeadSensors_vs_eta; + TProfile* m_nTotDeadSensors_vs_eta; + TH2* m_ptvsEtaUNLINKED; + TH2* m_ptvsEtaLINKED; + + TH2* m_recoMatchvsSiHitsUNLINKED; + TH2* m_recoMatchvsSCTHitsUNLINKED; + TH2* m_recoMatchvsPixHitsUNLINKED; + TH2* m_recoMatchvsSiHitsLINKED; + TH2* m_recoMatchvsSCTHitsLINKED; + TH2* m_recoMatchvsPixHitsLINKED; + TProfile* m_nSCTHits_vs_etaUNLINKED; + TProfile* m_nPixHits_vs_etaUNLINKED; + TProfile* m_nTotHits_vs_etaUNLINKED; + TProfile* m_nSCTHits_vs_etaLINKED; + TProfile* m_nPixHits_vs_etaLINKED; + TProfile* m_nTotHits_vs_etaLINKED; + TH1* m_recoMatchProbUNLINKED; + TH1* m_recoMatchProbLINKED; + + + TH2* m_ptvsEtaUnlinked; + TH2* m_probvsSCTUnlinked; + TH2* m_probvsPixUnlinked; + TH2* m_sharedHitsvsSCTUnlinked; + TH2* m_sharedHitsvsPixUnlinked; + TH2* m_pixholesvsPixUnlinked; + TH2* m_holesvsPixUnlinked; + TH2* m_sctholesvsSCTUnlinked; + TH2* m_holesvsSCTUnlinked; + TH2* m_outliersvsPixUnlinked; + TH2* m_pixoutliersvsPixUnlinked; + TH2* m_outliersvsSCTUnlinked; + TH2* m_sctoutliersvsSCTUnlinked; + TProfile* m_hitsvsEtaUnlinked; + TProfile* m_pixHolesvsEtaUnlinked; + TProfile* m_sctHolesvsEtaUnlinked; + TH2* m_sctHitsvsPixHitsUnlinked; + TProfile* m_sctHitsvsEtaUnlinked; + TProfile* m_pixHitsvsEtaUnlinked; + TProfile* m_pixOutliersvsEtaUnlinked; + TProfile* m_sctOutliersvsEtaUnlinked; + + TH2* m_ptvsEtaLinked; + TH2* m_probvsSCTLinked; + TH2* m_probvsPixLinked; + TH2* m_sharedHitsvsSCTLinked; + TH2* m_sharedHitsvsPixLinked; + TH2* m_pixholesvsPixLinked; + TH2* m_holesvsPixLinked; + TH2* m_sctholesvsSCTLinked; + TH2* m_holesvsSCTLinked; + TH2* m_outliersvsPixLinked; + TH2* m_pixoutliersvsPixLinked; + TH2* m_sctoutliersvsSCTLinked; + TH2* m_outliersvsSCTLinked; + TProfile* m_hitsvsEtaLinked; + TProfile* m_pixHolesvsEtaLinked; + TProfile* m_sctHolesvsEtaLinked; + TH2* m_sctHitsvsPixHitsLinked; + TProfile* m_sctHitsvsEtaLinked; + TProfile* m_pixHitsvsEtaLinked; + TProfile* m_pixOutliersvsEtaLinked; + TProfile* m_sctOutliersvsEtaLinked; // plot base has nop default implementation of this; we use it to book the histos void initializePlots(); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.cxx index 776917e20316d8d0807c27c38bdbc2a9e9bea974..e30148c21f0603a902c80a065fc53b0f064f6273 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.cxx @@ -32,8 +32,8 @@ // ​https://svnweb.cern.ch/trac/atlasoff/browser/Tracking/TrkEvent/TrkParametersBase/trunk/TrkParametersBase/CurvilinearParametersT.h -InDetPhysHitDecoratorTool::InDetPhysHitDecoratorTool(const std::string &type, const std::string &name, - const IInterface *parent) : +InDetPhysHitDecoratorTool::InDetPhysHitDecoratorTool(const std::string& type, const std::string& name, + const IInterface* parent) : AthAlgTool(type, name, parent), m_holeSearchTool("InDet::InDetTrackHoleSearchTool"), m_updatorHandle("Trk::KalmanUpdator/TrkKalmanUpdator"), @@ -56,7 +56,6 @@ InDetPhysHitDecoratorTool::~InDetPhysHitDecoratorTool () { StatusCode InDetPhysHitDecoratorTool::initialize() { - ATH_CHECK(m_holeSearchTool.retrieve()); if (not (m_updatorHandle.empty())) { ATH_CHECK(m_updatorHandle.retrieve()); @@ -95,7 +94,7 @@ InDetPhysHitDecoratorTool::finalize() { } bool -InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle &particle, const std::string &prefix) { +InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle& particle, const std::string& prefix) { static int trackNumber(0); typedef std::tuple<int, int, int, float, float, float, float, int, int, int> SingleResult_t; @@ -112,7 +111,7 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle &particle, co invalidPull, invalidRes, invalidPull, invalidWidth, invalidWidth, invalidMeasure); // get element link to the original track - const ElementLink< TrackCollection > &trackLink = particle.trackLink();// using xAODTracking-00-03-09, interface has + const ElementLink< TrackCollection >& trackLink = particle.trackLink();// using xAODTracking-00-03-09, interface has // changed later if (trackLink.isValid()) { ATH_MSG_VERBOSE("Track link found "); @@ -120,7 +119,7 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle &particle, co if (pt > m_ptThreshold) { ATH_MSG_VERBOSE("pt is over threshold "); std::unique_ptr<const Trk::Track> trackWithHoles(m_holeSearchTool->getTrackWithHoles(**trackLink)); - const auto &allTrackStates = *(trackWithHoles->trackStateOnSurfaces()); + const auto& allTrackStates = *(trackWithHoles->trackStateOnSurfaces()); const int numberOfHits(allTrackStates.size()); unsigned int trackParametersCounter(numberOfHits); TrackResult_t result; @@ -134,7 +133,7 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle &particle, co } ATH_MSG_DEBUG("Num. track states in track " << ++trackNumber << ": " << allTrackStates.size()); - for (const auto &thisTrackState: allTrackStates) { + for (const auto& thisTrackState: allTrackStates) { // Copy logic from InDetRttPerformance to get hits/outliers/holes // Variable specifying measurement type filled SingleResult_t thisResult(invalidResult); @@ -143,8 +142,8 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle &particle, co continue; } Identifier surfaceID; - const Trk::MeasurementBase *mesb = (thisTrackState)->measurementOnTrack(); - const Trk::RIO_OnTrack *hit = mesb ? dynamic_cast<const Trk::RIO_OnTrack *>(mesb) : nullptr; + const Trk::MeasurementBase* mesb = (thisTrackState)->measurementOnTrack(); + const Trk::RIO_OnTrack* hit = mesb ? dynamic_cast<const Trk::RIO_OnTrack*>(mesb) : nullptr; if (mesb && !hit) { continue; // skip pseudomeasurements } @@ -193,7 +192,7 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle &particle, co int phiWidth(-1); int etaWidth(-1); std::unique_ptr<const Trk::ResidualPull> residualPull(nullptr); - const Trk::TrackParameters *biasedTrackParameters = thisTrackState->trackParameters(); + const Trk::TrackParameters* biasedTrackParameters = thisTrackState->trackParameters(); if (biasedTrackParameters) { ATH_MSG_VERBOSE("biased track parameters ok"); } @@ -202,13 +201,13 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle &particle, co ATH_MSG_DEBUG("mesb and biased track parameters are ok"); // for outliers, the measurement is not part of the fit, so track parameters are already unbiased std::unique_ptr<const Trk::TrackParameters> cleanup_trackparam; - const Trk::TrackParameters *trackParameters = + const Trk::TrackParameters* trackParameters = (!thisTrackState->type(Trk::TrackStateOnSurface::Outlier)) ? getUnbiasedTrackParameters( biasedTrackParameters, mesb) : biasedTrackParameters; if (trackParameters != biasedTrackParameters) { - cleanup_trackparam.reset(trackParameters); + cleanup_trackparam.reset(trackParameters); } if (not trackParameters) { ATH_MSG_DEBUG("unbiased track parameters pointer is NULL"); @@ -237,8 +236,8 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle &particle, co // copy-paste from original if (hit && m_isUnbiased) { // Cluster width determination - if ((det == IBL)or(det == PIXEL) or(det == SCT)) { - const InDet::SiCluster *pCluster = dynamic_cast <const InDet::SiCluster *>(hit->prepRawData()); + if ((det == L0PIXBARR)or(det == PIXEL) or(det == SCT)) { + const InDet::SiCluster* pCluster = dynamic_cast <const InDet::SiCluster*>(hit->prepRawData()); if (pCluster) { InDet::SiWidth width = pCluster->width(); phiWidth = int(width.colRow().x()); @@ -264,7 +263,7 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle &particle, co }// end of for loop*/ ATH_MSG_DEBUG( "Out of " << numberOfHits << " hits, " << trackParametersCounter << " had track params, and " << result.size() << - " had residuals."); + " had residuals."); if (not result.empty()) { // particle.auxdecor<TrackResult_t>(prefix+"hitResiduals") = result; //!< no dictionary for tuple const unsigned int arraySize = result.size(); @@ -288,7 +287,7 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle &particle, co result_etaWidth.reserve(arraySize); std::vector<int> result_measureType; result_measureType.reserve(arraySize); - for (const SingleResult_t &single_result : result) { + for (const SingleResult_t& single_result : result) { result_det.push_back(std::get<0>(single_result)); result_r.push_back(std::get<1>(single_result)); result_iLayer.push_back(std::get<2>(single_result)); @@ -320,7 +319,7 @@ InDetPhysHitDecoratorTool::decorateTrack(const xAOD::TrackParticle &particle, co } bool -InDetPhysHitDecoratorTool::decideDetectorRegion(const Identifier &id, Subdetector &det, Region &r, int &layer) { +InDetPhysHitDecoratorTool::decideDetectorRegion(const Identifier& id, Subdetector& det, Region& r, int& layer) { bool success(false); const int normalBarrel(0); const int upgradedBarrel(1); @@ -352,16 +351,10 @@ InDetPhysHitDecoratorTool::decideDetectorRegion(const Identifier &id, Subdetecto bec = abs(m_pixelID->barrel_ec(id)); r = (bec == normalBarrel) ? (BARREL) : (ENDCAP); layer = m_pixelID->layer_disk(id); - if (layer == 0) { - det = IBL; + if (BARREL == r and layer == 0) { + det = L0PIXBARR; } } - /** cf. Miriam's code - if (det==PIXEL) { - r= (bec==normalBarrel)?(BARREL):(ENDCAP); - if (m_pixelID->layer_disk(id) == 0) det=BLAYER; - } - **/ if (det == DBM) { r = (bec < 0) ? (BARREL) : (ENDCAP); } @@ -384,11 +377,11 @@ InDetPhysHitDecoratorTool::decideDetectorRegion(const Identifier &id, Subdetecto return success; } -const Trk::TrackParameters * -InDetPhysHitDecoratorTool::getUnbiasedTrackParameters(const Trk::TrackParameters *trkParameters, - const Trk::MeasurementBase *measurement) { +const Trk::TrackParameters* +InDetPhysHitDecoratorTool::getUnbiasedTrackParameters(const Trk::TrackParameters* trkParameters, + const Trk::MeasurementBase* measurement) { static bool alreadyWarned(false); - const Trk::TrackParameters *unbiasedTrkParameters(trkParameters); + const Trk::TrackParameters* unbiasedTrkParameters(trkParameters); if (!m_updatorHandle.empty() && (m_isUnbiased)) { if (trkParameters->covariance()) { @@ -407,7 +400,7 @@ InDetPhysHitDecoratorTool::getUnbiasedTrackParameters(const Trk::TrackParameters << endmsg; alreadyWarned = true; m_isUnbiased = false; - }else { + } else { m_isUnbiased = false; }// end if no measured track parameter } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.h index 581143dcd85148c9ae748142e545e44989a408f4..686af27e7690c9d178c55e7ee7c2b7193e915dfe 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysHitDecoratorTool.h @@ -33,18 +33,20 @@ namespace Trk { // class to decorate xAOD::TruthParticles with additional information required by validation class InDetPhysHitDecoratorTool: virtual public IInDetPhysValDecoratorTool, public AthAlgTool { public: + // L0PIXBARR : layer0 of pixel barrel (IBL in Run2) + // PIXEL : in barrel all layers appart from layer0. In end-caps all disks/rings. enum Subdetector { - INVALID_DETECTOR=-1, IBL, PIXEL, SCT, TRT, DBM, N_SUBDETECTORS + INVALID_DETECTOR=-1, L0PIXBARR, PIXEL, SCT, TRT, DBM, N_SUBDETECTORS }; enum Region { INVALID_REGION=-1, BARREL, ENDCAP }; - InDetPhysHitDecoratorTool(const std::string &type, const std::string &name, const IInterface *parent); + InDetPhysHitDecoratorTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~InDetPhysHitDecoratorTool (); virtual StatusCode initialize(); virtual StatusCode finalize(); - virtual bool decorateTrack(const xAOD::TrackParticle &particle, const std::string &prefix); + virtual bool decorateTrack(const xAOD::TrackParticle& particle, const std::string& prefix); private: ToolHandle<Trk::ITrackHoleSearchTool> m_holeSearchTool; ToolHandle<Trk::IUpdator> m_updatorHandle; // !< Tool handle of updator for unbiased states @@ -54,15 +56,15 @@ private: bool m_isUnbiased; bool m_doUpgrade; // the following help identify a surface in the detector - const AtlasDetectorID *m_idHelper; - const PixelID *m_pixelID; - const SCT_ID *m_sctID; - const TRT_ID *m_trtID; + const AtlasDetectorID* m_idHelper; + const PixelID* m_pixelID; + const SCT_ID* m_sctID; + const TRT_ID* m_trtID; // private member functions - bool decideDetectorRegion(const Identifier &id, Subdetector &det, Region &r, int &layer); - const Trk::TrackParameters * - getUnbiasedTrackParameters(const Trk::TrackParameters *trkParameters, const Trk::MeasurementBase *measurement); + bool decideDetectorRegion(const Identifier& id, Subdetector& det, Region& r, int& layer); + const Trk::TrackParameters* + getUnbiasedTrackParameters(const Trk::TrackParameters* trkParameters, const Trk::MeasurementBase* measurement); }; #endif diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValDecoratorAlg.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValDecoratorAlg.cxx index 5b7805d285b8352f59328be5b7964a78051893d1..b2fadeddffeadb90eb0f403f7836d0f31f254246 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValDecoratorAlg.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValDecoratorAlg.cxx @@ -23,10 +23,10 @@ namespace { // utility functions used here // get truth particle associated with a track particle - const xAOD::TruthParticle * - getTruthPtr(const xAOD::TrackParticle &trackParticle) { + const xAOD::TruthParticle* + getTruthPtr(const xAOD::TrackParticle& trackParticle) { typedef ElementLink<xAOD::TruthParticleContainer> ElementTruthLink_t; - const xAOD::TruthParticle *result(nullptr); + const xAOD::TruthParticle* result(nullptr); // 0. is there any truth? if (trackParticle.isAvailable<ElementTruthLink_t>("truthParticleLink")) { // 1. ..then get link @@ -40,7 +40,7 @@ namespace { // utility functions used here } -InDetPhysValDecoratorAlg::InDetPhysValDecoratorAlg(const std::string &name, ISvcLocator *pSvcLocator) : AthAlgorithm( +InDetPhysValDecoratorAlg::InDetPhysValDecoratorAlg(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm( name, pSvcLocator), m_truthDecoratorTool("InDetPhysValTruthDecoratorTool"), m_hitDecoratorTool("InDetPhysHitDecoratorTool"), @@ -86,8 +86,8 @@ InDetPhysValDecoratorAlg::execute() { // const unsigned int nTruth(ptruth->size()); // unsigned int num_truthmatch_match(0); - for (const auto &thisTrack: *ptracks) { - const xAOD::TruthParticle *associatedTruth = getTruthPtr(*thisTrack); // get the associated truth + for (const auto& thisTrack: *ptracks) { + const xAOD::TruthParticle* associatedTruth = getTruthPtr(*thisTrack); // get the associated truth // decorate the track here, if necessary <insert code> // running hit decorator on slimmed tracks crashes bool successfulTrackDecoration = m_hitDecoratorTool->decorateTrack(*thisTrack, ""); @@ -108,17 +108,15 @@ InDetPhysValDecoratorAlg::execute() { // if (not successfulDecoration) ATH_MSG_WARNING ("The truth particle could not be assigned a type"); } } - const xAOD::TruthParticleContainer *truthParticles = + const xAOD::TruthParticleContainer* truthParticles = (!m_truthParticleName.empty() ? getContainer<xAOD::TruthParticleContainer>(m_truthParticleName) : nullptr); if (truthParticles) { - - for (const auto &thisTruth: *truthParticles) { + for (const auto& thisTruth: *truthParticles) { bool successfulDecoration = m_truthDecoratorTool->decorateTruth(*thisTruth, ""); if (not successfulDecoration) { ATH_MSG_DEBUG("Could not retrieve some information for the truth particle."); } } - } ATH_MSG_VERBOSE(nTracks << " tracks were retrieved; " << num_truthmatch_match << " had associated truth."); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValLargeD0Tool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValLargeD0Tool.cxx index d8beb8c3310d2a21eed3dedb13a8b2778f8f35fe..30209bb6a61d7c0202dd3eac3064de1415c93865 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValLargeD0Tool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValLargeD0Tool.cxx @@ -43,10 +43,10 @@ using std::make_pair; namespace { // utility functions used here // get truth particle associated with a track particle - const xAOD::TruthParticle * - getTruthPtr(const xAOD::TrackParticle &trackParticle) { + const xAOD::TruthParticle* + getTruthPtr(const xAOD::TrackParticle& trackParticle) { typedef ElementLink<xAOD::TruthParticleContainer> ElementTruthLink_t; - const xAOD::TruthParticle *result(nullptr); + const xAOD::TruthParticle* result(nullptr); // 0. is there any truth? if (trackParticle.isAvailable<ElementTruthLink_t>("truthParticleLink")) { // 1. ..then get link @@ -60,7 +60,7 @@ namespace { // utility functions used here // get truth/track matching probability float - getMatchingProbability(const xAOD::TrackParticle &trackParticle) { + getMatchingProbability(const xAOD::TrackParticle& trackParticle) { float result(std::numeric_limits<float>::quiet_NaN()); if (trackParticle.isAvailable<float>("truthMatchProbability")) { @@ -85,8 +85,8 @@ namespace { // utility functions used here }// namespace ///Parametrized constructor -InDetPhysValLargeD0Tool::InDetPhysValLargeD0Tool(const std::string &type, const std::string &name, - const IInterface *parent) : +InDetPhysValLargeD0Tool::InDetPhysValLargeD0Tool(const std::string& type, const std::string& name, + const IInterface* parent) : ManagedMonitorToolBase(type, name, parent), m_useTrackSelection(true), m_onlyInsideOutTracks(false), @@ -150,13 +150,13 @@ InDetPhysValLargeD0Tool::fillHistograms() { if (!ptracks) { return StatusCode::FAILURE; } - //Retrieve EventInfo container + // Retrieve EventInfo container auto eventinfo = getContainer<xAOD::EventInfo>(m_eventInfoContainerName); - //Retrieve vertex container + // Retrieve vertex container auto privert = getContainer<xAOD::VertexContainer>(m_vertexContainerName); // Retrieve truthParticle container. - const xAOD::TruthParticleContainer *truthParticles = + const xAOD::TruthParticleContainer* truthParticles = (!m_truthParticleName.empty() ? getContainer<xAOD::TruthParticleContainer>(m_truthParticleName) : nullptr); // Counters etc. @@ -181,7 +181,7 @@ InDetPhysValLargeD0Tool::fillHistograms() { * This is for filling Track-only, Track 'n' Truth with good matching probability (meas, res, & pull), and Fakes. */ - for (const auto &thisTrack : *ptracks) { + for (const auto& thisTrack : *ptracks) { // apply minimum track selection to all tracks to match with Truth Selection cuts if (!MinTrackSelection(thisTrack)) { continue; @@ -198,24 +198,29 @@ InDetPhysValLargeD0Tool::fillHistograms() { ++nSelectedTracks; // * Get associated truth particle and match probability. - const xAOD::TruthParticle *associatedTruth = getTruthPtr(*thisTrack); + const xAOD::TruthParticle* associatedTruth = getTruthPtr(*thisTrack); float prob = getMatchingProbability(*thisTrack); bool trtHit(false), trtOut(false); uint8_t iTrtHits(0), iTrtOutliers(0), iTrtTubeHits(0); int nTrtHits(0), nTrtTubeHits(0); - if (thisTrack->summaryValue(iTrtHits,xAOD::numberOfTRTHits)){ - if(iTrtHits > 0) { - trtHit = true; - nTrtHits = (int)iTrtHits; - } } - if (thisTrack->summaryValue(iTrtOutliers,xAOD::numberOfTRTOutliers)){ - if(iTrtOutliers > 0) { trtOut = true; } } - if (thisTrack->summaryValue(iTrtTubeHits,xAOD::numberOfTRTTubeHits)){ - if(iTrtTubeHits > 0) { - nTrtTubeHits = (int)iTrtTubeHits; - } } + if (thisTrack->summaryValue(iTrtHits, xAOD::numberOfTRTHits)) { + if (iTrtHits > 0) { + trtHit = true; + nTrtHits = (int) iTrtHits; + } + } + if (thisTrack->summaryValue(iTrtOutliers, xAOD::numberOfTRTOutliers)) { + if (iTrtOutliers > 0) { + trtOut = true; + } + } + if (thisTrack->summaryValue(iTrtTubeHits, xAOD::numberOfTRTTubeHits)) { + if (iTrtTubeHits > 0) { + nTrtTubeHits = (int) iTrtTubeHits; + } + } // This is where the BMR, Fake, and Really Fake fillers need to go. float BMR_w(0), RF_w(0); @@ -230,9 +235,9 @@ InDetPhysValLargeD0Tool::fillHistograms() { bool isFake = (prob < minProbEffLow); int barcode = (associatedTruth ? associatedTruth->barcode() : -1); - + // * Fake rate plots, using 'fake' flag. - m_LargeD0Plots->fillFakeRate(*thisTrack, isFake, barcode,trtHit,trtOut, nTrtHits, nTrtTubeHits); + m_LargeD0Plots->fillFakeRate(*thisTrack, isFake, barcode, trtHit, trtOut, nTrtHits, nTrtTubeHits); if (isFake) { m_LargeD0Plots->fillFake(*thisTrack, barcode, *eventinfo, *privert); @@ -250,10 +255,9 @@ InDetPhysValLargeD0Tool::fillHistograms() { * This is the beginning of the nested Loop, built mainly for the Efficiency Plots. */ if (truthParticles) { - // Outer loop: All truth particles. // - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - for (const auto &thisTruth : *truthParticles) { + for (const auto& thisTruth : *truthParticles) { if (thisTruth->pt() < 0.001) { continue; } @@ -262,19 +266,18 @@ InDetPhysValLargeD0Tool::fillHistograms() { } bool reconstructed(false), largeD0Track(false), trtHit(false), trtOut(false); - float bestMatch(0.0); - float PF_w(1); // weight for the trackeff histos + float bestMatch(0.0); + bool addsToEfficiency(true); // weight for the trackeff histos uint8_t iTrtHits(0), iTrtOutliers(0), iTrtTubeHits(0); int nTrtHits(0), nTrtTubeHits(0); m_LargeD0Plots->fillTruth(*thisTruth); // * Vector of pairs: <truth_matching_probability, track> if prob > minProbEffLow (0.5). - std::vector <pair<float, const xAOD::TrackParticle *> > prospects; + std::vector <pair<float, const xAOD::TrackParticle*> > prospects; // Inner loop: All track particles. - for (const auto &thisTrack : *ptracks) { - + for (const auto& thisTrack : *ptracks) { if (m_useTrackSelection) { // * 0 means z0, d0 cut is wrt. beam spot - put in a PV to change this. // if ( !(m_trackSelectionTool->accept(*thisTrack, 0)) ) { continue; } @@ -286,23 +289,30 @@ InDetPhysValLargeD0Tool::fillHistograms() { // if (m_onlyInsideOutTracks and (not isInsideOut(*thisTrack))) { continue; } // * Get associated truth particle and probability. - const xAOD::TruthParticle *associatedTruth = getTruthPtr(*thisTrack); + const xAOD::TruthParticle* associatedTruth = getTruthPtr(*thisTrack); float prob = getMatchingProbability(*thisTrack); // * If the associated truth particle matches the current particle in the truth particle loop... - if (associatedTruth && associatedTruth == thisTruth) { - // * Determine TRT hits, outliers, and tube hits for truth associated tracks - if (thisTrack->summaryValue(iTrtHits, xAOD::numberOfTRTHits)) { - if (iTrtHits > 0) { - trtHit = true; - nTrtHits = (int)iTrtHits; - } } - if (thisTrack->summaryValue(iTrtOutliers,xAOD::numberOfTRTOutliers)){ - if(iTrtOutliers > 0) { trtOut = true; } } - if (thisTrack->summaryValue(iTrtTubeHits,xAOD::numberOfTRTTubeHits)){ - if(iTrtTubeHits > 0) { nTrtTubeHits = (int)iTrtTubeHits; } } - // * ... as a standard or largeD0 track. - largeD0Track = isLargeD0Track(thisTrack); + if (associatedTruth && associatedTruth == thisTruth) { + // * Determine TRT hits, outliers, and tube hits for truth associated tracks + if (thisTrack->summaryValue(iTrtHits, xAOD::numberOfTRTHits)) { + if (iTrtHits > 0) { + trtHit = true; + nTrtHits = (int) iTrtHits; + } + } + if (thisTrack->summaryValue(iTrtOutliers, xAOD::numberOfTRTOutliers)) { + if (iTrtOutliers > 0) { + trtOut = true; + } + } + if (thisTrack->summaryValue(iTrtTubeHits, xAOD::numberOfTRTTubeHits)) { + if (iTrtTubeHits > 0) { + nTrtTubeHits = (int) iTrtTubeHits; + } + } + // * ... as a standard or largeD0 track. + largeD0Track = isLargeD0Track(thisTrack); bestMatch = std::max(prob, bestMatch); if (prob > minProbEffLow) { prospects.push_back(make_pair(prob, thisTrack)); @@ -316,24 +326,25 @@ InDetPhysValLargeD0Tool::fillHistograms() { // int deg_count = prospects.size();//unused if (bestMatch >= minProbEffHigh) { ++num_truthmatch_match; - const xAOD::TruthParticle *assoc_Truth = getTruthPtr(*prospects.at(0).second); + const xAOD::TruthParticle* assoc_Truth = getTruthPtr(*prospects.at(0).second); if (!assoc_Truth) { continue; } m_LargeD0Plots->fill(*assoc_Truth); // This is filling truth-only plots: m_TrackTruthInfoPlots - }else { - PF_w = 0; + } else { + addsToEfficiency = false; } - m_LargeD0Plots->pro_fill(*thisTruth, PF_w); + m_LargeD0Plots->fillEfficiency(*thisTruth, addsToEfficiency); // end of bestMatch >= minProbEffHigh - m_LargeD0Plots->fillEfficiency(*thisTruth, reconstructed, largeD0Track, trtHit,trtOut,nTrtHits,nTrtTubeHits, isSignal(thisTruth)); + m_LargeD0Plots->fillEfficiency(*thisTruth, reconstructed, largeD0Track, trtHit, trtOut, nTrtHits, nTrtTubeHits, isSignal( + thisTruth)); } // END: loop truthParticles } // END: if truthParticles if (num_truthmatch_match == 0) { ATH_MSG_DEBUG("NO TRACKS had associated truth."); - }else { + } else { ATH_MSG_DEBUG(num_truthmatch_match << " tracks out of " << nTracks << " had associated truth."); } @@ -371,7 +382,7 @@ InDetPhysValLargeD0Tool::procHistograms() { // ------------------------------------------------------------------- bool -InDetPhysValLargeD0Tool::isLargeD0Track(const xAOD::TrackParticle *tp) { +InDetPhysValLargeD0Tool::isLargeD0Track(const xAOD::TrackParticle* tp) { const std::bitset<xAOD::NumberOfTrackRecoInfo> patternReco = tp->patternRecoInfo(); if (patternReco.test(49)) { @@ -380,9 +391,8 @@ InDetPhysValLargeD0Tool::isLargeD0Track(const xAOD::TrackParticle *tp) { return false; } - bool -InDetPhysValLargeD0Tool::isSignal(const xAOD::TruthParticle *p) { +InDetPhysValLargeD0Tool::isSignal(const xAOD::TruthParticle* p) { if (m_signalIds.empty()) { return false; } @@ -390,9 +400,10 @@ InDetPhysValLargeD0Tool::isSignal(const xAOD::TruthParticle *p) { (p->status() == 1) && \ (p->hasProdVtx()) && \ (!p->hasDecayVtx()) && \ - // (p->nParents() > 0) && \ //taken out because not all signatures have tracks that stop decaying the way muons do + // (p->nParents() > 0) && \ //taken out because not all signatures have tracks that stop decaying the way + // muons do (p->isCharged())) { - const xAOD::TruthParticle *parent = p->parent(); + const xAOD::TruthParticle* parent = p->parent(); if (parent == NULL) { return false; } @@ -411,9 +422,11 @@ InDetPhysValLargeD0Tool::isSignal(const xAOD::TruthParticle *p) { } bool -InDetPhysValLargeD0Tool::MinTrackSelection(const xAOD::TrackParticle *tp) { +InDetPhysValLargeD0Tool::MinTrackSelection(const xAOD::TrackParticle* tp) { float maxEta = 2.5; - float minPt = /*1000.*/ 0; //Putting in this minPt cut actually increases the fake rate, so I am putting back to zero. + float minPt = /*1000.*/ 0; // Putting in this minPt cut actually increases the fake rate, so I am putting back to + + // zero. if ((tp->pt() > 1e-7 ? (fabs(tp->eta()) < maxEta) : false) && \ (tp->pt() > minPt)) { diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx index 2038ef03376e61cd23a7f6632870d8bc11dd55c6..8313c076fad8545aaca6ba2da946bc190b6a7174 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringTool.cxx @@ -13,7 +13,7 @@ #include "InDetPerfPlot_nTracks.h" #include "AthTruthSelectionTool.h" #include "CachedGetAssocTruth.h" -//#include "TrackTruthLookup.h" +// #include "TrackTruthLookup.h" // #include "TrkToolInterfaces/ITrackSelectorTool.h" #include "xAODTracking/TrackParticle.h" @@ -36,24 +36,26 @@ #include <algorithm> #include <limits> #include <cmath> // to get std::isnan(), std::abs etc. -//#include <functional> // to get std::plus +// #include <functional> // to get std::plus #include <utility> -#include <cstdlib> //to getenv +#include <cstdlib> // to getenv #include <vector> + namespace { // utility functions used here // sort method for prospects bool - sortProspects(std::pair<float, const xAOD::TrackParticle *> pair1, - std::pair<float, const xAOD::TrackParticle *> pair2) { + sortProspects(std::pair<float, const xAOD::TrackParticle*> pair1, + std::pair<float, const xAOD::TrackParticle*> pair2) { return(pair1.first < pair2.first); } // get truth/track matching probability float - getMatchingProbability(const xAOD::TrackParticle &trackParticle) { + getMatchingProbability(const xAOD::TrackParticle& trackParticle) { float result(std::numeric_limits<float>::quiet_NaN()); + if (trackParticle.isAvailable<float>("truthMatchProbability")) { result = trackParticle.auxdata<float>("truthMatchProbability"); } @@ -61,44 +63,93 @@ namespace { // utility functions used here } bool - isInsideOut(const xAOD::TrackParticle &track) { + isInsideOut(const xAOD::TrackParticle& track) { std::bitset<xAOD::TrackPatternRecoInfo::NumberOfTrackRecoInfo> patternInfo = track.patternRecoInfo(); return patternInfo.test(0); } + template <class T> + inline float + safelyGetEta(const T& pTrk, const float safePtThreshold = 0.1) { + return (pTrk->pt() > safePtThreshold) ? (pTrk->eta()) : std::nan(""); + } + + // Convert to GeV from the default MeV + constexpr float + operator "" _GeV (long double energy) { + return energy * 0.001; + } + + constexpr float + operator "" _GeV (unsigned long long energy) { + return energy * 0.001; + } + + // general utility function to check value is in range + template <class T> + inline bool + inRange(const T& value, const T& minVal, const T& maxVal) { + return not ((value < minVal)or(value > maxVal)); + } + + template<class T> + inline bool + inRange(const T& value, const T& absoluteMax) { + return not (std::abs(value) > absoluteMax); + } + + // Cuts on various objects bool - passJetCuts(const xAOD::Jet &jet) { - float etaMin = -2.5; - float etaMax = 2.5; - float jetPtMin = 100; // in GeV - float jetPtMax = 1000; // in GeV - float jetPt = jet.pt() / 1e3; // GeV - - if (jetPt < jetPtMin) { - return false; - } - if (jetPt > jetPtMax) { - return false; - } - float eta = jet.eta(); - if (eta < etaMin) { - return false; - } - if (eta > etaMax) { - return false; + passJetCuts(const xAOD::Jet& jet) { + const float absEtaMax = 2.5; + const float jetPtMin = 100; // in GeV + const float jetPtMax = 1000; // in GeV + const float jetPt = jet.pt() * 1_GeV; // GeV + const float jetEta = jet.eta(); + + return inRange(jetPt, jetPtMin, jetPtMax) and inRange(jetEta, absEtaMax); + } + + // general utility function to return bin index given a value and the upper endpoints of each bin + template <class T> + unsigned int + binIndex(const T& val, const std::vector<T>& partitions) {// signature should allow other containers + unsigned int i(0); + bool nf = true; + + while (nf and i != partitions.size()) { + nf = (val > partitions[i++]); } - return true; + return nf ? i : i - 1; } + + bool + acceptVertex(const xAOD::Vertex* vtx) { + return(vtx->vertexType() != xAOD::VxType::NoVtx); + } + + bool + acceptTruthVertex(const xAOD::TruthVertex* vtx) { + const float x(vtx->x()), y(vtx->y()), z(vtx->z()); + const float vrtR2 = (x * x + y * y); // radial distance squared + + return inRange(z, 500.f) and not (vrtR2 > 1); // units? + } + + const std::vector<float> ETA_PARTITIONS = { + 2.7, 3.5, std::numeric_limits<float>::infinity() + }; }// namespace ///Parametrized constructor -InDetPhysValMonitoringTool::InDetPhysValMonitoringTool(const std::string &type, const std::string &name, - const IInterface *parent) : +InDetPhysValMonitoringTool::InDetPhysValMonitoringTool(const std::string& type, const std::string& name, + const IInterface* parent) : ManagedMonitorToolBase(type, name, parent), m_useTrackSelection(false), m_onlyInsideOutTracks(false), + m_TrkSelectPV(false), m_trackSelectionTool("InDet::InDetTrackSelectionTool/TrackSelectionTool"), - m_truthSelectionTool("AthTruthSelectionTool",this), + m_truthSelectionTool("AthTruthSelectionTool", this), m_prospectsMatched(6, 0), m_twoMatchedEProb(0), m_threeMatchedEProb(0), @@ -149,7 +200,7 @@ InDetPhysValMonitoringTool::initialize() { } } ATH_CHECK(m_truthSelectionTool.retrieve()); - m_truthCutCounters=m_truthSelectionTool->counters(); + m_truthCutCounters = m_truthSelectionTool->counters(); m_monPlots = std::move(std::unique_ptr<InDetRttPlots> (new InDetRttPlots(0, m_dirName + m_folder))); m_monPlots->SetFillExtraTIDEPlots(m_fillExtraTIDEPlots); return StatusCode::SUCCESS; @@ -159,79 +210,70 @@ StatusCode InDetPhysValMonitoringTool::fillHistograms() { ATH_MSG_DEBUG("Filling hists " << name() << "..."); // function object could be used to retrieve truth: IDPVM::CachedGetAssocTruth getTruth; + const char* debugBacktracking = std::getenv("BACKTRACKDEBUG"); + // retrieve trackParticle container const auto ptracks = getContainer<xAOD::TrackParticleContainer>(m_trkParticleName); - if (not ptracks) return StatusCode::FAILURE; + if (not ptracks) { + return StatusCode::FAILURE; + } + if(debugBacktracking){ + std::cout<<"Rey: Start of new event \n"; + std::cout<<"Finn: Number of particles in container: "<<ptracks->size()<<"\n"; + } // // retrieve truthParticle container - std::vector<const xAOD::TruthParticle *> truthParticlesVec=getTruthParticles(); - //IDPVM::TrackTruthLookup getAsTruth(ptracks, &truthParticlesVec); //caches everything upon construction - IDPVM::CachedGetAssocTruth getAsTruth; //only cache one way, track->truth, not truth->tracks + std::vector<const xAOD::TruthParticle*> truthParticlesVec = getTruthParticles(); + // IDPVM::TrackTruthLookup getAsTruth(ptracks, &truthParticlesVec); //caches everything upon construction + IDPVM::CachedGetAssocTruth getAsTruth; // only cache one way, track->truth, not truth->tracks // bool incFake = false; - int nMuEvents= 0; - const xAOD::TruthPileupEventContainer *truthPileupEventContainer = 0; + int nMuEvents = 0; + const xAOD::TruthPileupEventContainer* truthPileupEventContainer = 0; if (incFake) { ATH_MSG_VERBOSE("getting TruthPileupEvents container"); - const char * truthPUEventCollName = evtStore()->contains<xAOD::TruthPileupEventContainer>("TruthPileupEvents")? "TruthPileupEvents" : "TruthPileupEvent"; - evtStore()->retrieve( truthPileupEventContainer, truthPUEventCollName ); - nMuEvents = (int)truthPileupEventContainer->size(); + const char* truthPUEventCollName = + evtStore()->contains<xAOD::TruthPileupEventContainer>("TruthPileupEvents") ? "TruthPileupEvents" : + "TruthPileupEvent"; + evtStore()->retrieve(truthPileupEventContainer, truthPUEventCollName); + nMuEvents = (int) truthPileupEventContainer->size(); } - ATH_MSG_DEBUG("Filling vertex plots"); - const xAOD::VertexContainer *pvertex = getContainer<xAOD::VertexContainer>(m_vertexContainerName); - const xAOD::Vertex *pvtx = nullptr; + const xAOD::VertexContainer* pvertex = getContainer<xAOD::VertexContainer>(m_vertexContainerName); + const xAOD::Vertex* pvtx = nullptr; if (pvertex and not pvertex->empty()) { - ATH_MSG_DEBUG("Number of vertices retrieved for this event "<<pvertex->size()); - const auto & stdVertexContainer= pvertex->stdcont(); - auto predicate = [](const xAOD::Vertex * vtx) { return (vtx->vertexType() != xAOD::VxType::NoVtx);}; - //find last non-dummy vertex; note *usually* there is only one (or maybe zero) - auto findVtx = std::find_if(stdVertexContainer.rbegin(), stdVertexContainer.rend(), predicate); - pvtx= (findVtx==stdVertexContainer.rend()) ? nullptr: *findVtx; - /** - for (const auto &vtx : pvertex->stdcont()) { - if (vtx->vertexType() == xAOD::VxType::NoVtx) { - continue; // skip dummy vertex - } - pvtx = vtx; - }**/ + ATH_MSG_DEBUG("Number of vertices retrieved for this event " << pvertex->size()); + const auto& stdVertexContainer = pvertex->stdcont(); + // find last non-dummy vertex; note *usually* there is only one (or maybe zero) + auto findVtx = std::find_if(stdVertexContainer.rbegin(), stdVertexContainer.rend(), acceptVertex); + pvtx = (findVtx == stdVertexContainer.rend()) ? nullptr : *findVtx; m_monPlots->fill(*pvertex); } else { ATH_MSG_WARNING("Skipping vertexing plots."); } ATH_MSG_DEBUG("Filling vertex/event info monitoring plots"); - const xAOD::EventInfo *pei = getContainer<xAOD::EventInfo>(m_eventInfoContainerName); + const xAOD::EventInfo* pei = getContainer<xAOD::EventInfo>(m_eventInfoContainerName); if (pei and pvertex) { - m_monPlots->fill(*pvertex, *pei); + m_monPlots->fill(*pvertex, *pei); } else { - ATH_MSG_WARNING( - "Skipping vertexing plots using EventInfo."); + ATH_MSG_WARNING("Skipping vertexing plots using EventInfo."); } // get truth vertex container name - m_truthVertexContainerName - const xAOD::TruthVertexContainer *truthVrt = getContainer<xAOD::TruthVertexContainer>(m_truthVertexContainerName); - const xAOD::TruthVertex *truthVertex = 0; + const xAOD::TruthVertexContainer* truthVrt = getContainer<xAOD::TruthVertexContainer>(m_truthVertexContainerName); + const xAOD::TruthVertex* truthVertex = 0; if (truthVrt) { if (!m_TrkSelectPV) { ATH_MSG_VERBOSE("size of TruthVertex container = " << truthVrt->size()); } - - for (const auto &vtx : truthVrt->stdcont()) { - if (!m_TrkSelectPV) { - // ATH_MSG_INFO("TruthVertex XYZ = " << vtx->x() << "," << vtx->y() << "," << vtx->z()); - } - float vrtR = std::sqrt(vtx->x() * vtx->x() + vtx->y() * vtx->y()); - if (vrtR > 1 || std::abs(vtx->z()) > 500) { - continue; - } - truthVertex = vtx; - } - }else { + const auto& stdVertexContainer = truthVrt->stdcont(); + auto findVtx = std::find_if(stdVertexContainer.rbegin(), stdVertexContainer.rend(), acceptTruthVertex); + truthVertex = (findVtx == stdVertexContainer.rend()) ? nullptr : *findVtx; + } else { ATH_MSG_WARNING("Cannot open " << m_truthVertexContainerName << " truth vertex container"); } - + if (not truthVertex) ATH_MSG_INFO ("Truth vertex did not pass cuts"); unsigned int num_truth_selected(0), nSelectedTracks(0), num_truthmatch_match(0); - // the truth matching probability must not be <= 0., otherwise the tool will seg fault in case of missing truth (e.g. // data): const float minProbEffLow(0.50); // if the probability of a match is less than this, we call it a fake @@ -239,7 +281,7 @@ InDetPhysValMonitoringTool::fillHistograms() { // or is a duplicate // VJ - Mar 14, 2016 - even for effs, use 0.51 const float minProbEffHigh(0.5); // if the probability of a match is higher than this, it either feeds the NUM or is - // a duplicate + // a duplicate // check if we are doing track selection relative to PV (or the default, which is the Beam Spot) if (!m_TrkSelectPV) { @@ -249,16 +291,18 @@ InDetPhysValMonitoringTool::fillHistograms() { bool fillVtx = true; // fill PV plots in fillSpectrum only once // Main track loop, filling Track-only, Track 'n' Truth with good matching probability (meas, res, & pull), and Fakes - std::vector<int> incTrkNum = {0,0,0}; + std::vector<int> incTrkNum = { + 0, 0, 0 + }; m_truthSelectionTool->clearCounters(); - //dummy variables + // dummy variables int base(0), hasTruth(0), hashighprob(0), passtruthsel(0); - - for (const auto &thisTrack: *ptracks) { + + for (const auto& thisTrack: *ptracks) { m_monPlots->fillSpectrum(*thisTrack); // This one needs prob anyway, why not rearrange & eliminate // getMatchingProbability from RttPlots? 5-17-16 - const xAOD::TruthParticle *associatedTruth = getAsTruth.getTruth(thisTrack); + const xAOD::TruthParticle* associatedTruth = getAsTruth.getTruth(thisTrack); float prob = getMatchingProbability(*thisTrack); if (!m_TrkSelectPV && truthVertex) { m_monPlots->fillSpectrum(*thisTrack, *truthVertex); @@ -279,14 +323,18 @@ InDetPhysValMonitoringTool::fillHistograms() { ++nSelectedTracks; // increment number of selected tracks m_monPlots->fill(*thisTrack); // Make all the plots requiring only // trackParticle - const float absTrackEta = (thisTrack->pt() >1e-7) ? std::abs(thisTrack->eta()) : std::nan(""); - if(absTrackEta < 2.7) ++incTrkNum[0]; - else if(absTrackEta >= 2.7 && absTrackEta < 3.5) ++incTrkNum[1]; - else ++incTrkNum[2]; + // const float absTrackEta = (thisTrack->pt() >1e-7) ? std::abs(thisTrack->eta()) : std::nan(""); + const float absTrackEta = std::abs(safelyGetEta(thisTrack)); + const unsigned int idx = binIndex(absTrackEta, ETA_PARTITIONS); + if (idx < incTrkNum.size()) { + ++incTrkNum[idx]; + } // This is where the BMR, Fake, and Really Fake fillers need to go. float BMR_w(0), RF_w(0); // weights for filling the Bad Match & Fake Rate plots - float Prim_w(0), Sec_w(0), Unlinked_w(0); //weights for the fake plots + float Prim_w(0), Sec_w(0), Unlinked_w(0); // weights for the fake plots + + if (associatedTruth) m_monPlots->track_vs_truth(*thisTrack, *associatedTruth, prob); if (prob < minProbEffHigh) { BMR_w = 1; @@ -299,127 +347,182 @@ InDetPhysValMonitoringTool::fillHistograms() { if (!associatedTruth) { m_monPlots->fillSpectrumUnlinked2(*thisTrack); - Unlinked_w = 1; //Unlinked, set weight to 1 + Unlinked_w = 1; // Unlinked, set weight to 1 } base += 1; if (associatedTruth) { hasTruth += 1; - if ((prob < minProbEffLow) and (not std::isnan(prob))) { + if (prob < minProbEffLow) { // nan will also fail this test const bool isFake = (prob < minProbEffLow); m_monPlots->fillFakeRate(*thisTrack, isFake); - if((associatedTruth->barcode() < 200e3) and (associatedTruth->barcode() != 0)) Prim_w = 1; //Fake Primary, set weight to 1 - if(associatedTruth->barcode() >= 200e3) Sec_w = 1; //Fake Secondary, set weight to 1 + if ((associatedTruth->barcode() < 200e3)and(associatedTruth->barcode() != 0)) { + Prim_w = 1; // Fake Primary, set weight to 1 + } + if (associatedTruth->barcode() >= 200e3) { + Sec_w = 1; // Fake Secondary, set weight to 1 + } + } + if (prob > minProbEffLow) { + hashighprob += 1; + } + if (m_truthSelectionTool->accept(associatedTruth)) { + passtruthsel += 1; } - if (prob > minProbEffLow) hashighprob += 1; - if (m_truthSelectionTool->accept(associatedTruth)) passtruthsel += 1; if ((prob > minProbEffLow) and m_truthSelectionTool->accept(associatedTruth)) { m_monPlots->fill(*thisTrack, *associatedTruth); // Make all plots requiring both truth & track (meas, res, & // pull) } - } - + m_monPlots->fillLinkedandUnlinked(*thisTrack, Prim_w, Sec_w, Unlinked_w); } ATH_MSG_DEBUG(m_truthSelectionTool->str()); - const auto & tmp=m_truthSelectionTool->counters(); //get array of counters for the cuts + const auto& tmp = m_truthSelectionTool->counters(); // get array of counters for the cuts unsigned idx(0); - for (auto & i:m_truthCutCounters){ - i+=tmp[idx++]; //i=sum of all the individual counters on each cut. + for (auto& i:m_truthCutCounters) { + i += tmp[idx++]; // i=sum of all the individual counters on each cut. } int nTruths(0), nInsideOut(0), nOutsideIn(0); - std::vector<int> incTrkDenom = {0,0,0}; - - const char * debugBacktracking = std::getenv("BACKTRACKDEBUG"); + std::vector<int> incTrkDenom = { + 0, 0, 0 + }; // This is the beginning of the Nested Loop, built mainly for the Efficiency Plots - if (debugBacktracking){ - std::cout<<"Start of new nested loop event ------------------------------------------------ \n"; + if (debugBacktracking) { + std::cout << "Start of new nested loop event ------------------------------------------------ \n"; } - + // preselect tracks to do efficiency calculation + std::vector<const xAOD::TrackParticle*> selectedTracks {}; + selectedTracks.reserve(ptracks->size()); + for (const auto& thisTrack: *ptracks) { + if (m_useTrackSelection and not (m_trackSelectionTool->accept(*thisTrack, pvtx))) { + continue; + } + const bool insideOut = isInsideOut(*thisTrack); + if (insideOut) { + nInsideOut += 1; + } else { + nOutsideIn += 1; + } + if (m_onlyInsideOutTracks and(not insideOut)) { + continue; + } + selectedTracks.push_back(thisTrack); + } + ATH_MSG_DEBUG("Starting nested loop efficiency calculation"); for (int itruth = 0; itruth < (int) truthParticlesVec.size(); itruth++) { // Outer loop over all truth particles nTruths += 1; - const xAOD::TruthParticle *thisTruth = truthParticlesVec[itruth]; + const xAOD::TruthParticle* thisTruth = truthParticlesVec[itruth]; m_monPlots->fillSpectrum(*thisTruth); + + if (thisTruth->pdgId() == 22) { + if (thisTruth->nParents() == 0) { + m_monPlots->prim_photon_fill(*thisTruth); + } else { + m_monPlots->brem_photon_fill(*thisTruth); + } + } + const bool accept = m_truthSelectionTool->accept(thisTruth); if (accept) { ++m_truthCounter; // total number of truth tracks which pass cuts ++num_truth_selected; // total number of truth which pass cuts per event - const float absTruthEta=(thisTruth->pt() >0.1) ? std::abs(thisTruth->eta()) : std::nan(""); - if(absTruthEta < 2.7) ++incTrkDenom[0]; - else if(absTruthEta >= 2.7 && absTruthEta < 3.5) ++incTrkDenom[1]; - else ++incTrkDenom[2]; + const float absTruthEta = std::abs(safelyGetEta(thisTruth)); + const unsigned int idx = binIndex(absTruthEta, ETA_PARTITIONS); + if (idx < incTrkNum.size()) { + ++incTrkNum[idx]; + } + // LMTODO add this Jain/Swift - float PF_w(1); // weight for the trackeff histos - float bestMatch = 0; - std::vector <std::pair<float, const xAOD::TrackParticle *> > prospects; // Vector of pairs: - // <truth_matching_probability, track> if - // prob > minProbEffLow (0.5) - - double lepton_w(0); - if(debugBacktracking){ - std::cout<<"Rey: these are the numbers for this truthParticle \n"; - std::cout<<"Barcode: "<<thisTruth->barcode()<<"\n"; - std::cout<<"PDGId: "<<thisTruth->pdgId()<<"\n"; - std::cout<<"Number of Parents: "<<thisTruth->nParents()<<"\n"; + bool addsToEfficiency(true); // weight for the trackeff histos - if(thisTruth->hasProdVtx()){ - const xAOD::TruthVertex *vtx = thisTruth->prodVtx(); + if (debugBacktracking) { + float lepton_w(0); + std::cout << "Barcode: " << thisTruth->barcode() << "\n"; + std::cout << "PDGId: " << thisTruth->pdgId() << "\n"; + std::cout << "Number of Parents: " << thisTruth->nParents() << "\n"; + + if (thisTruth->hasProdVtx()) { + const xAOD::TruthVertex* vtx = thisTruth->prodVtx(); double prod_rad = vtx->perp(); double prod_z = vtx->z(); - std::cout<<"Vertex Radial Position: "<<prod_rad<<"\n"; - std::cout<<"Vertex z Position: "<<prod_z<<"\n"; + std::cout << "Vertex Radial Position: " << prod_rad << "\n"; + std::cout << "Vertex z Position: " << prod_z << "\n"; } double Px = thisTruth->px(); double Py = thisTruth->py(); - std::cout<<"Px: "<<Px<<"\n"; - std::cout<<"Py: "<<Py<<"\n"; - std::cout<<"Pz: "<<thisTruth->pz()<<"\n"; - - if(thisTruth->absPdgId() == 11){ - double Pt = std::sqrt((Px * Px) + (Py * Py)); - if(Pt < 3000){ + std::cout << "Px: " << Px << "\n"; + std::cout << "Py: " << Py << "\n"; + std::cout << "Pz: " << thisTruth->pz() << "\n"; + constexpr int electronId = 11; + if (thisTruth->absPdgId() == electronId) { + double PtSquared = (Px * Px) + (Py * Py); + if (PtSquared < 9000000) { lepton_w = 1; } } + m_monPlots->lepton_fill(*thisTruth, lepton_w); }// end of debugging backtracking section - m_monPlots->lepton_fill(*thisTruth, lepton_w); - - for (const auto &thisTrack: *ptracks) { // Inner loop over all track particle - //filter tracks - if (m_useTrackSelection and not(m_trackSelectionTool->accept(*thisTrack, pvtx))) { - continue; - } + if(debugBacktracking){ + if(thisTruth->hasProdVtx()){ + const xAOD::TruthVertex* vtx = thisTruth->prodVtx(); + double prod_rad = vtx->perp(); + if(prod_rad < 300){ + double min_dR = 10; + float bestmatch = 0; + double best_inverse_delta_pt(0); + double inverse_delta_pt(0); + for(const auto& thisTrack: selectedTracks){ + float prob(0); + if((thisTrack->qOverP()) * (thisTruth->auxdata<float>("qOverP")) > 0){ + prob = getMatchingProbability(*thisTrack); + double track_theta = thisTrack->theta(); + double truth_theta = thisTruth->auxdata< float >("theta"); + double truth_eta = thisTruth->eta(); + double track_eta = -std::log(std::tan(track_theta/2)); + + double track_pt = thisTrack->pt() * 0.001; + double truth_pt = thisTruth->pt() * 0.001; + + if((track_pt != 0) and (truth_pt != 0)) inverse_delta_pt = ((1./track_pt) - (1./truth_pt)); + + double delta_eta = track_eta - truth_eta; + double delta_theta = track_theta - truth_theta; + double delta_R = sqrt(delta_eta * delta_eta + delta_theta * delta_theta); + if(min_dR > delta_R) min_dR = delta_R; + } + if(prob >= bestmatch) best_inverse_delta_pt = inverse_delta_pt; + bestmatch = std::max(prob, bestmatch); + } + m_monPlots->minDR(min_dR, prod_rad, bestmatch, best_inverse_delta_pt); + } + } + } - if(itruth == 1){ - if(isInsideOut(*thisTrack)){ - nInsideOut += 1; - }else{ - nOutsideIn += 1; - } - } - if (m_onlyInsideOutTracks and(not isInsideOut(*thisTrack))) { - continue; // not an inside-out track - } - const xAOD::TruthParticle *associatedTruth = getAsTruth.getTruth(thisTrack); + std::vector <std::pair<float, const xAOD::TrackParticle*> > matches; // Vector of pairs: + // <truth_matching_probability, track> if + // prob > minProbEffLow (0.5) + float bestMatch = 0; + for (const auto& thisTrack: selectedTracks) { // Inner loop over selected track particles + const xAOD::TruthParticle* associatedTruth = getAsTruth.getTruth(thisTrack); if (associatedTruth && associatedTruth == thisTruth) { float prob = getMatchingProbability(*thisTrack); if (not std::isnan(prob)) { bestMatch = std::max(prob, bestMatch); if (prob > minProbEffLow) { - prospects.push_back(std::make_pair(prob, thisTrack)); + matches.push_back(std::make_pair(prob, thisTrack)); } const bool isFake = (prob < minProbEffLow); m_monPlots->fillFakeRate(*thisTrack, isFake); } } } - + // count number of prospects and increment entry in vector for this event - int deg_count = prospects.size(); + int deg_count = matches.size(); if (deg_count <= 4) { ++m_prospectsMatched[deg_count]; } else { @@ -428,10 +531,10 @@ InDetPhysValMonitoringTool::fillHistograms() { // special histograms for 1 or 2 matched tracks if (deg_count == 1) { - m_monPlots->fillSingleMatch(*prospects.at(0).second); + m_monPlots->fillSingleMatch(*matches.at(0).second); } else if (deg_count == 2) { - m_monPlots->fillTwoMatchDuplicate(prospects[1].first, prospects[0].first, - *prospects[1].second, *prospects[0].second, + m_monPlots->fillTwoMatchDuplicate(matches[1].first, matches[0].first, + *matches[1].second, *matches[0].second, *thisTruth); } // determine how many duplicate match probabilities @@ -439,15 +542,17 @@ InDetPhysValMonitoringTool::fillHistograms() { if (deg_count > 1) { std::vector<float> probs; for (int i = 0; i < deg_count; i++) { - probs.push_back(prospects[i].first); + probs.push_back(matches[i].first); } - std::sort(prospects.begin(), prospects.end(), sortProspects); + std::sort(matches.begin(), matches.end(), sortProspects); // count duplicates - float prev = prospects[0].first; + float prev = matches[0].first; int nduplicates = 0; - const std::array<int *,5> matchedEProbs={nullptr, nullptr, &m_twoMatchedEProb, &m_threeMatchedEProb, &m_fourMatchedEProb}; + const std::array<int*, 5> matchedEProbs = { + nullptr, nullptr, &m_twoMatchedEProb, &m_threeMatchedEProb, &m_fourMatchedEProb + }; for (int i = 1; i < deg_count; i++) { - bool duplicate = std::fabs(prospects[i].first - prev) < 1.e-9; + bool duplicate = std::fabs(matches[i].first - prev) < 1.e-9; if (duplicate) { ++nduplicates; } @@ -456,55 +561,53 @@ InDetPhysValMonitoringTool::fillHistograms() { (*(matchedEProbs[deg_count]))++; } nduplicates = 0; - prev = prospects[i].first; + prev = matches[i].first; } } } - //if (prospects.empty()) ATH_MSG_WARNING("Called 'back' on empty container!"); - //auto thisProspect=prospects.back(); - + // fill truth-only plots - if (bestMatch >= minProbEffHigh) { ++num_truthmatch_match; - const xAOD::TruthParticle *associatedTruth = prospects.empty()? nullptr : getAsTruth.getTruth(prospects.back().second); + const xAOD::TruthParticle* associatedTruth = matches.empty() ? nullptr : getAsTruth.getTruth( + matches.back().second); if (!associatedTruth) { continue; } m_monPlots->fill(*associatedTruth); // This is filling truth-only plots: m_TrackTruthInfoPlots - }else { - PF_w = 0; + } else { + addsToEfficiency = false; } - - m_monPlots->pro_fill(*thisTruth, PF_w); + + m_monPlots->fillEfficiency(*thisTruth, addsToEfficiency); } // end of the "if(accept)" loop }// End of Big truthParticle loop ATH_MSG_DEBUG("End of efficiency calculation"); - + if (m_useTrackSelection) { - for (const auto &thisTrack: *ptracks) { // Inner loop over all track particle + for (const auto& thisTrack: *ptracks) { // Inner loop over all track particle if (m_useTrackSelection) { Root::TAccept trackAccept = m_trackSelectionTool->accept(*thisTrack, pvtx); fillTrackCutFlow(trackAccept); } } } - + if (num_truthmatch_match == 0) { ATH_MSG_INFO("NO TRACKS had associated truth."); } else { ATH_MSG_DEBUG(num_truthmatch_match << " tracks out of " << ptracks->size() << " had associated truth."); } - m_monPlots->fillIncTrkRate(nMuEvents,incTrkNum,incTrkDenom); + m_monPlots->fillIncTrkRate(nMuEvents, incTrkNum, incTrkDenom); m_monPlots->fillCounter(nSelectedTracks, InDetPerfPlot_nTracks::SELECTED); m_monPlots->fillCounter(ptracks->size(), InDetPerfPlot_nTracks::ALL); m_monPlots->fillCounter(truthParticlesVec.size(), InDetPerfPlot_nTracks::TRUTH); m_monPlots->fillCounter(num_truthmatch_match, InDetPerfPlot_nTracks::TRUTH_MATCHED); - //Tracking In Dense Environment + // Tracking In Dense Environment if (m_fillTIDEPlots && !m_jetContainerName.empty()) { - return doJetPlots(ptracks,getAsTruth, pvtx); + return doJetPlots(ptracks, getAsTruth, pvtx); } // if TIDE - //ATH_MSG_INFO(getTruth.report()); + // ATH_MSG_INFO(getTruth.report()); return StatusCode::SUCCESS; } @@ -517,6 +620,13 @@ InDetPhysValMonitoringTool::bookHistograms() { for (auto hist : hists) { ATH_CHECK(regHist(hist.first, hist.second, all)); // ?? } + // do the same for Efficiencies, but there's a twist: + std::vector<EfficiencyData> effs = m_monPlots->retrieveBookedEfficiencies(); + for (auto& eff : effs) { + // reg**** in the monitoring baseclass doesnt have a TEff version, but TGraph * + // pointers just get passed through, so we use that method after an ugly cast + ATH_CHECK(regGraph(reinterpret_cast<TGraph*>(eff.first), eff.second, all)); // ?? + } return StatusCode::SUCCESS; } @@ -533,15 +643,16 @@ InDetPhysValMonitoringTool::procHistograms() { ATH_MSG_INFO(" number with five+ matched reco = " << m_prospectsMatched[5]); ATH_MSG_INFO(" total number of truth particles which pass cuts = " << m_truthCounter); ATH_MSG_INFO( - " total number of truth particles which pass and match a reco track (including duplicates) = " << m_prospectsMatched[1] + - m_prospectsMatched[2] + m_prospectsMatched[3] + m_prospectsMatched[4] + m_prospectsMatched[5]); + " total number of truth particles which pass and match a reco track (including duplicates) = " << + m_prospectsMatched[1] + + m_prospectsMatched[2] + m_prospectsMatched[3] + m_prospectsMatched[4] + m_prospectsMatched[5]); ATH_MSG_INFO(" number zero matched reco = " << m_prospectsMatched[0]); ATH_MSG_INFO( " total number of truth tracks, which have more than one matching reco track = " << m_prospectsMatched[2] + - m_prospectsMatched[3] + m_prospectsMatched[4] + m_prospectsMatched[5]); + m_prospectsMatched[3] + m_prospectsMatched[4] + m_prospectsMatched[5]); ATH_MSG_INFO( " total number of truth tracks, which have more than one matching reco and atleast one duplicate mc_probability = " << m_twoMatchedEProb + m_threeMatchedEProb + - m_fourMatchedEProb); + m_fourMatchedEProb); if (m_useTrackSelection) { ATH_MSG_INFO(""); ATH_MSG_INFO("Now Cutflow for track cuts:"); @@ -554,7 +665,7 @@ InDetPhysValMonitoringTool::procHistograms() { ATH_MSG_INFO(""); ATH_MSG_INFO("Cutflow for truth tracks:"); unsigned int idx(0); - for (const auto & cutName:m_truthSelectionTool->names()) { + for (const auto& cutName:m_truthSelectionTool->names()) { ATH_MSG_INFO("number after " << cutName << ": " << m_truthCutCounters[idx++]); } if (endOfRunFlag()) { @@ -564,47 +675,54 @@ InDetPhysValMonitoringTool::procHistograms() { return StatusCode::SUCCESS; } -const std::vector<const xAOD::TruthParticle *> +const std::vector<const xAOD::TruthParticle*> InDetPhysValMonitoringTool::getTruthParticles() { - //truthParticles.clear(); - std::vector<const xAOD::TruthParticle *> tempVec{}; + // truthParticles.clear(); + std::vector<const xAOD::TruthParticle*> tempVec {}; + if (m_truthParticleName.empty()) { + return tempVec; + } if (m_pileupSwitch == "All") { - std::string m_truthContainerName = "TruthParticles"; - const xAOD::TruthParticleContainer *truthParticleContainer = + const xAOD::TruthParticleContainer* truthParticleContainer = (!m_truthParticleName.empty() ? getContainer<xAOD::TruthParticleContainer>(m_truthParticleName) : nullptr); - if (not truthParticleContainer) return tempVec; + if (not truthParticleContainer) { + return tempVec; + } tempVec.insert(tempVec.begin(), truthParticleContainer->begin(), truthParticleContainer->end()); } else { if (m_pileupSwitch == "HardScatter") { // get truthevent container to separate out pileup and hardscatter truth particles - const xAOD::TruthEventContainer *truthEventContainer = nullptr; + const xAOD::TruthEventContainer* truthEventContainer = nullptr; const std::string truthEventCollName = evtStore()->contains<xAOD::TruthEventContainer>("TruthEvents") ? "TruthEvents" : "TruthEvent"; evtStore()->retrieve(truthEventContainer, truthEventCollName); - const xAOD::TruthEvent * event = truthEventContainer->at(0); - const auto & links= event->truthParticleLinks(); + const xAOD::TruthEvent* event = (truthEventContainer) ? truthEventContainer->at(0) : nullptr; + if (not event) { + return tempVec; + } + const auto& links = event->truthParticleLinks(); tempVec.reserve(event->nTruthParticles()); - for( const auto& link : links ) { + for (const auto& link : links) { tempVec.push_back(*link); } - }else if (m_pileupSwitch == "PileUp") { + } else if (m_pileupSwitch == "PileUp") { ATH_MSG_VERBOSE("getting TruthPileupEvents container"); // get truth particles from all pileup events - const xAOD::TruthPileupEventContainer *truthPileupEventContainer = nullptr; + const xAOD::TruthPileupEventContainer* truthPileupEventContainer = nullptr; const std::string truthPUEventCollName = evtStore()->contains<xAOD::TruthPileupEventContainer>("TruthPileupEvents") ? "TruthPileupEvents" : "TruthPileupEvent"; evtStore()->retrieve(truthPileupEventContainer, truthPUEventCollName); if (truthPileupEventContainer) { - const unsigned int nPileup= truthPileupEventContainer->size(); - tempVec.reserve(nPileup*200); //quick initial guess, will still save some time + const unsigned int nPileup = truthPileupEventContainer->size(); + tempVec.reserve(nPileup * 200); // quick initial guess, will still save some time for (unsigned int i(0); i != nPileup; ++i) { auto eventPileup = truthPileupEventContainer->at(i); // get truth particles from each pileup event int ntruth = eventPileup->nTruthParticles(); ATH_MSG_VERBOSE("Adding " << ntruth << " truth particles from TruthPileupEvents container"); - const auto & links=eventPileup->truthParticleLinks(); - for( const auto& link : links ) { + const auto& links = eventPileup->truthParticleLinks(); + for (const auto& link : links) { tempVec.push_back(*link); } } @@ -619,15 +737,14 @@ InDetPhysValMonitoringTool::getTruthParticles() { } void -InDetPhysValMonitoringTool::fillTrackCutFlow(Root::TAccept &accept) { +InDetPhysValMonitoringTool::fillTrackCutFlow(Root::TAccept& accept) { fillCutFlow(accept, m_trackCutflowNames, m_trackCutflow); return; } - void -InDetPhysValMonitoringTool::fillCutFlow(Root::TAccept &accept, std::vector<std::string> &names, - std::vector<int> &cutFlow) { +InDetPhysValMonitoringTool::fillCutFlow(Root::TAccept& accept, std::vector<std::string>& names, + std::vector<int>& cutFlow) { // initialise cutflows if (cutFlow.empty()) { names.push_back("preCut"); @@ -645,7 +762,7 @@ InDetPhysValMonitoringTool::fillCutFlow(Root::TAccept &accept, std::vector<std:: continue; } if (accept.getCutResult(i)) { - cutFlow[i + 1] +=1; + cutFlow[i + 1] += 1; } else { cutPositive = false; } @@ -654,18 +771,19 @@ InDetPhysValMonitoringTool::fillCutFlow(Root::TAccept &accept, std::vector<std:: } StatusCode -InDetPhysValMonitoringTool::doJetPlots(const xAOD::TrackParticleContainer * ptracks, - IDPVM::CachedGetAssocTruth & getAsTruth, - const xAOD::Vertex * primaryVtx){ - const xAOD::JetContainer *jets = getContainer<xAOD::JetContainer>(m_jetContainerName); - const xAOD::TruthParticleContainer *truthParticles = getContainer<xAOD::TruthParticleContainer>("TruthParticles"); - const float minProbEffHigh=0.5; +InDetPhysValMonitoringTool::doJetPlots(const xAOD::TrackParticleContainer* ptracks, + IDPVM::CachedGetAssocTruth& getAsTruth, + const xAOD::Vertex* primaryVtx) { + const xAOD::JetContainer* jets = getContainer<xAOD::JetContainer>(m_jetContainerName); + const xAOD::TruthParticleContainer* truthParticles = getContainer<xAOD::TruthParticleContainer>("TruthParticles"); + const float minProbEffHigh = 0.5; + if (!jets || !truthParticles) { ATH_MSG_WARNING( "Cannot open " << m_jetContainerName << - " jet container or TruthParticles truth particle container. Skipping jet plots."); + " jet container or TruthParticles truth particle container. Skipping jet plots."); } else { - for (const auto &thisJet: *jets) { // The big jets loop + for (const auto& thisJet: *jets) { // The big jets loop if (not passJetCuts(*thisJet)) { continue; } @@ -690,25 +808,26 @@ InDetPhysValMonitoringTool::doJetPlots(const xAOD::TrackParticleContainer * ptra } m_monPlots->jet_fill(*thisTrack, *thisJet, trkInJet_w); // fill trkinjeteff plots m_monPlots->jetBMR(*thisTrack, *thisJet, trkInJet_BMR); // fin in track in jet bad - m_monPlots->fillSimpleJetPlots(*thisTrack, prob); // Fill all the // match rate plots - // simple jet plots - const xAOD::TruthParticle *associatedTruth = getAsTruth.getTruth(thisTrack); // for this track + m_monPlots->fillSimpleJetPlots(*thisTrack, prob); // Fill all the + + const xAOD::TruthParticle* associatedTruth = getAsTruth.getTruth(thisTrack); // + if (associatedTruth) { - m_monPlots->fillJetResPlots(*thisTrack, *associatedTruth, *thisJet); // Fill jet pull & - // resolution plots + m_monPlots->fillJetResPlots(*thisTrack, *associatedTruth, *thisJet); // Fill jet pull & + // resolution plots int barcode = associatedTruth->barcode(); - m_monPlots->fillJetHitsPlots(*thisTrack, prob, barcode); // Fill the two extra - // plots - if (m_truthSelectionTool->accept(associatedTruth)) { // Fill the Jet plots with - // "Eff" in the name + m_monPlots->fillJetHitsPlots(*thisTrack, prob, barcode); // Fill the two extra + // plots + if (m_truthSelectionTool->accept(associatedTruth)) { // Fill the Jet plots with + // "Eff" in the name m_monPlots->fillJetEffPlots(*associatedTruth, *thisJet); } - } + } } } // end of track loop - // fill in things like sum jet pT in dR bins - need all tracks in the jet first + // fill in things like sum jet pT in dR bins - need all tracks in the jet first m_monPlots->fillJetPlotCounter(*thisJet); - for (const auto &thisTruth: *truthParticles) { + for (const auto& thisTruth: *truthParticles) { // for primary tracks we want an efficiency as a function of track jet dR if ((m_truthSelectionTool->accept(thisTruth) and(thisJet->p4().DeltaR(thisTruth->p4()) < m_maxTrkJetDR))) { m_monPlots->fillJetTrkTruth(*thisTruth, *thisJet); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringUtilities.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringUtilities.h new file mode 100644 index 0000000000000000000000000000000000000000..f1f80d944c710da09e3c6c315808253c0c6b0865 --- /dev/null +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValMonitoringUtilities.h @@ -0,0 +1,67 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef INDETPHYSVALMONITORINGUTILITIES +#define INDETPHYSVALMONITORINGUTILITIES +/** + * @file InDetPhysValMonitoringUtilities.h + * @author shaun roe + * Header for generic utilities in the InDetPhysValMonitoring package + **/ + + #include <cmath> + #include <vector> +namespace IDPVM { + ///Convert to GeV from the default MeV + constexpr float + operator "" _GeV (long double energy) { + return energy * 0.001; + } + + constexpr float + operator "" _GeV (unsigned long long energy) { + return energy * 0.001; + } + + ///general utility function to check value is in range + template <class T> + inline bool + inRange(const T& value, const T& minVal, const T& maxVal) { + return not ((value < minVal)or(value > maxVal)); + } + + template<class T> + inline bool + inRange(const T& value, const T& absoluteMax) { + return not (std::abs(value) > absoluteMax); + } + + ///general utility function to return bin index given a value and the upper endpoints of each bin + template <class T> + unsigned int + binIndex(const T& val, const std::vector<T>& partitions) {// signature should allow other containers + unsigned int i(0); + bool nf = true; + + while (nf and i != partitions.size()) { + nf = (val > partitions[i++]); + } + return nf ? i : i - 1; + } + + ///Safely get eta + template <class T> + inline float + safelyGetEta(const T& pTrk, const float safePtThreshold = 0.1) { + return (pTrk.pt() > safePtThreshold) ? (pTrk.eta()) : std::nan(""); + } + + template <class T> + inline float + safelyGetEta(const T* pTrk, const float safePtThreshold = 0.1) { + return (pTrk->pt() > safePtThreshold) ? (pTrk->eta()) : std::nan(""); + } +} + + #endif \ No newline at end of file diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorTool.cxx index 73587692a79cb09d4143b08123b0628af9a918fd..866765e01c062dbf863ba6cf67cd11df07ab910f 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorTool.cxx @@ -27,8 +27,8 @@ -InDetPhysValTruthDecoratorTool::InDetPhysValTruthDecoratorTool(const std::string &type, const std::string &name, - const IInterface *parent) : +InDetPhysValTruthDecoratorTool::InDetPhysValTruthDecoratorTool(const std::string& type, const std::string& name, + const IInterface* parent) : AthAlgTool(type, name, parent), m_extrapolator("Trk::Extrapolator/AtlasExtrapolator"), m_beamSpotSvc("BeamCondSvc", name) { @@ -60,7 +60,7 @@ InDetPhysValTruthDecoratorTool::finalize() { } bool -InDetPhysValTruthDecoratorTool::decorateTruth(const xAOD::TruthParticle &particle, const std::string &prefix) { +InDetPhysValTruthDecoratorTool::decorateTruth(const xAOD::TruthParticle& particle, const std::string& prefix) { ATH_MSG_VERBOSE("Decorate truth with d0 etc"); if (particle.isNeutral()) { return false; @@ -75,7 +75,7 @@ InDetPhysValTruthDecoratorTool::decorateTruth(const xAOD::TruthParticle &particl } static bool errorEmitted(false); - const xAOD::TruthVertex *ptruthVertex(0); + const xAOD::TruthVertex* ptruthVertex(0); try{ ptruthVertex = particle.prodVtx(); } catch (std::exception e) { @@ -99,7 +99,7 @@ InDetPhysValTruthDecoratorTool::decorateTruth(const xAOD::TruthParticle &particl Trk::PerigeeSurface persf(m_beamSpotSvc->beamPos()); - const Trk::TrackParameters *tP = m_extrapolator->extrapolate(cParameters, persf, Trk::anyDirection, false); + const Trk::TrackParameters* tP = m_extrapolator->extrapolate(cParameters, persf, Trk::anyDirection, false); if (tP) { float d0_truth = tP->parameters()[Trk::d0]; float theta_truth = tP->parameters()[Trk::theta]; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorTool.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorTool.h index 58925b737f637999c81c113e3df9364aa4f0deae..fde409fedd94f9ce57ec80e3731e48612c0b8bfe 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorTool.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPhysValTruthDecoratorTool.h @@ -23,12 +23,12 @@ class IBeamCondSvc; // class to decorate xAOD::TruthParticles with additional information required by validation class InDetPhysValTruthDecoratorTool: virtual public IInDetPhysValDecoratorTool, public AthAlgTool { public: - InDetPhysValTruthDecoratorTool(const std::string &type, const std::string &name, const IInterface *parent); + InDetPhysValTruthDecoratorTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~InDetPhysValTruthDecoratorTool (); virtual StatusCode initialize(); virtual StatusCode finalize(); - virtual bool decorateTruth(const xAOD::TruthParticle &particle, const std::string &prefix); + virtual bool decorateTruth(const xAOD::TruthParticle& particle, const std::string& prefix); private: ToolHandle<Trk::IExtrapolator> m_extrapolator; ServiceHandle<IBeamCondSvc> m_beamSpotSvc; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.cxx index 40676ca823d6c053eac454e6ac5ffc29b3540db4..02935038eed4dd57ab8bbace0a21cf0f06cb26b5 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.cxx @@ -21,29 +21,29 @@ namespace { bool - validArguments(const float arg){ + validArguments(const float arg) { return not (std::isnan(arg)); - } + } + bool - validArguments(const float arg, const float arg2){ + validArguments(const float arg, const float arg2) { return not (std::isnan(arg) or std::isnan(arg2)); - } - + } + bool - validArguments(const float arg, const float arg2, const float arg3){ + validArguments(const float arg, const float arg2, const float arg3) { return not (std::isnan(arg) or std::isnan(arg2) or std::isnan(arg3)); } - } -InDetPlotBase::InDetPlotBase(InDetPlotBase *pParent, const std::string &dirName) : +InDetPlotBase::InDetPlotBase(InDetPlotBase* pParent, const std::string& dirName) : PlotBase(pParent, dirName), m_msg("InDetPlotBase"), m_histoDefSvc(nullptr) { // nop } void -InDetPlotBase::book(TH1 * &pHisto, const SingleHistogramDefinition &hd) { +InDetPlotBase::book(TH1*& pHisto, const SingleHistogramDefinition& hd) { if (hd.isValid()) { pHisto = Book1D(hd.name, hd.allTitles, hd.nBinsX, hd.xAxis.first, hd.xAxis.second, false); } @@ -51,16 +51,16 @@ InDetPlotBase::book(TH1 * &pHisto, const SingleHistogramDefinition &hd) { } void -InDetPlotBase::book(TProfile * &pHisto, const SingleHistogramDefinition &hd) { +InDetPlotBase::book(TProfile*& pHisto, const SingleHistogramDefinition& hd) { if (hd.isValid()) { - pHisto = BookTProfile(hd.name, hd.allTitles, hd.nBinsX, hd.xAxis.first, hd.xAxis.second, hd.yAxis.first, - hd.yAxis.second, false); + pHisto = BookTProfile(hd.name, hd.allTitles, hd.nBinsX, hd.xAxis.first, hd.xAxis.second, hd.yAxis.first, + hd.yAxis.second, false); } return; } void -InDetPlotBase::book(TH1 * &pHisto, const std::string &histoIdentifier, const std::string &folder) { +InDetPlotBase::book(TH1*& pHisto, const std::string& histoIdentifier, const std::string& folder) { const SingleHistogramDefinition hd = retrieveDefinition(histoIdentifier, folder); if (hd.empty()) { @@ -71,7 +71,7 @@ InDetPlotBase::book(TH1 * &pHisto, const std::string &histoIdentifier, const std } void -InDetPlotBase::book(TProfile * &pHisto, const std::string &histoIdentifier, const std::string &folder) { +InDetPlotBase::book(TProfile*& pHisto, const std::string& histoIdentifier, const std::string& folder) { const SingleHistogramDefinition hd = retrieveDefinition(histoIdentifier, folder); if (hd.empty()) { @@ -82,7 +82,7 @@ InDetPlotBase::book(TProfile * &pHisto, const std::string &histoIdentifier, cons } void -InDetPlotBase::book(TH2 * &pHisto, const std::string &histoIdentifier, const std::string &folder) { +InDetPlotBase::book(TH2*& pHisto, const std::string& histoIdentifier, const std::string& folder) { const SingleHistogramDefinition hd = retrieveDefinition(histoIdentifier, folder); if (hd.empty()) { @@ -93,17 +93,17 @@ InDetPlotBase::book(TH2 * &pHisto, const std::string &histoIdentifier, const std } void -InDetPlotBase::book(TH2 * &pHisto, const SingleHistogramDefinition &hd) { +InDetPlotBase::book(TH2*& pHisto, const SingleHistogramDefinition& hd) { if (hd.isValid()) { pHisto = Book2D(hd.name, hd.allTitles, hd.nBinsX, hd.xAxis.first, hd.xAxis.second, hd.nBinsY, hd.yAxis.first, - hd.yAxis.second, false); + hd.yAxis.second, false); } return; } /**/ void -InDetPlotBase::book(TEfficiency * &pHisto, const SingleHistogramDefinition &hd) { +InDetPlotBase::book(TEfficiency*& pHisto, const SingleHistogramDefinition& hd) { if (hd.isValid()) { pHisto = BookTEfficiency(hd.name, hd.allTitles, hd.nBinsX, hd.xAxis.first, hd.xAxis.second, false); } @@ -111,9 +111,9 @@ InDetPlotBase::book(TEfficiency * &pHisto, const SingleHistogramDefinition &hd) } void -InDetPlotBase::book(TEfficiency * &pHisto, const std::string &histoIdentifier, const std::string &folder) { +InDetPlotBase::book(TEfficiency*& pHisto, const std::string& histoIdentifier, const std::string& folder) { const SingleHistogramDefinition hd = retrieveDefinition(histoIdentifier, folder); - + if (hd.empty()) { ATH_MSG_WARNING("Histogram definition is empty for identifier " << histoIdentifier); } @@ -121,59 +121,57 @@ InDetPlotBase::book(TEfficiency * &pHisto, const std::string &histoIdentifier, c return; } -void -InDetPlotBase::fillHisto(TProfile *pTprofile, const float bin, const float weight ){ - if (pTprofile and validArguments(bin,weight)) { +void +InDetPlotBase::fillHisto(TProfile* pTprofile, const float bin, const float weight) { + if (pTprofile and validArguments(bin, weight)) { pTprofile->Fill(bin, weight); } } + // -void -InDetPlotBase::fillHisto(TH1 *pTh1, const float value){ +void +InDetPlotBase::fillHisto(TH1* pTh1, const float value) { if (pTh1 and validArguments(value)) { pTh1->Fill(value); } } void -InDetPlotBase::fillHisto(TH1 *pTh1, const float value,const float weight){ +InDetPlotBase::fillHisto(TH1* pTh1, const float value, const float weight) { if (pTh1 and validArguments(value)) { - pTh1->Fill(value,weight); + pTh1->Fill(value, weight); } } // -void -InDetPlotBase::fillHisto(TH2 *pTh2, const float xval, const float yval){ - if (pTh2 and validArguments(xval,yval)){ - pTh2->Fill(xval,yval); +void +InDetPlotBase::fillHisto(TH2* pTh2, const float xval, const float yval) { + if (pTh2 and validArguments(xval, yval)) { + pTh2->Fill(xval, yval); } } -void -InDetPlotBase::fillHisto(TH3 *pTh3, const float xval, const float yval,const float zval){ - if (pTh3 and validArguments(xval,yval,zval)){ - pTh3->Fill(xval,yval,zval); +void +InDetPlotBase::fillHisto(TH3* pTh3, const float xval, const float yval, const float zval) { + if (pTh3 and validArguments(xval, yval, zval)) { + pTh3->Fill(xval, yval, zval); } } -void -InDetPlotBase::fillHisto(TEfficiency *pTeff, const bool accepted, const float value ){ - if (pTeff and validArguments(value)){ - pTeff->Fill(accepted,value); +void +InDetPlotBase::fillHisto(TEfficiency* pTeff, const float value, const bool accepted) { + if (pTeff and validArguments(value)) { + pTeff->Fill(accepted, value); } - } - - /**/ SingleHistogramDefinition -InDetPlotBase::retrieveDefinition(const std::string &histoIdentifier, const std::string &folder) { +InDetPlotBase::retrieveDefinition(const std::string& histoIdentifier, const std::string& folder) { SingleHistogramDefinition s; // invalid result if (not m_histoDefSvc) { - ISvcLocator *svcLoc = Gaudi::svcLocator(); + ISvcLocator* svcLoc = Gaudi::svcLocator(); StatusCode sc = svcLoc->service("HistogramDefinitionSvc", m_histoDefSvc); if (sc.isFailure()) { ATH_MSG_FATAL("failed to retrieve HistogramDefinitionSvc in " << __FILE__); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.h index b6e668b7ea9cfd2cb144fb0691aab56e00e5e5c1..030f3b09baa7962738ed6ae4df8fecd2b4f3450a 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetPlotBase.h @@ -32,52 +32,52 @@ class TEfficiency; class InDetPlotBase: public PlotBase { public: /// Constructor taking parent node and directory name for plots - InDetPlotBase(InDetPlotBase *pParent, const std::string &dirName); + InDetPlotBase(InDetPlotBase* pParent, const std::string& dirName); /// Retrieve a single histogram definition, given the unique string identifier - SingleHistogramDefinition retrieveDefinition(const std::string &histoIdentifier, - const std::string &folder = "default"); + SingleHistogramDefinition retrieveDefinition(const std::string& histoIdentifier, + const std::string& folder = "default"); /// Book a TH1 histogram - void book(TH1 * &pHisto, const SingleHistogramDefinition &hd); + void book(TH1*& pHisto, const SingleHistogramDefinition& hd); /// Book a TH1 histogram with optional folder name - void book(TH1 * &pHisto, const std::string &histoIdentifier, const std::string &folder = "default"); + void book(TH1*& pHisto, const std::string& histoIdentifier, const std::string& folder = "default"); /// Book a TProfile histogram - void book(TProfile * &pHisto, const SingleHistogramDefinition &hd); + void book(TProfile*& pHisto, const SingleHistogramDefinition& hd); /// Book a TH1 histogram with optional folder name - void book(TProfile * &pHisto, const std::string &histoIdentifier, const std::string &folder = "default"); + void book(TProfile*& pHisto, const std::string& histoIdentifier, const std::string& folder = "default"); /// Book a 2D histogram (TH2) - void book(TH2 * &pHisto, const SingleHistogramDefinition &hd); + void book(TH2*& pHisto, const SingleHistogramDefinition& hd); /// Book a 2D histogram (TH2) with optional folder name - void book(TH2 * &pHisto, const std::string &histoIdentifier, const std::string &folder = "default"); + void book(TH2*& pHisto, const std::string& histoIdentifier, const std::string& folder = "default"); /// Book a (1-D) TEfficiency - void book(TEfficiency * &pHisto, const SingleHistogramDefinition &hd); + void book(TEfficiency*& pHisto, const SingleHistogramDefinition& hd); /// Book a TEfficiency with optional folder name - void book(TEfficiency * &pHisto, const std::string &histoIdentifier, const std::string &folder = "default"); + void book(TEfficiency*& pHisto, const std::string& histoIdentifier, const std::string& folder = "default"); // - void fillHisto(TProfile *pTprofile, const float bin, const float weight ); + void fillHisto(TProfile* pTprofile, const float bin, const float weight); // - void fillHisto(TH1 *pTh1, const float value); - void fillHisto(TH1 *pTh1, const float value,const float weight); + void fillHisto(TH1* pTh1, const float value); + void fillHisto(TH1* pTh1, const float value, const float weight); // - void fillHisto(TH2 *pTh2, const float xval, const float yval); + void fillHisto(TH2* pTh2, const float xval, const float yval); // - void fillHisto(TH3 *pTh3, const float xval, const float yval,const float zval); - // - void fillHisto(TEfficiency *pTeff, const bool accepted, const float value ); + void fillHisto(TH3* pTh3, const float xval, const float yval, const float zval); + // + void fillHisto(TEfficiency* pTeff, const float value, const bool accepted); // protected: /// book, for use by macro template <class T> void - mBook(T &pHisto, const std::string &histoIdentifier) { + mBook(T& pHisto, const std::string& histoIdentifier) { return book(pHisto, histoIdentifier.substr(2)); } /// Log a message using the Athena controlled logging system - MsgStream & + MsgStream& msg(MSG::Level lvl) const { return m_msg.get() << lvl; } @@ -91,7 +91,7 @@ protected: /// Private message stream member mutable Athena::MsgStreamMember m_msg; private: - IHistogramDefinitionSvc *m_histoDefSvc; + IHistogramDefinitionSvc* m_histoDefSvc; }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttLargeD0Plots.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttLargeD0Plots.cxx index 9c2bec291272b5ed4117871150737556d75c0a71..3ca3758c9057c07b061d4605eeba71d35c9d70e8 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttLargeD0Plots.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttLargeD0Plots.cxx @@ -23,7 +23,7 @@ using std::string; namespace { bool - isLargeD0Track(const xAOD::TrackParticle &tp) { + isLargeD0Track(const xAOD::TrackParticle& tp) { const std::bitset<xAOD::NumberOfTrackRecoInfo> patternReco = tp.patternRecoInfo(); if (patternReco.test(49)) { @@ -35,14 +35,14 @@ namespace { -InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::string &sDir) : +InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase(pParent, sDir), - // ============================================================= - // plots for LargeD0 performance study - // ============================================================= - - // //Testing TRT extension efficiency +// ============================================================= +// plots for LargeD0 performance study +// ============================================================= + +// //Testing TRT extension efficiency m_trtTesting_st_matched(this, "LargeD0/TRTTesting/StandardTracks/MatchedTracks/"), m_trtTesting_st_matched_primary(this, "LargeD0/TRTTesting/StandardTracks/MatchedTracks/Primary"), m_trtTesting_st_matched_secondary(this, "LargeD0/TRTTesting/StandardTracks/MatchedTracks/Secondary/"), @@ -60,8 +60,8 @@ InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::st m_trtTesting_ld0_fake_primary(this, "LargeD0/TRTTesting/LargeD0Tracks/FakeTracks/Primary"), m_trtTesting_ld0_fake_secondary(this, "LargeD0/TRTTesting/LargeD0Tracks/FakeTracks/Secondary"), m_trtTesting_ld0_fake_noTruthLink(this, "LargeD0/TRTTesting/LargeD0Tracks/FakeTracks/NoTruthLink"), - - // hits plots + +// hits plots m_hitsPlots_st_matched(this, "LargeD0/HitsPlots/StandardTracks/MatchedTracks"), m_hitsPlots_st_matched_primary(this, "LargeD0/HitsPlots/StandardTracks/MatchedTracks/Primary"), m_hitsPlots_st_matched_secondary(this, "LargeD0/HitsPlots/StandardTracks/MatchedTracks/Secondary"), @@ -70,7 +70,7 @@ InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::st m_hitsPlots_st_fake_primary(this, "LargeD0/HitsPlots/StandardTracks/FakeTracks/Primary"), m_hitsPlots_st_fake_secondary(this, "LargeD0/HitsPlots/StandardTracks/FakeTracks/Secondary"), m_hitsPlots_st_fake_noTruthLink(this, "LargeD0/HitsPlots/StandardTracks/FakeTracks/NoTruthLink"), - + m_hitsPlots_ld0_matched(this, "LargeD0/HitsPlots/LargeD0Tracks/MatchedTracks"), m_hitsPlots_ld0_matched_primary(this, "LargeD0/HitsPlots/LargeD0Tracks/MatchedTracks/Primary"), m_hitsPlots_ld0_matched_secondary(this, "LargeD0/HitsPlots/LargeD0Tracks/MatchedTracks/Secondary"), @@ -79,8 +79,8 @@ InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::st m_hitsPlots_ld0_fake_primary(this, "LargeD0/HitsPlots/LargeD0Tracks/FakeTracks/Primary"), m_hitsPlots_ld0_fake_secondary(this, "LargeD0/HitsPlots/LargeD0Tracks/FakeTracks/Secondary"), m_hitsPlots_ld0_fake_noTruthLink(this, "LargeD0/HitsPlots/LargeD0Tracks/FakeTracks/NoTruthLink"), - - // basic plots + +// basic plots m_basicPlot_st_matched(this, "LargeD0/basicPlot/StandardTracks/MatchedTracks"), m_basicPlot_st_matched_primary(this, "LargeD0/basicPlot/StandardTracks/MatchedTracks/Primary"), m_basicPlot_st_matched_secondary(this, "LargeD0/basicPlot/StandardTracks/MatchedTracks/Secondary"), @@ -89,7 +89,7 @@ InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::st m_basicPlot_st_fake_primary(this, "LargeD0/basicPlot/StandardTracks/FakeTracks/Primary"), m_basicPlot_st_fake_secondary(this, "LargeD0/basicPlot/StandardTracks/FakeTracks/Secondary"), m_basicPlot_st_fake_noTruthLink(this, "LargeD0/basicPlot/StandardTracks/FakeTracks/NoTruthLink"), - + m_basicPlot_ld0_matched(this, "LargeD0/basicPlot/LargeD0Tracks/MatchedTracks"), m_basicPlot_ld0_matched_primary(this, "LargeD0/basicPlot/LargeD0Tracks/MatchedTracks/Primary"), m_basicPlot_ld0_matched_secondary(this, "LargeD0/basicPlot/LargeD0Tracks/MatchedTracks/Secondary"), @@ -99,7 +99,7 @@ InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::st m_basicPlot_ld0_fake_secondary(this, "LargeD0/basicPlot/LargeD0Tracks/FakeTracks/Secondary"), m_basicPlot_ld0_fake_noTruthLink(this, "LargeD0/basicPlot/LargeD0Tracks/FakeTracks/NoTruthLink"), - // pt plots +// pt plots m_ptPlot_st_matched(this, "LargeD0/ptPlot/StandardTracks/MatchedTracks"), m_ptPlot_st_matched_primary(this, "LargeD0/ptPlot/StandardTracks/MatchedTracks/Primary"), m_ptPlot_st_matched_secondary(this, "LargeD0/ptPlot/StandardTracks/MatchedTracks/Secondary"), @@ -107,27 +107,28 @@ InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::st m_ptPlot_st_fake(this, "LargeD0/ptPlot/StandardTracks/FakeTracks"), m_ptPlot_st_fake_primary(this, "LargeD0/ptPlot/StandardTracks/FakeTracks/Primary"), m_ptPlot_st_fake_secondary(this, "LargeD0/ptPlot/StandardTracks/FakeTracks/Secondary"), - m_ptPlot_st_fake_noTruthLink(this, "LargeD0/ptPlot/StandardTracks/FakeTracks/NoTruthLink"), - + m_ptPlot_st_fake_noTruthLink(this, "LargeD0/ptPlot/StandardTracks/FakeTracks/NoTruthLink"), + m_ptPlot_ld0_matched(this, "LargeD0/ptPlot/LargeD0Tracks/MatchedTracks"), m_ptPlot_ld0_matched_primary(this, "LargeD0/ptPlot/LargeD0Tracks/MatchedTracks/Primary"), m_ptPlot_ld0_matched_secondary(this, "LargeD0/ptPlot/LargeD0Tracks/MatchedTracks/Secondary"), - m_ptPlot_ld0_matched_noTruthLink(this, "LargeD0/ptPlot/LargeD0Tracks/MatchedTracks/NoTruthLink"), + m_ptPlot_ld0_matched_noTruthLink(this, "LargeD0/ptPlot/LargeD0Tracks/MatchedTracks/NoTruthLink"), m_ptPlot_ld0_fake(this, "LargeD0/ptPlot/LargeD0Tracks/FakeTracks"), m_ptPlot_ld0_fake_primary(this, "LargeD0/ptPlot/LargeD0Tracks/FakeTracks/Primary"), m_ptPlot_ld0_fake_secondary(this, "LargeD0/ptPlot/LargeD0Tracks/FakeTracks/Secondary"), m_ptPlot_ld0_fake_noTruthLink(this, "LargeD0/ptPlot/LargeD0Tracks/FakeTracks/NoTruthLink"), - + m_ptPlot_truth_primary(this, "LargeD0/ptPlot/TruthTracks/Primary"), m_ptPlot_truth_secondary(this, "LargeD0/ptPlot/TruthTracks/Secondary"), m_ptPlot_pileup_primary(this, "LargeD0/ptPlot/Pileup/TruthTracks/Primary"), m_ptPlot_pileup_secondary(this, "LargeD0/ptPlot/Pileup/TruthTracks/Secondary"), - - // Reco info plots + +// Reco info plots m_TrackRecoInfoPlots_st_matched(this, "LargeD0/TrackRecoInfoPlots/StandardTracks/MatchedTracks"), m_TrackRecoInfoPlots_st_matched_primary(this, "LargeD0/TrackRecoInfoPlots/StandardTracks/MatchedTracks/Primary"), m_TrackRecoInfoPlots_st_matched_secondary(this, "LargeD0/TrackRecoInfoPlots/StandardTracks/MatchedTracks/Secondary"), - m_TrackRecoInfoPlots_st_matched_noTruthLink(this, "LargeD0/TrackRecoInfoPlots/StandardTracks/MatchedTracks/NoTruthLink"), + m_TrackRecoInfoPlots_st_matched_noTruthLink(this, + "LargeD0/TrackRecoInfoPlots/StandardTracks/MatchedTracks/NoTruthLink"), m_TrackRecoInfoPlots_st_fake(this, "LargeD0/TrackRecoInfoPlots/StandardTracks/FakeTracks"), m_TrackRecoInfoPlots_st_fake_primary(this, "LargeD0/TrackRecoInfoPlots/StandardTracks/FakeTracks/Primary"), m_TrackRecoInfoPlots_st_fake_secondary(this, "LargeD0/TrackRecoInfoPlots/StandardTracks/FakeTracks/Secondary"), @@ -136,13 +137,14 @@ InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::st m_TrackRecoInfoPlots_ld0_matched(this, "LargeD0/TrackRecoInfoPlots/LargeD0Tracks/MatchedTracks"), m_TrackRecoInfoPlots_ld0_matched_primary(this, "LargeD0/TrackRecoInfoPlots/LargeD0Tracks/MatchedTracks/Primary"), m_TrackRecoInfoPlots_ld0_matched_secondary(this, "LargeD0/TrackRecoInfoPlots/LargeD0Tracks/MatchedTracks/Secondary"), - m_TrackRecoInfoPlots_ld0_matched_noTruthLink(this, "LargeD0/TrackRecoInfoPlots/LargeD0Tracks/MatchedTracks/NoTruthLink"), + m_TrackRecoInfoPlots_ld0_matched_noTruthLink(this, + "LargeD0/TrackRecoInfoPlots/LargeD0Tracks/MatchedTracks/NoTruthLink"), m_TrackRecoInfoPlots_ld0_fake(this, "LargeD0/TrackRecoInfoPlots/LargeD0Tracks/FakeTracks"), m_TrackRecoInfoPlots_ld0_fake_primary(this, "LargeD0/TrackRecoInfoPlots/LargeD0Tracks/FakeTracks/Primary"), m_TrackRecoInfoPlots_ld0_fake_secondary(this, "LargeD0/TrackRecoInfoPlots/LargeD0Tracks/FakeTracks/Secondary"), m_TrackRecoInfoPlots_ld0_fake_noTruthLink(this, "LargeD0/TrackRecoInfoPlots/LargeD0Tracks/FakeTracks/NoTruthLink"), - - // Fake rate plots + +// Fake rate plots m_fakePlots_st(this, "LargeD0/FakeRatePlots/StandardTracks"), m_fakePlots_st_trtHit(this, "LargeD0/FakeRatePlots/StandardTracks/TRT"), m_fakePlots_st_trtOut(this, "LargeD0/FakeRatePlots/StandardTracks/TRTOut"), @@ -185,7 +187,7 @@ InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::st m_fakePlots_st_combined_tubeFrac051(this, "LargeD0/FakeRatePlots/StandardTracks/Combined/TubeFrac05_1"), m_fakePlots_st_combined_tubeFrac0405(this, "LargeD0/FakeRatePlots/StandardTracks/Combined/TubeFrac04_05"), m_fakePlots_st_combined_tubeFrac004(this, "LargeD0/FakeRatePlots/StandardTracks/Combined/TubeFrac0_04"), - + m_fakePlots_ld0(this, "LargeD0/FakeRatePlots/LargeD0Tracks"), m_fakePlots_ld0_trtHit(this, "LargeD0/FakeRatePlots/LargeD0Tracks/TRT"), m_fakePlots_ld0_trtOut(this, "LargeD0/FakeRatePlots/LargeD0Tracks/TRTOut"), @@ -217,7 +219,7 @@ InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::st m_fakePlots_ld0_notruth(this, "LargeD0/FakeRatePlots/LargeD0Tracks/NoTruth"), m_fakePlots_ld0_notruth_trtHit(this, "LargeD0/FakeRatePlots/LargeD0Tracks/NoTruth/TRT"), m_fakePlots_ld0_notruth_trtOut(this, "LargeD0/FakeRatePlots/LargeD0Tracks/NoTruth/TRTOut"), - m_fakePlots_ld0_notruth_noTrt(this, "LargeD0/FakeRatePlots/LargeD0Tracks/NoTruth/NoTRT"), + m_fakePlots_ld0_notruth_noTrt(this, "LargeD0/FakeRatePlots/LargeD0Tracks/NoTruth/NoTRT"), m_fakePlots_ld0_notruth_tubeFrac051(this, "LargeD0/FakeRatePlots/LargeD0Tracks/NoTruth/TubeFrac05_1"), m_fakePlots_ld0_notruth_tubeFrac0405(this, "LargeD0/FakeRatePlots/LargeD0Tracks/NoTruth/TubeFrac04_05"), m_fakePlots_ld0_notruth_tubeFrac004(this, "LargeD0/FakeRatePlots/LargeD0Tracks/NoTruth/TubeFrac0_04"), @@ -228,8 +230,8 @@ InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::st m_fakePlots_ld0_combined_tubeFrac051(this, "LargeD0/FakeRatePlots/LargeD0Tracks/Combined/TubeFrac05_1"), m_fakePlots_ld0_combined_tubeFrac0405(this, "LargeD0/FakeRatePlots/LargeD0Tracks/Combined/TubeFrac04_05"), m_fakePlots_ld0_combined_tubeFrac004(this, "LargeD0/FakeRatePlots/LargeD0Tracks/Combined/TubeFrac0_04"), - - // Efficiency plots + +// Efficiency plots m_effPlots_all(this, "LargeD0/EffPlots/AllTracks/"), m_effPlots_all_trtHit(this, "LargeD0/EffPlots/AllTracks/TRT"), m_effPlots_all_trtOut(this, "LargeD0/EffPlots/AllTracks/TRTOut"), @@ -242,7 +244,7 @@ InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::st m_effPlots_all_signal_tubeFrac0405(this, "LargeD0/EffPlots/AllTracks/Signal/TubeFrac04_05"), m_effPlots_all_signal_tubeFrac004(this, "LargeD0/EffPlots/AllTracks/Signal/TubeFrac0_04"), - m_effPlots_st(this, "LargeD0/EffPlots/StandardTracks/"), + m_effPlots_st(this, "LargeD0/EffPlots/StandardTracks/"), m_effPlots_st_trtHit(this, "LargeD0/EffPlots/StandardTracks/TRT/"), m_effPlots_st_trtOut(this, "LargeD0/EffPlots/StandardTracks/TRTOut/"), m_effPlots_st_noTrt(this, "LargeD0/EffPlots/StandardTracks/noTRT/"), @@ -291,16 +293,16 @@ InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::st m_effPlots_ld0NonSt_signal_tubeFrac004(this, "LargeD0/EffPlots/LargeD0TracksNonStd/Signal/TubeFrac0_04"), m_effPlots(this, "LargeD0/EffPlots"), - - // ============================================================= - // plots not used for LargeD0 - // ============================================================= + +// ============================================================= +// plots not used for LargeD0 +// ============================================================= m_ptPlot(this, "LargeD0_NOTUSED/SelectedGoodTracks"), m_basicPlot(this, "LargeD0_NOTUSED/SelectedGoodTracks"), - + m_PtEtaPlots(this, "LargeD0_NOTUSED/SelectedGoodTracks", "TrackParticle"), m_IPPlots(this, "LargeD0_NOTUSED/SelectedGoodTracks"), - + m_TrackRecoInfoPlots(this, "LargeD0_NOTUSED/SelectedGoodTracks"), m_TrackTruthInfoPlots(this, "LargeD0_NOTUSED/Truth"), m_nTracks(this, "LargeD0_NOTUSED/SelectedGoodTracks"), @@ -327,7 +329,7 @@ InDetRttLargeD0Plots::InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::st // =================================================================================== void -InDetRttLargeD0Plots::fill(const xAOD::TrackParticle &particle) { +InDetRttLargeD0Plots::fill(const xAOD::TrackParticle& particle) { m_hitResidualPlot.fill(particle); // fill pt plots m_ptPlot.fill(particle); @@ -340,70 +342,71 @@ InDetRttLargeD0Plots::fill(const xAOD::TrackParticle &particle) { } void -InDetRttLargeD0Plots::fill(const xAOD::TrackParticle &particle, const int barcode, const xAOD::EventInfo& ei, const xAOD::VertexContainer& pv) { - const bool noTruthLink=((barcode == 0) or (barcode == -1)); +InDetRttLargeD0Plots::fill(const xAOD::TrackParticle& particle, const int barcode, const xAOD::EventInfo& ei, + const xAOD::VertexContainer& pv) { + const bool noTruthLink = ((barcode == 0)or(barcode == -1)); + if (isLargeD0Track(particle)) { - //all ld0 tracks - m_trtTesting_ld0_matched.fill(particle,ei,pv); - m_hitsPlots_ld0_matched.fill(particle); + // all ld0 tracks + m_trtTesting_ld0_matched.fill(particle, ei, pv); + m_hitsPlots_ld0_matched.fill(particle); m_basicPlot_ld0_matched.fill(particle); m_ptPlot_ld0_matched.fill(particle); m_TrackRecoInfoPlots_ld0_matched.fill(particle); if (noTruthLink) { // no truth link - m_trtTesting_ld0_matched_noTruthLink.fill(particle,ei,pv); + m_trtTesting_ld0_matched_noTruthLink.fill(particle, ei, pv); m_hitsPlots_ld0_matched_noTruthLink.fill(particle); m_basicPlot_ld0_matched_noTruthLink.fill(particle); m_ptPlot_ld0_matched_noTruthLink.fill(particle); m_TrackRecoInfoPlots_ld0_matched_noTruthLink.fill(particle); } else { if (barcode >= 200000) { // secondary tracks - m_trtTesting_ld0_matched_secondary.fill(particle,ei,pv); + m_trtTesting_ld0_matched_secondary.fill(particle, ei, pv); m_hitsPlots_ld0_matched_secondary.fill(particle); m_basicPlot_ld0_matched_secondary.fill(particle); m_ptPlot_ld0_matched_secondary.fill(particle); m_TrackRecoInfoPlots_ld0_matched_secondary.fill(particle); - } else if (barcode > 0) { // primary tracks - m_trtTesting_ld0_matched_primary.fill(particle,ei,pv); + } else if (barcode > 0) { // primary tracks + m_trtTesting_ld0_matched_primary.fill(particle, ei, pv); m_hitsPlots_ld0_matched_primary.fill(particle); m_basicPlot_ld0_matched_primary.fill(particle); m_ptPlot_ld0_matched_primary.fill(particle); m_TrackRecoInfoPlots_ld0_matched_primary.fill(particle); } else { - std::cout << "<InDetRttLargeD0Plots::fill> Barcode " << barcode << " was not recognised." << std::endl; + std::cout << "<InDetRttLargeD0Plots::fill> Barcode " << barcode << " was not recognised." << std::endl; } } } else { - //all std tracks - m_trtTesting_st_matched.fill(particle,ei,pv); + // all std tracks + m_trtTesting_st_matched.fill(particle, ei, pv); m_hitsPlots_st_matched.fill(particle); m_basicPlot_st_matched.fill(particle); m_ptPlot_st_matched.fill(particle); m_TrackRecoInfoPlots_st_matched.fill(particle); if (noTruthLink) { // no truth link - m_trtTesting_st_matched_noTruthLink.fill(particle,ei,pv); + m_trtTesting_st_matched_noTruthLink.fill(particle, ei, pv); m_hitsPlots_st_matched_noTruthLink.fill(particle); m_basicPlot_st_matched_noTruthLink.fill(particle); m_ptPlot_st_matched_noTruthLink.fill(particle); m_TrackRecoInfoPlots_st_matched_noTruthLink.fill(particle); - } else { - if (barcode >= 200000) { // secondary tracks - m_trtTesting_st_matched_secondary.fill(particle,ei,pv); - m_hitsPlots_st_matched_secondary.fill(particle); - m_basicPlot_st_matched_secondary.fill(particle); - m_ptPlot_st_matched_secondary.fill(particle); - m_TrackRecoInfoPlots_st_matched_secondary.fill(particle); + } else { + if (barcode >= 200000) { // secondary tracks + m_trtTesting_st_matched_secondary.fill(particle, ei, pv); + m_hitsPlots_st_matched_secondary.fill(particle); + m_basicPlot_st_matched_secondary.fill(particle); + m_ptPlot_st_matched_secondary.fill(particle); + m_TrackRecoInfoPlots_st_matched_secondary.fill(particle); } else if (barcode > 0) { // primary tracks - m_trtTesting_st_matched_primary.fill(particle,ei,pv); - m_hitsPlots_st_matched_primary.fill(particle); - m_basicPlot_st_matched_primary.fill(particle); - m_ptPlot_st_matched_primary.fill(particle); - m_TrackRecoInfoPlots_st_matched_primary.fill(particle); + m_trtTesting_st_matched_primary.fill(particle, ei, pv); + m_hitsPlots_st_matched_primary.fill(particle); + m_basicPlot_st_matched_primary.fill(particle); + m_ptPlot_st_matched_primary.fill(particle); + m_TrackRecoInfoPlots_st_matched_primary.fill(particle); } else { - std::cout << "<InDetRttLargeD0Plots::fill> Barcode " << barcode << " was not recognised." << std::endl; + std::cout << "<InDetRttLargeD0Plots::fill> Barcode " << barcode << " was not recognised." << std::endl; } } } - } // =================================================================================== @@ -412,8 +415,10 @@ InDetRttLargeD0Plots::fill(const xAOD::TrackParticle &particle, const int barcod // =================================================================================== void -InDetRttLargeD0Plots::fillFake(const xAOD::TrackParticle &trackParticle, const int barcode, const xAOD::EventInfo& ei, const xAOD::VertexContainer& pv) { - const bool noTruthLink=(barcode == 0) or (barcode == -1); +InDetRttLargeD0Plots::fillFake(const xAOD::TrackParticle& trackParticle, const int barcode, const xAOD::EventInfo& ei, + const xAOD::VertexContainer& pv) { + const bool noTruthLink = (barcode == 0)or(barcode == -1); + if (isLargeD0Track(trackParticle)) { m_trtTesting_ld0_fake.fill(trackParticle, ei, pv); m_hitsPlots_ld0_fake.fill(trackParticle); @@ -428,48 +433,48 @@ InDetRttLargeD0Plots::fillFake(const xAOD::TrackParticle &trackParticle, const i m_TrackRecoInfoPlots_ld0_fake_noTruthLink.fill(trackParticle); } else { if (barcode >= 200000) { // secondary tracks - m_trtTesting_ld0_fake_secondary.fill(trackParticle,ei, pv); - m_hitsPlots_ld0_fake_secondary.fill(trackParticle); - m_basicPlot_ld0_fake_secondary.fill(trackParticle); - m_ptPlot_ld0_fake_secondary.fill(trackParticle); - m_TrackRecoInfoPlots_ld0_fake_secondary.fill(trackParticle); + m_trtTesting_ld0_fake_secondary.fill(trackParticle, ei, pv); + m_hitsPlots_ld0_fake_secondary.fill(trackParticle); + m_basicPlot_ld0_fake_secondary.fill(trackParticle); + m_ptPlot_ld0_fake_secondary.fill(trackParticle); + m_TrackRecoInfoPlots_ld0_fake_secondary.fill(trackParticle); } else if (barcode > 0) { // primary tracks - m_trtTesting_ld0_fake_primary.fill(trackParticle,ei, pv); - m_hitsPlots_ld0_fake_primary.fill(trackParticle); - m_basicPlot_ld0_fake_primary.fill(trackParticle); - m_ptPlot_ld0_fake_primary.fill(trackParticle); - m_TrackRecoInfoPlots_ld0_fake_primary.fill(trackParticle); + m_trtTesting_ld0_fake_primary.fill(trackParticle, ei, pv); + m_hitsPlots_ld0_fake_primary.fill(trackParticle); + m_basicPlot_ld0_fake_primary.fill(trackParticle); + m_ptPlot_ld0_fake_primary.fill(trackParticle); + m_TrackRecoInfoPlots_ld0_fake_primary.fill(trackParticle); } else { - std::cout << "<InDetRttLargeD0Plots::fill> Barcode " << barcode << " was not recognised." << std::endl; + std::cout << "<InDetRttLargeD0Plots::fill> Barcode " << barcode << " was not recognised." << std::endl; } } - }else { - m_trtTesting_st_fake.fill(trackParticle,ei, pv); + } else { + m_trtTesting_st_fake.fill(trackParticle, ei, pv); m_hitsPlots_st_fake.fill(trackParticle); m_basicPlot_st_fake.fill(trackParticle); m_ptPlot_st_fake.fill(trackParticle); m_TrackRecoInfoPlots_st_fake.fill(trackParticle); if (noTruthLink) { // no truth link - m_trtTesting_st_fake_noTruthLink.fill(trackParticle,ei, pv); + m_trtTesting_st_fake_noTruthLink.fill(trackParticle, ei, pv); m_hitsPlots_st_fake_noTruthLink.fill(trackParticle); m_basicPlot_st_fake_noTruthLink.fill(trackParticle); m_ptPlot_st_fake_noTruthLink.fill(trackParticle); m_TrackRecoInfoPlots_st_fake_noTruthLink.fill(trackParticle); } else { if (barcode >= 200000) { // secondary tracks - m_trtTesting_st_fake_secondary.fill(trackParticle,ei, pv); - m_hitsPlots_st_fake_secondary.fill(trackParticle); - m_basicPlot_st_fake_secondary.fill(trackParticle); - m_ptPlot_st_fake_secondary.fill(trackParticle); - m_TrackRecoInfoPlots_st_fake_secondary.fill(trackParticle); + m_trtTesting_st_fake_secondary.fill(trackParticle, ei, pv); + m_hitsPlots_st_fake_secondary.fill(trackParticle); + m_basicPlot_st_fake_secondary.fill(trackParticle); + m_ptPlot_st_fake_secondary.fill(trackParticle); + m_TrackRecoInfoPlots_st_fake_secondary.fill(trackParticle); } else if (barcode > 0) { // primary tracks - m_trtTesting_st_fake_primary.fill(trackParticle,ei, pv); - m_hitsPlots_st_fake_primary.fill(trackParticle); - m_basicPlot_st_fake_primary.fill(trackParticle); - m_ptPlot_st_fake_primary.fill(trackParticle); - m_TrackRecoInfoPlots_st_fake_primary.fill(trackParticle); + m_trtTesting_st_fake_primary.fill(trackParticle, ei, pv); + m_hitsPlots_st_fake_primary.fill(trackParticle); + m_basicPlot_st_fake_primary.fill(trackParticle); + m_ptPlot_st_fake_primary.fill(trackParticle); + m_TrackRecoInfoPlots_st_fake_primary.fill(trackParticle); } else { - std::cout << "<InDetRttLargeD0Plots::fill> Barcode " << barcode << " was not recognised." << std::endl; + std::cout << "<InDetRttLargeD0Plots::fill> Barcode " << barcode << " was not recognised." << std::endl; } } } @@ -481,116 +486,137 @@ InDetRttLargeD0Plots::fillFake(const xAOD::TrackParticle &trackParticle, const i // =================================================================================== void -InDetRttLargeD0Plots::fillTruth(const xAOD::TruthParticle &truth) { - //m_basicPlot_truth.fill(truth); +InDetRttLargeD0Plots::fillTruth(const xAOD::TruthParticle& truth) { + // m_basicPlot_truth.fill(truth); if ((truth.barcode() > 0)and(truth.barcode() < 200000)) { - //m_basicPlot_primary_truth.fill(truth); + // m_basicPlot_primary_truth.fill(truth); m_ptPlot_truth_primary.fill(truth); - }else { - //m_basicPlot_secondary_truth.fill(truth); + } else { + // m_basicPlot_secondary_truth.fill(truth); m_ptPlot_truth_secondary.fill(truth); } } void -InDetRttLargeD0Plots::pro_fill(const xAOD::TruthParticle &truth, float weight) { - m_effPlots.pro_fill(truth, weight); +InDetRttLargeD0Plots::fillEfficiency(const xAOD::TruthParticle& truth, const bool isGood) { + m_effPlots.fill(truth, isGood); } void -InDetRttLargeD0Plots::fillEfficiency(const xAOD::TruthParticle &truth, \ +InDetRttLargeD0Plots::fillEfficiency(const xAOD::TruthParticle& truth, \ const bool isReconstructed, \ - const bool isLargeD0Track, \ - const bool hasTRTHit, \ - const bool hasTRTOut, \ - const int nTrtHits, \ - const int nTrtTubeHits, \ + const bool isLargeD0Track, \ + const bool hasTRTHit, \ + const bool hasTRTOut, \ + const int nTrtHits, \ + const int nTrtTubeHits, \ const bool isSignal) { - unsigned int rec = (unsigned int) isReconstructed; - unsigned int LRT = (unsigned int)(isLargeD0Track and isReconstructed); - unsigned int TRT = (unsigned int) hasTRTHit; - unsigned int TRTout = (unsigned int) hasTRTOut; + //unsigned int rec = (unsigned int) isReconstructed; + const bool LRT = (isLargeD0Track and isReconstructed); + //unsigned int TRT = (unsigned int) hasTRTHit; + //unsigned int TRTout = (unsigned int) hasTRTOut; bool isStandardTrack = false; double tubeFrac = -1.0; - if(nTrtHits > 0) {tubeFrac = ((double)nTrtTubeHits)/((double)nTrtHits); } //determine the fraction of TRT hits which are TRT tube hits (rather than precision hits) + + if (nTrtHits > 0) { + tubeFrac = ((double) nTrtTubeHits) / ((double) nTrtHits); + } // determine the fraction of TRT hits which are TRT tube hits (rather than precision hits) bool tubeFrac05 = false; - if( tubeFrac < 0.5 ){ tubeFrac05 = true; } + if (tubeFrac < 0.5) { + tubeFrac05 = true; + } bool tubeFrac04 = false; - if( tubeFrac < 0.4 ){ tubeFrac04 = true; } - unsigned int tubeFracLess05 = (unsigned int) tubeFrac05; - unsigned int tubeFracLess04 = (unsigned int) tubeFrac04; + if (tubeFrac < 0.4) { + tubeFrac04 = true; + } + //unsigned int tubeFrac05 = (unsigned int) tubeFrac05; + //unsigned int tubeFrac04 = (unsigned int) tubeFrac04; if (!isLargeD0Track) { isStandardTrack = true; } - unsigned int STD = (unsigned int)(isStandardTrack and isReconstructed); - - m_effPlots_all.pro_fill(truth, rec); //efficiency of all types of tracks - all matched reco tracks/all truth tracks - m_effPlots_all_trtHit.pro_fill(truth, rec and TRT); //how much of efficiency is from tracks with TRT hits? - m_effPlots_all_trtOut.pro_fill(truth, rec and TRTout and not TRT); //how much from tracks with TRT outliers but no TRT hits? - m_effPlots_all_noTrt.pro_fill(truth, rec and not TRT and not TRTout); //how much from tracks without any TRT contribution? - m_effPlots_st.pro_fill(truth, STD); //all matched reco tracks from standard tracking/all truth tracks - m_effPlots_st_trtHit.pro_fill(truth, STD and TRT); - m_effPlots_st_trtOut.pro_fill(truth, STD and TRTout and not TRT); - m_effPlots_st_noTrt.pro_fill(truth, STD and not TRT and not TRTout); - m_effPlots_ld0.pro_fill(truth, LRT); //all matched reco tracks from large d0 tracking/all truth tracks - m_effPlots_ld0_trtHit.pro_fill(truth, LRT and TRT); - m_effPlots_ld0_trtOut.pro_fill(truth, LRT and TRTout and not TRT); - m_effPlots_ld0_noTrt.pro_fill(truth, LRT and not TRT and not TRTout); - - if (isStandardTrack) { //the point of these plots is that the denominator is only std tracks, so we can see the peformance of the std tracking itself as comparison to lrt - m_effPlots_stNonLd0.pro_fill(truth, STD); - m_effPlots_stNonLd0_trtHit.pro_fill(truth, STD and TRT); - m_effPlots_stNonLd0_trtOut.pro_fill(truth, STD and TRTout and not TRT); - m_effPlots_stNonLd0_noTrt.pro_fill(truth, STD and not TRT and not TRTout); + bool STD = (isStandardTrack and isReconstructed); + + m_effPlots_all.fill(truth, isReconstructed); // efficiency of all types of tracks - all matched reco tracks/all truth tracks + m_effPlots_all_trtHit.fill(truth, isReconstructed and hasTRTHit); // how much of efficiency is from tracks with TRT hits? + m_effPlots_all_trtOut.fill(truth, isReconstructed and hasTRTOut and not hasTRTHit); // how much from tracks with TRT outliers but no + // TRT hits? + m_effPlots_all_noTrt.fill(truth, isReconstructed and not hasTRTHit and not hasTRTOut); // how much from tracks without any TRT + // contribution? + m_effPlots_st.fill(truth, STD); // all matched reco tracks from standard tracking/all truth tracks + m_effPlots_st_trtHit.fill(truth, STD and hasTRTHit); + m_effPlots_st_trtOut.fill(truth, STD and hasTRTOut and not hasTRTHit); + m_effPlots_st_noTrt.fill(truth, STD and not hasTRTHit and not hasTRTOut); + m_effPlots_ld0.fill(truth, LRT); // all matched reco tracks from large d0 tracking/all truth tracks + m_effPlots_ld0_trtHit.fill(truth, LRT and hasTRTHit); + m_effPlots_ld0_trtOut.fill(truth, LRT and hasTRTOut and not hasTRTHit); + m_effPlots_ld0_noTrt.fill(truth, LRT and not hasTRTHit and not hasTRTOut); + + if (isStandardTrack) { // the point of these plots is that the denominator is only std tracks, so we can see the + // peformance of the std tracking itself as comparison to lrt + m_effPlots_stNonLd0.fill(truth, STD); + m_effPlots_stNonLd0_trtHit.fill(truth, STD and hasTRTHit); + m_effPlots_stNonLd0_trtOut.fill(truth, STD and hasTRTOut and not hasTRTHit); + m_effPlots_stNonLd0_noTrt.fill(truth, STD and not hasTRTHit and not hasTRTOut); } - if (isLargeD0Track) { //the point of these plots is that the denominator is only ld0 tracks, so we can see the peformance of the ld0 tracking itself - m_effPlots_ld0NonSt.pro_fill(truth, LRT); - m_effPlots_ld0NonSt_trtHit.pro_fill(truth, LRT and TRT); - m_effPlots_ld0NonSt_trtOut.pro_fill(truth, rec and LRT and TRTout and not TRT); - m_effPlots_ld0NonSt_noTrt.pro_fill(truth, rec and LRT and not TRT and not TRTout); + if (isLargeD0Track) { // the point of these plots is that the denominator is only ld0 tracks, so we can see the + // peformance of the ld0 tracking itself + m_effPlots_ld0NonSt.fill(truth, LRT); + m_effPlots_ld0NonSt_trtHit.fill(truth, LRT and hasTRTHit); + m_effPlots_ld0NonSt_trtOut.fill(truth, isReconstructed and LRT and hasTRTOut and not hasTRTHit); + m_effPlots_ld0NonSt_noTrt.fill(truth, isReconstructed and LRT and not hasTRTHit and not hasTRTOut); } - if (isSignal) { //reco signal tracks/tracks from all signal - m_effPlots_all_signal.pro_fill(truth, rec); - m_effPlots_all_signal_trtHit.pro_fill(truth, rec and TRT); - m_effPlots_all_signal_trtOut.pro_fill(truth, rec and TRTout and not TRT); - m_effPlots_all_signal_noTrt.pro_fill(truth, rec and not TRT and not TRTout); - m_effPlots_all_signal_tubeFrac051.pro_fill(truth, rec and TRT and not tubeFracLess05); //how much of eff comes from tracks with tube frac > 0.5? - m_effPlots_all_signal_tubeFrac0405.pro_fill(truth, rec and TRT and tubeFracLess05 and not tubeFracLess04); //how much from tracks with tube frac (0.4,0.5) - m_effPlots_all_signal_tubeFrac004.pro_fill(truth, rec and TRT and tubeFracLess04); //how much from tracks with tube frac < 0.4? - m_effPlots_st_signal.pro_fill(truth, STD); - m_effPlots_st_signal_trtHit.pro_fill(truth, STD and TRT); - m_effPlots_st_signal_trtOut.pro_fill(truth, STD and TRTout and not TRT); - m_effPlots_st_signal_noTrt.pro_fill(truth, STD and not TRT and not TRTout); - m_effPlots_st_signal_tubeFrac051.pro_fill(truth, STD and TRT and not tubeFracLess05); - m_effPlots_st_signal_tubeFrac0405.pro_fill(truth, STD and TRT and tubeFracLess05 and not tubeFracLess04); - m_effPlots_st_signal_tubeFrac004.pro_fill(truth, STD and TRT and tubeFracLess04); - m_effPlots_ld0_signal.pro_fill(truth, LRT); - m_effPlots_ld0_signal_trtHit.pro_fill(truth, LRT and TRT); - m_effPlots_ld0_signal_trtOut.pro_fill(truth, LRT and TRTout and not TRT); - m_effPlots_ld0_signal_noTrt.pro_fill(truth, LRT and not TRT and not TRTout); - m_effPlots_ld0_signal_tubeFrac051.pro_fill(truth, LRT and TRT and not tubeFracLess05); - m_effPlots_ld0_signal_tubeFrac0405.pro_fill(truth, LRT and TRT and tubeFracLess05 and not tubeFracLess04); - m_effPlots_ld0_signal_tubeFrac004.pro_fill(truth, LRT and TRT and tubeFracLess04); + if (isSignal) { // reco signal tracks/tracks from all signal + m_effPlots_all_signal.fill(truth, isReconstructed); + m_effPlots_all_signal_trtHit.fill(truth, isReconstructed and hasTRTHit); + m_effPlots_all_signal_trtOut.fill(truth, isReconstructed and hasTRTOut and not hasTRTHit); + m_effPlots_all_signal_noTrt.fill(truth, isReconstructed and not hasTRTHit and not hasTRTOut); + m_effPlots_all_signal_tubeFrac051.fill(truth, isReconstructed and hasTRTHit and not tubeFrac05); // how much of eff comes from + // tracks with tube frac > + // 0.5? + m_effPlots_all_signal_tubeFrac0405.fill(truth, isReconstructed and hasTRTHit and tubeFrac05 and not tubeFrac04); // how + // much + // from + // tracks + // with + // tube + // frac + // (0.4,0.5) + m_effPlots_all_signal_tubeFrac004.fill(truth, isReconstructed and hasTRTHit and tubeFrac04); // how much from tracks with tube + // frac < 0.4? + m_effPlots_st_signal.fill(truth, STD); + m_effPlots_st_signal_trtHit.fill(truth, STD and hasTRTHit); + m_effPlots_st_signal_trtOut.fill(truth, STD and hasTRTOut and not hasTRTHit); + m_effPlots_st_signal_noTrt.fill(truth, STD and not hasTRTHit and not hasTRTOut); + m_effPlots_st_signal_tubeFrac051.fill(truth, STD and hasTRTHit and not tubeFrac05); + m_effPlots_st_signal_tubeFrac0405.fill(truth, STD and hasTRTHit and tubeFrac05 and not tubeFrac04); + m_effPlots_st_signal_tubeFrac004.fill(truth, STD and hasTRTHit and tubeFrac04); + m_effPlots_ld0_signal.fill(truth, LRT); + m_effPlots_ld0_signal_trtHit.fill(truth, LRT and hasTRTHit); + m_effPlots_ld0_signal_trtOut.fill(truth, LRT and hasTRTOut and not hasTRTHit); + m_effPlots_ld0_signal_noTrt.fill(truth, LRT and not hasTRTHit and not hasTRTOut); + m_effPlots_ld0_signal_tubeFrac051.fill(truth, LRT and hasTRTHit and not tubeFrac05); + m_effPlots_ld0_signal_tubeFrac0405.fill(truth, LRT and hasTRTHit and tubeFrac05 and not tubeFrac04); + m_effPlots_ld0_signal_tubeFrac004.fill(truth, LRT and hasTRTHit and tubeFrac04); if (isStandardTrack) { - m_effPlots_stNonLd0_signal.pro_fill(truth, STD); - m_effPlots_stNonLd0_signal_trtHit.pro_fill(truth, STD and TRT); - m_effPlots_stNonLd0_signal_trtOut.pro_fill(truth, STD and TRTout and not TRT); - m_effPlots_stNonLd0_signal_noTrt.pro_fill(truth, STD and not TRT and not TRTout); - m_effPlots_stNonLd0_signal_tubeFrac051.pro_fill(truth, STD and TRT and not tubeFracLess05); - m_effPlots_stNonLd0_signal_tubeFrac0405.pro_fill(truth, STD and TRT and tubeFracLess05 and not tubeFracLess04); - m_effPlots_stNonLd0_signal_tubeFrac004.pro_fill(truth, STD and TRT and tubeFracLess04); + m_effPlots_stNonLd0_signal.fill(truth, STD); + m_effPlots_stNonLd0_signal_trtHit.fill(truth, STD and hasTRTHit); + m_effPlots_stNonLd0_signal_trtOut.fill(truth, STD and hasTRTOut and not hasTRTHit); + m_effPlots_stNonLd0_signal_noTrt.fill(truth, STD and not hasTRTHit and not hasTRTOut); + m_effPlots_stNonLd0_signal_tubeFrac051.fill(truth, STD and hasTRTHit and not tubeFrac05); + m_effPlots_stNonLd0_signal_tubeFrac0405.fill(truth, STD and hasTRTHit and tubeFrac05 and not tubeFrac04); + m_effPlots_stNonLd0_signal_tubeFrac004.fill(truth, STD and hasTRTHit and tubeFrac04); } if (isLargeD0Track) { - m_effPlots_ld0NonSt_signal.pro_fill(truth, LRT); - m_effPlots_ld0NonSt_signal_trtHit.pro_fill(truth, LRT and TRT); - m_effPlots_ld0NonSt_signal_trtOut.pro_fill(truth, LRT and TRTout and not TRT); - m_effPlots_ld0NonSt_signal_noTrt.pro_fill(truth, LRT and not TRT and not TRTout); - m_effPlots_ld0NonSt_signal_tubeFrac051.pro_fill(truth, LRT and TRT and not tubeFracLess05); - m_effPlots_ld0NonSt_signal_tubeFrac0405.pro_fill(truth, LRT and TRT and tubeFracLess05 and not tubeFracLess04); - m_effPlots_ld0NonSt_signal_tubeFrac004.pro_fill(truth, LRT and TRT and tubeFracLess04); + m_effPlots_ld0NonSt_signal.fill(truth, LRT); + m_effPlots_ld0NonSt_signal_trtHit.fill(truth, LRT and hasTRTHit); + m_effPlots_ld0NonSt_signal_trtOut.fill(truth, LRT and hasTRTOut and not hasTRTHit); + m_effPlots_ld0NonSt_signal_noTrt.fill(truth, LRT and not hasTRTHit and not hasTRTOut); + m_effPlots_ld0NonSt_signal_tubeFrac051.fill(truth, LRT and hasTRTHit and not tubeFrac05); + m_effPlots_ld0NonSt_signal_tubeFrac0405.fill(truth, LRT and hasTRTHit and tubeFrac05 and not tubeFrac04); + m_effPlots_ld0NonSt_signal_tubeFrac004.fill(truth, LRT and hasTRTHit and tubeFrac04); } } @@ -604,7 +630,7 @@ InDetRttLargeD0Plots::fillEfficiency(const xAOD::TruthParticle &truth, \ // =================================================================================== void -InDetRttLargeD0Plots::fill(const xAOD::TruthParticle &truthParticle) { +InDetRttLargeD0Plots::fill(const xAOD::TruthParticle& truthParticle) { // fill truth plots m_TrackTruthInfoPlots.fill(truthParticle); // this gets called for the truth particles associated to tracks - exactly what we need! @@ -612,23 +638,23 @@ InDetRttLargeD0Plots::fill(const xAOD::TruthParticle &truthParticle) { } void -InDetRttLargeD0Plots::fillBMR(const xAOD::TrackParticle &track, float weight) { +InDetRttLargeD0Plots::fillBMR(const xAOD::TrackParticle& track, float weight) { // fill the plot requiring truth matching probability less than 80% m_BadMatchRate.fillBMR(track, weight); } void -InDetRttLargeD0Plots::fillRF(const xAOD::TrackParticle &track, float weight) { +InDetRttLargeD0Plots::fillRF(const xAOD::TrackParticle& track, float weight) { // fill the plots requiring truth matching probability less than 20% m_BadMatchRate.fillRF(track, weight); } void -InDetRttLargeD0Plots::fill(const xAOD::VertexContainer &vertexContainer) { +InDetRttLargeD0Plots::fill(const xAOD::VertexContainer& vertexContainer) { // fill vertex container general properties // m_verticesPlots.fill(vertexContainer); //if ever needed // fill vertex-specific properties, for all vertices and for hard-scattering vertex - for (const auto &vtx : vertexContainer.stdcont()) { + for (const auto& vtx : vertexContainer.stdcont()) { if (vtx->vertexType() == xAOD::VxType::NoVtx) { continue; // skip dummy vertex } @@ -640,7 +666,7 @@ InDetRttLargeD0Plots::fill(const xAOD::VertexContainer &vertexContainer) { } void -InDetRttLargeD0Plots::fill(const xAOD::VertexContainer &vertexContainer, const xAOD::EventInfo &ei) { +InDetRttLargeD0Plots::fill(const xAOD::VertexContainer& vertexContainer, const xAOD::EventInfo& ei) { m_verticesPlots.fill(vertexContainer, ei); } @@ -650,114 +676,139 @@ InDetRttLargeD0Plots::fillCounter(const unsigned int freq, const InDetPerfPlot_n } void -InDetRttLargeD0Plots::fillFakeRate(const xAOD::TrackParticle &particle, \ - const bool fake, \ - const int barcode, \ - const bool trtHit, \ - const bool trtOut, \ - const int nTRTHit, \ - const int nTRTTube) { - +InDetRttLargeD0Plots::fillFakeRate(const xAOD::TrackParticle& particle, \ + const bool fake, \ + const int barcode, \ + const bool trtHit, \ + const bool trtOut, \ + const int nTRTHit, \ + const int nTRTTube) { // Declare and get necessary variables. const bool isLargeD0 = isLargeD0Track(particle); - const bool primary = (barcode < 200000 and barcode > 0); // match and ... + const bool primary = (barcode < 200000 and barcode > 0); // match and ... const bool secondary = (barcode >= 200000); // match and ... - const bool notruthlink = ((barcode == 0) or (barcode == -1)); + const bool notruthlink = ((barcode == 0)or(barcode == -1)); double tubeFrac = -1.0; - if(nTRTHit > 0) tubeFrac = ((double)nTRTTube)/((double)nTRTHit); + + if (nTRTHit > 0) { + tubeFrac = ((double) nTRTTube) / ((double) nTRTHit); + } bool tubeFrac05 = false; - if( tubeFrac < 0.5 ){ tubeFrac05 = true; } + if (tubeFrac < 0.5) { + tubeFrac05 = true; + } bool tubeFrac04 = false; - if( tubeFrac < 0.4 ){ tubeFrac04 = true; } - + if (tubeFrac < 0.4) { + tubeFrac04 = true; + } + // Fill fakerate distributions. - /* "New" definition, cf. [https://indico.cern.ch/event/559023/contributions/2255673/attachments/1314623/1968909/2016.07.25.pdf] */ + /* "New" definition, cf. + [https://indico.cern.ch/event/559023/contributions/2255673/attachments/1314623/1968909/2016.07.25.pdf] */ if (isLargeD0) { // ld0 fakes (matching prob < 0.5) or not associated to a particle with finite barcode/all ld0 tracks - m_fakePlots_ld0 .fill(particle, fake); //numerator is tracks that are fake, regardless of barcode status - m_fakePlots_ld0_trtHit .fill(particle, fake and trtHit); //for tracks with any number of trt hits - m_fakePlots_ld0_trtOut .fill(particle, fake and trtOut and not trtHit); //for tracks with some trt outliers but no trt hits - m_fakePlots_ld0_noTrt .fill(particle, fake and not trtHit and not trtOut); //tracks with no trt hits/outliers of any kind - m_fakePlots_ld0_tubeFrac051 .fill(particle, fake and trtHit and not tubeFrac05); //tracks with trt hits with tube fraction > 0.5 - m_fakePlots_ld0_tubeFrac0405 .fill(particle, fake and trtHit and tubeFrac05 and not tubeFrac04); //tracks with trt hits and tube fraction (.4,.5); - m_fakePlots_ld0_tubeFrac004 .fill(particle, fake and trtHit and tubeFrac04); //tracks with trt hits and tube fraction < 0.4 - m_fakePlots_ld0_primary .fill(particle, fake and primary); //numeator is tracks that are fake and have barcode > 0 and < 200 000 - m_fakePlots_ld0_primary_trtHit .fill(particle, fake and primary and trtHit); - m_fakePlots_ld0_primary_trtOut .fill(particle, fake and primary and trtOut and not trtHit); - m_fakePlots_ld0_primary_noTrt .fill(particle, fake and primary and not trtHit and not trtOut); - m_fakePlots_ld0_primary_tubeFrac051 .fill(particle, fake and primary and trtHit and not tubeFrac05); - m_fakePlots_ld0_primary_tubeFrac0405 .fill(particle, fake and primary and trtHit and tubeFrac05 and not tubeFrac04); - m_fakePlots_ld0_primary_tubeFrac004 .fill(particle, fake and primary and trtHit and tubeFrac04); - m_fakePlots_ld0_secondary .fill(particle, fake and secondary); //numerator is tracks that are fake and have barcode > 200 000 - m_fakePlots_ld0_secondary_trtHit .fill(particle, fake and secondary and trtHit); - m_fakePlots_ld0_secondary_trtOut .fill(particle, fake and secondary and trtOut and not trtHit); - m_fakePlots_ld0_secondary_noTrt .fill(particle, fake and secondary and not trtHit and not trtOut); - m_fakePlots_ld0_secondary_tubeFrac051 .fill(particle, fake and secondary and trtHit and not tubeFrac05); - m_fakePlots_ld0_secondary_tubeFrac0405.fill(particle, fake and secondary and trtHit and tubeFrac05 and not tubeFrac04); - m_fakePlots_ld0_secondary_tubeFrac004 .fill(particle, fake and secondary and trtHit and tubeFrac04); - m_fakePlots_ld0_linked .fill(particle, fake and (primary or secondary)); //numerator is tracks that are fake and have any finite barcode - m_fakePlots_ld0_linked_trtHit .fill(particle, fake and (primary or secondary) and trtHit); - m_fakePlots_ld0_linked_trtOut .fill(particle, fake and (primary or secondary) and trtOut and not trtHit); - m_fakePlots_ld0_linked_noTrt .fill(particle, fake and (primary or secondary) and not trtHit and not trtOut); - m_fakePlots_ld0_linked_tubeFrac051 .fill(particle, fake and (primary or secondary) and trtHit and not tubeFrac05); - m_fakePlots_ld0_linked_tubeFrac0405 .fill(particle, fake and (primary or secondary) and trtHit and tubeFrac05 and not tubeFrac04); - m_fakePlots_ld0_linked_tubeFrac004 .fill(particle, fake and (primary or secondary) and trtHit and tubeFrac04); - m_fakePlots_ld0_notruth .fill(particle, fake and notruthlink); //numerator is tracks that are fake and have barcode 0/no barcode - m_fakePlots_ld0_notruth_trtHit .fill(particle, fake and notruthlink and trtHit); - m_fakePlots_ld0_notruth_trtOut .fill(particle, fake and notruthlink and trtOut and not trtHit); - m_fakePlots_ld0_notruth_noTrt .fill(particle, fake and notruthlink and not trtHit and not trtOut); - m_fakePlots_ld0_notruth_tubeFrac051 .fill(particle, fake and notruthlink and trtHit and not tubeFrac05); - m_fakePlots_ld0_notruth_tubeFrac0405 .fill(particle, fake and notruthlink and trtHit and tubeFrac05 and not tubeFrac04); - m_fakePlots_ld0_notruth_tubeFrac004 .fill(particle, fake and notruthlink and trtHit and tubeFrac04); - m_fakePlots_ld0_combined .fill(particle, (fake or notruthlink)); //numerator tracks that are either fake or barcode 0/no barcode - m_fakePlots_ld0_combined_trtHit .fill(particle, (fake or notruthlink) and trtHit); - m_fakePlots_ld0_combined_trtOut .fill(particle, (fake or notruthlink) and trtOut and not trtHit); - m_fakePlots_ld0_combined_noTrt .fill(particle, (fake or notruthlink) and not trtHit and not trtOut); - m_fakePlots_ld0_combined_tubeFrac051 .fill(particle, (fake or notruthlink) and trtHit and not tubeFrac05); - m_fakePlots_ld0_combined_tubeFrac0405 .fill(particle, (fake or notruthlink) and trtHit and tubeFrac05 and not tubeFrac04); - m_fakePlots_ld0_combined_tubeFrac004 .fill(particle, (fake or notruthlink) and trtHit and tubeFrac04); + m_fakePlots_ld0.fill(particle, fake); // numerator is tracks that are fake, regardless of barcode status + m_fakePlots_ld0_trtHit.fill(particle, fake and trtHit); // for tracks with any number of trt hits + m_fakePlots_ld0_trtOut.fill(particle, fake and trtOut and not trtHit); // for tracks with some trt outliers but no + // trt hits + m_fakePlots_ld0_noTrt.fill(particle, fake and not trtHit and not trtOut); // tracks with no trt hits/outliers of any + // kind + m_fakePlots_ld0_tubeFrac051.fill(particle, fake and trtHit and not tubeFrac05); // tracks with trt hits with tube + // fraction > 0.5 + m_fakePlots_ld0_tubeFrac0405.fill(particle, fake and trtHit and tubeFrac05 and not tubeFrac04); // tracks with trt + // hits and tube + // fraction (.4,.5); + m_fakePlots_ld0_tubeFrac004.fill(particle, fake and trtHit and tubeFrac04); // tracks with trt hits and tube + // fraction < 0.4 + m_fakePlots_ld0_primary.fill(particle, fake and primary); // numeator is tracks that are fake and have barcode > 0 + // and < 200 000 + m_fakePlots_ld0_primary_trtHit.fill(particle, fake and primary and trtHit); + m_fakePlots_ld0_primary_trtOut.fill(particle, fake and primary and trtOut and not trtHit); + m_fakePlots_ld0_primary_noTrt.fill(particle, fake and primary and not trtHit and not trtOut); + m_fakePlots_ld0_primary_tubeFrac051.fill(particle, fake and primary and trtHit and not tubeFrac05); + m_fakePlots_ld0_primary_tubeFrac0405.fill(particle, fake and primary and trtHit and tubeFrac05 and not tubeFrac04); + m_fakePlots_ld0_primary_tubeFrac004.fill(particle, fake and primary and trtHit and tubeFrac04); + m_fakePlots_ld0_secondary.fill(particle, fake and secondary); // numerator is tracks that are fake and have barcode + // > 200 000 + m_fakePlots_ld0_secondary_trtHit.fill(particle, fake and secondary and trtHit); + m_fakePlots_ld0_secondary_trtOut.fill(particle, fake and secondary and trtOut and not trtHit); + m_fakePlots_ld0_secondary_noTrt.fill(particle, fake and secondary and not trtHit and not trtOut); + m_fakePlots_ld0_secondary_tubeFrac051.fill(particle, fake and secondary and trtHit and not tubeFrac05); + m_fakePlots_ld0_secondary_tubeFrac0405.fill(particle, + fake and secondary and trtHit and tubeFrac05 and not tubeFrac04); + m_fakePlots_ld0_secondary_tubeFrac004.fill(particle, fake and secondary and trtHit and tubeFrac04); + m_fakePlots_ld0_linked.fill(particle, fake and(primary or secondary)); // numerator is tracks that are fake and have + // any finite barcode + m_fakePlots_ld0_linked_trtHit.fill(particle, fake and(primary or secondary) and trtHit); + m_fakePlots_ld0_linked_trtOut.fill(particle, fake and(primary or secondary) and trtOut and not trtHit); + m_fakePlots_ld0_linked_noTrt.fill(particle, fake and(primary or secondary) and not trtHit and not trtOut); + m_fakePlots_ld0_linked_tubeFrac051.fill(particle, fake and(primary or secondary) and trtHit and not tubeFrac05); + m_fakePlots_ld0_linked_tubeFrac0405.fill(particle, fake and( + primary or secondary) and trtHit and tubeFrac05 and not tubeFrac04); + m_fakePlots_ld0_linked_tubeFrac004.fill(particle, fake and(primary or secondary) and trtHit and tubeFrac04); + m_fakePlots_ld0_notruth.fill(particle, fake and notruthlink); // numerator is tracks that are fake and have barcode + // 0/no barcode + m_fakePlots_ld0_notruth_trtHit.fill(particle, fake and notruthlink and trtHit); + m_fakePlots_ld0_notruth_trtOut.fill(particle, fake and notruthlink and trtOut and not trtHit); + m_fakePlots_ld0_notruth_noTrt.fill(particle, fake and notruthlink and not trtHit and not trtOut); + m_fakePlots_ld0_notruth_tubeFrac051.fill(particle, fake and notruthlink and trtHit and not tubeFrac05); + m_fakePlots_ld0_notruth_tubeFrac0405.fill(particle, + fake and notruthlink and trtHit and tubeFrac05 and not tubeFrac04); + m_fakePlots_ld0_notruth_tubeFrac004.fill(particle, fake and notruthlink and trtHit and tubeFrac04); + m_fakePlots_ld0_combined.fill(particle, (fake or notruthlink)); // numerator tracks that are either fake or barcode + // 0/no barcode + m_fakePlots_ld0_combined_trtHit.fill(particle, (fake or notruthlink) and trtHit); + m_fakePlots_ld0_combined_trtOut.fill(particle, (fake or notruthlink) and trtOut and not trtHit); + m_fakePlots_ld0_combined_noTrt.fill(particle, (fake or notruthlink) and not trtHit and not trtOut); + m_fakePlots_ld0_combined_tubeFrac051.fill(particle, (fake or notruthlink) and trtHit and not tubeFrac05); + m_fakePlots_ld0_combined_tubeFrac0405.fill(particle, + (fake or notruthlink) and trtHit and tubeFrac05 and not tubeFrac04); + m_fakePlots_ld0_combined_tubeFrac004.fill(particle, (fake or notruthlink) and trtHit and tubeFrac04); } else {// st fakes (matching prob < 0.5) or not associated to a particle with finite barcode/all std tracks - m_fakePlots_st .fill(particle, fake); - m_fakePlots_st_trtHit .fill(particle, fake and trtHit); - m_fakePlots_st_trtOut .fill(particle, fake and trtOut and not trtHit); - m_fakePlots_st_noTrt .fill(particle, fake and not trtHit and not trtOut); - m_fakePlots_st_primary .fill(particle, fake and primary); - m_fakePlots_st_tubeFrac051 .fill(particle, fake and trtHit and not tubeFrac05); - m_fakePlots_st_tubeFrac0405 .fill(particle, fake and trtHit and tubeFrac05 and not tubeFrac04); - m_fakePlots_st_tubeFrac004 .fill(particle, fake and trtHit and tubeFrac04); - m_fakePlots_st_primary_trtHit .fill(particle, fake and primary and trtHit); - m_fakePlots_st_primary_trtOut .fill(particle, fake and primary and trtOut and not trtHit); - m_fakePlots_st_primary_noTrt .fill(particle, fake and primary and not trtHit and not trtOut); - m_fakePlots_st_primary_tubeFrac051 .fill(particle, fake and primary and trtHit and not tubeFrac05); - m_fakePlots_st_primary_tubeFrac0405 .fill(particle, fake and primary and trtHit and tubeFrac05 and not tubeFrac04); - m_fakePlots_st_primary_tubeFrac004 .fill(particle, fake and primary and trtHit and tubeFrac04); - m_fakePlots_st_secondary .fill(particle, fake and secondary); - m_fakePlots_st_secondary_trtHit .fill(particle, fake and secondary and trtHit); - m_fakePlots_st_secondary_trtOut .fill(particle, fake and secondary and trtOut and not trtHit); - m_fakePlots_st_secondary_noTrt .fill(particle, fake and secondary and not trtHit and not trtOut); - m_fakePlots_st_secondary_tubeFrac051 .fill(particle, fake and secondary and trtHit and not tubeFrac05); - m_fakePlots_st_secondary_tubeFrac0405 .fill(particle, fake and secondary and trtHit and tubeFrac05 and not tubeFrac04); - m_fakePlots_st_secondary_tubeFrac004 .fill(particle, fake and secondary and trtHit and tubeFrac04); - m_fakePlots_st_linked_trtHit .fill(particle, fake and (primary or secondary) and trtHit); - m_fakePlots_st_linked_trtOut .fill(particle, fake and (primary or secondary) and trtOut and not trtHit); - m_fakePlots_st_linked_noTrt .fill(particle, fake and (primary or secondary) and not trtHit and not trtOut); - m_fakePlots_st_linked_tubeFrac051 .fill(particle, fake and (primary or secondary) and trtHit and not tubeFrac05); - m_fakePlots_st_linked_tubeFrac0405 .fill(particle, fake and (primary or secondary) and trtHit and tubeFrac05 and not tubeFrac04); - m_fakePlots_st_linked_tubeFrac004 .fill(particle, fake and (primary or secondary) and trtHit and tubeFrac04); - m_fakePlots_st_linked .fill(particle, fake and (primary or secondary)); - m_fakePlots_st_notruth .fill(particle, fake and notruthlink); - m_fakePlots_st_notruth_trtHit .fill(particle, fake and notruthlink and trtHit); - m_fakePlots_st_notruth_trtOut .fill(particle, fake and notruthlink and trtOut and not trtHit); - m_fakePlots_st_notruth_noTrt .fill(particle, fake and notruthlink and not trtHit and not trtOut); - m_fakePlots_st_notruth_tubeFrac051 .fill(particle, fake and notruthlink and trtHit and not tubeFrac05); - m_fakePlots_st_notruth_tubeFrac0405 .fill(particle, fake and notruthlink and trtHit and tubeFrac05 and not tubeFrac04); - m_fakePlots_st_notruth_tubeFrac004 .fill(particle, fake and notruthlink and trtHit and tubeFrac04); - m_fakePlots_st_combined .fill(particle, (fake or notruthlink)); - m_fakePlots_st_combined_trtHit .fill(particle, (fake or notruthlink) and trtHit); - m_fakePlots_st_combined_trtOut .fill(particle, (fake or notruthlink) and trtOut and not trtHit); - m_fakePlots_st_combined_noTrt .fill(particle, (fake or notruthlink) and not trtHit and not trtOut); - m_fakePlots_st_combined_tubeFrac051 .fill(particle, (fake or notruthlink) and trtHit and not tubeFrac05); - m_fakePlots_st_combined_tubeFrac0405 .fill(particle, (fake or notruthlink) and trtHit and tubeFrac05 and not tubeFrac04); - m_fakePlots_st_combined_tubeFrac004 .fill(particle, (fake or notruthlink) and trtHit and tubeFrac04); + m_fakePlots_st.fill(particle, fake); + m_fakePlots_st_trtHit.fill(particle, fake and trtHit); + m_fakePlots_st_trtOut.fill(particle, fake and trtOut and not trtHit); + m_fakePlots_st_noTrt.fill(particle, fake and not trtHit and not trtOut); + m_fakePlots_st_primary.fill(particle, fake and primary); + m_fakePlots_st_tubeFrac051.fill(particle, fake and trtHit and not tubeFrac05); + m_fakePlots_st_tubeFrac0405.fill(particle, fake and trtHit and tubeFrac05 and not tubeFrac04); + m_fakePlots_st_tubeFrac004.fill(particle, fake and trtHit and tubeFrac04); + m_fakePlots_st_primary_trtHit.fill(particle, fake and primary and trtHit); + m_fakePlots_st_primary_trtOut.fill(particle, fake and primary and trtOut and not trtHit); + m_fakePlots_st_primary_noTrt.fill(particle, fake and primary and not trtHit and not trtOut); + m_fakePlots_st_primary_tubeFrac051.fill(particle, fake and primary and trtHit and not tubeFrac05); + m_fakePlots_st_primary_tubeFrac0405.fill(particle, fake and primary and trtHit and tubeFrac05 and not tubeFrac04); + m_fakePlots_st_primary_tubeFrac004.fill(particle, fake and primary and trtHit and tubeFrac04); + m_fakePlots_st_secondary.fill(particle, fake and secondary); + m_fakePlots_st_secondary_trtHit.fill(particle, fake and secondary and trtHit); + m_fakePlots_st_secondary_trtOut.fill(particle, fake and secondary and trtOut and not trtHit); + m_fakePlots_st_secondary_noTrt.fill(particle, fake and secondary and not trtHit and not trtOut); + m_fakePlots_st_secondary_tubeFrac051.fill(particle, fake and secondary and trtHit and not tubeFrac05); + m_fakePlots_st_secondary_tubeFrac0405.fill(particle, + fake and secondary and trtHit and tubeFrac05 and not tubeFrac04); + m_fakePlots_st_secondary_tubeFrac004.fill(particle, fake and secondary and trtHit and tubeFrac04); + m_fakePlots_st_linked_trtHit.fill(particle, fake and(primary or secondary) and trtHit); + m_fakePlots_st_linked_trtOut.fill(particle, fake and(primary or secondary) and trtOut and not trtHit); + m_fakePlots_st_linked_noTrt.fill(particle, fake and(primary or secondary) and not trtHit and not trtOut); + m_fakePlots_st_linked_tubeFrac051.fill(particle, fake and(primary or secondary) and trtHit and not tubeFrac05); + m_fakePlots_st_linked_tubeFrac0405.fill(particle, fake and( + primary or secondary) and trtHit and tubeFrac05 and not tubeFrac04); + m_fakePlots_st_linked_tubeFrac004.fill(particle, fake and(primary or secondary) and trtHit and tubeFrac04); + m_fakePlots_st_linked.fill(particle, fake and(primary or secondary)); + m_fakePlots_st_notruth.fill(particle, fake and notruthlink); + m_fakePlots_st_notruth_trtHit.fill(particle, fake and notruthlink and trtHit); + m_fakePlots_st_notruth_trtOut.fill(particle, fake and notruthlink and trtOut and not trtHit); + m_fakePlots_st_notruth_noTrt.fill(particle, fake and notruthlink and not trtHit and not trtOut); + m_fakePlots_st_notruth_tubeFrac051.fill(particle, fake and notruthlink and trtHit and not tubeFrac05); + m_fakePlots_st_notruth_tubeFrac0405.fill(particle, + fake and notruthlink and trtHit and tubeFrac05 and not tubeFrac04); + m_fakePlots_st_notruth_tubeFrac004.fill(particle, fake and notruthlink and trtHit and tubeFrac04); + m_fakePlots_st_combined.fill(particle, (fake or notruthlink)); + m_fakePlots_st_combined_trtHit.fill(particle, (fake or notruthlink) and trtHit); + m_fakePlots_st_combined_trtOut.fill(particle, (fake or notruthlink) and trtOut and not trtHit); + m_fakePlots_st_combined_noTrt.fill(particle, (fake or notruthlink) and not trtHit and not trtOut); + m_fakePlots_st_combined_tubeFrac051.fill(particle, (fake or notruthlink) and trtHit and not tubeFrac05); + m_fakePlots_st_combined_tubeFrac0405.fill(particle, + (fake or notruthlink) and trtHit and tubeFrac05 and not tubeFrac04); + m_fakePlots_st_combined_tubeFrac004.fill(particle, (fake or notruthlink) and trtHit and tubeFrac04); } - } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttLargeD0Plots.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttLargeD0Plots.h index 31b4d6cc5d809d4260e1629e639f12a98fb47613..f321d7a8adb69040d6f2047314b7667a502d1669 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttLargeD0Plots.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttLargeD0Plots.h @@ -49,53 +49,55 @@ ///class holding all plots for Inner Detector RTT Validation and implementing fill methods class InDetRttLargeD0Plots: public InDetPlotBase { public: - InDetRttLargeD0Plots(InDetPlotBase *pParent, const std::string &dirName); + InDetRttLargeD0Plots(InDetPlotBase* pParent, const std::string& dirName); ///fill for things needing truth and track only // void fill(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthParticle); // not used. SC ///fill for things needing track only - void fill(const xAOD::TrackParticle &particle); - void fill(const xAOD::TrackParticle &particle, const int barcode, const xAOD::EventInfo& ei, const xAOD::VertexContainer& pv); + void fill(const xAOD::TrackParticle& particle); + void fill(const xAOD::TrackParticle& particle, const int barcode, const xAOD::EventInfo& ei, + const xAOD::VertexContainer& pv); ///fill for things needing truth only - void fill(const xAOD::TruthParticle &particle); + void fill(const xAOD::TruthParticle& particle); ///fill for things needing all truth - not just the ones from the reco tracks - void fillTruth(const xAOD::TruthParticle &particle); + void fillTruth(const xAOD::TruthParticle& particle); - void pro_fill(const xAOD::TruthParticle &truth, float weight); + void fillEfficiency(const xAOD::TruthParticle& truth, const bool isGood); - void fillEfficiency(const xAOD::TruthParticle &particle, \ + void fillEfficiency(const xAOD::TruthParticle& particle, \ const bool isReconstructed, \ - const bool isLargeD0Track = false, \ - const bool hasTRTHit = false, \ - const bool hasTRTOut = false, \ - const int nTrtHits = 0, \ - const int nTrtTubeHits = 0, \ + const bool isLargeD0Track, \ + const bool hasTRTHit = false, \ + const bool hasTRTOut = false, \ + const int nTrtHits = 0, \ + const int nTrtTubeHits = 0, \ const bool isSignal = false); // fill the fake and bad match rate plots - void fillBMR(const xAOD::TrackParticle &track, float weight); - void fillRF(const xAOD::TrackParticle &track, float weight); + void fillBMR(const xAOD::TrackParticle& track, float weight); + void fillRF(const xAOD::TrackParticle& track, float weight); ///fill reco-vertex related plots - void fill(const xAOD::VertexContainer &vertexContainer); + void fill(const xAOD::VertexContainer& vertexContainer); ///fill reco-vertex related plots that need EventInfo - void fill(const xAOD::VertexContainer &vertexContainer, const xAOD::EventInfo &ei); + void fill(const xAOD::VertexContainer& vertexContainer, const xAOD::EventInfo& ei); virtual ~InDetRttLargeD0Plots() {/**nop**/ }; ///fill for Counters void fillCounter(const unsigned int freq, const InDetPerfPlot_nTracks::CounterCategory counter); ///fill for fakes - void fillFakeRate(const xAOD::TrackParticle &particle, \ - const bool isFake, \ - const int barcode = -1, \ - const bool trtHit = false, \ - const bool trtOut = false, \ - const int nTRTHit = 0, \ - const int nTRTTube = 0); + void fillFakeRate(const xAOD::TrackParticle& particle, \ + const bool isFake, \ + const int barcode = -1, \ + const bool trtHit = false, \ + const bool trtOut = false, \ + const int nTRTHit = 0, \ + const int nTRTTube = 0); ///fill for fakes (Siinn) - void fillFake(const xAOD::TrackParticle &particle, const int barcode, const xAOD::EventInfo &ei, const xAOD::VertexContainer &pv); + void fillFake(const xAOD::TrackParticle& particle, const int barcode, const xAOD::EventInfo& ei, + const xAOD::VertexContainer& pv); private: // ============================================ // Plots used for LargeD0 performance study @@ -148,7 +150,7 @@ private: InDetBasicPlot m_basicPlot_st_fake_primary; InDetBasicPlot m_basicPlot_st_fake_secondary; InDetBasicPlot m_basicPlot_st_fake_noTruthLink; - + InDetBasicPlot m_basicPlot_ld0_matched; InDetBasicPlot m_basicPlot_ld0_matched_primary; InDetBasicPlot m_basicPlot_ld0_matched_secondary; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx index a087d96d35cf2b42a172d417a9e1b026d7203c39..c33cb21eff6716f1a6fde8deb2e6f5fe40b03596 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.cxx @@ -20,7 +20,7 @@ namespace { // utility functions used in this area - stolen from InDetPhysValMon // nice as should be in a common header somewhere // get truth/track matching probability float - getMatchingProbability(const xAOD::TrackParticle &trackParticle) { + getMatchingProbability(const xAOD::TrackParticle& trackParticle) { float result(std::numeric_limits<float>::quiet_NaN()); if (trackParticle.isAvailable<float>("truthMatchProbability")) { @@ -31,12 +31,10 @@ namespace { // utility functions used in this area - stolen from InDetPhysValMon }// namespace -InDetRttPlots::InDetRttPlots(InDetPlotBase *pParent, const std::string &sDir) : InDetPlotBase(pParent, sDir), +InDetRttPlots::InDetRttPlots(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase(pParent, sDir), m_ptPlot(this, "Tracks/SelectedGoodTracks"), m_basicPlot(this, "Tracks/SelectedGoodTracks"), - m_PtEtaPlots(this, "Tracks/SelectedGoodTracks", "TrackParticle"), - m_IPPlots(this, "Tracks/SelectedGoodTracks"), m_TrackRecoInfoPlots(this, "Tracks/SelectedGoodTracks"), m_TrackTruthInfoPlots(this, "Truth"), m_nTracks(this, "Tracks/SelectedGoodTracks"), @@ -46,11 +44,10 @@ InDetRttPlots::InDetRttPlots(InDetPlotBase *pParent, const std::string &sDir) : m_fakePlots(this, "Tracks/SelectedFakeTracks"), m_ITkResolutionPlotPrim(nullptr), m_ITkResolutionPlotSecd(nullptr), - m_hitsPlots(this, "Tracks/SelectedGoodTracks"), m_hitsMatchedTracksPlots(this, "Tracks/SelectedMatchedTracks"), - m_hitsFakeTracksPlots(this, "Tracks/SelectedFakeTracks"), m_hitsDetailedPlots(this, "Tracks/SelectedGoodTracks"), m_effPlots(this, "Tracks/SelectedGoodTracks"), + m_dumPlots(this, "Tracks/SelectedGoodTracks"), m_BadMatchRate(this, "Tracks/SelectedBadMatchTracks"), m_verticesPlots(this, "Vertices/AllPrimaryVertices"), m_vertexPlots(this, "Vertices/AllPrimaryVertices"), @@ -59,10 +56,8 @@ InDetRttPlots::InDetRttPlots(InDetPlotBase *pParent, const std::string &sDir) : m_trkInJetPlot(this, "Tracks/SelectedGoodJetTracks"), m_trkInJetPlot_highPt(this, "Tracks/SelectedGoodHighPtJetTracks"), m_trkInJetPtPlot(this, "Tracks/SelectedGoodJetTracks"), - m_trkInJetPtEtaPlots(this, "Tracks/SelectedGoodJetTracks", "TrackParticle"), - m_trkInJetIPPlots(this, "Tracks/SelectedGoodJetTracks"), + m_trkInJetBasicPlot(this, "Tracks/SelectedGoodJetTracks"), m_trkInJetTrackRecoInfoPlots(this, "Tracks/SelectedGoodJetTracks"), - m_trkInJetHitsPlots(this, "Tracks/SelectedGoodJetTracks"), m_trkInJetHitsDetailedPlots(this, "Tracks/SelectedGoodJetTracks"), m_trkInJetFakePlots(this, "Tracks/SelectedFakeJetTracks"), m_trkInJetResPlots(this, "Tracks/SelectedGoodJetTracks"), @@ -95,7 +90,7 @@ InDetRttPlots::InDetRttPlots(InDetPlotBase *pParent, const std::string &sDir) : } void -InDetRttPlots::fill(const xAOD::TrackParticle &particle, const xAOD::TruthParticle &truthParticle) { +InDetRttPlots::fill(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthParticle) { // fill measurement bias, resolution, and pull plots m_resPlots.fill(particle, truthParticle); m_basicPlot.fill(truthParticle); @@ -107,7 +102,7 @@ InDetRttPlots::fill(const xAOD::TrackParticle &particle, const xAOD::TruthPartic float barcode = truthParticle.barcode(); if (barcode < 200000 && barcode != 0 && prob > 0.5) { m_ITkResolutionPlotPrim->fill(particle, truthParticle); - }else if (barcode >= 200000 && prob > 0.7) { + } else if (barcode >= 200000 && prob > 0.7) { m_ITkResolutionPlotSecd->fill(particle, truthParticle); } } @@ -120,108 +115,126 @@ InDetRttPlots::fill(const xAOD::TrackParticle &particle, const xAOD::TruthPartic } void -InDetRttPlots::fillSpectrum(const xAOD::TrackParticle &trackParticle) { +InDetRttPlots::fillSpectrum(const xAOD::TrackParticle& trackParticle) { float prob = getMatchingProbability(trackParticle); m_specPlots.fillSpectrum(trackParticle, prob); } void -InDetRttPlots::fillSpectrum(const xAOD::TruthParticle &particle) { +InDetRttPlots::fillSpectrum(const xAOD::TruthParticle& particle) { m_specPlots.fillSpectrum(particle); } void -InDetRttPlots::fillSpectrum(const xAOD::TrackParticle &trkprt, const xAOD::TruthVertex &truthVrt) { +InDetRttPlots::fillSpectrum(const xAOD::TrackParticle& trkprt, const xAOD::TruthVertex& truthVrt) { m_specPlots.fillSpectrum(trkprt, truthVrt); } void -InDetRttPlots::fillSpectrum(const xAOD::TrackParticle &trkprt, const xAOD::Vertex &vertex, bool fill) { +InDetRttPlots::fillSpectrum(const xAOD::TrackParticle& trkprt, const xAOD::Vertex& vertex, bool fill) { m_specPlots.fillSpectrum(trkprt, vertex, fill); } void -InDetRttPlots::fillSpectrumLinked(const xAOD::TrackParticle &particle, const xAOD::TruthParticle &truthParticle, float /*weight*/) { +InDetRttPlots::fillSpectrumLinked(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthParticle, + float /*weight*/) { double prob = getMatchingProbability(particle); m_specPlots.fillSpectrumLinked(particle, truthParticle, prob); } void -InDetRttPlots::fillLinkedandUnlinked(const xAOD::TrackParticle &particle, float Prim_w, float Sec_w, float Unlinked_w) { +InDetRttPlots::fillLinkedandUnlinked(const xAOD::TrackParticle& particle, float Prim_w, float Sec_w, float Unlinked_w) { m_fakePlots.fillLinkedandUnlinked(particle, Prim_w, Sec_w, Unlinked_w); } void -InDetRttPlots::fillSpectrumUnlinked2(const xAOD::TrackParticle &particle) { +InDetRttPlots::fillSpectrumUnlinked2(const xAOD::TrackParticle& particle) { double prob = getMatchingProbability(particle); m_specPlots.fillSpectrumUnlinked2(particle, prob); } void -InDetRttPlots::fillSingleMatch(const xAOD::TrackParticle &trackParticle) { +InDetRttPlots::fillSingleMatch(const xAOD::TrackParticle& trackParticle) { m_duplicatePlots.fillSingleMatch(trackParticle); } void -InDetRttPlots::fillTwoMatchDuplicate(Float_t prob1, Float_t prob2, const xAOD::TrackParticle &trackParticle, - const xAOD::TrackParticle &particle, const xAOD::TruthParticle &tp) { +InDetRttPlots::fillTwoMatchDuplicate(Float_t prob1, Float_t prob2, const xAOD::TrackParticle& trackParticle, + const xAOD::TrackParticle& particle, const xAOD::TruthParticle& tp) { m_duplicatePlots.fillTwoMatchDuplicate(prob1, prob2, trackParticle, particle, tp); } void -InDetRttPlots::fill(const xAOD::TrackParticle &particle) { +InDetRttPlots::fill(const xAOD::TrackParticle& particle) { m_hitResidualPlot.fill(particle); m_hitEffPlot.fill(particle); // fill pt plots - m_ptPlot.fill(particle); + m_ptPlot.fill(particle); // to maintain correspondence with old InDetPerformanceRTT m_basicPlot.fill(particle); - m_PtEtaPlots.fill(particle); - m_IPPlots.fill(particle); m_TrackRecoInfoPlots.fill(particle); - m_hitsPlots.fill(particle); m_hitsDetailedPlots.fill(particle); } void -InDetRttPlots::pro_fill(const xAOD::TruthParticle &truth, float weight) { - m_effPlots.pro_fill(truth, weight); +InDetRttPlots::fillEfficiency(const xAOD::TruthParticle& truth, const bool isGood) { + m_effPlots.fill(truth, isGood); m_fakePlots.fillIncFakeDenom(truth); } void -InDetRttPlots::lepton_fill(const xAOD::TruthParticle &truth, float weight){ - m_effPlots.lepton_fill(truth, weight); +InDetRttPlots::lepton_fill(const xAOD::TruthParticle& truth, float weight) { + m_dumPlots.lepton_fill(truth, weight); } void -InDetRttPlots::BT_fill(const xAOD::TruthParticle &truth, float weight) { +InDetRttPlots::prim_photon_fill(const xAOD::TruthParticle& truth) { + m_dumPlots.prim_photon_fill(truth); +} + +void +InDetRttPlots::brem_photon_fill(const xAOD::TruthParticle& truth) { + m_dumPlots.brem_photon_fill(truth); +} + +void +InDetRttPlots::track_vs_truth(const xAOD::TrackParticle& track,const xAOD::TruthParticle& truth, float tmp){ + m_dumPlots.track_vs_truth(track, truth, tmp); +} + +void +InDetRttPlots::minDR(float min_dR, float prod_rad, float bestmatch, double BIDPt){ + m_dumPlots.minDR(min_dR, prod_rad, bestmatch, BIDPt); +} + +void +InDetRttPlots::BT_fill(const xAOD::TruthParticle& truth, float weight) { m_effPlots.BT_fill(truth, weight); } void -InDetRttPlots::fill(const xAOD::TruthParticle &truthParticle) { +InDetRttPlots::fill(const xAOD::TruthParticle& truthParticle) { // fill truth plots m_TrackTruthInfoPlots.fill(truthParticle); } void -InDetRttPlots::fillBMR(const xAOD::TrackParticle &track, float weight) { +InDetRttPlots::fillBMR(const xAOD::TrackParticle& track, float weight) { // fill the plot requiring truth matching probability less than the upper limit (50.1% right now) m_BadMatchRate.fillBMR(track, weight); } void -InDetRttPlots::fillRF(const xAOD::TrackParticle &track, float weight) { +InDetRttPlots::fillRF(const xAOD::TrackParticle& track, float weight) { // fill the plot requiring truth matching probability less than the lower limit (50.0% right now) m_BadMatchRate.fillRF(track, weight); } void -InDetRttPlots::fill(const xAOD::VertexContainer &vertexContainer) { +InDetRttPlots::fill(const xAOD::VertexContainer& vertexContainer) { // fill vertex container general properties // m_verticesPlots.fill(vertexContainer); //if ever needed // fill vertex-specific properties, for all vertices and for hard-scattering vertex - for (const auto &vtx : vertexContainer.stdcont()) { + for (const auto& vtx : vertexContainer.stdcont()) { if (vtx->vertexType() == xAOD::VxType::NoVtx) { continue; // skip dummy vertex } @@ -233,7 +246,7 @@ InDetRttPlots::fill(const xAOD::VertexContainer &vertexContainer) { } void -InDetRttPlots::fill(const xAOD::VertexContainer &vertexContainer, const xAOD::EventInfo &ei) { +InDetRttPlots::fill(const xAOD::VertexContainer& vertexContainer, const xAOD::EventInfo& ei) { m_verticesPlots.fill(vertexContainer, ei); } @@ -243,13 +256,13 @@ InDetRttPlots::fillCounter(const unsigned int freq, const InDetPerfPlot_nTracks: } void -InDetRttPlots::fillFakeRate(const xAOD::TrackParticle &particle, const bool match, +InDetRttPlots::fillFakeRate(const xAOD::TrackParticle& particle, const bool match, const InDetPerfPlot_fakes::Category c) { m_fakePlots.fill(particle, match, c); } bool -InDetRttPlots::filltrkInJetPlot(const xAOD::TrackParticle &particle, const xAOD::Jet &jet) { +InDetRttPlots::filltrkInJetPlot(const xAOD::TrackParticle& particle, const xAOD::Jet& jet) { ATH_MSG_VERBOSE("Filling trk in jet"); bool pass = m_trkInJetPlot.fill(particle, jet); ATH_MSG_VERBOSE("Filling trk in jet hi pt"); @@ -258,13 +271,11 @@ InDetRttPlots::filltrkInJetPlot(const xAOD::TrackParticle &particle, const xAOD: } void -InDetRttPlots::fillSimpleJetPlots(const xAOD::TrackParticle &particle, float prob) { +InDetRttPlots::fillSimpleJetPlots(const xAOD::TrackParticle& particle, float prob) { // the full suit of track plots m_trkInJetPtPlot.fill(particle); - m_trkInJetPtEtaPlots.fill(particle); - m_trkInJetIPPlots.fill(particle); + m_trkInJetBasicPlot.fill(particle); m_trkInJetTrackRecoInfoPlots.fill(particle); - m_trkInJetHitsPlots.fill(particle); m_trkInJetHitsDetailedPlots.fill(particle); if (std::isnan(prob)) { @@ -275,17 +286,17 @@ InDetRttPlots::fillSimpleJetPlots(const xAOD::TrackParticle &particle, float pro } void -InDetRttPlots::fillJetHitsPlots(const xAOD::TrackParticle &particle, float prob, int barcode) { +InDetRttPlots::fillJetHitsPlots(const xAOD::TrackParticle& particle, float prob, int barcode) { if (prob < m_truthProbLowThreshold) { m_trkInJetHitsFakeTracksPlots.fill(particle); - }else if (barcode < 100000 && barcode != 0) { + } else if (barcode < 100000 && barcode != 0) { m_trkInJetHitsMatchedTracksPlots.fill(particle); } } void -InDetRttPlots::fillJetResPlots(const xAOD::TrackParticle &particle, const xAOD::TruthParticle &truth, - const xAOD::Jet &jet) { +InDetRttPlots::fillJetResPlots(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truth, + const xAOD::Jet& jet) { // fill pull and resolution plots m_trkInJetResPlots.fill(particle, truth); if (particle.pt() > 10e3) { // 10 GeV @@ -304,43 +315,40 @@ InDetRttPlots::fillJetResPlots(const xAOD::TrackParticle &particle, const xAOD:: } void -InDetRttPlots::fillJetEffPlots(const xAOD::TruthParticle &truth, const xAOD::Jet &jet) { +InDetRttPlots::fillJetEffPlots(const xAOD::TruthParticle& truth, const xAOD::Jet& jet) { m_trkInJetPlot.BookEffReco(truth, jet); // fill hists with truth info! m_trkInJetPlot_highPt.BookEffReco(truth, jet); // fill hists with truth info! } void -InDetRttPlots::jet_fill(const xAOD::TrackParticle &track, const xAOD::Jet &jet, float weight) { +InDetRttPlots::jet_fill(const xAOD::TrackParticle& track, const xAOD::Jet& jet, float weight) { m_trkInJetEffPlots.jet_fill(track, jet, weight); } void -InDetRttPlots::jetBMR(const xAOD::TrackParticle &track, const xAOD::Jet &jet, float weight) { +InDetRttPlots::jetBMR(const xAOD::TrackParticle& track, const xAOD::Jet& jet, float weight) { m_BadMatchRate.jetBMR(track, jet, weight); } void -InDetRttPlots::fillJetTrkTruth(const xAOD::TruthParticle &truth, const xAOD::Jet &jet) { +InDetRttPlots::fillJetTrkTruth(const xAOD::TruthParticle& truth, const xAOD::Jet& jet) { m_trkInJetPlot.BookEffTruth(truth, jet); m_trkInJetPlot_highPt.BookEffTruth(truth, jet); } void -InDetRttPlots::fillJetPlotCounter(const xAOD::Jet &jet) { +InDetRttPlots::fillJetPlotCounter(const xAOD::Jet& jet) { m_trkInJetPlot.fillCounter(jet); m_trkInJetPlot_highPt.fillCounter(jet); } void -InDetRttPlots::fillJetTrkTruthCounter(const xAOD::Jet &jet) { +InDetRttPlots::fillJetTrkTruthCounter(const xAOD::Jet& jet) { m_trkInJetPlot.fillEff(jet); m_trkInJetPlot_highPt.fillEff(jet); } void -InDetRttPlots::fillIncTrkRate(const unsigned int nMuEvents, std::vector<int> incTrkNum, std::vector<int> incTrkDenom) -{ - m_fakePlots.fillIncTrkRate(nMuEvents,incTrkNum,incTrkDenom); - +InDetRttPlots::fillIncTrkRate(const unsigned int nMuEvents, std::vector<int> incTrkNum, std::vector<int> incTrkDenom) { + m_fakePlots.fillIncTrkRate(nMuEvents, incTrkNum, incTrkDenom); } - diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.h index 5b6c9b9cb65e1a2a3c214ffbe2c5fe0ecb420365..2d2e29e2ec52880bdc5fe01c4da90362c1747869 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetRttPlots.h @@ -17,8 +17,7 @@ #include "InDetPlotBase.h" #include "InDetPerfPlot_Pt.h" #include "InDetBasicPlot.h" -#include "TrkValHistUtils/ParamPlots.h" -#include "TrkValHistUtils/ImpactPlots.h" + #include "TrkValHistUtils/RecoInfoPlots.h" #include "TrkValHistUtils/TruthInfoPlots.h" #include "InDetPerfPlot_nTracks.h" @@ -30,6 +29,7 @@ #include "InDetPerfPlot_spectrum.h" #include "InDetPerfPlot_duplicate.h" +#include "InDetDummyPlots.h" #include "InDet_BadMatchRate.h" #include "TrkValHistUtils/IDHitPlots.h" @@ -49,74 +49,77 @@ ///class holding all plots for Inner Detector RTT Validation and implementing fill methods class InDetRttPlots: public InDetPlotBase { public: - InDetRttPlots(InDetPlotBase *pParent, const std::string &dirName); + InDetRttPlots(InDetPlotBase* pParent, const std::string& dirName); void SetFillExtraTIDEPlots(bool fillthem) { m_moreJetPlots = fillthem; } ///fill for things needing truth and track only - void fill(const xAOD::TrackParticle &particle, const xAOD::TruthParticle &truthParticle); + void fill(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthParticle); ///fill for things needing track only - void fill(const xAOD::TrackParticle &particle); + void fill(const xAOD::TrackParticle& particle); ///fill for things needing truth only - void fill(const xAOD::TruthParticle &particle); - void fillSpectrum(const xAOD::TrackParticle &trackParticle); - void fillSpectrum(const xAOD::TruthParticle &particle); - void fillSpectrum(const xAOD::TrackParticle &trkprt, const xAOD::TruthVertex &truthVrt); - void fillSpectrum(const xAOD::TrackParticle &trkprt, const xAOD::Vertex &vertex); - void fillSpectrum(const xAOD::TrackParticle &trkprt, const xAOD::Vertex &vertex, bool fill); - void fillSpectrumLinked(const xAOD::TrackParticle &particle, const xAOD::TruthParticle &truthParticle, float weight); - void fillLinkedandUnlinked(const xAOD::TrackParticle &particle, float Prim_w, float Sec_w, float Unlinked_w); - void fillSpectrumUnlinked2(const xAOD::TrackParticle &particle); - void fillSingleMatch(const xAOD::TrackParticle &trackParticle); - void fillTwoMatchDuplicate(Float_t prob1, Float_t prob2, const xAOD::TrackParticle &trackParticle, - const xAOD::TrackParticle &particle, const xAOD::TruthParticle &tp); + void fill(const xAOD::TruthParticle& particle); + ///Fill for efficiency plots + void fillEfficiency(const xAOD::TruthParticle& truth, const bool isGood); + + void fillSpectrum(const xAOD::TrackParticle& trackParticle); + void fillSpectrum(const xAOD::TruthParticle& particle); + void fillSpectrum(const xAOD::TrackParticle& trkprt, const xAOD::TruthVertex& truthVrt); + void fillSpectrum(const xAOD::TrackParticle& trkprt, const xAOD::Vertex& vertex); + void fillSpectrum(const xAOD::TrackParticle& trkprt, const xAOD::Vertex& vertex, bool fill); + void fillSpectrumLinked(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthParticle, float weight); + void fillLinkedandUnlinked(const xAOD::TrackParticle& particle, float Prim_w, float Sec_w, float Unlinked_w); + void fillSpectrumUnlinked2(const xAOD::TrackParticle& particle); + void fillSingleMatch(const xAOD::TrackParticle& trackParticle); + void fillTwoMatchDuplicate(Float_t prob1, Float_t prob2, const xAOD::TrackParticle& trackParticle, + const xAOD::TrackParticle& particle, const xAOD::TruthParticle& tp); ///fill for things needing all truth - not just the ones from the reco tracks - void pro_fill(const xAOD::TruthParticle &truth, float weight); - - void lepton_fill(const xAOD::TruthParticle &truth, float weight); - void BT_fill(const xAOD::TruthParticle &truth, float weight); + void lepton_fill(const xAOD::TruthParticle& truth, float weight); + void prim_photon_fill(const xAOD::TruthParticle& truth); + void brem_photon_fill(const xAOD::TruthParticle& truth); + void track_vs_truth(const xAOD::TrackParticle& track, const xAOD::TruthParticle& truth, float tmp); + void minDR(float min_dR, float prod_rad, float bestmatch, double BIDPt); + void BT_fill(const xAOD::TruthParticle& truth, float weight); // fill the fake and bad match rate plots - void fillBMR(const xAOD::TrackParticle &track, float weight); - void fillRF(const xAOD::TrackParticle &track, float weight); + void fillBMR(const xAOD::TrackParticle& track, float weight); + void fillRF(const xAOD::TrackParticle& track, float weight); ///fill reco-vertex related plots - void fill(const xAOD::VertexContainer &vertexContainer); + void fill(const xAOD::VertexContainer& vertexContainer); ///fill reco-vertex related plots that need EventInfo - void fill(const xAOD::VertexContainer &vertexContainer, const xAOD::EventInfo &ei); + void fill(const xAOD::VertexContainer& vertexContainer, const xAOD::EventInfo& ei); // New set has replaced fillJetPlot - bool filltrkInJetPlot(const xAOD::TrackParticle &particle, const xAOD::Jet &jet); - void fillSimpleJetPlots(const xAOD::TrackParticle &particle, float prob); - void fillJetHitsPlots(const xAOD::TrackParticle &particle, float prob, int barcode); - void fillJetResPlots(const xAOD::TrackParticle &particle, const xAOD::TruthParticle &truth, const xAOD::Jet &jet); - void fillJetEffPlots(const xAOD::TruthParticle &truth, const xAOD::Jet &jet); + bool filltrkInJetPlot(const xAOD::TrackParticle& particle, const xAOD::Jet& jet); + void fillSimpleJetPlots(const xAOD::TrackParticle& particle, float prob); + void fillJetHitsPlots(const xAOD::TrackParticle& particle, float prob, int barcode); + void fillJetResPlots(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truth, const xAOD::Jet& jet); + void fillJetEffPlots(const xAOD::TruthParticle& truth, const xAOD::Jet& jet); - void jet_fill(const xAOD::TrackParticle &track, const xAOD::Jet &jet, float weight); - void jetBMR(const xAOD::TrackParticle &track, const xAOD::Jet &jet, float weight); + void jet_fill(const xAOD::TrackParticle& track, const xAOD::Jet& jet, float weight); + void jetBMR(const xAOD::TrackParticle& track, const xAOD::Jet& jet, float weight); - void fillJetPlotCounter(const xAOD::Jet &jet); - void fillJetTrkTruth(const xAOD::TruthParticle &truth, const xAOD::Jet &jet); - void fillJetTrkTruthCounter(const xAOD::Jet &jet); + void fillJetPlotCounter(const xAOD::Jet& jet); + void fillJetTrkTruth(const xAOD::TruthParticle& truth, const xAOD::Jet& jet); + void fillJetTrkTruthCounter(const xAOD::Jet& jet); virtual ~InDetRttPlots() {/**nop**/ }; ///fill for Counters void fillCounter(const unsigned int freq, const InDetPerfPlot_nTracks::CounterCategory counter); ///fill for fakes - void fillFakeRate(const xAOD::TrackParticle &particle, const bool match, + void fillFakeRate(const xAOD::TrackParticle& particle, const bool match, const InDetPerfPlot_fakes::Category c = InDetPerfPlot_fakes::ALL); void fillIncTrkRate(const unsigned int nMuEvents, std::vector<int> incTrkNum, std::vector<int> incTrkDenom); - void fillFakeRateLinked(const xAOD::TrackParticle &particle, const xAOD::TruthParticle &truthParticle); - void fillFakeRateUnlinked(const xAOD::TrackParticle &particle); + void fillFakeRateLinked(const xAOD::TrackParticle& particle, const xAOD::TruthParticle& truthParticle); + void fillFakeRateUnlinked(const xAOD::TrackParticle& particle); private: InDetPerfPlot_Pt m_ptPlot; InDetBasicPlot m_basicPlot; - Trk::ParamPlots m_PtEtaPlots; - Trk::ImpactPlots m_IPPlots; Trk::RecoInfoPlots m_TrackRecoInfoPlots; Trk::TruthInfoPlots m_TrackTruthInfoPlots; InDetPerfPlot_nTracks m_nTracks; @@ -126,14 +129,13 @@ private: InDetPerfPlot_fakes m_fakePlots; // fakes vs eta etc, as per original RTT code // ITk resolutions - InDetPerfPlot_resITk *m_ITkResolutionPlotPrim; - InDetPerfPlot_resITk *m_ITkResolutionPlotSecd; + InDetPerfPlot_resITk* m_ITkResolutionPlotPrim; + InDetPerfPlot_resITk* m_ITkResolutionPlotSecd; - Trk::IDHitPlots m_hitsPlots; - Trk::IDHitPlots m_hitsMatchedTracksPlots; - Trk::IDHitPlots m_hitsFakeTracksPlots; + InDetPerfPlot_HitDetailed m_hitsMatchedTracksPlots; InDetPerfPlot_HitDetailed m_hitsDetailedPlots; InDetPerfPlot_Eff m_effPlots; + InDetDummyPlots m_dumPlots; InDet_BadMatchRate m_BadMatchRate; InDetPerfPlot_VertexContainer m_verticesPlots; @@ -147,20 +149,20 @@ private: InDetPerfPlot_TrkInJet m_trkInJetPlot; InDetPerfPlot_TrkInJet m_trkInJetPlot_highPt; InDetPerfPlot_Pt m_trkInJetPtPlot; - Trk::ParamPlots m_trkInJetPtEtaPlots; - Trk::ImpactPlots m_trkInJetIPPlots; + InDetBasicPlot m_trkInJetBasicPlot; + // Trk::ParamPlots m_trkInJetPtEtaPlots; + // Trk::ImpactPlots m_trkInJetIPPlots; Trk::RecoInfoPlots m_trkInJetTrackRecoInfoPlots; - Trk::IDHitPlots m_trkInJetHitsPlots; InDetPerfPlot_HitDetailed m_trkInJetHitsDetailedPlots; InDetPerfPlot_fakes m_trkInJetFakePlots; // fakes vs eta etc, as per original RTT code InDetPerfPlot_res m_trkInJetResPlots; - InDetPerfPlot_res *m_trkInJetResPlotsDr0010; - InDetPerfPlot_res *m_trkInJetResPlotsDr1020; - InDetPerfPlot_res *m_trkInJetResPlotsDr2030; + InDetPerfPlot_res* m_trkInJetResPlotsDr0010; + InDetPerfPlot_res* m_trkInJetResPlotsDr1020; + InDetPerfPlot_res* m_trkInJetResPlotsDr2030; InDetPerfPlot_Eff m_trkInJetEffPlots; InDetPerfPlot_res m_trkInJetHighPtResPlots; - Trk::IDHitPlots m_trkInJetHitsFakeTracksPlots; - Trk::IDHitPlots m_trkInJetHitsMatchedTracksPlots; + InDetPerfPlot_HitDetailed m_trkInJetHitsFakeTracksPlots; + InDetPerfPlot_HitDetailed m_trkInJetHitsMatchedTracksPlots; Trk::TruthInfoPlots m_trkInJetTrackTruthInfoPlots; InDetPerfPlot_spectrum m_specPlots; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetTestPlot.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetTestPlot.cxx index 9dd6f339b7854adf61edaf879f52e646ebc177ea..f8a30c33fdb6f53d764a3b90dc39fd1f25b01458 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetTestPlot.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetTestPlot.cxx @@ -11,8 +11,9 @@ #include <random> #include "TEfficiency.h" -InDetTestPlot::InDetTestPlot(InDetPlotBase *pParent, const std::string &sDir) : InDetPlotBase(pParent, sDir), - m_test(nullptr), m_test1(nullptr), m_test2(nullptr), m_testProfile(nullptr), m_test2D(nullptr), m_testEff(nullptr),m_nonsense(nullptr) { +InDetTestPlot::InDetTestPlot(InDetPlotBase* pParent, const std::string& sDir) : InDetPlotBase(pParent, sDir), + m_test(nullptr), m_test1(nullptr), m_test2(nullptr), m_testProfile(nullptr), m_test2D(nullptr), m_testEff(nullptr), + m_nonsense(nullptr) { } void @@ -53,26 +54,26 @@ InDetTestPlot::initializePlots() { ATH_MSG_INFO(hdEff.str()); // print out the definition, formatted as a string book(m_testEff, "testEfficiency"); ATH_MSG_INFO("Try to book nonsense"); - book(m_nonsense,"rubbish"); + book(m_nonsense, "rubbish"); } void -InDetTestPlot::fill(const xAOD::TrackParticle & /*particle*/) { +InDetTestPlot::fill(const xAOD::TrackParticle& /*particle*/) { std::random_device rd; std::mt19937 gen(rd()); std::normal_distribution<float> d(50, 4); const float pt(d(gen)); - fillHisto(m_test,pt); + fillHisto(m_test, pt); std::normal_distribution<float> d1(70, 4); - fillHisto(m_test1,d1(gen)); + fillHisto(m_test1, d1(gen)); const float p(rand() % 50); - fillHisto(m_testProfile,p, 1); + fillHisto(m_testProfile, p, 1); const float eta = (rand() % 6) - 3; const float ybin = (rand() % 20); - fillHisto(m_test2D,eta, ybin); + fillHisto(m_test2D, eta, ybin); const bool passed(p > 25); - fillHisto(m_testEff,passed, p); - - fillHisto(m_nonsense,pt); + fillHisto(m_testEff, passed, p); + + fillHisto(m_nonsense, pt); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetTestPlot.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetTestPlot.h index 4f0b989277e68bdaf342c2ad404ef1bb401c6a8b..1736817b5a8b852e833430a5e19dd6c71d95e767 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetTestPlot.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetTestPlot.h @@ -25,16 +25,16 @@ class TEfficiency; */ class InDetTestPlot: public InDetPlotBase { public: - InDetTestPlot(InDetPlotBase *pParent, const std::string &dirName); - void fill(const xAOD::TrackParticle &particle); + InDetTestPlot(InDetPlotBase* pParent, const std::string& dirName); + void fill(const xAOD::TrackParticle& particle); private: - TH1 *m_test; - TH1 *m_test1; - TH1 *m_test2; - TProfile *m_testProfile; - TH2 *m_test2D; - TEfficiency *m_testEff; - TH1 *m_nonsense; + TH1* m_test; + TH1* m_test1; + TH1* m_test2; + TProfile* m_testProfile; + TH2* m_test2D; + TEfficiency* m_testEff; + TH1* m_nonsense; // plot base has nop default implementation of this; we use it to book the histos void initializePlots(); }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetValidationPlots.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetValidationPlots.cxx index 1522df9394d51e941e4a55321f75a5ea9dd7f441..420e4d06f64d67d951663861d1a7c912524b701c 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetValidationPlots.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDetValidationPlots.cxx @@ -7,12 +7,12 @@ // std includes -InDetValidationPlots::InDetValidationPlots(PlotBase *pParent, const std::string &dirName) : PlotBase(pParent, dirName), +InDetValidationPlots::InDetValidationPlots(PlotBase* pParent, const std::string& dirName) : PlotBase(pParent, dirName), m_idPlots(this, "all/") { // nop } void -InDetValidationPlots::fill(const xAOD::TrackParticle &trkParticle) { +InDetValidationPlots::fill(const xAOD::TrackParticle& trkParticle) { m_idPlots.fill(trkParticle); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDet_BadMatchRate.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDet_BadMatchRate.cxx index a34a6c52e9815e8e16995d91f4498917ba00c5a2..9652231904cbdd6cec9a573b17e9a235d77a74bf 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDet_BadMatchRate.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDet_BadMatchRate.cxx @@ -10,12 +10,12 @@ */ #include "InDet_BadMatchRate.h" -#include <utility> -#include "TProfile.h" +#include "InDetPhysValMonitoringUtilities.h" -using namespace TMath; +using namespace IDPVM; -InDet_BadMatchRate::InDet_BadMatchRate(InDetPlotBase *pParent, std::string sDir) : + +InDet_BadMatchRate::InDet_BadMatchRate(InDetPlotBase* pParent, std::string sDir) : InDetPlotBase(pParent, sDir), m_BadMatchRate{nullptr}, m_BMR_vs_logpt{nullptr}, @@ -38,27 +38,28 @@ InDet_BadMatchRate::initializePlots() { } void -InDet_BadMatchRate::fillBMR(const xAOD::TrackParticle &particle, float weight) { +InDet_BadMatchRate::fillBMR(const xAOD::TrackParticle& particle, float weight) { float trketa = particle.eta(); float trkpt = particle.pt(); - float logpt = Log10(trkpt) - 3.0; // -3 converts from MeV to GeV + float logpt = std::log10(trkpt) - 3.0; // -3 converts from MeV to GeV - fillHisto(m_BadMatchRate,trketa, weight); - fillHisto(m_BMR_vs_logpt,logpt, weight); + fillHisto(m_BadMatchRate, trketa, weight); + fillHisto(m_BMR_vs_logpt, logpt, weight); } void -InDet_BadMatchRate::fillRF(const xAOD::TrackParticle &particle, float weight) { +InDet_BadMatchRate::fillRF(const xAOD::TrackParticle& particle, float weight) { float trketa = particle.eta(); - fillHisto(m_ReallyFakeRate,trketa, weight); + + fillHisto(m_ReallyFakeRate, trketa, weight); } void -InDet_BadMatchRate::jetBMR(const xAOD::TrackParticle &track, const xAOD::Jet &jet, float weight) { - float jet_et = jet.pt() * 0.001; // divide by 1000 to convert to GeV +InDet_BadMatchRate::jetBMR(const xAOD::TrackParticle& track, const xAOD::Jet& jet, float weight) { + float jet_et = jet.pt() * 1_GeV; // divide by 1000 to convert to GeV float dR = jet.p4().DeltaR(track.p4()); if (jet_et > 100) { - fillHisto(m_trackinjet_badmatchrate_vs_dr_gr_j100,dR, weight); + fillHisto(m_trackinjet_badmatchrate_vs_dr_gr_j100, dR, weight); } } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDet_BadMatchRate.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDet_BadMatchRate.h index a1b0b067b0f84db1cfeea896334e6557efff6018..04c4156bc2681d2d36843560f54fa3e6148b5e21 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDet_BadMatchRate.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/InDet_BadMatchRate.h @@ -11,28 +11,29 @@ * **/ -#include <string> + #include "InDetPlotBase.h" #include "xAODTracking/TrackParticle.h" #include "xAODJet/Jet.h" +#include <string> class TProfile; class InDet_BadMatchRate: public InDetPlotBase { public: - InDet_BadMatchRate(InDetPlotBase *pParent, std::string sDir); + InDet_BadMatchRate(InDetPlotBase* pParent, std::string sDir); - void fillBMR(const xAOD::TrackParticle &particle, float weight); - void fillRF(const xAOD::TrackParticle &particle, float weight); + void fillBMR(const xAOD::TrackParticle& particle, float weight); + void fillRF(const xAOD::TrackParticle& particle, float weight); - void jetBMR(const xAOD::TrackParticle &track, const xAOD::Jet &jet, float weight); + void jetBMR(const xAOD::TrackParticle& track, const xAOD::Jet& jet, float weight); private: - TProfile *m_BadMatchRate; - TProfile *m_BMR_vs_logpt; + TProfile* m_BadMatchRate; + TProfile* m_BMR_vs_logpt; - TProfile *m_ReallyFakeRate; + TProfile* m_ReallyFakeRate; - TProfile *m_trackinjet_badmatchrate_vs_dr_gr_j100; + TProfile* m_trackinjet_badmatchrate_vs_dr_gr_j100; void initializePlots(); // void finalizePlots(); //I'm not 100% sure a finalize section is actually needed here diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorTool.cxx index b7d6548fecfc676ed32c45e1121f384e78788d94..c5b7aa1f9fc3141cd70ff11a8491ad2044445bc0 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorTool.cxx @@ -13,8 +13,8 @@ -ParameterErrDecoratorTool::ParameterErrDecoratorTool(const std::string &type, const std::string &name, - const IInterface *parent) : +ParameterErrDecoratorTool::ParameterErrDecoratorTool(const std::string& type, const std::string& name, + const IInterface* parent) : AthAlgTool(type, name, parent) { declareInterface<IInDetPhysValDecoratorTool>(this); } @@ -40,7 +40,7 @@ ParameterErrDecoratorTool::finalize() { } bool -ParameterErrDecoratorTool::decorateTrack(const xAOD::TrackParticle &particle, const std::string &prefix) { +ParameterErrDecoratorTool::decorateTrack(const xAOD::TrackParticle& particle, const std::string& prefix) { ATH_MSG_VERBOSE("Decorate track with errors "); bool success(true); const AmgSymMatrix(5) errorMat = particle.definingParametersCovMatrix(); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorTool.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorTool.h index a900db22fcbd66c656e05caad597ec29b0bde0a4..dc6c92c15faab327489180920df38e91cb57bd30 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorTool.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ParameterErrDecoratorTool.h @@ -20,12 +20,12 @@ // class to decorate xAOD::TrackParticles with errors on the defining parameters class ParameterErrDecoratorTool: virtual public IInDetPhysValDecoratorTool, public AthAlgTool { public: - ParameterErrDecoratorTool(const std::string &type, const std::string &name, const IInterface *parent); + ParameterErrDecoratorTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~ParameterErrDecoratorTool(); virtual StatusCode initialize(); virtual StatusCode finalize(); - virtual bool decorateTrack(const xAOD::TrackParticle &particle, const std::string &prefix); + virtual bool decorateTrack(const xAOD::TrackParticle& particle, const std::string& prefix); private: }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromText.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromText.cxx index 04dd34fc1d9ca79fa0331bcbbb00c8d8f31ef485..8914fbf1294e44c255ac17ec6cca92c4c72090dd 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromText.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromText.cxx @@ -20,7 +20,7 @@ #include "PathResolver/PathResolver.h" namespace { std::vector<std::string> - split(const std::string &str, int delimiter(int) = std::isspace) { + split(const std::string& str, int delimiter(int) = std::isspace) { std::vector<std::string> result; auto e = str.end(); auto i = str.begin(); @@ -42,7 +42,7 @@ namespace { ReadFromText::ReadFromText() : m_source("unspecified file"), m_format("text/plain") { } -ReadFromText::ReadFromText(const std::string &source) : m_source(source), m_format("text/plain") { +ReadFromText::ReadFromText(const std::string& source) : m_source(source), m_format("text/plain") { m_source = PathResolver::find_file(source, "DATAPATH"); } @@ -57,7 +57,7 @@ ReadFromText::format() const { } bool -ReadFromText::histoDefinitionMap(std::map<std::string, SingleHistogramDefinition> &usersmap) const { +ReadFromText::histoDefinitionMap(std::map<std::string, SingleHistogramDefinition>& usersmap) const { bool ok(true); for (auto i:m_vectorOfDefinitions) { @@ -76,7 +76,7 @@ ReadFromText::histoDefinitionMap(std::map<std::string, SingleHistogramDefinition } bool -ReadFromText::insertDefinition(const SingleHistogramDefinition &oneDefinition) { +ReadFromText::insertDefinition(const SingleHistogramDefinition& oneDefinition) { bool ok(true); m_vectorOfDefinitions.push_back(oneDefinition); @@ -86,6 +86,7 @@ ReadFromText::insertDefinition(const SingleHistogramDefinition &oneDefinition) { bool ReadFromText::initialize() { bool ok(true); + std::ifstream myfile; myfile.open(source()); @@ -104,7 +105,7 @@ ReadFromText::initialize() { } SingleHistogramDefinition -ReadFromText::parseTextLine(const std::string &line) { +ReadFromText::parseTextLine(const std::string& line) { SingleHistogramDefinition s; typedef std::vector<std::string> StringVec; @@ -197,7 +198,7 @@ ReadFromText::parseTextLine(const std::string &line) { nbinsX = (unsigned int) (std::stoul(m[NXBINS])); xLo = std::stof(m[XLO]); xHi = std::stof(m[XHI]); - } catch (std::invalid_argument &e) { + } catch (std::invalid_argument& e) { std::cout << "Problem converting some of the arguments : " << m[NXBINS] << "; " << m[XLO] << "; " << m[XHI] << std::endl; hType = INVALID; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromText.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromText.h index 18d2e65c7372089e790d5ea04972e164453e0f38..b8522cbad3bb410e7fd6f781728e2c715e87a184 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromText.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromText.h @@ -15,16 +15,16 @@ class ReadFromText: public IReadHistoDef { public: ReadFromText(); - ReadFromText(const std::string &source); + ReadFromText(const std::string& source); std::string source() const final; std::string format() const final; - bool histoDefinitionMap(std::map<std::string, SingleHistogramDefinition> &usersMap) const; - bool insertDefinition(const SingleHistogramDefinition &oneDefinition); + bool histoDefinitionMap(std::map<std::string, SingleHistogramDefinition>& usersMap) const; + bool insertDefinition(const SingleHistogramDefinition& oneDefinition); bool initialize() final; bool sourceExists() const; private: std::vector <SingleHistogramDefinition> m_vectorOfDefinitions; - SingleHistogramDefinition parseTextLine(const std::string &line); + SingleHistogramDefinition parseTextLine(const std::string& line); std::string m_source; const std::string m_format; }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXml.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXml.cxx index 6dbe586e44d50c2ecf1124158bfff292264b50af..760caa07519a909afd02de087fbd4949607c7bbc 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXml.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXml.cxx @@ -18,7 +18,7 @@ ReadFromXml::ReadFromXml() : m_source("unspecified file"), m_format("text/xml") { } -ReadFromXml::ReadFromXml(const std::string &source) : m_format("text/xml") { +ReadFromXml::ReadFromXml(const std::string& source) : m_format("text/xml") { m_source = PathResolver::find_file(source, "DATAPATH"); } @@ -33,7 +33,7 @@ ReadFromXml::format() const { } bool -ReadFromXml::histoDefinitionMap(std::map<std::string, SingleHistogramDefinition> &usersmap) const { +ReadFromXml::histoDefinitionMap(std::map<std::string, SingleHistogramDefinition>& usersmap) const { bool ok(true); for (auto i:m_vectorOfDefinitions) { @@ -50,7 +50,7 @@ ReadFromXml::histoDefinitionMap(std::map<std::string, SingleHistogramDefinition> } bool -ReadFromXml::insertDefinition(const SingleHistogramDefinition & /*oneDefinition*/) { +ReadFromXml::insertDefinition(const SingleHistogramDefinition& /*oneDefinition*/) { bool ok(true); // m_vectorOfDefinitions.push_back(oneDefinition); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXml.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXml.h index 936e1ff7476114e379b53b14ad2ffefde78e964f..0a80be36de00a0400a86917e7e6522f31e6d2e2a 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXml.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXml.h @@ -16,16 +16,16 @@ class ReadFromXml: public IReadHistoDef { public: ReadFromXml(); - ReadFromXml(const std::string &source); + ReadFromXml(const std::string& source); std::string source() const final; std::string format() const final; - bool histoDefinitionMap(std::map<std::string, SingleHistogramDefinition> &usersMap) const final; - bool insertDefinition(const SingleHistogramDefinition &oneDefinition); + bool histoDefinitionMap(std::map<std::string, SingleHistogramDefinition>& usersMap) const final; + bool insertDefinition(const SingleHistogramDefinition& oneDefinition); bool initialize() final; bool sourceExists() const final; private: std::vector <SingleHistogramDefinition> m_vectorOfDefinitions; - SingleHistogramDefinition parseTextLine(const std::string &line); + SingleHistogramDefinition parseTextLine(const std::string& line); std::string m_source; const std::string m_format; }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXmlDom.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXmlDom.cxx index f6ec577ab91aaa2d8644d56ce8942ecddd26b954..b6e7be16fc2fa9c7a99f3920d9c8c3b696ebedc0 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXmlDom.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXmlDom.cxx @@ -20,7 +20,7 @@ namespace { bool - validAxisName(const std::string &proposedName, const std::array<std::string, 2> &allowedNames) { + validAxisName(const std::string& proposedName, const std::array<std::string, 2>& allowedNames) { return((proposedName == allowedNames[0])or(proposedName == allowedNames[1])); } } @@ -28,7 +28,7 @@ namespace { ReadFromXmlDom::ReadFromXmlDom() : m_source("unspecified file"), m_format("text/xml") { } -ReadFromXmlDom::ReadFromXmlDom(const std::string &source) : m_format("text/xml") { +ReadFromXmlDom::ReadFromXmlDom(const std::string& source) : m_format("text/xml") { m_source = PathResolver::find_file(source, "DATAPATH"); } @@ -43,7 +43,7 @@ ReadFromXmlDom::format() const { } bool -ReadFromXmlDom::histoDefinitionMap(std::map<std::string, SingleHistogramDefinition> &usersmap) const { +ReadFromXmlDom::histoDefinitionMap(std::map<std::string, SingleHistogramDefinition>& usersmap) const { bool ok(true); for (auto i:m_vectorOfDefinitions) { @@ -53,13 +53,18 @@ ReadFromXmlDom::histoDefinitionMap(std::map<std::string, SingleHistogramDefiniti if (not i.validType()) { continue; } - ok &= (usersmap.insert(std::pair<std::string, SingleHistogramDefinition>(i.stringIndex(), i))).second; + bool thisIsOk = (usersmap.insert(std::pair<std::string, SingleHistogramDefinition>(i.stringIndex(), i))).second; + if (not thisIsOk) { + ok &= thisIsOk; + std::string msg = "You have attempted to add a duplicate histogram definition: " + i.stringIndex(); + throw std::runtime_error(msg); + } } return(ok and(not usersmap.empty())); } bool -ReadFromXmlDom::insertDefinition(const SingleHistogramDefinition &oneDefinition) { +ReadFromXmlDom::insertDefinition(const SingleHistogramDefinition& oneDefinition) { bool ok(true); m_vectorOfDefinitions.push_back(oneDefinition); @@ -71,17 +76,17 @@ ReadFromXmlDom::initialize() { bool ok(true); if (m_source.empty() or(not sourceExists())) { - std::cerr<<"Could not open file "<<m_source<<" in ReadFromXmlDom initialize"<<std::endl; + std::cerr << "Could not open file " << m_source << " in ReadFromXmlDom initialize" << std::endl; return false; } myXerces::Lib xercesFrame; // RAII xerces context static const XMLCh gLS[] = { xercesc::chLatin_L, xercesc::chLatin_S, xercesc::chNull }; - xercesc::DOMImplementation *impl = xercesc::DOMImplementationRegistry::getDOMImplementation(gLS); - xercesc::DOMLSParser *parser = ((xercesc::DOMImplementationLS *) impl)->createLSParser( + xercesc::DOMImplementation* impl = xercesc::DOMImplementationRegistry::getDOMImplementation(gLS); + xercesc::DOMLSParser* parser = ((xercesc::DOMImplementationLS*) impl)->createLSParser( xercesc::DOMImplementationLS::MODE_SYNCHRONOUS, 0); - xercesc::DOMConfiguration *config = parser->getDomConfig(); + xercesc::DOMConfiguration* config = parser->getDomConfig(); if (config->canSetParameter(xercesc::XMLUni::fgXercesDoXInclude, true)) { config->setParameter(xercesc::XMLUni::fgXercesDoXInclude, true); } @@ -89,11 +94,11 @@ ReadFromXmlDom::initialize() { config->setParameter(xercesc::XMLUni::fgDOMErrorHandler, &errorHandler); auto doc = parser->parseURI(m_source.c_str()); const XercesString temp = fromNative("h"); - xercesc::DOMNodeList *list = doc->getElementsByTagName(temp.c_str()); + xercesc::DOMNodeList* list = doc->getElementsByTagName(temp.c_str()); const auto nElements = list->getLength(); for (unsigned long i(0); i != nElements; ++i) { - xercesc::DOMNode const *thisNode = list->item(i); - auto thisElement = dynamic_cast<xercesc::DOMElement const *> (thisNode); + xercesc::DOMNode const* thisNode = list->item(i); + auto thisElement = dynamic_cast<xercesc::DOMElement const*> (thisNode); if (thisElement) { insertDefinition(parseXmlElement(thisElement)); } @@ -105,11 +110,12 @@ ReadFromXmlDom::initialize() { bool ReadFromXmlDom::sourceExists() const { struct stat buffer; + return(stat(m_source.c_str(), &buffer) == 0); } SingleHistogramDefinition -ReadFromXmlDom::parseXmlElement(const xercesc::DOMElement *element) { +ReadFromXmlDom::parseXmlElement(const xercesc::DOMElement* element) { SingleHistogramDefinition s; enum RegXHistoGroups { TYPE, NAME, TITLE, NX, NY, XLO, YLO, XHI, YHI, XAXIS, YAXIS, FOLDER, NGROUPS @@ -117,10 +123,11 @@ ReadFromXmlDom::parseXmlElement(const xercesc::DOMElement *element) { const std::array<std::string, NGROUPS> attrNames = { "type", "id", "title", "n", "n", "lo", "lo", "hi", "hi", "title", "title", "folder" }; + // // transform the std::string attribute names to Xerces string attribute names std::array<XercesString, NGROUPS> xercesNames; - std::transform(attrNames.begin(), attrNames.end(), xercesNames.begin(), [](const std::string &s) { + std::transform(attrNames.begin(), attrNames.end(), xercesNames.begin(), [](const std::string& s) { return fromNative(s); }); // Use this array to store the primary returned attribute values, which will be Xerces strings @@ -139,7 +146,7 @@ ReadFromXmlDom::parseXmlElement(const xercesc::DOMElement *element) { const std::string type = toNative(xercesValues[TYPE]); const bool isTProfile = (type == "TProfile"); // get children of the histogram, these are the two axes - const xercesc::DOMElement *axisDef0 = element->getFirstElementChild(); + const xercesc::DOMElement* axisDef0 = element->getFirstElementChild(); if (!axisDef0 and element->hasChildNodes()) { XercesString xercesContent = element->getTextContent(); const std::string textContent = toNative(xercesContent); @@ -151,12 +158,15 @@ ReadFromXmlDom::parseXmlElement(const xercesc::DOMElement *element) { sx.histoType = type; return sx; } - const xercesc::DOMElement *axisDef1 = axisDef0->getNextElementSibling(); + //if get to here and axisDef0 is null, theres a problem + if (not axisDef0) return s; + const xercesc::DOMElement* axisDef1 = axisDef0->getNextElementSibling(); // only allow two axes, but could be ordered x-y or y-x std::string axisName0 = toNative(axisDef0->getTagName()); std::string axisName1 = toNative(axisDef1->getTagName()); - if (validAxisName(axisName0, allowedAxisNames) and validAxisName(axisName1, - allowedAxisNames) and(axisName1 != axisName0)) { + if (validAxisName(axisName0, allowedAxisNames) + and validAxisName(axisName1,allowedAxisNames) + and (axisName1 != axisName0)) { // default order unsigned int xIndex = 0, yIndex = 1; if (axisName0 == allowedAxisNames[1]) { @@ -176,11 +186,11 @@ ReadFromXmlDom::parseXmlElement(const xercesc::DOMElement *element) { std::array<std::string, NGROUPS> stringValues { "" }; - std::transform(xercesValues.begin(), xercesValues.end(), stringValues.begin(), [](const XercesString &s) { + std::transform(xercesValues.begin(), xercesValues.end(), stringValues.begin(), [](const XercesString& s) { return toNative(s); }); // numerical values are required for some quantities - constexpr float NaN = std::nanf(""); // default 'invalid' float is not-a-number (NaN) + const float NaN = std::nanf(""); // default 'invalid' float is not-a-number (NaN) const unsigned int nx = stringValues[NX].empty() ? 0 : (unsigned int) (std::stoul(stringValues[NX])); const unsigned int ny = stringValues[NY].empty() ? 0 : (unsigned int) (std::stoul(stringValues[NY])); const float xlo = stringValues[XLO].empty() ? NaN : std::stof(stringValues[XLO]); @@ -197,11 +207,12 @@ ReadFromXmlDom::parseXmlElement(const xercesc::DOMElement *element) { } SingleHistogramDefinition -ReadFromXmlDom::parseTextLine(const std::string &line) { +ReadFromXmlDom::parseTextLine(const std::string& line) { SingleHistogramDefinition s; enum RegXHistoGroups { TOTAL, TITLE, NBINS, XLO, XHI, XAXIS, YAXIS, DUMMY, FOLDER, NGROUPS }; + std::string rex = R"delim(^\s+"([^"]+)"\s+(\d+)\s+([-+.0-9eE]+)\s+([-+.0-9eE]+)\s+"([^"]+)"\s+"([^"]+)"\s*(.*)\s*$)delim"; std::regex reg(rex); @@ -223,11 +234,12 @@ ReadFromXmlDom::parseTextLine(const std::string &line) { } SingleHistogramDefinition -ReadFromXmlDom::parseTProfileText(const std::string &line) { +ReadFromXmlDom::parseTProfileText(const std::string& line) { SingleHistogramDefinition s; enum RegXHistoGroups { TOTAL, TITLE, NBINS, XLO, XHI, YLO, YHI, XAXIS, YAXIS, DUMMY, FOLDER, NGROUPS }; + // text like: "Test of TProfile" 20 -50 50 0 200 "#eta" "testEntries" std::string rex = R"delim(^\s+"([^"]+)"\s+(\d+)\s+([-+.0-9eE]+)\s+([-+.0-9eE]+)\s+([-+.0-9eE]+)\s+([-+.0-9eE]+)\s+"([^"]+)"\s+"([^"]+)"\s*(.*)\s*$)delim"; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXmlDom.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXmlDom.h index 4ea26830ac43a01ad1019ab33ffbeb761f446977..624ca65bdf8a1613380af590739f9a963ff706d1 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXmlDom.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ReadFromXmlDom.h @@ -18,19 +18,19 @@ class ReadFromXmlDom: public IReadHistoDef { public: ReadFromXmlDom(); - ReadFromXmlDom(const std::string &source); + ReadFromXmlDom(const std::string& source); std::string source() const final; std::string format() const final; - bool histoDefinitionMap(std::map<std::string, SingleHistogramDefinition> &usersMap) const final; - bool insertDefinition(const SingleHistogramDefinition &oneDefinition); + bool histoDefinitionMap(std::map<std::string, SingleHistogramDefinition>& usersMap) const final; + bool insertDefinition(const SingleHistogramDefinition& oneDefinition); bool initialize() final; bool sourceExists() const final; private: std::vector <SingleHistogramDefinition> m_vectorOfDefinitions; std::string m_source; const std::string m_format; - SingleHistogramDefinition parseTextLine(const std::string &line); - SingleHistogramDefinition parseTProfileText(const std::string &line); - SingleHistogramDefinition parseXmlElement(const xercesc::DOMElement *element); + SingleHistogramDefinition parseTextLine(const std::string& line); + SingleHistogramDefinition parseTProfileText(const std::string& line); + SingleHistogramDefinition parseXmlElement(const xercesc::DOMElement* element); }; #endif /* ReadFromXmlDom_h */ \ No newline at end of file diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/SingleHistogramDefinition.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/SingleHistogramDefinition.cxx index 3f7f76025b7af9562723e28f7e1a7c44c1a43503..bad9da57f009203e981273570e3c994e1ade4ccd 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/SingleHistogramDefinition.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/SingleHistogramDefinition.cxx @@ -102,7 +102,7 @@ SingleHistogramDefinition::titleDigest() const { } std::string -SingleHistogramDefinition::stringIndex(const std::string &thisname, const std::string &thisfolder) { +SingleHistogramDefinition::stringIndex(const std::string& thisname, const std::string& thisfolder) { if (thisfolder.empty()) { return thisname; } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ToolTestMonitoringPlots.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ToolTestMonitoringPlots.cxx index d485abd1a18a58b38a8df3c72b1c244a39261bef..f0414c4b772958f2cd1d715cc650beed7af178c3 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ToolTestMonitoringPlots.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/ToolTestMonitoringPlots.cxx @@ -26,12 +26,13 @@ using std::pair; using std::make_pair; using std::cout; using std::endl; +class TGraph; ///Parametrized constructor -ToolTestMonitoringPlots::ToolTestMonitoringPlots(const std::string &type, const std::string &name, - const IInterface *parent) : +ToolTestMonitoringPlots::ToolTestMonitoringPlots(const std::string& type, const std::string& name, + const IInterface* parent) : ManagedMonitorToolBase(type, name, parent) { // declareProperty("TrackParticleContainerName", m_trkParticleName="InDetTrackParticles"); // declareProperty("TruthParticleContainerName", m_truthParticleName="TruthParticles"); @@ -80,9 +81,13 @@ ToolTestMonitoringPlots::bookHistograms() { m_monPlots->setDetailLevel(100); // DEBUG, enable expert histograms m_monPlots->initialize(); std::vector<HistData> hists = m_monPlots->retrieveBookedHistograms(); - for (auto hist : hists) { + for (auto& hist : hists) { ATH_CHECK(regHist(hist.first, hist.second, all)); // ?? } + std::vector<EfficiencyData> effs = m_monPlots->retrieveBookedEfficiencies(); + for (auto& eff : effs) { + ATH_CHECK(regGraph(reinterpret_cast<TGraph*>(eff.first), eff.second, all)); // ?? + } return StatusCode::SUCCESS; } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackSelectionTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackSelectionTool.cxx index 9a696d73a2ca89b403505558266eb0c2f4bce0c9..6c8ce32c2a9a363a62181ddb70a78f58d589ab18 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackSelectionTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackSelectionTool.cxx @@ -4,9 +4,9 @@ // InDetPhysValMonitoring includes #include "TrackSelectionTool.h" -#include <cmath> //std::fabs +#include <cmath> // std::fabs -TrackSelectionTool::TrackSelectionTool(const std::string &name) : +TrackSelectionTool::TrackSelectionTool(const std::string& name) : asg::AsgTool(name), m_accept("TrackSelection"), m_numProcessed(0), @@ -162,7 +162,7 @@ TrackSelectionTool::initialize() { // if (m_maxEta>-1) m_cuts.push_back(std::make_pair("eta", "Cut on (absolute) particle eta")); // Add cuts to the TAccept. - for (const auto &cut : m_cuts) { + for (const auto& cut : m_cuts) { if (m_accept.addCut(cut.first, cut.second) < 0) { ATH_MSG_ERROR("Failed to add cut " << cut.first << " because the TAccept object is full."); return StatusCode::FAILURE; @@ -177,13 +177,13 @@ TrackSelectionTool::initialize() { return StatusCode::SUCCESS; } -const Root::TAccept & +const Root::TAccept& TrackSelectionTool::getTAccept( ) const { return m_accept; } -const Root::TAccept & -TrackSelectionTool::accept(const xAOD::IParticle *p) const { +const Root::TAccept& +TrackSelectionTool::accept(const xAOD::IParticle* p) const { /*Is this perhaps supposed to be xAOD::TrackParticle? */ // Reset the result. @@ -200,14 +200,14 @@ TrackSelectionTool::accept(const xAOD::IParticle *p) const { } // Cast it to a track (we have already checked its type so we do not have to dynamic_cast). - const xAOD::TrackParticle *track = static_cast< const xAOD::TrackParticle * >(p); + const xAOD::TrackParticle* track = static_cast< const xAOD::TrackParticle* >(p); // Let the specific function do the work. return accept(track); } -const Root::TAccept & -TrackSelectionTool::accept(const xAOD::TrackParticle *p) const { +const Root::TAccept& +TrackSelectionTool::accept(const xAOD::TrackParticle* p) const { // Reset the TAccept. m_accept.clear(); @@ -382,7 +382,7 @@ TrackSelectionTool::accept(const xAOD::TrackParticle *p) const { // if (m_maxEta>-1) m_accept.setCutResult("eta", (p->pt()>1e-7 ? (fabs(p->eta()) < m_maxEta) : false) ); // Book keep cuts - for (const auto &cut : m_cuts) { + for (const auto& cut : m_cuts) { unsigned int pos = m_accept.getCutPosition(cut.first); if (m_accept.getCutResult(pos)) { m_numPassedCuts[pos]++; @@ -407,7 +407,7 @@ TrackSelectionTool::finalize() { } ATH_MSG_INFO(m_numPassed << " / " << m_numProcessed << " = " << m_numPassed * 100. / m_numProcessed << "% passed all cuts."); - for (const auto &cut : m_cuts) { + for (const auto& cut : m_cuts) { ULong64_t numPassed = m_numPassedCuts.at(m_accept.getCutPosition(cut.first)); ATH_MSG_INFO(numPassed << " = " << numPassed * 100. / m_numProcessed << "% passed " << cut.first << " cut."); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackSelectionTool.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackSelectionTool.h index 1e6a4ee5591792d88b0926d1b71afd86982dfed7..9995fd5097d51b520e9d91484e9d1b0d0715889f 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackSelectionTool.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackSelectionTool.h @@ -16,15 +16,15 @@ class TrackSelectionTool: public asg::AsgTool { ASG_TOOL_CLASS1(TrackSelectionTool, IAsgSelectionTool); public: - TrackSelectionTool(const std::string &name); + TrackSelectionTool(const std::string& name); virtual ~TrackSelectionTool(); virtual StatusCode initialize(); virtual StatusCode finalize(); - virtual const Root::TAccept &getTAccept( ) const; - virtual const Root::TAccept &accept(const xAOD::IParticle *p) const; - virtual const Root::TAccept &accept(const xAOD::TrackParticle *p) const; + virtual const Root::TAccept& getTAccept( ) const; + virtual const Root::TAccept& accept(const xAOD::IParticle* p) const; + virtual const Root::TAccept& accept(const xAOD::TrackParticle* p) const; private: mutable Root::TAccept m_accept; std::vector<std::pair<std::string, std::string> > m_cuts; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthLookup.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthLookup.cxx index 4740da20ea2b94d5607dbb623a6675dc46436abf..741cb4f7454741df1b990a963ae4283dce9f2926 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthLookup.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthLookup.cxx @@ -5,111 +5,113 @@ #include "TrackTruthLookup.h" namespace IDPVM { - // Utility function to get the linked truth particle from a track. // Taken directly from InDetPhysValLargeD0Tool.cxx -const xAOD::TruthParticle* getTruthPointer(const xAOD::TrackParticle &track) { - typedef ElementLink<xAOD::TruthParticleContainer> ElementTruthLink_t; - const xAOD::TruthParticle *result(nullptr); - - // Check whether truthParticleLink exists. - if (track.isAvailable<ElementTruthLink_t>("truthParticleLink")) { - // If so, get linked xAOD::TruthParticle. - const ElementTruthLink_t ptruthContainer = \ - track.auxdata<ElementTruthLink_t>("truthParticleLink"); - if (ptruthContainer.isValid()) { - result = *ptruthContainer; + const xAOD::TruthParticle* + getTruthPointer(const xAOD::TrackParticle& track) { + typedef ElementLink<xAOD::TruthParticleContainer> ElementTruthLink_t; + const xAOD::TruthParticle* result(nullptr); + + // Check whether truthParticleLink exists. + if (track.isAvailable<ElementTruthLink_t>("truthParticleLink")) { + // If so, get linked xAOD::TruthParticle. + const ElementTruthLink_t ptruthContainer = \ + track.auxdata<ElementTruthLink_t>("truthParticleLink"); + if (ptruthContainer.isValid()) { + result = *ptruthContainer; + } } + return result; } - return result; -} -std::vector<const xAOD::TrackParticle*> -TrackTruthLookup::getTracks(const xAOD::TruthParticle* truth) const{ - // C++ try-catch blocks are zero-cost if no exception is thrown, so - // performance should be unaffected by this check. - try { - return m_mapTruth.at(truth); - } catch (const std::out_of_range& oor) { - throw std::out_of_range("Truth particle was not found in lookup map. Did you remember to call TrackTruthLookup::cache?"); + std::vector<const xAOD::TrackParticle*> + TrackTruthLookup::getTracks(const xAOD::TruthParticle* truth) const { + // C++ try-catch blocks are zero-cost if no exception is thrown, so + // performance should be unaffected by this check. + try { + return m_mapTruth.at(truth); + } catch (const std::out_of_range& oor) { + throw std::out_of_range( + "Truth particle was not found in lookup map. Did you remember to call TrackTruthLookup::cache?"); } - return {}; -} - -const xAOD::TruthParticle* -TrackTruthLookup::getTruth(const xAOD::TrackParticle* track) const{ - // C++ try-catch blocks are zero-cost if no exception is thrown, so - // performance should be unaffected by this check. - try { - return m_mapTrack.at(track); - } catch (const std::out_of_range& oor) { - throw std::out_of_range("Track particle was not found in lookup map. Did you remember to call TrackTruthLookup::cache?"); } - return nullptr; -} -void -TrackTruthLookup::cacheTracks(const xAOD::TrackParticleContainer* trackParticles){ - // Cache all track particles. - for (const xAOD::TrackParticle* track : *trackParticles) { - const xAOD::TruthParticle* truth = getTruthPointer(*track); + const xAOD::TruthParticle* + TrackTruthLookup::getTruth(const xAOD::TrackParticle* track) const { + // C++ try-catch blocks are zero-cost if no exception is thrown, so + // performance should be unaffected by this check. + try { + return m_mapTrack.at(track); + } catch (const std::out_of_range& oor) { + throw std::out_of_range( + "Track particle was not found in lookup map. Did you remember to call TrackTruthLookup::cache?"); + } + } - // Store pointer, even if null. - m_mapTrack[track] = truth; + void + TrackTruthLookup::cacheTracks(const xAOD::TrackParticleContainer* trackParticles) { + // Cache all track particles. + for (const xAOD::TrackParticle* track : *trackParticles) { + const xAOD::TruthParticle* truth = getTruthPointer(*track); + + // Store pointer, even if null. + m_mapTrack[track] = truth; + + // Store link in reverse direction as well, to avoid O(N^2) complexity. + if (truth) { + if (!contains(truth)) { + // New truth particle; initialise vector. + m_mapTruth[truth] = { + track + }; + } else { + // Existing truth particle; append vector. + m_mapTruth[truth].push_back(track); + } + } + } + return; + } - // Store link in reverse direction as well, to avoid O(N^2) complexity. - if (truth) { + void + TrackTruthLookup::cacheTruth(const xAOD::TruthParticleContainer* truthParticles) { + // Cache remaining truth particles. + for (const xAOD::TruthParticle* truth : *truthParticles) { if (!contains(truth)) { - // New truth particle; initialise vector. - m_mapTruth[truth] = {track}; - } else { - // Existing truth particle; append vector. - m_mapTruth[truth].push_back(track); + m_mapTruth[truth] = {}; } } + return; } - return; -} -void -TrackTruthLookup::cacheTruth(const xAOD::TruthParticleContainer* truthParticles){ - // Cache remaining truth particles. - for (const xAOD::TruthParticle* truth : *truthParticles) { - if (!contains(truth)) { m_mapTruth[truth] = {}; } + void + TrackTruthLookup::cacheTruth(const std::vector<const xAOD::TruthParticle*>* truthParticlesVec) { + // Cache remaining truth particles. + for (const xAOD::TruthParticle* truth : *truthParticlesVec) { + if (!contains(truth)) { + m_mapTruth[truth] = {}; + } + } + return; } - return; -} -void -TrackTruthLookup::cacheTruth(const std::vector<const xAOD::TruthParticle*> * truthParticlesVec){ - // Cache remaining truth particles. - for (const xAOD::TruthParticle* truth : *truthParticlesVec) { - if (!contains(truth)) { m_mapTruth[truth] = {}; } + void + TrackTruthLookup::cache(const xAOD::TrackParticleContainer* trackParticles, + const xAOD::TruthParticleContainer* truthParticles) { + // Clear existing cache. + clear(); + cacheTracks(trackParticles); + cacheTruth(truthParticles); + return; } - return; -} - - -void -TrackTruthLookup::cache(const xAOD::TrackParticleContainer* trackParticles, - const xAOD::TruthParticleContainer* truthParticles) { - - // Clear existing cache. - clear(); - cacheTracks(trackParticles); - cacheTruth(truthParticles); - return; -} - -void -TrackTruthLookup::cache(const xAOD::TrackParticleContainer* trackParticles, - const std::vector<const xAOD::TruthParticle*> * truthParticlesVec) { - - // Clear existing cache. - clear(); - cacheTracks(trackParticles); - cacheTruth(truthParticlesVec); - return; -} + void + TrackTruthLookup::cache(const xAOD::TrackParticleContainer* trackParticles, + const std::vector<const xAOD::TruthParticle*>* truthParticlesVec) { + // Clear existing cache. + clear(); + cacheTracks(trackParticles); + cacheTruth(truthParticlesVec); + return; + } } // namespace diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthLookup.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthLookup.h index ef7d23b505d6fe5326311676a2fb506caec38c93..2e9e00c12e64246c7cab36c7c0bd4eeba42289cd 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthLookup.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthLookup.h @@ -23,26 +23,25 @@ #include "xAODTruth/TruthParticleContainer.h" namespace IDPVM { - /** - * Class for providing fast lookup of linked tracks and truth particles. + * Class for providing fast lookup of linked tracks and truth particles. * * Intended to be used to avoid nested loops when matching tracks and truth * particles, e.g. when computing efficiencies. - * + * * The links are stored in two unordered maps (single caching call per event, * with O(N) complexity), emulating a bidirectional[1] map with O(1) look-up * complexity. Tracks in the provided container are guaranteed to exist in the * corresponding map, but may map to a nullptr if no link to a truth particle - * exists. Conversely, every truth particle is guaranteed to exist in the - * corresponding map, but may map to an empty vector if no link to a track + * exists. Conversely, every truth particle is guaranteed to exist in the + * corresponding map, but may map to an empty vector if no link to a track * exists. * * Use, e.g. in the InDetPhysValLargeD0Tool, like: - * + * * [InDetPhysValMonitoring/InDetPhysValLargeD0Tool.h] * #include "src/TrackTruthLookup.h" - * ... + * ... * private: * std::unique_ptr<IDPVM::TrackTruthLookup> m_lookup; * ... @@ -65,95 +64,96 @@ namespace IDPVM { * } * } * ... - * } + * } * - * [1] It is not *exactly* bidirectional, since the mapping track <-> truth is + * [1] It is not *exactly* bidirectional, since the mapping track <-> truth is * not exactly bijective: tracks are injective (one-to-one) on the set of - * truth particles but one truth particle may (although rarely) be + * truth particles but one truth particle may (although rarely) be * associated to more than one track. */ -class TrackTruthLookup { - - public: - /// Constructor(s). - TrackTruthLookup() {} - - TrackTruthLookup(const xAOD::TrackParticleContainer* trackParticles, - const xAOD::TruthParticleContainer* truthParticles) { - cache(trackParticles, truthParticles); - } - - TrackTruthLookup(const xAOD::TrackParticleContainer* trackParticles, - const std::vector<const xAOD::TruthParticle*> * truthParticlesVec) { - cache(trackParticles, truthParticlesVec); - } - - /// Destructor. - ~TrackTruthLookup() {} - - /** @name CacheMethods - * Methods for initial cache generation of links between associated - * tracks and truth particles in the provided containers. - */ - //@{ - /** Cache using a vector of TruthParticles, for compatibility with datatype returned - * from the xAOD::TruthEvent::truthParticleLinks() - */ - void cache(const xAOD::TrackParticleContainer* trackParticles, - const std::vector<const xAOD::TruthParticle*> * truthParticlesVec); - - /// Generate cache from usual evtStore() retrieved container pointers. - void cache(const xAOD::TrackParticleContainer* trackParticles, - const xAOD::TruthParticleContainer* truthParticles); - //@} - - /** Accessor to get the vector of xAOD::TrackParticles associated with 'truth', - * possibly empty if none is associated. - * Throws out_of_range exception if truth particle does not exist in cache. - */ - std::vector<const xAOD::TrackParticle*> getTracks(const xAOD::TruthParticle* truth) const; - - /** Accessor to get the unique xAOD::TruthParticle associated with 'track', or - * a nullptr is none is associated. - * Throws out_of_range exception if track does not exist in cache. - */ - const xAOD::TruthParticle* getTruth(const xAOD::TrackParticle* track) const; - - /// Returns true if the Lookup contains the pointer 'truth'. - inline bool contains (const xAOD::TruthParticle* truth) const { - return m_mapTruth.find(truth) != m_mapTruth.end(); - } - - /// Returns true if the Lookup contains the pointer 'track'. - inline bool contains (const xAOD::TrackParticle* track) const{ - return m_mapTrack.find(track) != m_mapTrack.end(); - } - - /// Clears the contents of the unordered map data members. - inline void clear() { - m_mapTrack.clear(); - m_mapTruth.clear(); - return; - } - - - private: - void cacheTracks(const xAOD::TrackParticleContainer* trackParticles); - void cacheTruth(const xAOD::TruthParticleContainer* truthParticles); - void cacheTruth(const std::vector<const xAOD::TruthParticle*> * truthParticlesVec); - /// Data member(s). - // Mapping of xAOD::TrackParticle to their unique associated - // xAOD::TruthParticle. nullptr if none exist. - std::unordered_map<const xAOD::TrackParticle*, - const xAOD::TruthParticle*> m_mapTrack; - - // Mapping of xAOD::TruthParticle to vector of their (possibly multiple - // associated xAOD::TrackParticles. Empty if none exist. - std::unordered_map<const xAOD::TruthParticle*, - std::vector<const xAOD::TrackParticle*> > m_mapTruth; - -}; - + class TrackTruthLookup { + public: + /// Constructor(s). + TrackTruthLookup() { + } + + TrackTruthLookup(const xAOD::TrackParticleContainer* trackParticles, + const xAOD::TruthParticleContainer* truthParticles) { + cache(trackParticles, truthParticles); + } + + TrackTruthLookup(const xAOD::TrackParticleContainer* trackParticles, + const std::vector<const xAOD::TruthParticle*>* truthParticlesVec) { + cache(trackParticles, truthParticlesVec); + } + + /// Destructor. + ~TrackTruthLookup() { + } + + /** @name CacheMethods + * Methods for initial cache generation of links between associated + * tracks and truth particles in the provided containers. + */ + // @{ + /** Cache using a vector of TruthParticles, for compatibility with datatype returned + * from the xAOD::TruthEvent::truthParticleLinks() + */ + void cache(const xAOD::TrackParticleContainer* trackParticles, + const std::vector<const xAOD::TruthParticle*>* truthParticlesVec); + + /// Generate cache from usual evtStore() retrieved container pointers. + void cache(const xAOD::TrackParticleContainer* trackParticles, + const xAOD::TruthParticleContainer* truthParticles); + // @} + + /** Accessor to get the vector of xAOD::TrackParticles associated with 'truth', + * possibly empty if none is associated. + * Throws out_of_range exception if truth particle does not exist in cache. + */ + std::vector<const xAOD::TrackParticle*> getTracks(const xAOD::TruthParticle* truth) const; + + /** Accessor to get the unique xAOD::TruthParticle associated with 'track', or + * a nullptr is none is associated. + * Throws out_of_range exception if track does not exist in cache. + */ + const xAOD::TruthParticle* getTruth(const xAOD::TrackParticle* track) const; + + /// Returns true if the Lookup contains the pointer 'truth'. + inline bool + contains(const xAOD::TruthParticle* truth) const { + return m_mapTruth.find(truth) != m_mapTruth.end(); + } + + /// Returns true if the Lookup contains the pointer 'track'. + inline bool + contains(const xAOD::TrackParticle* track) const { + return m_mapTrack.find(track) != m_mapTrack.end(); + } + + /// Clears the contents of the unordered map data members. + inline void + clear() { + m_mapTrack.clear(); + m_mapTruth.clear(); + return; + } + + private: + void cacheTracks(const xAOD::TrackParticleContainer* trackParticles); + void cacheTruth(const xAOD::TruthParticleContainer* truthParticles); + void cacheTruth(const std::vector<const xAOD::TruthParticle*>* truthParticlesVec); + /// Data member(s). + // Mapping of xAOD::TrackParticle to their unique associated + // xAOD::TruthParticle. nullptr if none exist. + std::unordered_map<const xAOD::TrackParticle*, + const xAOD::TruthParticle*> m_mapTrack; + + // Mapping of xAOD::TruthParticle to vector of their (possibly multiple + // associated xAOD::TrackParticles. Empty if none exist. + std::unordered_map<const xAOD::TruthParticle*, + std::vector<const xAOD::TrackParticle*> > m_mapTruth; + }; } // namespace #endif // > !INDETPHYSVALMONITORING_TRACKTRUTHLOOKUP_H diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthSelectionTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthSelectionTool.cxx index 6f829048b259f54c006964151d0f973dfa68d738..4a8caf1bd0b54377b327e079ddf0692f6a5f06bc 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthSelectionTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthSelectionTool.cxx @@ -5,27 +5,26 @@ // InDetPhysValMonitoring includes #include "TrackTruthSelectionTool.h" #include "xAODTruth/TruthVertex.h" -#include <cmath> //std::fabs +#include <cmath> // std::fabs -TrackTruthSelectionTool::TrackTruthSelectionTool(const std::string &name) : +TrackTruthSelectionTool::TrackTruthSelectionTool(const std::string& name) : asg::AsgTool(name) , m_accept("TrackTruthSelection") , m_numTruthProcessed(0) , m_numTruthPassed(0) { - declareInterface<IAsgSelectionTool>(this); // declareProperty( "Property", m_nProperty ); //example property declaration declareProperty("maxEta", m_maxEta = 2.5); - declareProperty("minPt", m_minPt = 400); + declareProperty("minPt", m_minPt = 400); declareProperty("maxPt", m_maxPt = -1); - declareProperty("maxBarcode", m_maxBarcode = 200e3); - declareProperty("requireCharged", m_requireCharged = true); - declareProperty("requireStatus1", m_requireStatus1 = true); + declareProperty("maxBarcode", m_maxBarcode = 200e3); + declareProperty("requireCharged", m_requireCharged = true); + declareProperty("requireStatus1", m_requireStatus1 = true); declareProperty("maxProdVertRadius", m_maxProdVertRadius = 110.); declareProperty("pdgId", m_pdgId = -1); -} +} TrackTruthSelectionTool::~TrackTruthSelectionTool() { } @@ -60,7 +59,7 @@ TrackTruthSelectionTool::initialize() { m_cuts.push_back(std::make_pair("status_1", "Particle status=1")); } - if (m_maxProdVertRadius>0.) { + if (m_maxProdVertRadius > 0.) { m_cuts.push_back(std::make_pair("decay_before_pixel", "Decays before first pixel layer")); } @@ -68,7 +67,7 @@ TrackTruthSelectionTool::initialize() { m_cuts.push_back(std::make_pair("pdgId", "Pdg Id cut")); // 3-18-16 normally enabled, disabled for testing } // Add cuts to the TAccept - for (const auto &cut : m_cuts) { + for (const auto& cut : m_cuts) { if (m_accept.addCut(cut.first, cut.second) < 0) { ATH_MSG_ERROR("Failed to add cut " << cut.first << " because the TAccept object is full."); return StatusCode::FAILURE; @@ -81,13 +80,13 @@ TrackTruthSelectionTool::initialize() { return StatusCode::SUCCESS; } -const Root::TAccept & +const Root::TAccept& TrackTruthSelectionTool::getTAccept( ) const { return m_accept; } -const Root::TAccept & -TrackTruthSelectionTool::accept(const xAOD::IParticle *p) const// Is this perhaps supposed to be xAOD::TruthParticle? +const Root::TAccept& +TrackTruthSelectionTool::accept(const xAOD::IParticle* p) const// Is this perhaps supposed to be xAOD::TruthParticle? { // Reset the result: m_accept.clear(); @@ -103,14 +102,14 @@ TrackTruthSelectionTool::accept(const xAOD::IParticle *p) const// Is this perhap } // Cast it to a track (we have already checked its type so we do not have to dynamic_cast): - const xAOD::TruthParticle *truth = static_cast< const xAOD::TruthParticle * >(p); + const xAOD::TruthParticle* truth = static_cast< const xAOD::TruthParticle* >(p); // Let the specific function do the work: return accept(truth); } -const Root::TAccept & -TrackTruthSelectionTool::accept(const xAOD::TruthParticle *p) const { +const Root::TAccept& +TrackTruthSelectionTool::accept(const xAOD::TruthParticle* p) const { // Reset the TAccept m_accept.clear(); @@ -134,14 +133,14 @@ TrackTruthSelectionTool::accept(const xAOD::TruthParticle *p) const { if (m_requireStatus1) { m_accept.setCutResult("status_1", (p->status() == 1)); } - if (m_maxProdVertRadius>0.) { + if (m_maxProdVertRadius > 0.) { m_accept.setCutResult("decay_before_pixel", (!p->hasProdVtx() || p->prodVtx()->perp() < m_maxProdVertRadius)); } if (m_pdgId > -1) { m_accept.setCutResult("pdgId", (std::fabs(p->pdgId()) == m_pdgId));// 3-18-16 normally on, disabled for testing } // Book keep cuts - for (const auto &cut : m_cuts) { + for (const auto& cut : m_cuts) { unsigned int pos = m_accept.getCutPosition(cut.first); if (m_accept.getCutResult(pos)) { m_numTruthPassedCuts[pos]++; @@ -165,7 +164,7 @@ TrackTruthSelectionTool::finalize() { } ATH_MSG_INFO(m_numTruthPassed << " / " << m_numTruthProcessed << " = " << m_numTruthPassed * 100. / m_numTruthProcessed << "% passed all cuts."); - for (const auto &cut : m_cuts) { + for (const auto& cut : m_cuts) { ULong64_t numPassed = m_numTruthPassedCuts.at(m_accept.getCutPosition(cut.first)); ATH_MSG_INFO(numPassed << " = " << numPassed * 100. / m_numTruthProcessed << "% passed " << cut.first << " cut."); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthSelectionTool.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthSelectionTool.h index 9c1dae9cbc0ab1b4d297af00ae6559a4405cb136..c4cc2369353aacff8090a050e84340e488f766dc 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthSelectionTool.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TrackTruthSelectionTool.h @@ -16,16 +16,16 @@ class TrackTruthSelectionTool: public asg::AsgTool { ASG_TOOL_CLASS1(TrackTruthSelectionTool, IAsgSelectionTool); public: - TrackTruthSelectionTool(const std::string &name); + TrackTruthSelectionTool(const std::string& name); // TrackTruthSelectionTool(const std::string& type,const std::string& name,const IInterface* parent); virtual ~TrackTruthSelectionTool(); virtual StatusCode initialize(); virtual StatusCode finalize(); - virtual const Root::TAccept &getTAccept( ) const; - virtual const Root::TAccept &accept(const xAOD::IParticle *p) const; - virtual const Root::TAccept &accept(const xAOD::TruthParticle *p) const; + virtual const Root::TAccept& getTAccept( ) const; + virtual const Root::TAccept& accept(const xAOD::IParticle* p) const; + virtual const Root::TAccept& accept(const xAOD::TruthParticle* p) const; private: mutable Root::TAccept m_accept; std::vector<std::pair<std::string, std::string> > m_cuts; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TruthClassDecoratorTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TruthClassDecoratorTool.cxx index ba2588c4a0ab0597f1ba81607fcccaf6786ee924..c5cc3cc2dec544b62277b306fa2bb80b84b89bdd 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TruthClassDecoratorTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TruthClassDecoratorTool.cxx @@ -13,8 +13,8 @@ -TruthClassDecoratorTool::TruthClassDecoratorTool(const std::string &type, const std::string &name, - const IInterface *parent) : +TruthClassDecoratorTool::TruthClassDecoratorTool(const std::string& type, const std::string& name, + const IInterface* parent) : AthAlgTool(type, name, parent), m_truthClassifier("MCTruthClassifier/MCTruthClassifier") { declareInterface<IInDetPhysValDecoratorTool>(this); @@ -33,7 +33,7 @@ TruthClassDecoratorTool::finalize() { } bool -TruthClassDecoratorTool::decorateTruth(const xAOD::TruthParticle &particle, const std::string &prefix) { +TruthClassDecoratorTool::decorateTruth(const xAOD::TruthParticle& particle, const std::string& prefix) { bool success(false); if (not m_truthClassifier.empty()) { diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TruthClassDecoratorTool.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TruthClassDecoratorTool.h index 434d4fee172b00a27d85438a753325ae685fad99..ea602c4d4b139c41bc232cd0dffafc67efdc9b9a 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TruthClassDecoratorTool.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/TruthClassDecoratorTool.h @@ -21,12 +21,12 @@ // class to decorate xAOD::TruthParticles with type and origin, required by validation class TruthClassDecoratorTool: virtual public IInDetPhysValDecoratorTool, public AthAlgTool { public: - TruthClassDecoratorTool(const std::string &type, const std::string &name, const IInterface *parent); + TruthClassDecoratorTool(const std::string& type, const std::string& name, const IInterface* parent); virtual ~TruthClassDecoratorTool () {/*nop*/ }; virtual StatusCode initialize(); virtual StatusCode finalize(); - virtual bool decorateTruth(const xAOD::TruthParticle &particle, const std::string &prefix = ""); + virtual bool decorateTruth(const xAOD::TruthParticle& particle, const std::string& prefix = ""); private: ToolHandle<IMCTruthClassifier> m_truthClassifier; }; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/XincludeErrHandler.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/XincludeErrHandler.cxx index f9d7b581f47b5e19f7f74c88ccd20fc281de65db..ad3b1f75bdad0401130b143d4de7d127e7a51a55 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/XincludeErrHandler.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/XincludeErrHandler.cxx @@ -13,7 +13,7 @@ XIncludeErrHandler::~XIncludeErrHandler() { } bool -XIncludeErrHandler::handleError(const xercesc::DOMError &domError) { +XIncludeErrHandler::handleError(const xercesc::DOMError& domError) { bool continueParsing = true; if (domError.getSeverity() == xercesc::DOMError::DOM_SEVERITY_WARNING) { @@ -21,7 +21,7 @@ XIncludeErrHandler::handleError(const xercesc::DOMError &domError) { } else if (domError.getSeverity() == xercesc::DOMError::DOM_SEVERITY_ERROR) { std::cout << "\nError at file "; m_errors = true; - }else { + } else { std::cout << "\nFatal Error at file "; continueParsing = false; m_errors = true; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/XincludeErrHandler.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/XincludeErrHandler.h index e17e7b2190017bcd129aba7372a82f21fc4977c2..74d01df2fdfd9c91db143b65b16e325fc901f899 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/XincludeErrHandler.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/XincludeErrHandler.h @@ -12,15 +12,15 @@ public: XIncludeErrHandler(); ~XIncludeErrHandler(); // no copy - XIncludeErrHandler(const XIncludeErrHandler &) = delete; + XIncludeErrHandler(const XIncludeErrHandler&) = delete; // no assignment - void operator = (const XIncludeErrHandler &) = delete; + void operator = (const XIncludeErrHandler&) = delete; bool getSawErrors() const { return m_errors; } - bool handleError(const xercesc::DOMError &domError); + bool handleError(const xercesc::DOMError& domError); void resetErrors(); private: bool m_errors; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/XmlContentHandlers.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/XmlContentHandlers.h index 989a7f74d61371e0e0a7e9b0a021a065bdb91a5c..2e588e5a41a8b1dfa78bf9b6bc8d6680aac0ea31 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/XmlContentHandlers.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/XmlContentHandlers.h @@ -21,18 +21,18 @@ unsigned int -partialHdefFromAttributes(SingleHistogramDefinition &s, const xercesc::Attributes &attrs) { +partialHdefFromAttributes(SingleHistogramDefinition& s, const xercesc::Attributes& attrs) { unsigned int nFilled(0); // id, type and title are *possible* attributes XercesString histoStrings[] = { fromNative("id"), fromNative("type"), fromNative("title") }; - const XMLCh *val(nullptr); + const XMLCh* val(nullptr); unsigned int idx { 0 }; - for (auto &h:histoStrings) { + for (auto& h:histoStrings) { if ((val = attrs.getValue(h.c_str())) != 0) { switch (idx) { case 0: @@ -55,19 +55,20 @@ partialHdefFromAttributes(SingleHistogramDefinition &s, const xercesc::Attribute } unsigned int -xAxisFromAttributes(SingleHistogramDefinition &s, const xercesc::Attributes &attrs) { +xAxisFromAttributes(SingleHistogramDefinition& s, const xercesc::Attributes& attrs) { unsigned int nFilled(0); // title, n, lo and hi are currently *necessary* attributes XercesString histoStrings[] = { fromNative("title"), fromNative("n"), fromNative("lo"), fromNative("hi") }; - const XMLCh *val(nullptr); + const XMLCh* val(nullptr); unsigned int idx { 0 }; + IHistogramDefinitionSvc::axesLimits_t xaxis(std::nanf(""), std::nanf("")); - for (auto &h:histoStrings) { + for (auto& h:histoStrings) { if ((val = attrs.getValue(h.c_str())) != 0) { switch (idx) { case 0: @@ -95,19 +96,20 @@ xAxisFromAttributes(SingleHistogramDefinition &s, const xercesc::Attributes &att } unsigned int -yAxisFromAttributes(SingleHistogramDefinition &s, const xercesc::Attributes &attrs) { +yAxisFromAttributes(SingleHistogramDefinition& s, const xercesc::Attributes& attrs) { unsigned int nFilled(0); // title, n, lo and hi are currently *necessary* attributes XercesString histoStrings[] = { fromNative("title"), fromNative("n"), fromNative("lo"), fromNative("hi") }; - const XMLCh *val(nullptr); + const XMLCh* val(nullptr); unsigned int idx { 0 }; + IHistogramDefinitionSvc::axesLimits_t yaxis(std::nanf(""), std::nanf("")); - for (auto &h:histoStrings) { + for (auto& h:histoStrings) { if ((val = attrs.getValue(h.c_str())) != 0) { switch (idx) { case 0: @@ -135,11 +137,12 @@ yAxisFromAttributes(SingleHistogramDefinition &s, const xercesc::Attributes &att } unsigned int -partialHdefFromText(SingleHistogramDefinition &s, const std::string &line) { +partialHdefFromText(SingleHistogramDefinition& s, const std::string& line) { unsigned int nFilled(0); enum RegXHistoGroups { TOTAL, TITLE, NBINS, XLO, XHI, XAXIS, YAXIS, DUMMY, FOLDER, NGROUPS }; + std::string rex = R"delim(^\s+"([^"]+)"\s+(\d+)\s+([-+.0-9eE]+)\s+([-+.0-9eE]+)\s+"([^"]+)"\s+"([^"]+)"\s*(.*)\s*$)delim"; std::regex reg(rex); @@ -161,11 +164,12 @@ partialHdefFromText(SingleHistogramDefinition &s, const std::string &line) { } unsigned int -partialHdefFromTProfText(SingleHistogramDefinition &s, const std::string &line) { +partialHdefFromTProfText(SingleHistogramDefinition& s, const std::string& line) { unsigned int nFilled(0); enum RegXHistoGroups { TOTAL, TITLE, NBINS, XLO, XHI, YLO, YHI, XAXIS, YAXIS, DUMMY, FOLDER, NGROUPS }; + // text like: "Test of TProfile" 20 -50 50 0 200 "#eta" "testEntries" std::string rex = R"delim(^\s+"([^"]+)"\s+(\d+)\s+([-+.0-9eE]+)\s+([-+.0-9eE]+)\s+([-+.0-9eE]+)\s+([-+.0-9eE]+)\s+"([^"]+)"\s+"([^"]+)"\s*(.*)\s*$)delim"; @@ -193,14 +197,14 @@ public: enum HistoTypes { UNKNOWN, TH1, TPROFILE, TH2, TEFFICIENCY, NTYPES }; - HDefContentHandler(std::vector<SingleHistogramDefinition> &defs) : m_histoType(UNKNOWN), m_numberFilled(0), + HDefContentHandler(std::vector<SingleHistogramDefinition>& defs) : m_histoType(UNKNOWN), m_numberFilled(0), m_currentDefinition{}, m_definitions(defs), m_currentText() { // nop } void - startElement(const XMLCh *const /*uri*/, const XMLCh *const localName, const XMLCh *const /*qName*/, - const xercesc::Attributes &attrs) { + startElement(const XMLCh* const /*uri*/, const XMLCh* const localName, const XMLCh* const /*qName*/, + const xercesc::Attributes& attrs) { const static XercesString hdefStr = fromNative("hdef"); const static XercesString hStr = fromNative("h"); const static XercesString xStr = fromNative("x"); @@ -223,7 +227,7 @@ public: } void - endElement(const XMLCh *const /*uri*/, const XMLCh *const localName, const XMLCh *const /*qName*/) { + endElement(const XMLCh* const /*uri*/, const XMLCh* const localName, const XMLCh* const /*qName*/) { const static XercesString hdefStr = fromNative("hdef"); const static XercesString hStr = fromNative("h"); const static XercesString xStr = fromNative("x"); @@ -247,7 +251,7 @@ public: } void - characters(const XMLCh *const chars, const XMLSize_t length) { + characters(const XMLCh* const chars, const XMLSize_t length) { m_currentText.append(chars, length); } @@ -255,12 +259,12 @@ private: HistoTypes m_histoType; unsigned int m_numberFilled; SingleHistogramDefinition m_currentDefinition; - std::vector<SingleHistogramDefinition> &m_definitions; + std::vector<SingleHistogramDefinition>& m_definitions; XercesString m_currentText; void - setHistoType(const xercesc::Attributes &attrs) { + setHistoType(const xercesc::Attributes& attrs) { m_histoType = UNKNOWN; - const XMLCh *val(nullptr); + const XMLCh* val(nullptr); const static XercesString TH1Str = fromNative("TH1F"); const static XercesString TProfileStr = fromNative("TProfile"); const static XercesString TH2Str = fromNative("TH2F"); diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/dRMatchingTool.cxx b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/dRMatchingTool.cxx index cb417eb64143a85b8e03258317890222c8bc9bef..a72ce659afc4f01d1c0616341b81069d61014453 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/dRMatchingTool.cxx +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/dRMatchingTool.cxx @@ -8,65 +8,91 @@ #include "../src/TrackTruthSelectionTool.h" /* to perform dynamic_cast */ namespace { // Placing utility functions in anonymous namespace. - // Utility definitions. -const float pi = 3.14159265359; -const float twopi = 6.28318530718; + const float pi = 3.14159265359; + const float twopi = 6.28318530718; // Accessor utility function, for getting the best available value of pT. -template<class U> -float pt(const U* p) { return p->pt(); } + template<class U> + float + pt(const U* p) { + return p->pt(); + } // Accessor utility function, for getting the best available value of phi. -// Need to explicitly state that 'isAvailable' and 'auxdata' are templated +// Need to explicitly state that 'isAvailable' and 'auxdata' are templated // functions. -template<class U> -float phi(const U* p) { return (p->template isAvailable<float>("phi") ? - p->template auxdata<float>("phi") : p->phi()); } + template<class U> + float + phi(const U* p) { + return(p->template isAvailable<float>("phi") ? + p->template auxdata<float>("phi") : p->phi()); + } // Accessor utility function, for getting the best available value of eta. -// Need to explicitly state that 'isAvailable' and 'auxdata' are templated +// Need to explicitly state that 'isAvailable' and 'auxdata' are templated // functions. -template<class U> -float eta(const U* p) { return (p->template isAvailable<float>("eta") ? - p->template auxdata<float>("eta") : p->eta()); } + template<class U> + float + eta(const U* p) { + return(p->template isAvailable<float>("eta") ? + p->template auxdata<float>("eta") : p->eta()); + } // Function to compute dPhi-separation using best available parameter values. -template<class U, class V> -float comp_deltaPhi(const U* p1, const V* p2) { - // Ensures that $\Delta\phi \in [-pi, pi)$, and takes absolute value. - float dphi = phi(p1) - phi(p2); - while (dphi >= pi) { dphi -= twopi; } - while (dphi < -pi) { dphi += twopi; } - return std::fabs(dphi); -} + template<class U, class V> + float + comp_deltaPhi(const U* p1, const V* p2) { + // Ensures that $\Delta\phi \in [-pi, pi)$, and takes absolute value. + float dphi = phi(p1) - phi(p2); + + while (dphi >= pi) { + dphi -= twopi; + } + while (dphi < -pi) { + dphi += twopi; + } + return std::fabs(dphi); + } // Function to compute dEta-separation using best available parameter values. -template<class U, class V> -float comp_deltaEta(const U* p1, const V* p2) { return eta(p1) - eta(p2); } + template<class U, class V> + float + comp_deltaEta(const U* p1, const V* p2) { + return eta(p1) - eta(p2); + } // Function to compute dR-separation using best available parameter values. -template<class U, class V> -float comp_deltaR(const U* p1, const V* p2) { - return sqrt( pow(comp_deltaPhi(p1, p2), 2.) + pow(comp_deltaEta(p1, p2), 2.) ); -} + template<class U, class V> + float + comp_deltaR(const U* p1, const V* p2) { + return sqrt(pow(comp_deltaPhi(p1, p2), 2.) + pow(comp_deltaEta(p1, p2), 2.)); + } // Function for sorting vector of xAOD particles by increasing pT. -template<class U> -bool sort_pt(const U* p1, const U* p2) { return pt(p1) < pt(p2); } + template<class U> + bool + sort_pt(const U* p1, const U* p2) { + return pt(p1) < pt(p2); + } // Function for sorting vector of xAOD particles by increasing eta. -template<class U> -bool sort_eta(const U* p1, const U* p2) { return eta(p1) < eta(p2); } + template<class U> + bool + sort_eta(const U* p1, const U* p2) { + return eta(p1) < eta(p2); + } // Function for sorting vector of xAOD particles by increasing phi. -template<class U> -bool sort_phi(const U* p1, const U* p2) { return phi(p1) < phi(p2); } - + template<class U> + bool + sort_phi(const U* p1, const U* p2) { + return phi(p1) < phi(p2); + } } // namespace -dRMatchingTool::dRMatchingTool(const std::string &name) : +dRMatchingTool::dRMatchingTool(const std::string& name) : asg::AsgTool(name), m_accept("dRMatching"), m_numProcessed(0), @@ -74,7 +100,7 @@ dRMatchingTool::dRMatchingTool(const std::string &name) : declareInterface<IAsgSelectionTool>(this); // Decleare cut properties, for access in job option. - declareProperty("dRmax", m_dRmax = -1); + declareProperty("dRmax", m_dRmax = -1); declareProperty("pTResMax", m_pTResMax = -1); } @@ -97,11 +123,12 @@ dRMatchingTool::initialize() { m_cuts.push_back(std::make_pair("dRmax", "Cut on maximal dR between track and truth particle.")); } if (m_pTResMax > -1) { - m_cuts.push_back(std::make_pair("pTResMax", "Cut on maximal, relativ pT difference between track and truth particle.")); + m_cuts.push_back(std::make_pair("pTResMax", + "Cut on maximal, relativ pT difference between track and truth particle.")); } // Add cuts to the TAccept. - for (const auto &cut : m_cuts) { + for (const auto& cut : m_cuts) { if (m_accept.addCut(cut.first, cut.second) < 0) { ATH_MSG_ERROR("Failed to add cut " << cut.first << " because the TAccept object is full."); return StatusCode::FAILURE; @@ -113,7 +140,7 @@ dRMatchingTool::initialize() { /** * If no cuts are enabled, force to have length one, such that it will always - * return 'false'. This is because we want the dRMatchingTool to be + * return 'false'. This is because we want the dRMatchingTool to be * ineffecitive in this case, and not select _all_ tracks. */ if (m_accept.getNCuts() == 0) { @@ -123,16 +150,17 @@ dRMatchingTool::initialize() { return StatusCode::SUCCESS; } -const Root::TAccept & +const Root::TAccept& dRMatchingTool::getTAccept( ) const { return m_accept; } -const Root::TAccept & -dRMatchingTool::accept(const xAOD::IParticle * /*p*/) const { +const Root::TAccept& +dRMatchingTool::accept(const xAOD::IParticle* /*p*/) const { m_accept.clear(); - - ATH_MSG_ERROR("accept(...) function called without needed Truth- or TrackParticleContainer. Please use one of the dRMatchingTool-specific accept methods."); + + ATH_MSG_ERROR( + "accept(...) function called without needed Truth- or TrackParticleContainer. Please use one of the dRMatchingTool-specific accept methods."); return m_accept; } @@ -140,49 +168,49 @@ dRMatchingTool::accept(const xAOD::IParticle * /*p*/) const { template<class T, class U> void dRMatchingTool::sortVectors(const T* container, - std::vector< const U* >& vec_pt, - std::vector< const U* >& vec_eta, - std::vector< const U* >& vec_phi, - bool (*selectionTool)(const U*)) const { - + std::vector< const U* >& vec_pt, + std::vector< const U* >& vec_eta, + std::vector< const U* >& vec_phi, + bool (* selectionTool)(const U*)) const { // Look all particles in container. for (const U* p : *container) { - // Ignore particles not passing the selection, if applicable. - if (selectionTool and !(*selectionTool)(p)) { continue; } + if (selectionTool and !(*selectionTool)(p)) { + continue; + } // Append passing particles to cached vectors. - vec_pt .push_back(p); + vec_pt.push_back(p); vec_eta.push_back(p); vec_phi.push_back(p); - } // Sort vectors. - std::sort(vec_pt.begin(), vec_pt.end(), sort_pt <U>); + std::sort(vec_pt.begin(), vec_pt.end(), sort_pt <U>); std::sort(vec_eta.begin(), vec_eta.end(), sort_eta<U>); std::sort(vec_phi.begin(), vec_phi.end(), sort_phi<U>); return; } -void -dRMatchingTool::checkCacheTrackParticles(const xAOD::TrackParticleContainer *trackParticles, - bool (*trackSelectionTool)(const xAOD::TrackParticle*)) const { - - // Check whether to cache. - if (*trackParticles == m_baseTrackContainer) { return; } +void +dRMatchingTool::checkCacheTrackParticles(const xAOD::TrackParticleContainer* trackParticles, + bool (* trackSelectionTool)(const xAOD::TrackParticle*)) const { + // Check whether to cache. + if (*trackParticles == m_baseTrackContainer) { + return; + } // Clear existing cache. clearTrackParticles(); // Cache track particles. sortVectors<xAOD::TrackParticleContainer, - xAOD::TrackParticle>(trackParticles, - m_trackParticlesSortedPt, - m_trackParticlesSortedEta, - m_trackParticlesSortedPhi, - trackSelectionTool); + xAOD::TrackParticle>(trackParticles, + m_trackParticlesSortedPt, + m_trackParticlesSortedEta, + m_trackParticlesSortedPhi, + trackSelectionTool); // Store copy of base track container. m_baseTrackContainer = *trackParticles; @@ -190,23 +218,24 @@ dRMatchingTool::checkCacheTrackParticles(const xAOD::TrackParticleContainer *tra return; } -void -dRMatchingTool::checkCacheTruthParticles(const xAOD::TruthParticleContainer *truthParticles, - bool (*truthSelectionTool)(const xAOD::TruthParticle*)) const { - +void +dRMatchingTool::checkCacheTruthParticles(const xAOD::TruthParticleContainer* truthParticles, + bool (* truthSelectionTool)(const xAOD::TruthParticle*)) const { // Check whether to cache. - if (*truthParticles == m_baseTruthContainer) { return; } + if (*truthParticles == m_baseTruthContainer) { + return; + } // Clear existing cache. clearTruthParticles(); // Cache truth particles. - sortVectors<xAOD::TruthParticleContainer, - xAOD::TruthParticle>(truthParticles, - m_truthParticlesSortedPt, - m_truthParticlesSortedEta, - m_truthParticlesSortedPhi, - truthSelectionTool); + sortVectors<xAOD::TruthParticleContainer, + xAOD::TruthParticle>(truthParticles, + m_truthParticlesSortedPt, + m_truthParticlesSortedEta, + m_truthParticlesSortedPhi, + truthSelectionTool); // Store copy of base truth container. m_baseTruthContainer = *truthParticles; @@ -217,77 +246,80 @@ dRMatchingTool::checkCacheTruthParticles(const xAOD::TruthParticleContainer *tru template<class U, class V> bool dRMatchingTool::sortedMatch(const U* p, - std::vector< const V* >& vec_pt, - std::vector< const V* >& vec_eta, - std::vector< const V* >& vec_phi) const { - + std::vector< const V* >& vec_pt, + std::vector< const V* >& vec_eta, + std::vector< const V* >& vec_phi) const { // (Re-)set variables. m_dRmin = 9999.; // Perform search in cached vectors. auto it_pt_lower = m_pTResMax < 0 ? vec_pt.begin() : - std::lower_bound(vec_pt.begin(), vec_pt.end(), - pt(p) * (1. - m_pTResMax), - [](const V* o, const float& val) -> bool { - return pt(o) < val; - }); - + std::lower_bound(vec_pt.begin(), vec_pt.end(), + pt(p) * (1. - m_pTResMax), + [](const V* o, const float& val) -> bool { + return pt(o) < val; + }); + auto it_pt_upper = m_pTResMax < 0 ? vec_pt.end() : - std::upper_bound(vec_pt.begin(), vec_pt.end(), - pt(p) * (1. + m_pTResMax), - [](const float& val, const V* o) -> bool { - return val < pt(o); - }); + std::upper_bound(vec_pt.begin(), vec_pt.end(), + pt(p) * (1. + m_pTResMax), + [](const float& val, const V* o) -> bool { + return val < pt(o); + }); auto it_eta_lower = m_dRmax < 0 ? vec_eta.begin() : - std::lower_bound(vec_eta.begin(), vec_eta.end(), - eta(p) - m_dRmax, - [](const V* o, const float& val) -> bool { - return eta(o) < val; - }); - + std::lower_bound(vec_eta.begin(), vec_eta.end(), + eta(p) - m_dRmax, + [](const V* o, const float& val) -> bool { + return eta(o) < val; + }); + auto it_eta_upper = m_dRmax < 0 ? vec_eta.end() : - std::upper_bound(vec_eta.begin(), vec_eta.end(), - eta(p) + m_dRmax, - [](const float& val, const V* o) -> bool { - return val < eta(o); - }); + std::upper_bound(vec_eta.begin(), vec_eta.end(), + eta(p) + m_dRmax, + [](const float& val, const V* o) -> bool { + return val < eta(o); + }); - // Dealing with cyclic nature of phi: Determining whether phi range wraps + // Dealing with cyclic nature of phi: Determining whether phi range wraps // around +-pi. - bool wrapLow = phi(p) - m_dRmax < -pi; - bool wrapHigh = phi(p) + m_dRmax > pi; + bool wrapLow = phi(p) - m_dRmax < -pi; + bool wrapHigh = phi(p) + m_dRmax > pi; bool wrap = wrapLow or wrapHigh; auto it_phi_lower = m_dRmax < 0 ? vec_phi.begin() : - std::lower_bound(vec_phi.begin(), vec_phi.end(), - phi(p) - m_dRmax + (wrapLow ? twopi : 0), - [](const V* o, const float& val) -> bool { - return phi(o) < val; - }); - - auto it_phi_upper = m_dRmax < 0 ? vec_phi.end() : - std::upper_bound(vec_phi.begin(), vec_phi.end(), - phi(p) + m_dRmax + (wrapHigh ? -twopi : 0), - [](const float& val, const V* o) -> bool { - return val < phi(o); - }); - + std::lower_bound(vec_phi.begin(), vec_phi.end(), + phi(p) - m_dRmax + (wrapLow ? twopi : 0), + [](const V* o, const float& val) -> bool { + return phi(o) < val; + }); + + auto it_phi_upper = m_dRmax < 0 ? vec_phi.end() : + std::upper_bound(vec_phi.begin(), vec_phi.end(), + phi(p) + m_dRmax + (wrapHigh ? -twopi : 0), + [](const float& val, const V* o) -> bool { + return val < phi(o); + }); + // Break early if no truth particles passed selection. - if (m_pTResMax > 0 and it_pt_upper < it_pt_lower) { return false; } - else if (m_dRmax > 0 and it_eta_upper < it_eta_lower) { return false; } - else if (m_dRmax > 0 and ((!wrap and it_phi_upper < it_phi_lower) or - ( wrap and it_phi_upper > it_phi_lower))) { return false; } - + if (m_pTResMax > 0 and it_pt_upper < it_pt_lower) { + return false; + } else if (m_dRmax > 0 and it_eta_upper < it_eta_lower) { + return false; + } else if (m_dRmax > 0 and((!wrap and it_phi_upper < it_phi_lower)or + (wrap and it_phi_upper > it_phi_lower))) { + return false; + } + // Initialise base set. - std::vector< const V* > set (vec_pt); + std::vector< const V* > set(vec_pt); // -- Sort, pointer-based; necessary for set_intersection. - std::sort(set.begin(), set.end()); + std::sort(set.begin(), set.end()); // Compute subset of selected truth particles. - std::vector< const V* > subset_pt (it_pt_lower, it_pt_upper); - std::vector< const V* > subset_eta (it_eta_lower, it_eta_upper); + std::vector< const V* > subset_pt(it_pt_lower, it_pt_upper); + std::vector< const V* > subset_eta(it_eta_lower, it_eta_upper); std::vector< const V* > subset_phi; if (!wrap) { subset_phi = std::vector< const V* >(it_phi_lower, it_phi_upper); @@ -305,66 +337,68 @@ dRMatchingTool::sortedMatch(const U* p, subsets.push_back(subset_eta); subsets.push_back(subset_phi); } - + // Compute successive intersections between base set and subset. for (std::vector< const V* > subset : subsets) { - // -- Sort, pointer-based; necessary for set::set_intersection. std::sort(subset.begin(), subset.end()); // -- Set intersection. std::vector< const V* > intersection; - std::set_intersection(set .begin(), set .end(), - subset.begin(), subset.end(), - std::back_inserter(intersection)); - + std::set_intersection(set.begin(), set.end(), + subset.begin(), subset.end(), + std::back_inserter(intersection)); + // -- Break early if intersection is empty. - if (intersection.size() == 0) { return false; } + if (intersection.size() == 0) { + return false; + } set = intersection; } // If only pT-matching, we're done. - if (m_dRmax < 0) { return set.size() > 0; } + if (m_dRmax < 0) { + return set.size() > 0; + } // Otherwise, compute dR for all remaining particles. bool passes = false; for (const V* other : set) { float dR = comp_deltaR(p, other); - m_dRmin = (dR < m_dRmin ? dR : m_dRmin); - passes |= m_dRmin < m_dRmax; + m_dRmin = (dR < m_dRmin ? dR : m_dRmin); + passes |= m_dRmin < m_dRmax; } return passes; } -const Root::TAccept & -dRMatchingTool::accept(const xAOD::TrackParticle *track, - const xAOD::TruthParticleContainer *truthParticles, - bool(*truthSelectionTool)(const xAOD::TruthParticle*)) const { - +const Root::TAccept& +dRMatchingTool::accept(const xAOD::TrackParticle* track, + const xAOD::TruthParticleContainer* truthParticles, + bool (* truthSelectionTool)(const xAOD::TruthParticle*)) const { // Reset the results. m_accept.clear(); // Determine whether to cache current truth particle container checkCacheTruthParticles(truthParticles, truthSelectionTool); - bool passes = sortedMatch<xAOD::TrackParticle, - xAOD::TruthParticle>(track, - m_truthParticlesSortedPt, - m_truthParticlesSortedEta, - m_truthParticlesSortedPhi); + bool passes = sortedMatch<xAOD::TrackParticle, + xAOD::TruthParticle>(track, + m_truthParticlesSortedPt, + m_truthParticlesSortedEta, + m_truthParticlesSortedPhi); // Set cut values. if (m_dRmax > -1) { - m_accept.setCutResult("dRmax", passes); + m_accept.setCutResult("dRmax", passes); } if (m_pTResMax > -1) { m_accept.setCutResult("pTResMax", passes); } // Book keep cuts - for (const auto &cut : m_cuts) { + for (const auto& cut : m_cuts) { unsigned int pos = m_accept.getCutPosition(cut.first); if (m_accept.getCutResult(pos)) { m_numPassedCuts[pos]++; @@ -377,36 +411,34 @@ dRMatchingTool::accept(const xAOD::TrackParticle *track, } return m_accept; - } -const Root::TAccept & -dRMatchingTool::accept(const xAOD::TruthParticle *truth, - const xAOD::TrackParticleContainer *trackParticles, - bool(*trackSelectionTool)(const xAOD::TrackParticle*)) const { - +const Root::TAccept& +dRMatchingTool::accept(const xAOD::TruthParticle* truth, + const xAOD::TrackParticleContainer* trackParticles, + bool (* trackSelectionTool)(const xAOD::TrackParticle*)) const { // Reset the results. m_accept.clear(); // Determine whether to cache current track particle container checkCacheTrackParticles(trackParticles, trackSelectionTool); - bool passes = sortedMatch<xAOD::TruthParticle, - xAOD::TrackParticle>(truth, - m_trackParticlesSortedPt, - m_trackParticlesSortedEta, - m_trackParticlesSortedPhi); + bool passes = sortedMatch<xAOD::TruthParticle, + xAOD::TrackParticle>(truth, + m_trackParticlesSortedPt, + m_trackParticlesSortedEta, + m_trackParticlesSortedPhi); // Set cut values. if (m_dRmax > -1) { - m_accept.setCutResult("dRmax", passes); + m_accept.setCutResult("dRmax", passes); } if (m_pTResMax > -1) { m_accept.setCutResult("pTResMax", passes); } // Book keep cuts - for (const auto &cut : m_cuts) { + for (const auto& cut : m_cuts) { unsigned int pos = m_accept.getCutPosition(cut.first); if (m_accept.getCutResult(pos)) { m_numPassedCuts[pos]++; @@ -419,35 +451,33 @@ dRMatchingTool::accept(const xAOD::TruthParticle *truth, } return m_accept; - } - -const Root::TAccept & -dRMatchingTool::acceptLegacy(const xAOD::TrackParticle *p, - const xAOD::TruthParticleContainer *truthParticles, - bool(*truthSelectionTool)(const xAOD::TruthParticle*)) const { - +const Root::TAccept& +dRMatchingTool::acceptLegacy(const xAOD::TrackParticle* p, + const xAOD::TruthParticleContainer* truthParticles, + bool (* truthSelectionTool)(const xAOD::TruthParticle*)) const { // Reset the results. m_accept.clear(); m_dRmin = 9999.; // Define variables. - const unsigned int Ncuts (m_cuts.size()); + const unsigned int Ncuts(m_cuts.size()); bool passes(false), passesThis(false); // Loop all truth particles. for (const xAOD::TruthParticle* truth : *truthParticles) { - // Ignore all truth particles failing the selection. - if (truthSelectionTool and !(*truthSelectionTool)(truth)) { continue; } + if (truthSelectionTool and !(*truthSelectionTool)(truth)) { + continue; + } // Compute cut variable values. float dR = comp_deltaR(p, truth); float pTRes = std::fabs(pt(truth) / pt(p) - 1.); - + // Initialise cut monitoring objects. - std::vector<bool> vecPassesThis (Ncuts, false); + std::vector<bool> vecPassesThis(Ncuts, false); // Check whether each individual cut passed. unsigned int icut = 0; @@ -459,28 +489,29 @@ dRMatchingTool::acceptLegacy(const xAOD::TrackParticle *p, } // Check whether all cuts passed. - passesThis = std::all_of(vecPassesThis.begin(), - vecPassesThis.end(), - [](const bool& v) { return v; }); + passesThis = std::all_of(vecPassesThis.begin(), + vecPassesThis.end(), + [](const bool& v) { + return v; + }); passes |= passesThis; // If the current truth particle was matched, check minimal dR. if (passesThis) { m_dRmin = (dR < m_dRmin ? dR : m_dRmin); } - } // Set cut values. if (m_dRmax > -1) { - m_accept.setCutResult("dRmax", passes); + m_accept.setCutResult("dRmax", passes); } if (m_pTResMax > -1) { m_accept.setCutResult("pTResMax", passes); } // Book keep cuts - for (const auto &cut : m_cuts) { + for (const auto& cut : m_cuts) { unsigned int pos = m_accept.getCutPosition(cut.first); if (m_accept.getCutResult(pos)) { m_numPassedCuts[pos]++; @@ -495,32 +526,31 @@ dRMatchingTool::acceptLegacy(const xAOD::TrackParticle *p, return m_accept; } - -const Root::TAccept & -dRMatchingTool::acceptLegacy(const xAOD::TruthParticle *p, - const xAOD::TrackParticleContainer *trackParticles, - bool(*trackSelectionTool)(const xAOD::TrackParticle*)) const { - +const Root::TAccept& +dRMatchingTool::acceptLegacy(const xAOD::TruthParticle* p, + const xAOD::TrackParticleContainer* trackParticles, + bool (* trackSelectionTool)(const xAOD::TrackParticle*)) const { // Reset the results. m_accept.clear(); m_dRmin = 9999.; // Define variables. - const unsigned int Ncuts (m_cuts.size()); + const unsigned int Ncuts(m_cuts.size()); bool passes(false), passesThis(false); // Loop all track particles. for (const xAOD::TrackParticle* track : *trackParticles) { - // Ignore all tracks failing the selection. - if (trackSelectionTool and !(*trackSelectionTool)(track)) { continue; } + if (trackSelectionTool and !(*trackSelectionTool)(track)) { + continue; + } // Compute cut variable values. float dR = comp_deltaR(p, track); float pTRes = std::fabs(pt(track) / pt(p) - 1.); // Initialise cut monitoring objects. - std::vector<bool> vecPassesThis (Ncuts, false); + std::vector<bool> vecPassesThis(Ncuts, false); // Check whether each individual cut passed. unsigned int icut = 0; @@ -532,28 +562,29 @@ dRMatchingTool::acceptLegacy(const xAOD::TruthParticle *p, } // Check whether all cuts passed. - passesThis = std::all_of(vecPassesThis.begin(), - vecPassesThis.end(), - [](const bool& v) { return v; }); + passesThis = std::all_of(vecPassesThis.begin(), + vecPassesThis.end(), + [](const bool& v) { + return v; + }); passes |= passesThis; // If the current track particle was matched, check minimal dR. if (passesThis) { m_dRmin = (dR < m_dRmin ? dR : m_dRmin); } - } // Set cut values. if (m_dRmax > -1) { - m_accept.setCutResult("dRmax", passes); + m_accept.setCutResult("dRmax", passes); } if (m_pTResMax > -1) { m_accept.setCutResult("pTResMax", passes); } // Book keep cuts - for (const auto &cut : m_cuts) { + for (const auto& cut : m_cuts) { unsigned int pos = m_accept.getCutPosition(cut.first); if (m_accept.getCutResult(pos)) { m_numPassedCuts[pos]++; @@ -578,11 +609,11 @@ dRMatchingTool::finalize() { } ATH_MSG_INFO(m_numPassed << " / " << m_numProcessed << " = " << m_numPassed * 100. / m_numProcessed - << "% passed all cuts."); - for (const auto &cut : m_cuts) { + << "% passed all cuts."); + for (const auto& cut : m_cuts) { ULong64_t numPassed = m_numPassedCuts.at(m_accept.getCutPosition(cut.first)); ATH_MSG_INFO(numPassed << " = " << numPassed * 100. / m_numProcessed - << "% passed " << cut.first << " cut."); + << "% passed " << cut.first << " cut."); } return StatusCode::SUCCESS; diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/dRMatchingTool.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/dRMatchingTool.h index 6c53ec71caba8435de72544a4cce65b3970b10a2..f487867e7b2c13f3dcdddbfdcc86afe80114182e 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/dRMatchingTool.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/dRMatchingTool.h @@ -41,25 +41,25 @@ * bool dRMatched = (bool) dynamic_cast<dRMatchingTool&>(*m_dRMatchingTool) \ * .accept(track, truthParticles, &truthSelectionTool); * - * to match a track to a subset of truth particle, or + * to match a track to a subset of truth particle, or * * bool dRMatched = (bool) dynamic_cast<dRMatchingTool&>(*m_dRMatchingTool) \ * .accept(truth, trackParticles); * - * to match a truth particle to all tracks. The standard accept(const + * to match a truth particle to all tracks. The standard accept(const * xAOD::IParticle*) method is disabled. * - * Optional track- and truth particle selection functions are allowed, to + * Optional track- and truth particle selection functions are allowed, to * perform the matching to only a subset of the respective containers. If these - * functions are omitted as arguments, the matching is performed to the all + * functions are omitted as arguments, the matching is performed to the all * particles in the specified container. - * + * * The tool is able to perform matching wrt. dR as well relative pT-resolution, * i.e. * \Delta p_{T}/p_{T} = \frac{|p_{T,this} - p_{T,other}|}{p_{T,this}} * The tool is configured such that a successful match means that all set cuts * were passed. That means that if only the dR-cut is set, no pT-resoution cut - * is imposed, and conversely. In particular, if neither cut is set, no + * is imposed, and conversely. In particular, if neither cut is set, no * particles pass the matching. The cut values are set in the job option as e.g. * * from InDetPhysValMonitoring.InDetPhysValMonitoringConf import \ @@ -68,81 +68,80 @@ * dRMatcher.dRmax = 0.1 # Disabled: -1 * dRMatcher.pTResMax = 0.1 # Disabled: -1 * ToolSvc += dRMatcher - * - * The main 'accept' methods are implemented using caching and sorting to avoid - * O(N^2) complexity from what is essentially nested loops. This speeds up - * performance drastically, at the cost of transparency. To this end, and for - * validation purposes, 'acceptLegacy' methods are kept in, which are - * conceptually simpler and more intuitive, but much slower, than the main + * + * The main 'accept' methods are implemented using caching and sorting to avoid + * O(N^2) complexity from what is essentially nested loops. This speeds up + * performance drastically, at the cost of transparency. To this end, and for + * validation purposes, 'acceptLegacy' methods are kept in, which are + * conceptually simpler and more intuitive, but much slower, than the main * methods. However, these legacy methods ought not to be used for actual, even * just moderately large runs. */ class dRMatchingTool: -public virtual ::IAsgSelectionTool, + public virtual ::IAsgSelectionTool, public asg::AsgTool { ASG_TOOL_CLASS1(dRMatchingTool, IAsgSelectionTool); - - public: - +public: /// Constructor(s). - dRMatchingTool(const std::string &name); + dRMatchingTool(const std::string& name); /// Destructor. - virtual ~dRMatchingTool(); + virtual + ~dRMatchingTool(); /// SelectionTool method(s). virtual StatusCode initialize(); virtual StatusCode finalize(); - virtual const Root::TAccept &getTAccept( ) const; - virtual const Root::TAccept &accept(const xAOD::IParticle *p) const; + virtual const Root::TAccept& getTAccept( ) const; + virtual const Root::TAccept& accept(const xAOD::IParticle* p) const; /// dR-matching specific method(s). // For matching single track to set of truth particles. virtual const Root::TAccept& - acceptLegacy(const xAOD::TrackParticle *p, - const xAOD::TruthParticleContainer *truthParticles, - bool (*truthSelectionTool)(const xAOD::TruthParticle*) = nullptr) const; + acceptLegacy(const xAOD::TrackParticle* p, + const xAOD::TruthParticleContainer* truthParticles, + bool (* truthSelectionTool)(const xAOD::TruthParticle*) = nullptr) const; const Root::TAccept& - accept(const xAOD::TrackParticle *p, - const xAOD::TruthParticleContainer *truthParticles, - bool (*truthSelectionTool)(const xAOD::TruthParticle*) = nullptr) const; + accept(const xAOD::TrackParticle* p, + const xAOD::TruthParticleContainer* truthParticles, + bool (* truthSelectionTool)(const xAOD::TruthParticle*) = nullptr) const; // For matching single truth particle to set of tracks. virtual const Root::TAccept& - acceptLegacy(const xAOD::TruthParticle *p, - const xAOD::TrackParticleContainer *trackParticles, - bool (*trackSelectionTool)(const xAOD::TrackParticle*) = nullptr) const; + acceptLegacy(const xAOD::TruthParticle* p, + const xAOD::TrackParticleContainer* trackParticles, + bool (* trackSelectionTool)(const xAOD::TrackParticle*) = nullptr) const; const Root::TAccept& - accept(const xAOD::TruthParticle *p, - const xAOD::TrackParticleContainer *trackParticles, - bool (*trackSelectionTool)(const xAOD::TrackParticle*) = nullptr) const; + accept(const xAOD::TruthParticle* p, + const xAOD::TrackParticleContainer* trackParticles, + bool (* trackSelectionTool)(const xAOD::TrackParticle*) = nullptr) const; // Accessor for the minimal dR from the latest matching of either type. float dRmin() const; - - - protected: - +protected: /// Internal method(s). // Cache track particles. - void checkCacheTrackParticles(const xAOD::TrackParticleContainer *trackParticles, - bool (*trackSelectionTool)(const xAOD::TrackParticle*) = nullptr) const; + void checkCacheTrackParticles(const xAOD::TrackParticleContainer* trackParticles, + bool (* trackSelectionTool)(const xAOD::TrackParticle*) = nullptr) const; // Cache truth particles. - void checkCacheTruthParticles(const xAOD::TruthParticleContainer *truthParticles, - bool (*truthSelectionTool)(const xAOD::TruthParticle*) = nullptr) const; + void checkCacheTruthParticles(const xAOD::TruthParticleContainer* truthParticles, + bool (* truthSelectionTool)(const xAOD::TruthParticle*) = nullptr) const; // Clear cached track particle arrays. - inline void clearTrackParticles() const { - m_trackParticlesSortedPt .clear(); + inline void + clearTrackParticles() const { + m_trackParticlesSortedPt.clear(); m_trackParticlesSortedEta.clear(); m_trackParticlesSortedPhi.clear(); return; } + // Clear cached truth particle arrays. - inline void clearTruthParticles() const { - m_truthParticlesSortedPt .clear(); + inline void + clearTruthParticles() const { + m_truthParticlesSortedPt.clear(); m_truthParticlesSortedEta.clear(); m_truthParticlesSortedPhi.clear(); return; @@ -152,21 +151,19 @@ public virtual ::IAsgSelectionTool, // subject to their passing the selectionTool. template<class T, class U> void sortVectors(const T* container, - std::vector< const U* >& vec_pt, - std::vector< const U* >& vec_eta, - std::vector< const U* >& vec_phi, - bool (*selectionTool)(const U*)) const; + std::vector< const U* >& vec_pt, + std::vector< const U* >& vec_eta, + std::vector< const U* >& vec_phi, + bool (* selectionTool)(const U*)) const; - // Match the particle p by dR and/or pT to the particles in the three cached + // Match the particle p by dR and/or pT to the particles in the three cached // vectors. template<class U, class V> bool sortedMatch(const U* p, - std::vector< const V* >& vec_pt, - std::vector< const V* >& vec_eta, - std::vector< const V* >& vec_phi) const; - + std::vector< const V* >& vec_pt, + std::vector< const V* >& vec_eta, + std::vector< const V* >& vec_phi) const; private: - /// Data member(s). // TAccept object. mutable Root::TAccept m_accept; @@ -186,24 +183,23 @@ private: // The minimal dR for latest successful matching of either type. mutable float m_dRmin = 9999.; - // Copy of the xAOD::TruthParticleContainer used to perform the caching. A - // copy, rather than a pointer or reference, is necessary to check when a new + // Copy of the xAOD::TruthParticleContainer used to perform the caching. A + // copy, rather than a pointer or reference, is necessary to check when a new // container is encountered (i.e. when a new event is processed). mutable xAOD::TruthParticleContainer m_baseTruthContainer; - // Copy of the xAOD::TrackParticleContainer used to perform the caching. + // Copy of the xAOD::TrackParticleContainer used to perform the caching. mutable xAOD::TrackParticleContainer m_baseTrackContainer; - // Cached vectors of the xAOD::TruthParticles in m_baseTruthContainer, sorted + // Cached vectors of the xAOD::TruthParticles in m_baseTruthContainer, sorted // in ascending order accoring to their pT, eta, and phi, resp. mutable std::vector< const xAOD::TruthParticle* > m_truthParticlesSortedPt; mutable std::vector< const xAOD::TruthParticle* > m_truthParticlesSortedEta; mutable std::vector< const xAOD::TruthParticle* > m_truthParticlesSortedPhi; - // Cached vectors of the xAOD::TrackParticles in m_baseTrackContainer, sorted + // Cached vectors of the xAOD::TrackParticles in m_baseTrackContainer, sorted // in ascending order accoring to their pT, eta, and phi, resp. mutable std::vector< const xAOD::TrackParticle* > m_trackParticlesSortedPt; mutable std::vector< const xAOD::TrackParticle* > m_trackParticlesSortedEta; mutable std::vector< const xAOD::TrackParticle* > m_trackParticlesSortedPhi; - }; #endif // > !INDETPHYSVALMONITORING_DRMATCHINGTOOL_H diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/safeDecorator.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/safeDecorator.h index d6c3c97a4b0778eb2a4229b66cd28725379b8338..deeec976e2d248a6e0b47efcd5a3ee4105746977 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/safeDecorator.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/safeDecorator.h @@ -32,10 +32,10 @@ namespace IDPVM { DO_NOTHING, REJECT_QUIETLY, REJECT_WITH_WARNING, REJECT_WARN_IF_UNEQUAL }; - // safe decorator for TrackParticles + /// Safe decorator for TrackParticles template <class T> void - safeDecorator(const xAOD::TrackParticle &particle, const std::string &decorName, const T &value, + safeDecorator(const xAOD::TrackParticle& particle, const std::string& decorName, const T& value, const DuplicateBehaviour duplicate = REJECT_WITH_WARNING) { switch (duplicate) { // @@ -74,10 +74,10 @@ namespace IDPVM { } } - // safe decorator for TruthParticles + /// Safe decorator for TruthParticles template <class T> void - safeDecorator(const xAOD::TruthParticle &particle, const std::string &decorName, const T &value, + safeDecorator(const xAOD::TruthParticle& particle, const std::string& decorName, const T& value, const DuplicateBehaviour duplicate = REJECT_WITH_WARNING) { switch (duplicate) { // diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/xmlUtilities.h b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/xmlUtilities.h index 6df1e4a82763cc3ffe0d33e4df6e8005358f3d06..42e90a98344135d17dbf827b0b88bf995795ed55 100644 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/xmlUtilities.h +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/src/xmlUtilities.h @@ -18,32 +18,34 @@ typedef std::basic_string<XMLCh>XercesString; inline XercesString -fromNative(const char *str) { +fromNative(const char* str) { auto xDeleter = [&](XMLCh buf[]) { xercesc::XMLString::release(&buf); }; + std::unique_ptr<XMLCh[], decltype(xDeleter)> ptr(xercesc::XMLString::transcode(str), xDeleter); return XercesString(ptr.get()); } inline XercesString -fromNative(const std::string &str) { +fromNative(const std::string& str) { return fromNative(str.c_str()); } inline std::string -toNative(const XMLCh *str) { +toNative(const XMLCh* str) { auto cDeleter = [&](char buf[]) { xercesc::XMLString::release(&buf); }; + std::unique_ptr<char[], decltype(cDeleter)> ptr(xercesc::XMLString::transcode(str), cDeleter); return std::string(ptr.get()); } inline std::string -toNative(const XercesString &str) { +toNative(const XercesString& str) { return toNative(str.c_str()); } diff --git a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/InDetPhysValMonitoring_TestConfiguration.xml b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/InDetPhysValMonitoring_TestConfiguration.xml index 4afa0556d64f3e1952549d899f86a3f684eb7def..defe2d1ff4e905740ec34b38e3258768396f1018 100755 --- a/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/InDetPhysValMonitoring_TestConfiguration.xml +++ b/InnerDetector/InDetValidation/InDetPhysValMonitoring/test/InDetPhysValMonitoring_TestConfiguration.xml @@ -21,7 +21,7 @@ IdPhysValTtbar </jobTransformJobName> <jobTransformCmd> - Reco_tf.py --steering doRAWtoALL --checkEventCount False --ignoreErrors True --maxEvents 500 --valid True --inputRDOFile root://eosatlas.cern.ch//eos/atlas/atlasgroupdisk/perf-idtracking/dq2/rucio/mc15_13TeV/d6/dc/RDO.08543088._000001.pool.root.1 --outputNTUP_PHYSVALFile physval.root --outputAODFile physval.AOD.root --validationFlags doInDet --preExec "from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doSlimming.set_Value_and_Lock(False);rec.doTrigger.set_Value_and_Lock(False); from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags; InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False);rec.doDumpProperties=True;rec.doCalo=False;rec.doEgamma=False;rec.doForwardDet=False;rec.doInDet=True;rec.doJetMissingETTag=False;rec.doLArg=False;rec.doLucid=False;rec.doMuon=False;rec.doMuonCombined=False;rec.doSemiDetailedPerfMon=True;rec.doTau=False;rec.doTile=False;" + Reco_tf.py --steering doRAWtoALL --checkEventCount False --ignoreErrors True --maxEvents 500 --valid True --inputRDOFile root://eosatlas.cern.ch//eos/atlas/atlasgroupdisk/perf-idtracking/dq2/rucio/mc15_13TeV/d6/dc/RDO.08543088._000001.pool.root.1 --outputNTUP_PHYSVALFile physval.root --outputAODFile physval.AOD.root --validationFlags doInDet --preExec "from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doSlimming.set_Value_and_Lock(False);rec.doTrigger.set_Value_and_Lock(False); from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags; InDetPhysValFlags.doValidateTightPrimaryTracks.set_Value_and_Lock(True);InDetPhysValFlags.doValidateTracksInJets.set_Value_and_Lock(True);InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False);rec.doDumpProperties=True;rec.doCalo=False;rec.doEgamma=False;rec.doForwardDet=False;rec.doInDet=True;rec.doJetMissingETTag=False;rec.doLArg=False;rec.doLucid=False;rec.doMuon=False;rec.doMuonCombined=False;rec.doSemiDetailedPerfMon=True;rec.doTau=False;rec.doTile=False;" </jobTransformCmd> <group>IdPhysValTtbar</group> <queue>medium</queue> @@ -33,25 +33,24 @@ InPhysValMinbias </jobTransformJobName> <jobTransformCmd> - Reco_tf.py --steering doRAWtoALL --checkEventCount False --ignoreErrors True --maxEvents 25 --valid True --inputRDOFile root://eosatlas.cern.ch//eos/atlas/atlasgroupdisk/perf-idtracking/dq2/rucio/mc15_13TeV/0c/a1/RDO.07497163._000001.pool.root.1 root://eosatlas.cern.ch//eos/atlas/atlasgroupdisk/perf-idtracking/dq2/rucio/mc15_13TeV/61/b8/RDO.07497154._000001.pool.root.1 --outputNTUP_PHYSVALFile physval.root --outputAODFile physval.AOD.root --validationFlags doInDet --preExec "from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doSlimming.set_Value_and_Lock(False);rec.doTrigger.set_Value_and_Lock(False); from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags; InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False);rec.doDumpProperties=True;InDetFlags.doMinBias.set_Value_and_Lock(True);rec.doCalo=False;rec.doEgamma=False;rec.doForwardDet=False;rec.doInDet=True;rec.doJetMissingETTag=False;rec.doLArg=False;rec.doLucid=False;rec.doMuon=False;rec.doMuonCombined=False;rec.doSemiDetailedPerfMon=True;rec.doTau=False;rec.doTile=False;" + Reco_tf.py --steering doRAWtoALL --checkEventCount False --ignoreErrors True --maxEvents 1500 --valid True --inputRDOFile root://eosatlas.cern.ch//eos/atlas/atlasgroupdisk/perf-idtracking/dq2/rucio/mc15_13TeV/0c/a1/RDO.07497163._000001.pool.root.1 root://eosatlas.cern.ch//eos/atlas/atlasgroupdisk/perf-idtracking/dq2/rucio/mc15_13TeV/61/b8/RDO.07497154._000001.pool.root.1 root://eosatlas.cern.ch//eos/atlas/atlasgroupdisk/perf-idtracking/dq2/rucio/mc15_13TeV/57/d8/RDO.07497154._000002.pool.root.1 --outputNTUP_PHYSVALFile physval.root --outputAODFile physval.AOD.root --validationFlags doInDet --preExec "from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doSlimming.set_Value_and_Lock(False);rec.doTrigger.set_Value_and_Lock(False); from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags; InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(False);rec.doDumpProperties=True;InDetFlags.doMinBias.set_Value_and_Lock(True);rec.doCalo=False;rec.doEgamma=False;rec.doForwardDet=False;rec.doInDet=True;rec.doJetMissingETTag=False;rec.doLArg=False;rec.doLucid=False;rec.doMuon=False;rec.doMuonCombined=False;rec.doSemiDetailedPerfMon=True;rec.doTau=False;rec.doTile=False;" </jobTransformCmd> <group>IdPhysValMinBias</group> <queue>medium</queue> </jobTransform> <jobTransform userJobId="IdPhysValGSFSingleE"> - <doc>gsf, single-electrons, mc15</doc> + <doc>gsf, single-electrons, mc15, 1 GeV electrnos but abuses old 5 GeV group name</doc> <jobTransformJobName> InPhysValGSFSingleE </jobTransformJobName> <jobTransformCmd> - Reco_tf.py --steering doRAWtoALL --checkEventCount False --ignoreErrors True --maxEvents 25 --valid True --inputRDOFile root://eosatlas.cern.ch//eos/atlas/atlasgroupdisk/perf-idtracking/dq2/rucio/mc15_13TeV/ef/41/RDO.07275505._000001.pool.root.1 --outputNTUP_PHYSVALFile physval.root --outputAODFile physval.AOD.root --validationFlags doInDet --preExec "from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doSlimming.set_Value_and_Lock(False);rec.doTrigger.set_Value_and_Lock(False); from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags; InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(True);rec.doForwardDet=False;rec.doInDet=True;rec.doJetMissingETTag=False;rec.doCalo=True;rec.doEgamma=True;rec.doLucid=False;rec.doMuon=False;rec.doMuonCombined=False;rec.doSemiDetailedPerfMon=True;rec.doTau=False;rec.doDumpProperties=True;" + Reco_tf.py --steering doRAWtoALL --checkEventCount False --ignoreErrors True --maxEvents 5000 --valid True --inputRDOFile root://eosatlas.cern.ch//eos/atlas/atlasgroupdisk/perf-idtracking/dq2/rucio/mc15_13TeV/57/ea/RDO.07275503._000001.pool.root.1 root://eosatlas.cern.ch//eos/atlas/atlasgroupdisk/perf-idtracking/dq2/rucio/mc15_13TeV/28/a2/RDO.07275503._000002.pool.root.1 root://eosatlas.cern.ch//eos/atlas/atlasgroupdisk/perf-idtracking/dq2/rucio/mc15_13TeV/6b/43/RDO.07275503._000003.pool.root.1 --outputNTUP_PHYSVALFile physval.root --outputAODFile physval.AOD.root --validationFlags doInDet --preExec "from InDetRecExample.InDetJobProperties import InDetFlags;InDetFlags.doSlimming.set_Value_and_Lock(False);rec.doTrigger.set_Value_and_Lock(False); from InDetPhysValMonitoring.InDetPhysValJobProperties import InDetPhysValFlags; InDetPhysValFlags.doValidateGSFTracks.set_Value_and_Lock(True);rec.doForwardDet=False;rec.doInDet=True;rec.doJetMissingETTag=False;rec.doCalo=True;rec.doEgamma=True;rec.doLucid=False;rec.doMuon=False;rec.doMuonCombined=False;rec.doSemiDetailedPerfMon=True;rec.doTau=False;rec.doDumpProperties=True;" + <!-- 5GeV: root://eosatlas.cern.ch//eos/atlas/atlasgroupdisk/perf-idtracking/dq2/rucio/mc15_13TeV/ef/41/RDO.07275505._000001.pool.root.1 --> </jobTransformCmd> <group>IdPhysValGSFSingleE</group> <queue>medium</queue> </jobTransform> - - </jobList> <jobGroups> <jobGroup name="IdPhysValTtbar" parent="Transform"> diff --git a/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx b/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx index bd7a41330de5a0dc1ab8900ccf1e9a43630e7ff0..749d486503dede695fb491852b3fb413d8b00713 100644 --- a/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx +++ b/MuonSpectrometer/MuonDigitization/RPC_Digitization/src/RpcDigitizationTool.cxx @@ -620,6 +620,7 @@ StatusCode RpcDigitizationTool::doDigitization() { //status.ignore(); int nKilledStrips = 0; + int nToBeKilledStrips = 0; RPCSimHitCollection* inputSimHitColl=NULL; @@ -804,7 +805,7 @@ StatusCode RpcDigitizationTool::doDigitization() { MuonMCData((*b),time)); // store tof+strip_propagation+corr.jitter // MuonMCData((*b),G4Time+bunchTime+proptime )); // store tof+strip_propagation - if( abs(hit.particleEncoding())== 13 ){ + if( abs(hit.particleEncoding())== 13 || hit.particleEncoding() == 0){ auto channelSimDataMapPos = channelSimDataMap.find(atlasId); if( channelSimDataMapPos == channelSimDataMap.end() ){ @@ -842,8 +843,11 @@ StatusCode RpcDigitizationTool::doDigitization() { if(m_rSummarySvc->RPC_DeadStripList().find( newId ) != m_rSummarySvc->RPC_DeadStripList().end()) { ATH_MSG_DEBUG ( "After DetectionEfficiency: strip "<< m_idHelper->show_to_string(newId) <<" in a cluster of size "<< pcs[2]-pcs[1]+1<<" is dead - kill it "); - ++nKilledStrips; - if (m_kill_deadstrips) continue;//gabriele + ++nToBeKilledStrips; + if (m_kill_deadstrips){ + ++nKilledStrips; + continue;//gabriele + } } } } @@ -1053,7 +1057,7 @@ StatusCode RpcDigitizationTool::doDigitization() { m_thpcRPC=0; } - ATH_MSG_DEBUG ("EndOf Digitize() n. of strips Killed (dead) in the DB = "<<nKilledStrips); + ATH_MSG_DEBUG ("EndOf Digitize() n. of strips Killed (dead) in the DB = "<<nKilledStrips<<" ("<<nToBeKilledStrips<<")"); return StatusCode::SUCCESS; } @@ -1609,8 +1613,9 @@ int RpcDigitizationTool::findStripNumber(Amg::Vector3D posInGap, Identifier digi int result= int((impact-min_)/pitch)+1; if (result<1 || result>nstrips) { - ATH_MSG_WARNING("strip closest to hit is outside the strip panel boundaries: impact, min_, max_ " - <<impact<<" ["<<min_<<", "<<max_<<"] strip # "<<result<<" [1, "<<nstrips<<"] pitch = "<<pitch); + ATH_MSG_DEBUG("WARNING: strip closest to hit is outside the strip panel boundaries: impact, min_, max_ " + <<impact<<" ["<<min_<<", "<<max_<<"] strip # "<<result<<" [1, "<<nstrips<<"] pitch = "<<pitch + <<" stripID="<< m_idHelper->show_to_string(digitId)); if (result>nstrips) result=nstrips; else if (result<1) result=1; } @@ -1937,14 +1942,14 @@ StatusCode RpcDigitizationTool::DetectionEfficiency(const Identifier* IdEtaRpcSt if (fabs(FracDeadStripEta-1.)<0.001) { - ATH_MSG_WARNING ("SPECIAL CASE: Read from Cool: FracDeadStripEta/Phi "<<FracDeadStripEta<<"/"<<FracDeadStripPhi + ATH_MSG_DEBUG ("Watch out: SPECIAL CASE: Read from Cool: FracDeadStripEta/Phi "<<FracDeadStripEta<<"/"<<FracDeadStripPhi <<" RPC_ProjectedTracksEta "<<RPC_ProjectedTracksEta<<" Eta/PhiPanelEfficiency "<<EtaPanelEfficiency<<"/"<<PhiPanelEfficiency - <<" gapEff "<<GapEfficiency<<" for gas gap "<<m_idHelper->show_to_string(IdEta)); + <<" gapEff "<<GapEfficiency<<" for gas gap "<<m_idHelper->show_to_string(IdEta)<<" id "<<IdEta.get_identifier32().get_compact()); // dead eta panel => cannot determine the strip status for phi strips // FracDeadStripPhi must be reset to 0. and undefinedPhiStripStatus = true FracDeadStripPhi = 0.; undefinedPhiStripStatus = true; - ATH_MSG_WARNING ("SPECIAL CASE: Resetting FracDeadStripPhi "<<FracDeadStripPhi<<" ignoring phi dead strips "); + ATH_MSG_VERBOSE ("Watch out: SPECIAL CASE: Resetting FracDeadStripPhi "<<FracDeadStripPhi<<" ignoring phi dead strips "); } @@ -1959,7 +1964,7 @@ StatusCode RpcDigitizationTool::DetectionEfficiency(const Identifier* IdEtaRpcSt if ((maxGeomEff-FracDeadStripEta)-EtaPanelEfficiency<-0.011) { ATH_MSG_DEBUG("Ineff. from dead strips on Eta Panel larger that measured efficiency: deadFrac="<<FracDeadStripEta<<" Panel Eff="<<EtaPanelEfficiency<<" for Panel "<<m_idHelper->show_to_string(IdEta)); - ATH_MSG_DEBUG("... see the corresponding report among the warnings of RpcDetectorStatusDbTool"); + ATH_MSG_DEBUG("... see the corresponding report from RpcDetectorStatusDbTool"); //EtaPanelEfficiency = 1.-FracDeadStripEta; EtaPanelEfficiency = maxGeomEff-FracDeadStripEta; changing = true; diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecHelperTools/doc/mainpage.h b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecHelperTools/doc/mainpage.h deleted file mode 100644 index 2f62a88fed88d26e266f1858cfc7d602f36b8b5e..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecHelperTools/doc/mainpage.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - -@mainpage MuonRecHelperTools package - @author Niels.Van.Eldik@cern.ch - -@section MuonRecHelperTools Introduction - -This package contains a set of helper tools for Muon EDM objects and Identifiers - -@section ExtrasMuonRecHelperTools Extra Pages - - - @ref UsedMuonRecHelperTools - - @ref RequirementsMuonRecHelperTools -*/ - -/** -@page UsedMuonRecHelperTools Used Packages -@htmlinclude used_packages.html -*/ - -/** -@page RequirementsMuonRecHelperTools Requirements -@include requirements - -*/ diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecHelperTools/src/MuonEDMPrinterTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecHelperTools/src/MuonEDMPrinterTool.cxx index 5d07d444b64c1ab038ddfa01e44050eab0a7cd3b..3d4cce51871093d26b0e287e8569c03009e58b86 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecHelperTools/src/MuonEDMPrinterTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonRecHelperTools/src/MuonEDMPrinterTool.cxx @@ -110,6 +110,7 @@ namespace Muon { for( ;chit!=chit_end;++chit ){ const Identifier& chId = chit->chamberId(); bool isMdt = m_idHelper->isMdt(chId); + bool isCsc = m_idHelper->isCsc(chId); sout << " " << std::setw(35) << m_idHelper->toStringChamber(chId); @@ -157,6 +158,8 @@ namespace Muon { sout << secondString << std::setw(3) << second.ncloseHits; } } + + if(isCsc) sout<<" Unspoiled eta hits: "<<first.ngoodHits; if( chit != chit_last ) sout << std::endl; } diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/doc/mainpage.h b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/doc/mainpage.h deleted file mode 100644 index 04e35479bdb07ae9e1634bfef161bd94df641107..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/doc/mainpage.h +++ /dev/null @@ -1,37 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** -@mainpage MuonTrackSummaryHelperTool -@author Edward.Moyse@cern.ch - -@section MuonTrackSummaryHelperToolIntro Introduction - -This package provides an implementation of the Trk::ITrackSummaryHelperTool interface, which is used by the Trk::TrackSummaryTool -to handle Muon specific measurements on a track - -This tool also makes use of the Muon::MuonHolesOnTrackTool to count the missing measurements. - - -@see Trk::ITrackSummaryHelperTool -@see Trk::TrackSummaryTool -@see InDet::InDetTrackSummaryHelperTool -@see Muon::MuonHolesOnTrackTool - - -@ref used_MuonTrackSummaryHelperTool - -@ref requirements_MuonTrackSummaryHelperTool - -*/ - -/** -@page used_MuonTrackSummaryHelperTool Used Packages -@htmlinclude used_packages.html -*/ - -/** -@page requirements_MuonTrackSummaryHelperTool Requirements -@include requirements -*/ diff --git a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx index 44e446d4ac9b56a657ec98fccefb593d256b61e2..d8b4981c837112be2e7a09728ffbb7bcf9ea8787 100755 --- a/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonRecTools/MuonTrackSummaryHelperTool/src/MuonTrackSummaryHelperTool.cxx @@ -464,6 +464,10 @@ void Muon::MuonTrackSummaryHelperTool::addDetailedTrackSummary( const Trk::Track goodLayIds.insert(layId); } } + else if(m_idHelperTool->isCsc(id)){ + const Muon::CscClusterOnTrack* cscClus = dynamic_cast<const Muon::CscClusterOnTrack*>(rot); + if(cscClus->status()==0 || cscClus->status()==10) goodLayIds.insert(layId); + } }else{ const Muon::CompetingMuonClustersOnTrack* crot = dynamic_cast<const Muon::CompetingMuonClustersOnTrack*>(meas); if( crot ){ @@ -479,6 +483,10 @@ void Muon::MuonTrackSummaryHelperTool::addDetailedTrackSummary( const Trk::Track // get layer Identifier and insert it into set Identifier layId = m_idHelperTool->layerId( (*clit)->identify() ); layIds.insert(layId); + if(m_idHelperTool->isCsc(id)){ + const Muon::CscClusterOnTrack* cscClus = dynamic_cast<const Muon::CscClusterOnTrack*>(*clit); + if(cscClus->status()==0 || cscClus->status()==10) goodLayIds.insert(layId); + } } }else{ continue; diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonRefitTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonRefitTool.cxx index 7afa95b1bfed115ab568de523b19412a402e2de3..0b3499c812545b47bf018503883e8431479d0c06 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonRefitTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonRefitTool.cxx @@ -604,8 +604,10 @@ namespace Muon { if( !meas ) { continue; } + if(dynamic_cast<const Trk::PseudoMeasurementOnTrack*>(meas)) continue; //exclude pseudos // if( (*tsit)->type(Trk::TrackStateOnSurface::Outlier) ) continue; Identifier id = m_helper->getIdentifier(*meas); + //std::cout<<"measurement: "<<*meas<<std::endl; if( m_idHelper->isMdt(id) ) stationIds.insert( m_idHelper->chamberIndex(id) ); diff --git a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackExtrapolationTool.cxx b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackExtrapolationTool.cxx index 679b39c5be6ede97193fad767f602001ccc9bff8..7ddb1027daf70dde7b524e70fc81d5d316c2d10c 100644 --- a/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackExtrapolationTool.cxx +++ b/MuonSpectrometer/MuonReconstruction/MuonTrackMakers/MuonTrackMakerTools/MuonTrackFinderTools/src/MuonTrackExtrapolationTool.cxx @@ -559,7 +559,7 @@ namespace Muon { // collect the material going in opposite direction const std::vector<const Trk::TrackStateOnSurface*>* matvec = m_muonExtrapolator->extrapolateM(*perigee,meas->associatedSurface(), - Trk::oppositeMomentum,false,Trk::muon); + Trk::oppositeMomentum,false,particleHypo); if (matvec && !matvec->empty()){ ATH_MSG_VERBOSE(" got material layers " << matvec->size()); @@ -592,7 +592,7 @@ namespace Muon { ATH_MSG_VERBOSE(" trying to add material layers extrapolating to next measurement "); const std::vector<const Trk::TrackStateOnSurface*>* matvec = m_muonExtrapolator->extrapolateM(*perigee,meas->associatedSurface(), - Trk::alongMomentum,false,Trk::muon); + Trk::alongMomentum,false,particleHypo); if (matvec && !matvec->empty()){ ATH_MSG_VERBOSE(" got material layers " << matvec->size()); @@ -635,7 +635,7 @@ namespace Muon { // collect the material going in opposite direction const std::vector<const Trk::TrackStateOnSurface*>* matvec = m_muonExtrapolator->extrapolateM(*secondPerigee,meas->associatedSurface(), - Trk::oppositeMomentum,false,Trk::muon); + Trk::oppositeMomentum,false,particleHypo); if (matvec && !matvec->empty()){ ATH_MSG_VERBOSE(" got material layers " << matvec->size()); @@ -663,7 +663,7 @@ namespace Muon { if( meas ){ ATH_MSG_VERBOSE(" trying to add material layers extrapolating to next measurement "); const std::vector<const Trk::TrackStateOnSurface*>* matvec = m_muonExtrapolator->extrapolateM(*secondPerigee,meas->associatedSurface(), - Trk::alongMomentum,false,Trk::muon); + Trk::alongMomentum,false,particleHypo); if (matvec && !matvec->empty()){ ATH_MSG_VERBOSE(" got material layers " << matvec->size()); @@ -702,7 +702,7 @@ namespace Muon { // collect the material going in opposite direction const std::vector<const Trk::TrackStateOnSurface*>* matvec = m_muonExtrapolator->extrapolateM(*perigee,meas->associatedSurface(), - Trk::oppositeMomentum,false,Trk::muon); + Trk::oppositeMomentum,false,particleHypo); if (matvec && !matvec->empty()){ ATH_MSG_VERBOSE(" got material layers " << matvec->size()); @@ -726,7 +726,7 @@ namespace Muon { // collect the material going in opposite direction const std::vector<const Trk::TrackStateOnSurface*>* matvec = m_muonExtrapolator->extrapolateM(*secondPerigee,meas->associatedSurface(), - Trk::oppositeMomentum,false,Trk::muon); + Trk::oppositeMomentum,false,particleHypo); if (matvec && !matvec->empty()){ ATH_MSG_VERBOSE(" got material layers " << matvec->size()); diff --git a/MuonSpectrometer/MuonTruthAlgs/doc/mainpage.h b/MuonSpectrometer/MuonTruthAlgs/doc/mainpage.h deleted file mode 100644 index ce720374e806abe9679ce6ece92283376eca357a..0000000000000000000000000000000000000000 --- a/MuonSpectrometer/MuonTruthAlgs/doc/mainpage.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** -@mainpage MuonTruthAlgs -@author Edward.Moyse@cern.ch - -@section MuonTruthAlgsIntro Introduction - -This package provides algorithms which produces the 'truth' information for Muon EDM classes. For example, MuonDetailedTrackTruthMaker implements the common -tracking interface Trk::IDetailedTrackTruthBuilder. - -@section MuonTruthAlgsOverview Class Overview - The MuonTruthAlgs package contains of following classes: - - - MuonDetailedTrackTruthMaker : produces truth for tracks - - MuonPRD_MultiTruthMaker : produces truth for MuonPrepRawData - -@see Trk::IDetailedTrackTruthBuilder - -@ref used_MuonTruthAlgs - -@ref requirements_MuonTruthAlgs - -*/ - -/** -@page used_MuonTruthAlgs Used Packages -@htmlinclude used_packages.html -*/ - -/** -@page requirements_MuonTruthAlgs Requirements -@include requirements -*/ \ No newline at end of file diff --git a/MuonSpectrometer/MuonTruthAlgs/src/MuonTruthDecorationAlg.cxx b/MuonSpectrometer/MuonTruthAlgs/src/MuonTruthDecorationAlg.cxx index 7b6b69f9fa5933d9ef0362859cdb1a9acfd3edbc..af5864e4630ba2604f83ad24e2b770ab37e6eae8 100644 --- a/MuonSpectrometer/MuonTruthAlgs/src/MuonTruthDecorationAlg.cxx +++ b/MuonSpectrometer/MuonTruthAlgs/src/MuonTruthDecorationAlg.cxx @@ -367,9 +367,9 @@ namespace Muon { segment->setPosition(gpos.x(),gpos.y(),gpos.z()); segment->setDirection(gdir.x(),gdir.y(),gdir.z()); } - delete firstPos; - delete secondPos; } + if(firstPos) delete firstPos; + if(secondPos) delete secondPos; } } diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonChamberNameConverter.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonChamberNameConverter.cxx index 370fce50eff61925d6d61be116bb14e9b3af86f7..e9b7165df0c2b49c46cece15753d3447e6b1147e 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonChamberNameConverter.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonChamberNameConverter.cxx @@ -97,6 +97,7 @@ std::string convertChamberName(int ChamberName , int ChamberEta , int ChamberPhi case 51 : m_Name_string = "CSL"; limits.push_back(1); limits.push_back(0); limits.push_back(1); limits.push_back(8); limits.push_back(-100); limits.push_back(-100); limits.push_back(1); break; case 52 : m_Name_string = "BIM"; limits.push_back(5); limits.push_back(0); limits.push_back(100); limits.push_back(-100); limits.push_back(6); limits.push_back(8); limits.push_back(1); break; case 53 : m_Name_string = "BME"; limits.push_back(1); limits.push_back(0); limits.push_back(100); limits.push_back(-100); limits.push_back(7); limits.push_back(7); limits.push_back(-1); break; + case 54 : m_Name_string = "BMG"; limits.push_back(3); limits.push_back(0); limits.push_back(100); limits.push_back(-100); limits.push_back(6); limits.push_back(7); limits.push_back(-1); break; default : m_Name_string = "WrongName"; limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); limits.push_back(-100); } } else if (m_Type=="RPC") { @@ -124,7 +125,10 @@ std::string convertChamberName(int ChamberName , int ChamberEta , int ChamberPhi } if (m_Name_int==10){//exception of the BOG,BOF alternating eta m_Eta_int=2*m_Eta_int; - } + } + if (m_Name_int==54){//exception of the BMG + m_Eta_int=2*m_Eta_int; + } std::stringstream eta_inttostring; std::string eta_str; eta_inttostring << m_Eta_int; @@ -139,7 +143,10 @@ std::string convertChamberName(int ChamberName , int ChamberEta , int ChamberPhi } if (m_Name_int==10){//exception of the BOG,BOF alternating eta m_Eta_int=2*m_Eta_int; - } + } + if (m_Name_int==54){//exception of the BMG alternating eta + m_Eta_int=2*m_Eta_int; + } std::stringstream eta_inttostring; std::string eta_str; eta_inttostring << abs(m_Eta_int); diff --git a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonStrToIntName.cxx b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonStrToIntName.cxx index 8c744054b39d3231fcabf990ee219272e4ffdf72..ea93f3f4076ee4f6d510b1bd39d678fb195746f2 100755 --- a/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonStrToIntName.cxx +++ b/MuonSpectrometer/MuonValidation/MuonDQA/MuonDQAUtils/src/MuonStrToIntName.cxx @@ -80,6 +80,7 @@ int convertStrToIntName(std::string ChamberName, std::string ChamberType) { else if (m_Name_str=="CSS") m_Name_int = 50; else if (m_Name_str=="CSL") m_Name_int = 51; else if (m_Name_str=="BIM") m_Name_int = 52; + else if (m_Name_str=="BMG") m_Name_int = 54; else m_Name_int = -1; } else if (m_Type=="RPC") { diff --git a/PhysicsAnalysis/AnalysisCommon/ParticleBuilderOptions/python/AODFlags.py b/PhysicsAnalysis/AnalysisCommon/ParticleBuilderOptions/python/AODFlags.py index e5e3975d8f8ce888a54d61b4eded6730544d9c28..3428bf22af13302a2a9607907f8204b90a46fb10 100755 --- a/PhysicsAnalysis/AnalysisCommon/ParticleBuilderOptions/python/AODFlags.py +++ b/PhysicsAnalysis/AnalysisCommon/ParticleBuilderOptions/python/AODFlags.py @@ -62,6 +62,13 @@ class ThinNegativeEnergyCaloClusters(JobProperty): statusOn=True allowedTypes=['bool'] StoredValue=False + +class ThinNegativeEnergyNeutralPFOs(JobProperty): + """ If True, add ThinNegativeEnergyNeutralPFOs + """ + statusOn=True + allowedTypes=['bool'] + StoredValue=False class Muon(JobProperty): """ If True, add Muon @@ -275,6 +282,7 @@ _list_AOD=[ \ Photon,Electron,egammaTrackSlimmer, \ ThinGeantTruth, \ ThinNegativeEnergyCaloClusters, \ + ThinNegativeEnergyNeutralPFOs, \ Muon,MuonTrackSlimmer, \ Tau,TauTrackSlimmer, \ TrackParticleSlimmer, TrackParticleLastHitAndPerigeeSlimmer, \ diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/CMakeLists.txt b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/CMakeLists.txt index aeadaebf16174155b827fa16ec6abbd97a04f155..e5b650f3bc50da04f2634c3ec5cf5ef8829743d5 100644 --- a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/CMakeLists.txt +++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/CMakeLists.txt @@ -1,4 +1,4 @@ -# $Id: CMakeLists.txt 791506 2017-01-09 00:33:35Z jcatmore $ +# $Id: CMakeLists.txt 795961 2017-02-07 12:53:47Z jcatmore $ ################################################################################ # Package: ThinningUtils ################################################################################ @@ -34,14 +34,15 @@ atlas_depends_on_subdirs( GaudiKernel PhysicsAnalysis/CommonTools/ExpressionEvaluation PhysicsAnalysis/DerivationFramework/DerivationFrameworkInterfaces + Tracking/TrkTools/TrkToolInterfaces ${extra_deps} ) # Component(s) in the package: -atlas_add_component( ThinningUtils +atlas_add_component(ThinningUtils src/*.h src/*.cxx src/components/*.cxx LINK_LIBRARIES AthLinks AthenaBaseComps AthenaKernel EventInfo xAODBase xAODCaloEvent xAODEgamma xAODJet xAODMuon xAODParticleEvent xAODTau - xAODTracking xAODTruth GaudiKernel ExpressionEvaluationLib ${extra_libs} ) + xAODTracking xAODTruth GaudiKernel ExpressionEvaluationLib TrkToolInterfaces ${extra_libs}) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/python/ThinNegativeEnergyNeutralPFOs.py b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/python/ThinNegativeEnergyNeutralPFOs.py new file mode 100644 index 0000000000000000000000000000000000000000..e9924adb51723351a51afc3d7d30535bea146dc3 --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/python/ThinNegativeEnergyNeutralPFOs.py @@ -0,0 +1,26 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from RecExConfig.Configured import Configured +from AthenaCommon.Logging import logging + +class ThinNegativeEnergyNeutralPFOs(Configured): + + def configure(self): + mlog = logging.getLogger ('ThinNegativeEnergyNeutralPFOs.py::configure:') + mlog.info('entering') + try: + from ThinningUtils.ThinningUtilsConf import ThinNegativeEnergyNeutralPFOsAlg + theNegativeEnergyNeutralPFOsThinner = ThinNegativeEnergyNeutralPFOsAlg( + "ThinNegativeEnergyNeutralPFOsAlg", + ThinNegativeEnergyNeutralPFOs = True + ) + print theNegativeEnergyNeutralPFOsThinner + except Exception: + mlog.error("could not get handle to ThinNegativeEnergyNeutralPFOsAlg") + print traceback.format_exc() + return False + mlog.info("now adding to topSequence") + from AthenaCommon.AlgSequence import AlgSequence + topSequence = AlgSequence() + topSequence += theNegativeEnergyNeutralPFOsThinner + return True diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/python/ThinTrkTrack.py b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/python/ThinTrkTrack.py new file mode 100644 index 0000000000000000000000000000000000000000..4c2ce6692bd0648cb1276b54184bdf642448c2cb --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/python/ThinTrkTrack.py @@ -0,0 +1,41 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from RecExConfig.Configured import Configured +from AthenaCommon.Logging import logging +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags + +class ThinTrkTrack(Configured): + def configure(self): + + mlog = logging.getLogger ('TrkTrackPostExecStream.py::configure:') + mlog.info('entering') + + try: + from ThinningUtils.ThinningUtilsConf import ThinTrkTrackAlg + theTrkTrackThinner = ThinTrkTrackAlg( + "ThinTrkTrackAlg", + doElectrons=True, + doMuons=True, + MuonsKey="Muons", + ElectronsKey="Electrons", + CombinedMuonsTrackKey="CombinedMuonTracks", + GSFTrackKey="GSFTracks") + + from AthenaCommon.Constants import VERBOSE, DEBUG, INFO, ERROR + theTrkTrackThinner.OutputLevel=DEBUG + + print theTrkTrackThinner + + except Exception: + import traceback + mlog.error("could not get handle to ThinTrkTrackAlg") + print traceback.format_exc() + return False + + mlog.info("now adding to topSequence") + from AthenaCommon.AlgSequence import AlgSequence + topSequence = AlgSequence() + topSequence += theTrkTrackThinner + mlog.info("Done adding to topSequence") + + return True diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/python/TrkTrackPostExecStream.py b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/python/TrkTrackPostExecStream.py new file mode 100644 index 0000000000000000000000000000000000000000..2e6f2d911e1c40fbcea889cd7cc5b08cd429b774 --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/python/TrkTrackPostExecStream.py @@ -0,0 +1,24 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +from RecExConfig.Configured import Configured +from AthenaCommon.Logging import logging +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags + +class TrkTrackPostExecStream(Configured): + + def configure(self): + + mlog = logging.getLogger ('TrkTrackPostExecStream.py::configure:') + mlog.info('entering') + # + mlog.info("Now adding to AOD Stream") + #Add to stream AOD + streamName = "StreamAOD" + from OutputStreamAthenaPool.MultipleStreamManager import MSMgr + stream = MSMgr.GetStream(streamName) + stream.AddItem("TrackCollection#GSFTracks") + stream.AddItem("TrackCollection#CombinedMuonTracks") + mlog.info("Done adding to AOD Stream") + mlog.info(stream.Stream.ItemList) + + return True diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.cxx b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.cxx index 51cb749f63dc7b904efb191b8e8f0bc22bcc71fa..e10b65d89b9cab07fca53f538e9cec9ccd87faea 100644 --- a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.cxx +++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.cxx @@ -47,6 +47,7 @@ ThinGeantTruthAlg::ThinGeantTruthAlg( const std::string& name, m_thinningSvc( "ThinningSvc/ThinningSvc", name ), m_doThinning(true), m_geantOffset(200000), +m_longlived{310,3122,3222,3112,3322,3312}, m_truthParticlesKey("TruthParticles"), m_truthVerticesKey("TruthVertices"), m_muonsKey("Muons"), @@ -58,7 +59,7 @@ m_nVerticesProcessed(0), m_nParticlesThinned(0), m_nVerticesThinned(0) { - + declareProperty("ThinningSvc", m_thinningSvc, "The ThinningSvc instance for a particular output stream" ); @@ -68,6 +69,9 @@ m_nVerticesThinned(0) declareProperty("GeantBarcodeOffset", m_geantOffset, "Barcode offset for Geant particles"); + declareProperty("LongLivedParticleList", m_longlived, + "List of long lifetime particles which are likely to be decayed by Geant but whose children must be kept"); + declareProperty("TruthParticlesKey", m_truthParticlesKey, "StoreGate key for TruthParticle container"); @@ -106,7 +110,6 @@ StatusCode ThinGeantTruthAlg::initialize() ATH_MSG_INFO("Geant truth will be thinned"); } - // Initialize the counters to zero m_nEventsProcessed = 0; m_nParticlesProcessed = 0; @@ -140,7 +143,7 @@ StatusCode ThinGeantTruthAlg::execute() if (!m_doThinning) { return StatusCode::SUCCESS; } - + // Retrieve truth and vertex containers const xAOD::TruthParticleContainer* truthParticles(0); const xAOD::TruthVertexContainer* truthVertices(0); @@ -225,6 +228,19 @@ StatusCode ThinGeantTruthAlg::execute() descendants(particle,particleMask,encounteredBarcodes); encounteredBarcodes.clear(); } + // Retain children of longer-lived generator particles + if (particle->status()==1) { + int pdgId = abs(particle->pdgId()); + if ( std::find(m_longlived.begin(), m_longlived.end(), pdgId) != m_longlived.end() ) { + const xAOD::TruthVertex* decayVtx(0); + if (particle->hasDecayVtx()) {decayVtx = particle->decayVtx();} + int nChildren = 0; + if (decayVtx) nChildren = decayVtx->nOutgoingParticles(); + for (int i=0; i<nChildren; ++i) { + particleMask[decayVtx->outgoingParticle(i)->index()] = true; + } + } + } // Retain particles and their descendants/ancestors associated with the reconstructed objects if ( std::find(recoParticleTruthIndices.begin(), recoParticleTruthIndices.end(), i) != recoParticleTruthIndices.end() ) { if (abs(particle->barcode()) > m_geantOffset) { // only need to do this for Geant particles since non-Geant are kept anyway diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.h b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.h index 5c4d6d582b700596117d3ef3650a23a51b286e16..ea11eafaea4abafd47ba2c067d6ad86a47fef760 100644 --- a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.h +++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinGeantTruthAlg.h @@ -54,6 +54,7 @@ public: private: + /// Pointer to IThinningSvc ServiceHandle<IThinningSvc> m_thinningSvc; @@ -63,6 +64,9 @@ private: /// Geant barcode int m_geantOffset; + /// Geant-decayed longer lived particles + std::vector<int> m_longlived; + /// Names of the containers to thin std::string m_truthParticlesKey; std::string m_truthVerticesKey; diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinNegativeEnergyNeutralPFOsAlg.cxx b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinNegativeEnergyNeutralPFOsAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..c09f4f53973165db18b9f252f70d43294c975af4 --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinNegativeEnergyNeutralPFOsAlg.cxx @@ -0,0 +1,140 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// ThinNegativeEnergyNeutralPFOsAlg.cxx +// Author: Chris Young <christopher.young@cern.ch> +// based on similar code by Karsten Koeneke <karsten.koeneke@cern.ch> +// and James Catmore <James.Catmore@cern.ch> +// Uses thinning service to remove Neutral PFOs with negative energy +// Intended for use in ESD->AOD in reconstruction - use other tools +// for analysis (Expression evaluation is not used here) +/////////////////////////////////////////////////////////////////// + +// EventUtils includes +#include "ThinNegativeEnergyNeutralPFOsAlg.h" +#include "xAODPFlow/PFOContainer.h" + +// STL includes +#include <algorithm> + +// FrameWork includes +#include "GaudiKernel/Property.h" +#include "GaudiKernel/IJobOptionsSvc.h" + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// +ThinNegativeEnergyNeutralPFOsAlg::ThinNegativeEnergyNeutralPFOsAlg( const std::string& name, + ISvcLocator* pSvcLocator ) : +::AthAlgorithm( name, pSvcLocator ), +m_thinningSvc( "ThinningSvc/ThinningSvc", name ), +m_doThinning(true), +m_neutralPFOsKey("JetETMissNeutralParticleFlowObjects"), +m_nEventsProcessed(0), +m_nNeutralPFOsProcessed(0), +m_nNeutralPFOsThinned(0) +{ + + declareProperty("ThinningSvc", m_thinningSvc, + "The ThinningSvc instance for a particular output stream" ); + + declareProperty("ThinNegativeEnergyNeutralPFOs", m_doThinning, + "Should the thinning of negative energy neutral PFOs be run?"); + + declareProperty("NeutralPFOsKey", m_neutralPFOsKey, + "StoreGate key for the PFOContainer to be thinned"); + +} + +// Destructor +/////////////// +ThinNegativeEnergyNeutralPFOsAlg::~ThinNegativeEnergyNeutralPFOsAlg() +{} + +// Athena Algorithm's Hooks +//////////////////////////// +StatusCode ThinNegativeEnergyNeutralPFOsAlg::initialize() +{ + ATH_MSG_DEBUG ("Initializing " << name() << "..."); + + // Print out the used configuration + ATH_MSG_DEBUG ( " using = " << m_thinningSvc ); + + // Is truth thinning required? + if (!m_doThinning) { + ATH_MSG_INFO("Negative energy NeutralPFO thinning not required"); + } else { + ATH_MSG_INFO("Negative energy NeutralPFOs will be thinned"); + } + + + // Initialize the counters to zero + m_nEventsProcessed = 0; + m_nNeutralPFOsProcessed = 0; + m_nNeutralPFOsThinned = 0; + + ATH_MSG_DEBUG ( "==> done with initialize " << name() << "..." ); + + return StatusCode::SUCCESS; +} + + + +StatusCode ThinNegativeEnergyNeutralPFOsAlg::finalize() +{ + ATH_MSG_DEBUG ("Finalizing " << name() << "..."); + ATH_MSG_INFO("Processed " << m_nEventsProcessed << " events containing " << m_nNeutralPFOsProcessed << " NeutralPFOs"); + ATH_MSG_INFO("Removed " << m_nNeutralPFOsThinned << " negative energy NeutralPFOs "); + return StatusCode::SUCCESS; +} + + + +StatusCode ThinNegativeEnergyNeutralPFOsAlg::execute() +{ + // Increase the event counter + ++m_nEventsProcessed; + + // Is truth thinning required? + if (!m_doThinning) { + return StatusCode::SUCCESS; + } + + // Retrieve the container + const xAOD::PFOContainer* neutralPFOs(0); + if (evtStore()->contains<xAOD::PFOContainer>(m_neutralPFOsKey)) { + CHECK( evtStore()->retrieve( neutralPFOs , m_neutralPFOsKey ) ); + } else { + ATH_MSG_FATAL("No PFOContainer with key "+m_neutralPFOsKey+" found."); + return StatusCode::FAILURE; + } + + // Set up masks + std::vector<bool> mask; + int nNeutralPFOs = neutralPFOs->size(); + m_nNeutralPFOsProcessed += nNeutralPFOs; + mask.assign(nNeutralPFOs,false); + + // Loop over NeutralPFOs and update mask + for (int i=0; i<nNeutralPFOs; ++i) { + const xAOD::PFO* neutralPFO = (*neutralPFOs)[i]; + // Retain postive energy neutral PFOs + if (neutralPFO->ptEM()>0.0) {mask[i] = true;} + else {++m_nNeutralPFOsThinned;} + } + + // Apply masks to thinning service + if (m_thinningSvc->filter(*neutralPFOs, mask, IThinningSvc::Operator::Or).isFailure()) { + ATH_MSG_ERROR("Application of thinning service failed for NeutralPFOs! "); + return StatusCode::FAILURE; + } + + return StatusCode::SUCCESS; +} + diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinNegativeEnergyNeutralPFOsAlg.h b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinNegativeEnergyNeutralPFOsAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..eec6d157231904a44c866e5650cdd712405b7d5a --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinNegativeEnergyNeutralPFOsAlg.h @@ -0,0 +1,63 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + + +#ifndef THINNINGUTILS_ThinNegativeEnergyNeutralPFOsAlg_H +#define THINNINGUTILS_ThinNegativeEnergyNeutralPFOsAlg_H 1 + +/** + @class ThinNegativeEnergyNeutralPFOsAlg +*/ + + +// STL includes +#include <string> + +// FrameWork includes +#include "GaudiKernel/ToolHandle.h" +#include "GaudiKernel/ServiceHandle.h" +#include "AthenaBaseComps/AthAlgorithm.h" +#include "AthenaKernel/IThinningSvc.h" + +class ThinNegativeEnergyNeutralPFOsAlg +: public ::AthAlgorithm +{ +public: + + /// Constructor with parameters: + ThinNegativeEnergyNeutralPFOsAlg( const std::string& name, ISvcLocator* pSvcLocator ); + + /// Destructor: + virtual ~ThinNegativeEnergyNeutralPFOsAlg(); + + /// Athena algorithm's initalize hook + virtual StatusCode initialize(); + + /// Athena algorithm's execute hook + virtual StatusCode execute(); + + /// Athena algorithm's finalize hook + virtual StatusCode finalize(); + +private: + /// Pointer to IThinningSvc + ServiceHandle<IThinningSvc> m_thinningSvc; + + /// Should the thinning run? + bool m_doThinning; + + /// Names of the containers to thin + std::string m_neutralPFOsKey; + + /// Counters + unsigned long m_nEventsProcessed; + unsigned long m_nNeutralPFOsProcessed; + unsigned long m_nNeutralPFOsThinned; + +}; + + +#endif //> !THINNINGUTILS_ThinNegativeEnergyNeutralPFOsAlg_H diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinTrkTrackAlg.cxx b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinTrkTrackAlg.cxx new file mode 100644 index 0000000000000000000000000000000000000000..bb94a38f48407e102cfb02df63cd36804b68db29 --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinTrkTrackAlg.cxx @@ -0,0 +1,210 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// ThinTrkTrackAlg.cxx +// Author: Christos +// Lets see if we can write Trk::Tracks in xAOD +/////////////////////////////////////////////////////////////////// + +#include "ThinTrkTrackAlg.h" +#include "xAODMuon/MuonContainer.h" +#include "xAODEgamma/ElectronContainer.h" +#include "xAODEgamma/PhotonContainer.h" +#include "xAODTracking/TrackParticleContainer.h" +#include "xAODEgamma/ElectronxAODHelpers.h" +#include "TrkTrack/TrackCollection.h" +#include "AthenaKernel/IThinningSvc.h" + +// STL includes +#include <algorithm> + +/////////////////////////////////////////////////////////////////// +// Public methods: +/////////////////////////////////////////////////////////////////// + +// Constructors +//////////////// +ThinTrkTrackAlg::ThinTrkTrackAlg( const std::string& name, + ISvcLocator* pSvcLocator ) : + ::AthAlgorithm( name, pSvcLocator ), + m_thinningSvc( "ThinningSvc/ThinningSvc", name ), + m_doElectrons(true), + m_doMuons(true), + m_muonsKey("Muons"), + m_electronsKey("Electrons"), + m_CombinedMuonsTracksKey("CombinedMuonTracks"), + m_GSFTracksKey("GSFTracks") +{ + + declareProperty("ThinningSvc", m_thinningSvc, + "The ThinningSvc instance for a particular output stream" ); + + declareProperty("doElectrons", m_doElectrons, + "Flag to Thin the Electron GSF tracks"); + + declareProperty("doMuons", m_doMuons, + "Flag to Thin the Muon Combinedtracks"); + + declareProperty("MuonsKey", m_muonsKey, + "StoreGate key for muons container"); + + declareProperty("ElectronsKey",m_electronsKey , + "StoreGate key for electrons container"); + + declareProperty("CombinedMuonsTrackKey", m_CombinedMuonsTracksKey, + "StoreGate key for combined muons Trk::Track container"); + + declareProperty("GSFTrackKey", m_GSFTracksKey, + "StoreGate key for GSF Trk::Track container"); + + +} + +// Destructor +/////////////// +ThinTrkTrackAlg::~ThinTrkTrackAlg() +{} + +// Athena Algorithm's Hooks +//////////////////////////// +StatusCode ThinTrkTrackAlg::initialize(){ + ATH_MSG_DEBUG ("Initializing " << name() << "..."); + + if ( !m_thinningSvc.retrieve().isSuccess() ) { + ATH_MSG_ERROR("Unable to retrieve pointer to IThinningSvc"); + return StatusCode::FAILURE; + } + // Print out the used configuration + ATH_MSG_DEBUG ( " using = " << m_thinningSvc ); + + // Is truth thinning required? + if (m_doElectrons) { + ATH_MSG_INFO("Will thin " << m_electronsKey << " Trk::Tracks with key " << m_GSFTracksKey); + } + if (m_doMuons) { + ATH_MSG_INFO("Will thin " << m_muonsKey << " Trk::Tracks with key " << m_CombinedMuonsTracksKey); + } + ATH_MSG_DEBUG ( "==> done with initialize " << name() << "..." ); + return StatusCode::SUCCESS; +} + + + +StatusCode ThinTrkTrackAlg::finalize(){ + ATH_MSG_DEBUG ("Finalizing " << name() << "..."); + return StatusCode::SUCCESS; +} + +StatusCode ThinTrkTrackAlg::execute(){ + + if (m_doElectrons) { + CHECK(doElectrons()); + } + if (m_doMuons) { + CHECK(doMuons()); + } + return StatusCode::SUCCESS; +} + +StatusCode ThinTrkTrackAlg::doElectrons(){ + + //Prepare for the Thinning of Trk::Tracks + IThinningSvc::VecFilter_t keptTracks; + const TrackCollection* trackPC(0); + if(evtStore()->contains<TrackCollection >(m_GSFTracksKey)){ + ATH_CHECK(evtStore()->retrieve(trackPC,m_GSFTracksKey)); + } + else{ + ATH_MSG_WARNING ("No " << m_GSFTracksKey << " found , disabling electrons"); + m_doElectrons=false; + return StatusCode::SUCCESS; + } + ATH_MSG_DEBUG("Number of " << m_GSFTracksKey << " " << trackPC->size()); + if( keptTracks.size() < trackPC->size() ) { + keptTracks.resize( trackPC->size(), false ); + } + + //Get the electrons + const xAOD::ElectronContainer* electrons = + evtStore()->retrieve< const xAOD::ElectronContainer >(m_electronsKey); + if( ! electrons ) { + ATH_MSG_ERROR( "Couldn't retrieve electron container with key: "<< m_electronsKey); + return StatusCode::FAILURE; + } + + //Loop over electrons + size_t kept(0); + for(auto el: *electrons) { + const xAOD::TrackParticle* tp=el->trackParticle(); + if ( ! tp || !tp->trackLink().isValid() ){ + continue; + } + size_t index= tp->trackLink().index(); + keptTracks[index]=true; + ++kept; + } + + ATH_MSG_DEBUG("keep " << kept << " out of " <<keptTracks.size()); + ATH_MSG_DEBUG("Do the Thinning"); + CHECK( m_thinningSvc->filter( *trackPC, keptTracks,IThinningSvc::Operator::Or) ); + return StatusCode::SUCCESS; +} + + +StatusCode ThinTrkTrackAlg::doMuons(){ + + //Prepare for the Thinning of Trk::Tracks + IThinningSvc::VecFilter_t keptTracks; + const TrackCollection* trackPC(0); + + if(evtStore()->contains<TrackCollection >(m_CombinedMuonsTracksKey)){ + ATH_CHECK(evtStore()->retrieve(trackPC,m_CombinedMuonsTracksKey)); + } + else{ + ATH_MSG_WARNING ("No " << m_CombinedMuonsTracksKey << " found, disabling Muons"); + m_doMuons=false; + return StatusCode::SUCCESS; + } + + ATH_MSG_DEBUG("Number of " << m_CombinedMuonsTracksKey << " " << trackPC->size()); + if( keptTracks.size() < trackPC->size() ) { + keptTracks.resize( trackPC->size(), false ); + } + + //Get the muons + const xAOD::MuonContainer* muons = + evtStore()->retrieve< const xAOD::MuonContainer >(m_muonsKey); + + if( ! muons ) { + ATH_MSG_ERROR( "Couldn't retrieve muon container with key: "<< m_muonsKey); + return StatusCode::FAILURE; + } + + //Loop over muons + size_t kept(0); + for(auto mu: *muons) { + static SG::AuxElement::Accessor<ElementLink< xAOD::TrackParticleContainer>> acc( "combinedTrackParticleLink" ); + if( ! acc.isAvailable(*mu) ) { + continue; + } + const ElementLink< xAOD::TrackParticleContainer > link = acc(*mu); + if(! link.isValid() ) { + continue; + } + const xAOD::TrackParticle* tp=(*link); + if ( ! tp || !tp->trackLink().isValid() ){ + continue; + } + size_t index= tp->trackLink().index(); + keptTracks[index]=true; + ++kept; + } + + ATH_MSG_DEBUG("keep " << kept << " out of " <<keptTracks.size()); + ATH_MSG_DEBUG("Do the Thinning"); + CHECK( m_thinningSvc->filter( *trackPC, keptTracks,IThinningSvc::Operator::Or) ); + return StatusCode::SUCCESS; +} diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinTrkTrackAlg.h b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinTrkTrackAlg.h new file mode 100644 index 0000000000000000000000000000000000000000..cafd0f98c213a2a95df56603389180924f2936a2 --- /dev/null +++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/ThinTrkTrackAlg.h @@ -0,0 +1,63 @@ +///////////////////////// -*- C++ -*- ///////////////////////////// + +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef THINNINGUTILS_ThinTrkTrackAlg_H +#define THINNINGUTILS_ThinTrkTrackAlg_H +/** + @class ThinTrkTrackAlg +*/ +// STL includes +#include <string> + + +// FrameWork includes +#include "GaudiKernel/ToolHandle.h" +#include "GaudiKernel/ServiceHandle.h" +#include "AthenaBaseComps/AthAlgorithm.h" + +class IThinningSvc; + + +class ThinTrkTrackAlg : public ::AthAlgorithm { +public: + + /// Constructor with parameters: + ThinTrkTrackAlg( const std::string& name, ISvcLocator* pSvcLocator ); + + /// Destructor: + virtual ~ThinTrkTrackAlg(); + + /// Athena algorithm's initalize hook + virtual StatusCode initialize() final; + + /// Athena algorithm's execute hook + virtual StatusCode execute() final; + + /// Athena algorithm's finalize hook + virtual StatusCode finalize() final; + + private: + /// Inline method + StatusCode doElectrons() ; + StatusCode doMuons() ; + + /// Pointer to IThinningSvc + ServiceHandle<IThinningSvc> m_thinningSvc; + + /// Should the thinning run? + bool m_doElectrons; + bool m_doMuons; + ///Names of the containers of Objects of interest Electron/Muon + std::string m_muonsKey; + std::string m_electronsKey; + /// Names of the containers to thin + std::string m_CombinedMuonsTracksKey; + std::string m_GSFTracksKey; + +}; + + +#endif diff --git a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/components/ThinningUtils_entries.cxx b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/components/ThinningUtils_entries.cxx index 045ccb17104f2b42a666e9f7cc9e09b64fd78194..92f409149e3b7905abf86514129db9a8cf84a193 100644 --- a/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/components/ThinningUtils_entries.cxx +++ b/PhysicsAnalysis/AnalysisCommon/ThinningUtils/src/components/ThinningUtils_entries.cxx @@ -6,6 +6,7 @@ #include "../ThinCaloCellsAlg.h" #include "../ThinGeantTruthAlg.h" #include "../ThinNegativeEnergyCaloClustersAlg.h" +#include "../ThinNegativeEnergyNeutralPFOsAlg.h" // AthAnalysisBase doesn't know about calo cells (geometry would be needed) #ifndef XAOD_ANALYSIS #include "../ThinCaloCellsTool.h" @@ -17,6 +18,7 @@ DECLARE_ALGORITHM_FACTORY( ThinGeantTruthAlg ) DECLARE_ALGORITHM_FACTORY( ThinNegativeEnergyCaloClustersAlg ) +DECLARE_ALGORITHM_FACTORY( ThinNegativeEnergyNeutralPFOsAlg ) DECLARE_ALGORITHM_FACTORY( ReducePileUpEventInfoAlg ) DECLARE_ALGORITHM_FACTORY( ThinIParticlesAlg ) DECLARE_TOOL_FACTORY( ThinIParticlesTool ) @@ -34,6 +36,7 @@ DECLARE_FACTORY_ENTRIES( ThinningUtils ) { DECLARE_ALGORITHM( ThinGeantTruthAlg ); DECLARE_ALGORITHM( ThinNegativeEnergyCaloClustersAlg); + DECLARE_ALGORITHM( ThinNegativeEnergyNeutralPFOsAlg); DECLARE_ALGORITHM( ReducePileUpEventInfoAlg ); DECLARE_ALGORITHM( ThinIParticlesAlg ); DECLARE_TOOL( ThinIParticlesTool ); diff --git a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/CMakeLists.txt b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/CMakeLists.txt index 830b4828d6096436ee5ef5107ba16f825b7c98e2..ae5dee08d1f0fba24356ee4810fab4ef3cfe62ca 100644 --- a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/CMakeLists.txt +++ b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/CMakeLists.txt @@ -12,15 +12,21 @@ atlas_depends_on_subdirs( PUBLIC Event/xAOD/xAODJet GaudiKernel PhysicsAnalysis/EventTag/TagEvent + PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration/xAODBTaggingEfficiency PRIVATE Control/AthContainers Control/CxxUtils Event/xAOD/xAODCore Event/xAOD/xAODMissingET Event/xAOD/xAODParticleEvent + Event/xAOD/xAODEgamma + Event/xAOD/xAODMuon + Event/xAOD/xAODTau PhysicsAnalysis/AnalysisCommon/AnalysisUtils PhysicsAnalysis/JetMissingEtID/JetSelectorTools + Reconstruction/MET/METInterface Reconstruction/Jet/JetCalibTools + Reconstruction/Jet/JetInterface Reconstruction/Jet/JetUtils ) # External dependencies: diff --git a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/JetMissingEtTagTools/JetMissingEtTagTool.h b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/JetMissingEtTagTools/JetMissingEtTagTool.h index 5f5fa69be8cbf9939cf426ea212702ab884f91da..95df2a5beda6a9ddd3c1f8dc915cefa7a6b74c41 100755 --- a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/JetMissingEtTagTools/JetMissingEtTagTool.h +++ b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/JetMissingEtTagTools/JetMissingEtTagTool.h @@ -17,12 +17,14 @@ Purpose : build the JetMissingEt Tag objects - ParticleJetTagCollection.h and Mi #include "TagEvent/TagFragmentCollection.h" #include "AthenaPoolUtilities/AthenaAttributeSpecification.h" #include "xAODJet/JetContainer.h" +#include "xAODBTaggingEfficiency/IBTaggingSelectionTool.h" #include <map> // forward declaration class IJetCalibrationTool; - +class IJetUpdateJvt; +class IMETMaker; class JetMetTagTool : public AthAlgTool { @@ -53,14 +55,27 @@ private: /**Calibrate and record a shallow copy of a given jet container */ const xAOD::JetContainer* calibrateAndRecordShallowCopyJetCollection(const xAOD::JetContainer * jetContainer); + /**recompute MET*/ + StatusCode recomputeMissingEt(); + + /** Jet calibration tool handle */ ToolHandle<IJetCalibrationTool> m_jetCalibrationTool; - + ToolHandle<IJetUpdateJvt> m_jetJVTUpdateTool; + ToolHandle<IMETMaker> m_metmaker; + ToolHandle<IBTaggingSelectionTool> m_FixedCutBEff_60,m_FixedCutBEff_70,m_FixedCutBEff_85, + m_FlatBEff_60,m_FlatBEff_70,m_FlatBEff_77; /** Properties */ std::string m_containerName; std::string m_jetCalibcontainerName; std::string m_jetCalibcontainerName_skim; + std::string m_ElectronsContainer_skim; + std::string m_PhotonsContainer_skim; + std::string m_TausContainer_skim; + std::string m_MuonsContainer_skim; + std::string m_METCoreName; + std::string m_METMapName; std::string m_metContainerName; std::string m_metRefFinalName; std::string m_metRefJetName; @@ -76,6 +91,7 @@ private: double m_jetPtCut_skim; bool m_useEMScale; //Emergency fix for HI (W.L, 22.11.2010) bool m_isSimulation; + bool m_doJVT; /** the attribute names */ std::vector<std::string> m_ptStr; diff --git a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/cmt/requirements b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/cmt/requirements index 332d4294c348b295a5fa17c5ce7c26cfef6e9e5e..5f2cd3879c078c4338101a5b06151633b4dd975f 100755 --- a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/cmt/requirements +++ b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/cmt/requirements @@ -9,11 +9,17 @@ use AtlasCLHEP AtlasCLHEP-* External use JetUtils JetUtils-* Reconstruction/Jet use AnalysisUtils AnalysisUtils-* PhysicsAnalysis/AnalysisCommon use xAODCore xAODCore-* Event/xAOD -use xAODMissingET xAODMissingET-* Event/xAOD use xAODParticleEvent xAODParticleEvent-* Event/xAOD -use JetSelectorTools JetSelectorTools-* PhysicsAnalysis/JetMissingEtID +use JetSelectorTools JetSelectorTools-* PhysicsAnalysis/JetMissingEtID use JetCalibTools JetCalibTools-* Reconstruction/Jet +use JetInterface JetInterface-* Reconstruction/Jet use AthContainers AthContainers-* Control +use xAODEgamma xAODEgamma-* Event/xAOD +use xAODMuon xAODMuon-* Event/xAOD +use xAODTau xAODTau-* Event/xAOD +use xAODMissingET xAODMissingET-* Event/xAOD +use METInterface METInterface-* Reconstruction/MET + public use xAODJet xAODJet-* Event/xAOD use AtlasPolicy AtlasPolicy-* @@ -21,6 +27,7 @@ use AthenaPoolUtilities AthenaPoolUtilities-* Database/AthenaPOOL use GaudiInterface GaudiInterface-* External use AthenaBaseComps AthenaBaseComps-* Control use TagEvent TagEvent-* PhysicsAnalysis/EventTag +use xAODBTaggingEfficiency xAODBTaggingEfficiency-* PhysicsAnalysis/JetTagging/JetTagPerformanceCalibration apply_pattern dual_use_library files="*.cxx" diff --git a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/doc/mainpage.h b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/doc/mainpage.h deleted file mode 100755 index 4e7fd33aa46a5fc518fc4bac8d0f4387c939d595..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/doc/mainpage.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** -\mainpage JetMissingEtTagTools - -\section introductionJetMissingEtTagTools Introduction -This package contains the alg tools for building the tag fragments for ParticleJet, MissingET and their -identification process. - -\section packagecontentJetMissingEtTagTools Package Contents -JetMissingEtTagTools contains the following tools: - -- JetMissingEtIdentificationTagTool ... tool for ParticleJet and MissingET identification TAG fragment -- JetMissingEtTagTool ... tool for ParticleJet and MissingET TAG fragments - -- for questions and comments: ketevi@bnl.gov - -\section used_packagesJetMissingEtTagTools Used packages -@htmlinclude used_packages.html - -\section requirementsJetMissingEtTagTools Requirements -@include requirements - -*/ - - diff --git a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/share/JetTagTool_jobOptions.py b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/share/JetTagTool_jobOptions.py index 3fe0a55b9c8865cdc02ce6047cdb5b6a0f58ab34..f6be6135aded0457ff59a374fe71d69ff507bcc7 100755 --- a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/share/JetTagTool_jobOptions.py +++ b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/share/JetTagTool_jobOptions.py @@ -1,8 +1,5 @@ include.block ("JetMissingEtTagTools/JetTagTool_jobOptions.py") -########### Jet tag options ################ -from RecExConfig.RecFlags import rec - #==================================================================== # Check if we have Monte Carlo or real data, based on the inputFileSummary #==================================================================== @@ -14,109 +11,143 @@ if inputFileSummary.has_key("evt_type"): inputIsSimulation = True else: print "Detected that the input file is real data" - pass + pass -from JetMissingEtTagTools.JetMissingEtTagToolsConf import JetMetTagTool as ConfiguredJetMissingEtTagTool +calibseq = "JetArea_Residual_EtaJES_GSC" +evs = "Kt4EMTopoOriginEventShape" +isdata = False +# options for data +if not inputIsSimulation: + calibseq += "_Insitu" + isdata = True + +# override for cosmics where neither PVs nor track moments are available from AthenaCommon.BeamFlags import jobproperties +if jobproperties.Beam.beamType == 'cosmics': + print "Working on a cosmics file, use alternate JetCalib config" + calibseq = "JetArea_EtaJES" + evs = "Kt4EMTopoEventShape" + +JetCalibTool = CfgMgr.JetCalibrationTool("JetCalib", + JetCollection = "AntiKt4EMTopo", + ConfigFile = "JES_MC15cRecommendation_May2016_rel21.config", + CalibSequence = calibseq, + IsData = isdata, + RhoKey=evs + ) -if rec.doHeavyIon() or jobproperties.Beam.beamType() == 'cosmics' or jobproperties.Beam.beamType() == 'singlebeam': +ToolSvc += JetCalibTool - CalibrationSetup="aroj" +JetVertexTaggerTool = CfgMgr.JetVertexTaggerTool('JVT') +ToolSvc += JetVertexTaggerTool - if jobproperties.Beam.beamType() == 'cosmics' or jobproperties.Beam.beamType() == 'singlebeam': - CalibrationSetup="aj" +METMakerTool = CfgMgr.met__METMaker('METMaker', + DoRemoveMuonJets = True, + DoSetMuonJetEMScale = True, + JetJvtMomentName = 'JvtUpdate', + CustomJetJvtCut = 0.59, + CustomJetJvtPtMax = 60e3 + ) +ToolSvc += METMakerTool - from JetRec.JetRecCalibrationFinder import jrcf - JetCalibrationTool = jrcf.find("AntiKt", 0.4, "LCTopo", CalibrationSetup, "reco", "Kt4") - ToolSvc += JetCalibrationTool +# FlvTagCutDefinitionsFileName = "xAODBTaggingEfficiency/13TeV/2016-13TeV-WorkingPointsOnly-Release20_7-AntiKt4EMTopoJets-May3.root" +FlvTagCutDefinitionsFileName = "xAODBTaggingEfficiency/13TeV/2016-20_7-13TeV-MC15-CDI-May12_v1.root" +MaxEta = 2.5 +MinPt = 20000. +JetAuthor = "AntiKt4EMTopoJets" +TaggerName = "MV2c10" - if rec.doHeavyIon(): - JetMissingEtTagTool=ConfiguredJetMissingEtTagTool( - JetCalibrationTool = JetCalibrationTool, - JetContainer = "antikt4HIItrEM_TowerJets", - METContainer = "MET_Reference_AntiKt4Topo_TAGcalibskim", - METFinalName = "FinalClus", - METJetName = "RefJet", - METMuonsName = "Muons", - METSoftClusName = "SoftClus", - METRefTauName = "RefTau", - METRefEleName = "RefEle", - METRefGammaName = "RefGamma", - METPVSoftTrkName = "PVSoftTrk", - METFinalTrkName = "FinalTrk", - JetCalibContainer = "AntiKt4TopoJets_TAGcalib", - JetCalibContainerSkim = "AntiKt4TopoJets_TAGcalibskim", - EtCut = 40.0*GeV, - EtCutSkim = 20.0*GeV, - UseEMScale = False, - isSimulation = inputIsSimulation - #OutputLevel = 2, - ) - else: - JetMissingEtTagTool=ConfiguredJetMissingEtTagTool( - JetCalibrationTool = JetCalibrationTool, - JetContainer = "AntiKt4LCTopoJets", - METContainer = "MET_Reference_AntiKt4Topo_TAGcalibskim", - METFinalName = "FinalClus", - METJetName = "RefJet", - METMuonsName = "Muons", - METSoftClusName = "SoftClus", - METRefTauName = "RefTau", - METRefEleName = "RefEle", - METRefGammaName = "RefGamma", - METPVSoftTrkName = "PVSoftTrk", - METFinalTrkName = "FinalTrk", +BTagTool_FixedCutBEff_60 = CfgMgr.BTaggingSelectionTool('FixedCutBEff_60', + MaxEta = MaxEta, + MinPt = MinPt, + JetAuthor = JetAuthor, + TaggerName = TaggerName, + FlvTagCutDefinitionsFileName = FlvTagCutDefinitionsFileName, + OperatingPoint = "FixedCutBEff_60") +ToolSvc += BTagTool_FixedCutBEff_60 - JetCalibContainer = "AntiKt4TopoJets_TAGcalib", - JetCalibContainerSkim = "AntiKt4TopoJets_TAGcalibskim", - EtCut = 40.0*GeV, - EtCutSkim = 20.0*GeV, - UseEMScale = False, - isSimulation = inputIsSimulation - - #OutputLevel = 2, - ) - pass - pass -else: +BTagTool_FixedCutBEff_70 = CfgMgr.BTaggingSelectionTool('FixedCutBEff_70', + MaxEta = MaxEta, + MinPt = MinPt, + JetAuthor = JetAuthor, + TaggerName = TaggerName, + FlvTagCutDefinitionsFileName = FlvTagCutDefinitionsFileName, + OperatingPoint = "FixedCutBEff_70") +ToolSvc += BTagTool_FixedCutBEff_70 - # ME: use EM jets for 2015 since this is calibrated +BTagTool_FixedCutBEff_85 = CfgMgr.BTaggingSelectionTool('FixedCutBEff_85', + MaxEta = MaxEta, + MinPt = MinPt, + JetAuthor = JetAuthor, + TaggerName = TaggerName, + FlvTagCutDefinitionsFileName = FlvTagCutDefinitionsFileName, + OperatingPoint = "FixedCutBEff_85") +ToolSvc += BTagTool_FixedCutBEff_85 - JetCalibTool = CfgMgr.JetCalibrationTool( - "JetCalib", - JetCollection = "AntiKt4EMTopo", - ConfigFile = "JES_MC15Prerecommendation_April2015.config", - RhoKey = "Kt4EMTopoEventShape" - ) - if inputIsSimulation: - JetCalibTool.CalibSequence="JetArea_Residual_Origin_EtaJES_GSC" - JetCalibTool.IsData=False - else: - JetCalibTool.CalibSequence="JetArea_Residual_Origin_EtaJES_GSC_Insitu" - JetCalibTool.IsData=True - ToolSvc += JetCalibTool +#FlvTagCutDefinitionsFileName = "xAODBTaggingEfficiency/13TeV/2015-PreRecomm-13TeV-MC12-CDI-October23_v1.root" +#BTagTool_FlatBEff_60 = CfgMgr.BTaggingSelectionTool('FlatBEff_60', +# MaxEta = MaxEta, +# MinPt = MinPt, +# JetAuthor = JetAuthor, +# TaggerName = TaggerName, +# FlvTagCutDefinitionsFileName = FlvTagCutDefinitionsFileName, +# OperatingPoint = "FlatBEff_60") +#ToolSvc += BTagTool_FlatBEff_60 +# +#BTagTool_FlatBEff_70 = CfgMgr.BTaggingSelectionTool('FlatBEff_70', +# MaxEta = MaxEta, +# MinPt = MinPt, +# JetAuthor = JetAuthor, +# TaggerName = TaggerName, +# FlvTagCutDefinitionsFileName = FlvTagCutDefinitionsFileName, +# OperatingPoint = "FlatBEff_70") +#ToolSvc += BTagTool_FlatBEff_70 +# +#BTagTool_FlatBEff_77 = CfgMgr.BTaggingSelectionTool('FlatBEff_77', +# MaxEta = MaxEta, +# MinPt = MinPt, +# JetAuthor = JetAuthor, +# TaggerName = TaggerName, +# FlvTagCutDefinitionsFileName = FlvTagCutDefinitionsFileName, +# OperatingPoint = "FlatBEff_77") +#ToolSvc += BTagTool_FlatBEff_77 - JetMissingEtTagTool=ConfiguredJetMissingEtTagTool( - JetCalibrationTool = JetCalibTool, - JetContainer = "AntiKt4EMTopoJets", - METContainer = "MET_Reference_AntiKt4Topo_TAGcalibskim", - METFinalName = "FinalClus", - METJetName = "RefJet", - METMuonsName = "Muons", - METSoftClusName = "SoftClus", - METRefTauName = "RefTau", - METRefEleName = "RefEle", - METRefGammaName = "RefGamma", - METPVSoftTrkName = "PVSoftTrk", - METFinalTrkName = "FinalTrk", - JetCalibContainer = "AntiKt4TopoJets_TAGcalib", - JetCalibContainerSkim = "AntiKt4TopoJets_TAGcalibskim", - EtCut = 40.0*GeV, - EtCutSkim = 20.0*GeV, - UseEMScale = False, - isSimulation = inputIsSimulation - #OutputLevel = 2, - ) - pass +from JetMissingEtTagTools.JetMissingEtTagToolsConf import JetMetTagTool as ConfiguredJetMissingEtTagTool +JetMissingEtTagTool=ConfiguredJetMissingEtTagTool( + JetCalibrationTool = JetCalibTool, + JetVertexTaggerTool = JetVertexTaggerTool, + JetContainer = "AntiKt4EMTopoJets", + EtCut = 40.0*GeV, + EtCutSkim = 20.0*GeV, + UseEMScale = False, + isSimulation = inputIsSimulation, + JetCalibContainer = "AntiKt4TopoJets_TAGcalib", + JetCalibContainerSkim = "AntiKt4TopoJets_TAGcalibskim", + ElectronsContainerSkim = "Electrons_TAG_skim", + PhotonsContainerSkim = "Photons_TAG_skim", + TausContainerSkim = "TauJets_TAG_skim", + MuonsContainerSkim = "Muons_TAG_skim", + METMaker = METMakerTool, + METCoreName = "MET_Core_AntiKt4EMTopo", + METMapName = "METAssoc_AntiKt4EMTopo", + METContainer = "MET_Reference_AntiKt4Topo_TAGcalibskim", + METFinalName = "FinalClus", + METJetName = "RefJet", + METMuonsName = "Muons", + METSoftClusName = "SoftClus", + METRefTauName = "RefTau", + METRefEleName = "RefEle", + METRefGammaName = "RefGamma", + METPVSoftTrkName = "PVSoftTrk", + METFinalTrkName = "FinalTrk", + FixedCutBEff60 = BTagTool_FixedCutBEff_60, + FixedCutBEff70 = BTagTool_FixedCutBEff_70, + FixedCutBEff85 = BTagTool_FixedCutBEff_85, + DoJVT = jetFlags.useVertices(), +# FlatBEff60 = BTagTool_FlatBEff_60, +# FlatBEff70 = BTagTool_FlatBEff_70, +# FlatBEff77 = BTagTool_FlatBEff_77 + #OutputLevel = 2, + ) ToolSvc += JetMissingEtTagTool diff --git a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/src/JetMissingEtIdentificationTagTool.cxx b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/src/JetMissingEtIdentificationTagTool.cxx index 1fcbe87f7d8e541e95f881782a629326d0d78a94..187a4b392b83b0d2d428adf8815e15286861ec7c 100755 --- a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/src/JetMissingEtIdentificationTagTool.cxx +++ b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/src/JetMissingEtIdentificationTagTool.cxx @@ -50,7 +50,7 @@ JetMissingEtIdentificationTagTool::JetMissingEtIdentificationTagTool (const std: /** initialization - called once at the begginning */ StatusCode JetMissingEtIdentificationTagTool::initialize() { MsgStream mLog(msgSvc(), name()); - mLog << MSG::DEBUG << "in intialize()" << endreq; + mLog << MSG::DEBUG << "in intialize()" << endmsg; CHECK(initJetSelectors()); @@ -63,7 +63,7 @@ StatusCode JetMissingEtIdentificationTagTool::attributeSpecification( std::map<std::string,AthenaAttributeType>& attrMap, const int max) { MsgStream mLog(msgSvc(), name()); - mLog << MSG::DEBUG << "in attributeSpecification()" << endreq; + mLog << MSG::DEBUG << "in attributeSpecification()" << endmsg; /** specify the Jet and MissingET the attributes */ @@ -121,7 +121,7 @@ StatusCode JetMissingEtIdentificationTagTool::execute(TagFragmentCollection& jet /** finialize - called once at the end */ StatusCode JetMissingEtIdentificationTagTool::finalize() { MsgStream mLog(msgSvc(), name()); - mLog << MSG::DEBUG << "in finalize()" << endreq; + mLog << MSG::DEBUG << "in finalize()" << endmsg; return StatusCode::SUCCESS; } diff --git a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/src/JetMissingEtTagTool.cxx b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/src/JetMissingEtTagTool.cxx index 65af6e5b7c1cfe3badc0898b1904f66db4ef76c2..5c7048979bec5edda54518c7ca7b95f5b5918621 100755 --- a/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/src/JetMissingEtTagTool.cxx +++ b/PhysicsAnalysis/JetMissingEtID/JetMissingEtTagTools/src/JetMissingEtTagTool.cxx @@ -14,30 +14,37 @@ Purpose : create a collection of JetMissingEtJetTag #include "AthContainers/ConstDataVector.h" #include "xAODCore/ShallowCopy.h" #include "xAODParticleEvent/IParticleLink.h" +#include "xAODJet/JetContainer.h" #include "xAODJet/JetAuxContainer.h" #include "JetUtils/JetCaloQualityUtils.h" +#include "xAODEgamma/ElectronContainer.h" +#include "xAODEgamma/PhotonContainer.h" +#include "xAODMuon/MuonContainer.h" +#include "xAODTau/TauJetContainer.h" + #include "xAODMissingET/MissingET.h" #include "xAODMissingET/MissingETContainer.h" +#include "xAODMissingET/MissingETAuxContainer.h" +#include "xAODMissingET/MissingETComposition.h" +#include "xAODMissingET/MissingETAssociationMap.h" #include "TagEvent/MissingETAttributeNames.h" #include "TagEvent/ParticleJetAttributeNames.h" // JetCalibTools includes -#include "JetCalibTools/IJetCalibrationTool.h" +#include "JetCalibTools/JetCalibrationTool.h" + +// JetInterface includes +#include "JetInterface/IJetUpdateJvt.h" +#include "METInterface/IMETMaker.h" #include "AnalysisUtils/AnalysisMisc.h" #include "AthenaPoolUtilities/AthenaAttributeSpecification.h" - #include <sstream> #include <vector> - -using xAOD::Jet; -using xAOD::MissingET; -using xAOD::MissingETContainer; - // define some global/static selectors // veryLooseBadTool, looseBadTool, etc... are defined here #include "JetSelectorDefs.h" @@ -46,13 +53,46 @@ using xAOD::MissingETContainer; JetMetTagTool::JetMetTagTool (const std::string& type, const std::string& name, const IInterface* parent) : AthAlgTool( type, name, parent ), - m_jetCalibrationTool("") { + m_jetCalibrationTool(""), m_jetJVTUpdateTool("") { - /** JetMissingEt AOD Container Name */ + /** JetMissingEt tools */ declareProperty("JetCalibrationTool", m_jetCalibrationTool); + declareProperty("JetVertexTaggerTool", m_jetJVTUpdateTool); + /** MET maker tool */ + declareProperty( "METMaker", m_metmaker); + + /** B-tagging tools */ + declareProperty( "FixedCutBEff60", m_FixedCutBEff_60); + declareProperty( "FixedCutBEff70", m_FixedCutBEff_70); + declareProperty( "FixedCutBEff85", m_FixedCutBEff_85); + // declareProperty( "FlatBEff60", m_FlatBEff_60); + // declareProperty( "FlatBEff70", m_FlatBEff_70); + // declareProperty( "FlatBEff77", m_FlatBEff_77); /** JetMissingEt AOD Container Name */ declareProperty("JetContainer", m_containerName = "AntiKt4EMTopo"); + declareProperty("JetCalibContainer", m_jetCalibcontainerName = "AntiKt4TopoJets_TAGcalib"); + + /** selection cut of Pt */ + declareProperty("EtCut", m_jetPtCut = 40.0*CLHEP::GeV); + declareProperty("EtCutSkim", m_jetPtCut_skim = 20.0*CLHEP::GeV); + + declareProperty("UseEMScale", m_useEMScale = false); + declareProperty("isSimulation", m_isSimulation = false); + + /** Have to toggle off in cosmics */ + declareProperty("DoJVT", m_doJVT = true); + + /** MET input with skims */ + declareProperty("JetCalibContainerSkim", m_jetCalibcontainerName_skim = "AntiKt4TopoJets_TAGcalibskim"); + declareProperty("ElectronsContainerSkim",m_ElectronsContainer_skim); + declareProperty("PhotonsContainerSkim", m_PhotonsContainer_skim); + declareProperty("TausContainerSkim", m_TausContainer_skim); + declareProperty("MuonsContainerSkim", m_MuonsContainer_skim); + declareProperty("METMapName", m_METMapName); + declareProperty("METCoreName", m_METCoreName); + + /** MET with skims */ declareProperty("METContainer", m_metContainerName = "MET_Reference_AntiKt4Topo_TAGcalibskim"); declareProperty("METFinalName", m_metRefFinalName = "FinalClus"); declareProperty("METJetName", m_metRefJetName = "RefJet"); @@ -64,15 +104,6 @@ JetMetTagTool::JetMetTagTool (const std::string& type, const std::string& name, declareProperty("METPVSoftTrkName", m_metPVSoftTrkName = "PVSoftTrk"); declareProperty("METFinalTrkName", m_metFinalTrkName = "FinalTrk"); - declareProperty("JetCalibContainer", m_jetCalibcontainerName = "AntiKt4TopoJets_TAGcalib"); - declareProperty("JetCalibContainerSkim", m_jetCalibcontainerName_skim = "AntiKt4TopoJets_TAGcalibskim"); - /** selection cut of Pt */ - declareProperty("EtCut", m_jetPtCut = 40.0*CLHEP::GeV); - declareProperty("EtCutSkim", m_jetPtCut_skim = 20.0*CLHEP::GeV); - - declareProperty("UseEMScale", m_useEMScale = false); - declareProperty("isSimulation", m_isSimulation = false); - declareInterface<JetMetTagTool>( this ); } @@ -83,6 +114,20 @@ StatusCode JetMetTagTool::initialize() { // retrieve the jet calibration tool CHECK(m_jetCalibrationTool.retrieve()); + // retrieve the JVT update tool + CHECK(m_jetJVTUpdateTool.retrieve()); + + // MET maker tool + CHECK(m_metmaker.retrieve()); + + // B-tagging tools + CHECK(m_FixedCutBEff_60.retrieve()); + CHECK(m_FixedCutBEff_70.retrieve()); + CHECK(m_FixedCutBEff_85.retrieve()); + // CHECK(m_FlatBEff_60.retrieve()); + // CHECK(m_FlatBEff_70.retrieve()); + // CHECK(m_FlatBEff_77.retrieve()); + // init selectors as defined in JetSelectorDefs.h CHECK(initJetSelectors()); @@ -95,28 +140,63 @@ StatusCode JetMetTagTool::attributeSpecification(std::map<std::string,AthenaAttr ATH_MSG_DEBUG( "in attributeSpecification() for missingET" ); /** MissingET Ref_final attributes */ - attrMap[ MissingEtAttributeNames[EtMiss::MET_RefFinalX] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_RefFinalX], MissingEtAttributeGroupNames[EtMiss::MET_RefFinalX]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_RefFinalY] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_RefFinalY], MissingEtAttributeGroupNames[EtMiss::MET_RefFinalY]); - attrMap[ MissingEtAttributeNames[EtMiss::SumET] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::SumET], MissingEtAttributeGroupNames[EtMiss::SumET]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_SoftClusX] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_SoftClusX], MissingEtAttributeGroupNames[EtMiss::MET_SoftClusX]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_SoftClusY] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_SoftClusY], MissingEtAttributeGroupNames[EtMiss::MET_SoftClusY]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_RefJetX] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_RefJetX], MissingEtAttributeGroupNames[EtMiss::MET_RefJetX]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_RefJetY] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_RefJetY], MissingEtAttributeGroupNames[EtMiss::MET_RefJetY]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_RefTauX] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_RefTauX], MissingEtAttributeGroupNames[EtMiss::MET_RefTauX]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_RefTauY] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_RefTauY], MissingEtAttributeGroupNames[EtMiss::MET_RefTauY]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_MuonsX] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_MuonsX], MissingEtAttributeGroupNames[EtMiss::MET_MuonsX]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_MuonsY] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_MuonsY], MissingEtAttributeGroupNames[EtMiss::MET_MuonsY]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_RefEleX] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_RefEleX], MissingEtAttributeGroupNames[EtMiss::MET_RefEleX]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_RefEleY] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_RefEleY], MissingEtAttributeGroupNames[EtMiss::MET_RefEleY]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_RefGammaX] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_RefGammaX], MissingEtAttributeGroupNames[EtMiss::MET_RefGammaX]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_RefGammaY] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_RefGammaY], MissingEtAttributeGroupNames[EtMiss::MET_RefGammaY]); - - attrMap[ MissingEtAttributeNames[EtMiss::MET_PVSoftTrkX] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_PVSoftTrkX], MissingEtAttributeGroupNames[EtMiss::MET_PVSoftTrkX]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_PVSoftTrkY] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_PVSoftTrkY], MissingEtAttributeGroupNames[EtMiss::MET_PVSoftTrkY]); - - attrMap[ MissingEtAttributeNames[EtMiss::MET_FinalTrkX] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_FinalTrkX], MissingEtAttributeGroupNames[EtMiss::MET_FinalTrkX]); - attrMap[ MissingEtAttributeNames[EtMiss::MET_FinalTrkY] ] = AthenaAttributeType("float", MissingEtAttributeUnitNames[EtMiss::MET_FinalTrkY], MissingEtAttributeGroupNames[EtMiss::MET_FinalTrkY]); - + attrMap[ MissingEtAttributeNames[EtMiss::MET_RefFinalX] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_RefFinalX], + MissingEtAttributeGroupNames[EtMiss::MET_RefFinalX]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_RefFinalY] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_RefFinalY], + MissingEtAttributeGroupNames[EtMiss::MET_RefFinalY]); + attrMap[ MissingEtAttributeNames[EtMiss::SumET] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::SumET], + MissingEtAttributeGroupNames[EtMiss::SumET]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_SoftClusX] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_SoftClusX], + MissingEtAttributeGroupNames[EtMiss::MET_SoftClusX]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_SoftClusY] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_SoftClusY], + MissingEtAttributeGroupNames[EtMiss::MET_SoftClusY]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_RefJetX] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_RefJetX], + MissingEtAttributeGroupNames[EtMiss::MET_RefJetX]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_RefJetY] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_RefJetY], + MissingEtAttributeGroupNames[EtMiss::MET_RefJetY]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_RefTauX] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_RefTauX], + MissingEtAttributeGroupNames[EtMiss::MET_RefTauX]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_RefTauY] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_RefTauY], + MissingEtAttributeGroupNames[EtMiss::MET_RefTauY]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_MuonsX] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_MuonsX], + MissingEtAttributeGroupNames[EtMiss::MET_MuonsX]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_MuonsY] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_MuonsY], + MissingEtAttributeGroupNames[EtMiss::MET_MuonsY]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_RefEleX] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_RefEleX], + MissingEtAttributeGroupNames[EtMiss::MET_RefEleX]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_RefEleY] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_RefEleY], + MissingEtAttributeGroupNames[EtMiss::MET_RefEleY]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_RefGammaX] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_RefGammaX], + MissingEtAttributeGroupNames[EtMiss::MET_RefGammaX]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_RefGammaY] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_RefGammaY], + MissingEtAttributeGroupNames[EtMiss::MET_RefGammaY]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_PVSoftTrkX] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_PVSoftTrkX], + MissingEtAttributeGroupNames[EtMiss::MET_PVSoftTrkX]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_PVSoftTrkY] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_PVSoftTrkY], + MissingEtAttributeGroupNames[EtMiss::MET_PVSoftTrkY]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_FinalTrkX] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_FinalTrkX], + MissingEtAttributeGroupNames[EtMiss::MET_FinalTrkX]); + attrMap[ MissingEtAttributeNames[EtMiss::MET_FinalTrkY] ] = AthenaAttributeType("float", + MissingEtAttributeUnitNames[EtMiss::MET_FinalTrkY], + MissingEtAttributeGroupNames[EtMiss::MET_FinalTrkY]); return StatusCode::SUCCESS; } @@ -128,8 +208,8 @@ StatusCode JetMetTagTool::attributeSpecification(std::map<std::string,AthenaAttr std::ostringstream os; /** Jet Attributes */ - attrMap[ JetAttributeNames[PJet::NJet] ] = AthenaAttributeType("unsigned int", JetAttributeUnitNames[PJet::NJet], JetAttributeGroupNames[PJet::NJet]); - attrMap[ JetAttributeNames[PJet::JetSumET] ] = AthenaAttributeType("float", JetAttributeUnitNames[PJet::JetSumET], JetAttributeGroupNames[PJet::JetSumET]); + attrMap[ JetAttributeNames[PJet::NJet] ] = AthenaAttributeType("unsigned int", JetAttributeUnitNames[PJet::NJet], JetAttributeGroupNames[PJet::NJet]); + attrMap[ JetAttributeNames[PJet::JetSumET] ] = AthenaAttributeType("float", JetAttributeUnitNames[PJet::JetSumET], JetAttributeGroupNames[PJet::JetSumET]); for (int i=1; i<= max; ++i) { @@ -157,7 +237,6 @@ StatusCode JetMetTagTool::attributeSpecification(std::map<std::string,AthenaAttr attrMap[ os.str() ] = AthenaAttributeType("float", JetAttributeUnitNames[PJet::Phi], JetAttributeGroupNames[PJet::Phi]); m_phiStr.push_back( os.str() ); - /** Jet PID */ os.str(""); os << JetAttributeNames[PJet::JetPID] << std::dec << i; @@ -190,7 +269,8 @@ const xAOD::JetContainer* JetMetTagTool::calibrateAndRecordShallowCopyJetCollect } static SG::AuxElement::Accessor< xAOD::IParticleLink > accSetOriginLink ("originalObjectLink"); - + static SG::AuxElement::Decorator< float > decJvt("JvtUpdate"); + for ( xAOD::Jet *shallowCopyJet : * jetContainerShallowCopy ) { if( m_jetCalibrationTool->applyCalibration(*shallowCopyJet).isFailure() ){ @@ -199,14 +279,16 @@ const xAOD::JetContainer* JetMetTagTool::calibrateAndRecordShallowCopyJetCollect } const xAOD::IParticleLink originLink( *jetContainer, shallowCopyJet->index() ); accSetOriginLink(*shallowCopyJet) = originLink; - - + + if(m_doJVT) { + decJvt(*shallowCopyJet) = m_jetJVTUpdateTool->updateJvt(*shallowCopyJet); + } } + if( evtStore()->setConst(jetContainerShallowCopy ).isFailure() ){ ATH_MSG_WARNING( "Failed to set jetcalibCollection (" << m_jetCalibcontainerName+"Aux." << ")const in StoreGate!"); return 0; } - if( evtStore()->setConst(jetAuxContainerShallowCopy ).isFailure() ){ ATH_MSG_WARNING( "Failed to set jetcalibCollection (" << m_jetCalibcontainerName+"Aux." << ")const in StoreGate!"); return 0; @@ -219,7 +301,9 @@ const xAOD::JetContainer* JetMetTagTool::calibrateAndRecordShallowCopyJetCollect StatusCode JetMetTagTool::execute(TagFragmentCollection& jetMissingEtTagColl, const int max) { ATH_MSG_DEBUG( "in execute() - jet" ); + static SG::AuxElement::Accessor< xAOD::IParticleLink > accSetOriginLink ("originalObjectLink"); + /** retrieve the AOD Jet container */ const xAOD::JetContainer *jetContainer=0; StatusCode sc = evtStore()->retrieve( jetContainer, m_containerName); @@ -229,17 +313,17 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& jetMissingEtTagColl, co } ATH_MSG_DEBUG( "AOD Jet container ("<<m_containerName<<") successfully retrieved" ); - // Calibrate and record a shallow copy of the jet container + /** Calibrate and record a shallow copy of the jet container */ const xAOD::JetContainer * jetContainerShallowCopy = calibrateAndRecordShallowCopyJetCollection(jetContainer); if(!jetContainerShallowCopy){ ATH_MSG_WARNING( "Unable to create calibrated jet shallow copy container" ); return StatusCode::SUCCESS; } - // determine jet scale to use + /** determine jet scale to use */ xAOD::JetScale scale = m_useEMScale ? xAOD::JetEMScaleMomentum : xAOD::JetAssignedScaleMomentum ; - // create a new copy for MET calculation + /** create a new copy for MET calculation */ ConstDataVector< xAOD::JetContainer >* selectedJets = new ConstDataVector< xAOD::JetContainer >( SG::VIEW_ELEMENTS ); ATH_CHECK( evtStore()->record( selectedJets, m_jetCalibcontainerName_skim ) ); @@ -254,20 +338,27 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& jetMissingEtTagColl, co if (select) { + /** //retrieve jvt information - bool hasjvt = originalJet->isAvailable<float>("Jvt"); + bool hasjvt = originalJet->isAvailable<float>("JvtUpdate"); if (hasjvt) { //apply pile up removal selection - float jvt = originalJet->auxdata<float>("Jvt"); - if ( !( originalJet->pt()< 50000. && fabs(originalJet->eta())<2.4 && fabs(jvt) < 0.64 ) ) { + float jvt = originalJet->auxdata<float>("JvtUpdate"); + if ( !( originalJet->pt()< 60000. && fabs(originalJet->eta())<2.4 && fabs(jvt) < 0.59 ) ) { selectedJets->push_back( originalJet ); } } + */ + + /** we do take all jets at this point, JVT cut is done in METmaker */ + selectedJets->push_back( originalJet ); + } } - // vector to store all jets that pass selection cuts + + /** vector to store all jets that pass selection cuts */ std::vector<const xAOD::Jet *> selectedJetsVector; selectedJetsVector.reserve(jetContainerShallowCopy->size() ); @@ -299,18 +390,18 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& jetMissingEtTagColl, co AnalysisUtils::Sort::pT( &selectedJetsVector ); /** make the selection */ - int i=0; + int i = 0; /** for counting different pT jets and b-jets */ - int ij40=0; - int ij50=0; - int ij55=0; - int ij80=0; - int ij100=0; - int iBj40=0; - int iBj50=0; - int iBj55=0; - int iBj80=0; - int iBj100=0; + int ij40 = 0; + int ij50 = 0; + int ij55 = 0; + int ij80 = 0; + int ij100 = 0; + int iBj40 = 0; + int iBj50 = 0; + int iBj55 = 0; + int iBj80 = 0; + int iBj100 = 0; for (const xAOD::Jet *selectedJet : selectedJetsVector) { @@ -343,15 +434,19 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& jetMissingEtTagColl, co pid |= 1 << 4; /** get JVT */ - bool hasjvt = selectedJet->isAvailable<float>("Jvt"); + bool hasjvt = selectedJet->isAvailable<float>("JvtUpdate"); if (hasjvt) { - float jvt = selectedJet->auxdata<float>("Jvt"); + float jvt = selectedJet->auxdata<float>("JvtUpdate"); + if (fabs(jvt) > 0.2){ pid |= 1 << 6; } if (fabs(jvt) > 0.64){ pid |= 1 << 7; } + if (fabs(jvt) > 0.59){ + pid |= 1 << 17; + } } /** get JVF */ @@ -371,20 +466,19 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& jetMissingEtTagColl, co pid |= 1 << 11; } + /** B-tagging using selection tools*/ + /** B-tagging */ const xAOD::BTagging* btag = selectedJet->btagging(); if (bool(btag)) { - double mvx; - btag->MVx_discriminant("MV2c20", mvx); - - if (mvx > 0.473) - pid |= 1 << 12; // MV2c20 @ 60% - if (mvx > -0.046) - pid |= 1 << 13; // MV2c20 @ 70% - if (mvx > -0.819) - pid |= 1 << 14; // MV2c20 @ 85% + if ( m_FixedCutBEff_60->accept( selectedJet ) ) pid |= 1 << 12; // MV2c20 @ 60% + if ( m_FixedCutBEff_70->accept( selectedJet ) ) pid |= 1 << 13; // MV2c20 @ 70% + if ( m_FixedCutBEff_85->accept( selectedJet ) ) pid |= 1 << 14; // MV2c20 @ 85% + // if ( m_FlatBEff_60->accept( selectedJet ) ) pid |= 1 << 18; // MV2c20 @ flat 60% + // if ( m_FlatBEff_70->accept( selectedJet ) ) pid |= 1 << 19; // MV2c20 @ flat 70% + // if ( m_FlatBEff_77->accept( selectedJet ) ) pid |= 1 << 20; // MV2c20 @ flat 77% } - + /** isbadCHF */ std::vector<float> sumPtTrkvec; selectedJet->getAttribute( xAOD::JetAttribute::SumPtTrkPt500, sumPtTrkvec ); @@ -446,21 +540,182 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& jetMissingEtTagColl, co return StatusCode::SUCCESS; } +/** recomputeMissingEt - called on every event for missing Et */ +StatusCode JetMetTagTool::recomputeMissingEt() { + + ATH_MSG_DEBUG( "in recomputeMissingEt() - missing Et" ); + // Create a MissingETContainer with its aux store + + xAOD::MissingETContainer* newMet = new xAOD::MissingETContainer(); + if( evtStore()->record(newMet, m_metContainerName).isFailure() ) { + ATH_MSG_WARNING("Unable to record MissingETContainer: " << m_metContainerName); + return StatusCode::SUCCESS; + } + + xAOD::MissingETAuxContainer* metAuxCont = new xAOD::MissingETAuxContainer(); + if( evtStore()->record(metAuxCont, m_metContainerName+"Aux.").isFailure() ) { + ATH_MSG_WARNING("Unable to record MissingETAuxContainer: " << m_metContainerName+"Aux."); + return StatusCode::SUCCESS; + } + newMet->setStore(metAuxCont); + + // Settings for MET calculation *********************************************** + + // std::vector<const xAOD::IParticle*> uniques; + //MissingETBase::UsageHandler::Policy objScale = MissingETBase::UsageHandler::PhysicsObject; + + // Retrieve containers and compute MET **************************************** + + /// MET map + const xAOD::MissingETAssociationMap* metMap = 0; + if( evtStore()->retrieve(metMap, m_METMapName).isFailure() ) { + ATH_MSG_WARNING("Unable to retrieve MissingETAssociationMap: " << m_METMapName); + return StatusCode::SUCCESS; + } + metMap->resetObjSelectionFlags(); + + /// MET core + const xAOD::MissingETContainer* coreMet(0); + if( evtStore()->retrieve(coreMet, m_METCoreName).isFailure() ) { + ATH_MSG_WARNING("Unable to retrieve MissingETContainer: " << m_METCoreName); + return StatusCode::SUCCESS; + } + + /// Electrons + const xAOD::ElectronContainer* elCont(0); + if(!m_ElectronsContainer_skim.empty()) { + if( evtStore()->retrieve(elCont, m_ElectronsContainer_skim).isFailure() ) { + ATH_MSG_WARNING("Unable to retrieve input electron container: " << m_ElectronsContainer_skim); + return StatusCode::SUCCESS; + } + ATH_MSG_DEBUG("Successfully retrieved electron collection"); + + // compute MET term + // uniques.clear(); + if( m_metmaker->rebuildMET("RefEle", xAOD::Type::Electron, newMet, + elCont, + metMap).isFailure() ) { + ATH_MSG_WARNING("Failed to build electron term."); + } + //ATH_MSG_DEBUG("Selected " << elCont->size() << " MET electrons. " + // << uniques.size() << " are non-overlapping."); + } + + /// Photons + const xAOD::PhotonContainer* phCont(0); + if(!m_PhotonsContainer_skim.empty()) { + if( evtStore()->retrieve(phCont, m_PhotonsContainer_skim).isFailure() ) { + ATH_MSG_WARNING("Unable to retrieve input photon container: " << m_PhotonsContainer_skim); + return StatusCode::SUCCESS; + } + ATH_MSG_DEBUG("Successfully retrieved photon collection"); + + // compute MET term + //uniques.clear(); + if( m_metmaker->rebuildMET("RefGamma", xAOD::Type::Photon, newMet, + phCont, + metMap).isFailure() ) { + ATH_MSG_WARNING("Failed to build photon term."); + } + //ATH_MSG_DEBUG("Selected " << phCont->size() << " MET photons. " + // << uniques.size() << " are non-overlapping."); + } + + /// Taus + const xAOD::TauJetContainer* tauCont(0); + if(!m_TausContainer_skim.empty()) { + if( evtStore()->retrieve(tauCont, m_TausContainer_skim).isFailure() ) { + ATH_MSG_WARNING("Unable to retrieve input tau container: " << m_TausContainer_skim); + return StatusCode::SUCCESS; + } + ATH_MSG_DEBUG("Successfully retrieved tau collection"); + + // compute MET term + //uniques.clear(); + if( m_metmaker->rebuildMET("RefTau", xAOD::Type::Tau, newMet, + tauCont, + metMap).isFailure() ){ + ATH_MSG_WARNING("Failed to build tau term."); + } + //ATH_MSG_DEBUG("Selected " << tauCont->size() << " MET taus. " + //<< uniques.size() << " are non-overlapping."); + } + + /// Muons + const xAOD::MuonContainer* muonCont(0); + if(!m_MuonsContainer_skim.empty()) { + if( evtStore()->retrieve(muonCont, m_MuonsContainer_skim).isFailure() ) { + ATH_MSG_WARNING("Unable to retrieve input muon container: " << m_MuonsContainer_skim); + return StatusCode::SUCCESS; + } + ATH_MSG_DEBUG("Successfully retrieved muon collection"); + + // compute MET term + //uniques.clear(); + if( m_metmaker->rebuildMET("Muons", xAOD::Type::Muon, newMet, + muonCont, + metMap).isFailure() ) { + ATH_MSG_WARNING("Failed to build muon term."); + } + //ATH_MSG_DEBUG("Selected " << muonCont->size() << " MET muons. " + //<< uniques.size() << " are non-overlapping."); + } + + /// Jets + const xAOD::JetContainer* jetCont(0); + if( evtStore()->retrieve(jetCont, m_jetCalibcontainerName_skim).isFailure() ) { + ATH_MSG_WARNING("Unable to retrieve input jet container: " << m_jetCalibcontainerName_skim); + return StatusCode::SUCCESS; + } + ATH_MSG_DEBUG("Successfully retrieved jet collection"); + + // compute MET term + //uniques.clear(); + if( m_metmaker->rebuildJetMET("RefJet", m_metSoftClusName, m_metPVSoftTrkName, newMet, + jetCont, coreMet, metMap, true ).isFailure() ) { + ATH_MSG_WARNING("Failed to build jet and soft terms."); + } + //ATH_MSG_DEBUG("Of " << jetCont->size() << " jets, " + //<< uniques.size() << " are non-overlapping."); + + // compute Track soft term + MissingETBase::Types::bitmask_t trksource = MissingETBase::Source::Track; + if((*newMet)[m_metPVSoftTrkName]) trksource = (*newMet)[m_metPVSoftTrkName]->source(); + if( m_metmaker->buildMETSum("FinalTrk", newMet, trksource).isFailure() ){ + ATH_MSG_WARNING("Building MET FinalTrk sum failed."); + } + + // compute cluster soft term + MissingETBase::Types::bitmask_t clsource = MissingETBase::Source::LCTopo; + if((*newMet)[m_metSoftClusName]) clsource = (*newMet)[m_metSoftClusName]->source(); + if( m_metmaker->buildMETSum("FinalClus", newMet, clsource).isFailure() ) { + ATH_MSG_WARNING("Building MET FinalClus sum failed."); + } + + return StatusCode::SUCCESS; +} /** execute - called on every event for missing Et */ StatusCode JetMetTagTool::execute(TagFragmentCollection& missingEtTagColl) { ATH_MSG_DEBUG( "in execute() - missing Et" ); - const MissingETContainer *met(0); //comment out const - StatusCode sc = evtStore()->retrieve( met, m_metContainerName); - if (sc.isFailure()) { - ATH_MSG_WARNING( "No MissingET container found in SG" ); + /** Calibrate and record a shallow copy of the jet container */ + StatusCode sc = recomputeMissingEt(); + if(sc.isFailure()){ + ATH_MSG_WARNING( "Unable to recompute MissingET" ); return StatusCode::SUCCESS; } - - const MissingET* metfinal = (*met)[m_metRefFinalName]; //comment out const + + const xAOD::MissingETContainer *met(0); //comment out const + sc = evtStore()->retrieve( met, m_metContainerName); + if (sc.isFailure()) { + ATH_MSG_WARNING( "No recomputed MissingET container found in SG" ); + return StatusCode::SUCCESS; + } + + const xAOD::MissingET* metfinal = (*met)[m_metRefFinalName]; //comment out const if (!metfinal) { ATH_MSG_WARNING( "No total MissingET object found in container with name " << m_metRefFinalName ); return StatusCode::SUCCESS; @@ -472,7 +727,7 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& missingEtTagColl) { missingEtTagColl.insert(MissingEtAttributeNames[EtMiss::MET_RefFinalY], metfinal->mpy()); missingEtTagColl.insert(MissingEtAttributeNames[EtMiss::SumET], metfinal->sumet()); - const MissingET *metSoftTerm = (*met)[m_metSoftClusName]; + const xAOD::MissingET *metSoftTerm = (*met)[m_metSoftClusName]; if ( !metSoftTerm ) { ATH_MSG_WARNING( "No soft MissingET found in container with name " << m_metSoftClusName ); return StatusCode::SUCCESS; @@ -481,7 +736,7 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& missingEtTagColl) { missingEtTagColl.insert(MissingEtAttributeNames[EtMiss::MET_SoftClusX], metSoftTerm->mpx()); missingEtTagColl.insert(MissingEtAttributeNames[EtMiss::MET_SoftClusY], metSoftTerm->mpy()); - const MissingET *metRefJet = (*met)[m_metRefJetName]; + const xAOD::MissingET *metRefJet = (*met)[m_metRefJetName]; if ( !metRefJet ) { ATH_MSG_WARNING( "No tau MissingET found in container with name " << m_metRefJetName ); return StatusCode::SUCCESS; @@ -491,7 +746,7 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& missingEtTagColl) { missingEtTagColl.insert(MissingEtAttributeNames[EtMiss::MET_RefJetY], metRefJet->mpy()); - const MissingET *metRefTau = (*met)[m_metRefTauName]; + const xAOD::MissingET *metRefTau = (*met)[m_metRefTauName]; if ( !metRefTau ) { ATH_MSG_WARNING( "No tau MissingET found in container with name " << m_metRefTauName ); return StatusCode::SUCCESS; @@ -501,7 +756,7 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& missingEtTagColl) { missingEtTagColl.insert(MissingEtAttributeNames[EtMiss::MET_RefTauY], metRefTau->mpy()); - const MissingET *metMuons = (*met)[m_metMuonsName]; + const xAOD::MissingET *metMuons = (*met)[m_metMuonsName]; if ( !metMuons ) { ATH_MSG_WARNING( "No tau MissingET found in container with name " << m_metMuonsName ); return StatusCode::SUCCESS; @@ -511,7 +766,7 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& missingEtTagColl) { missingEtTagColl.insert(MissingEtAttributeNames[EtMiss::MET_MuonsY], metMuons->mpy()); - const MissingET *metRefEle = (*met)[m_metRefEleName]; + const xAOD::MissingET *metRefEle = (*met)[m_metRefEleName]; if ( !metRefEle ) { ATH_MSG_WARNING( "No tau MissingET found in container with name " << m_metRefEleName ); return StatusCode::SUCCESS; @@ -521,7 +776,7 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& missingEtTagColl) { missingEtTagColl.insert(MissingEtAttributeNames[EtMiss::MET_RefEleY], metRefEle->mpy()); - const MissingET *metRefGamma = (*met)[m_metRefGammaName]; + const xAOD::MissingET *metRefGamma = (*met)[m_metRefGammaName]; if ( !metRefGamma ) { ATH_MSG_WARNING( "No tau MissingET found in container with name " << m_metRefGammaName ); return StatusCode::SUCCESS; @@ -531,7 +786,7 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& missingEtTagColl) { missingEtTagColl.insert(MissingEtAttributeNames[EtMiss::MET_RefGammaY], metRefGamma->mpy()); - const MissingET *metPVSoftTrk = (*met)[m_metPVSoftTrkName]; + const xAOD::MissingET *metPVSoftTrk = (*met)[m_metPVSoftTrkName]; if ( !metPVSoftTrk ) { ATH_MSG_WARNING( "No tau MissingET found in container with name " << m_metPVSoftTrkName ); return StatusCode::SUCCESS; @@ -540,7 +795,7 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& missingEtTagColl) { missingEtTagColl.insert(MissingEtAttributeNames[EtMiss::MET_PVSoftTrkX], metPVSoftTrk->mpx()); missingEtTagColl.insert(MissingEtAttributeNames[EtMiss::MET_PVSoftTrkY], metPVSoftTrk->mpy()); - const MissingET *metFinalTrk = (*met)[m_metFinalTrkName]; + const xAOD::MissingET *metFinalTrk = (*met)[m_metFinalTrkName]; if ( !metFinalTrk ) { ATH_MSG_WARNING( "No tau MissingET found in container with name " << m_metFinalTrkName ); return StatusCode::SUCCESS; @@ -549,7 +804,6 @@ StatusCode JetMetTagTool::execute(TagFragmentCollection& missingEtTagColl) { missingEtTagColl.insert(MissingEtAttributeNames[EtMiss::MET_FinalTrkX], metFinalTrk->mpx()); missingEtTagColl.insert(MissingEtAttributeNames[EtMiss::MET_FinalTrkY], metFinalTrk->mpy()); - return StatusCode::SUCCESS; } diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration.py index 84839751192f722984862aea2339ee230ccf9bf8..2c610fa7de303927b33e62d1b136399fdecafd93 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration.py @@ -35,6 +35,7 @@ from BTagging.BTaggingConfiguration_IP3DNegTag import * #from BTagging.BTaggingConfiguration_IP3DSpcPosTag import * #from BTagging.BTaggingConfiguration_IP3DSpcTag import * from BTagging.BTaggingConfiguration_IP3DTag import * +from BTagging.BTaggingConfiguration_RNNIPTag import * # Jet fitter taggers #from BTagging.BTaggingConfiguration_JetFitterCOMB import * @@ -84,7 +85,10 @@ from BTagging.BTaggingConfiguration_MV1FlipTag import * from BTagging.BTaggingConfiguration_MV1Tag import * #from BTagging.BTaggingConfiguration_MV2FlipTag import * #from BTagging.BTaggingConfiguration_MV2Tag import * -from BTagging.BTaggingConfiguration_Myc100Tag import * +from BTagging.BTaggingConfiguration_MV2c10muTag import * +from BTagging.BTaggingConfiguration_MV2c10muFlipTag import * +from BTagging.BTaggingConfiguration_MV2c10rnnTag import * +from BTagging.BTaggingConfiguration_MV2c10rnnFlipTag import * from BTagging.BTaggingConfiguration_MV1cTag import * from BTagging.BTaggingConfiguration_MV1cFlipTag import * from BTagging.BTaggingConfiguration_MV2c00Tag import * @@ -119,7 +123,7 @@ from BTagging.BTaggingConfiguration_DL1FlipTag import * # TagNtupleDumper from BTagging.BTaggingConfiguration_TagNtupleDumper import * -# Global dictionary keeping track of all tool collections +# Global dictionary keeping track of all tool collections _BTaggingConfig_ToolCollections = {} # We also need deepcopy here (for cloning metadata when cloning tools since these include nested dictionaries) @@ -165,7 +169,7 @@ def createConfiguration(name = ""): class Configuration: def __init__(self, name = ""): - + # Name of this configuration (default is empty) self._name = name @@ -181,10 +185,10 @@ class Configuration: self._OutputFilesBaseAuxNameJFSecVtx = BTaggingFlags.OutputFilesBaseAuxNameJFSecVtx # This dictionary keeps track of tools/taggers that have been initialized - # the key is the type of the tool, the value is the actual tool. All functions + # the key is the type of the tool, the value is the actual tool. All functions # that set up tools should add to this dictionary! self._BTaggingConfig_InitializedTools = {} - + # This dictionaries keeps track of all btagtools and other things for each jet collection. self._BTaggingConfig_JetCollections = {} self._BTaggingConfig_SecVtxTools = {} @@ -544,7 +548,7 @@ class Configuration: def registerTool(self, tool_type, tool, track = "", jetcol = "", ToolSvc = None, Verbose = False, MuonCollection='Muons', ElectronCollection='Electrons', PhotonCollection='Photons', CheckPrerequisites=False, CheckOnlyInsideToolCollection=False, DoNotSetUpParticleAssociators=False): """Registers a tool so it can be used in order to figure out dependencies. This should be called after a tool is configured. It automatically adds it to - ToolSvc if it is specified. + ToolSvc if it is specified. If ToolSvc is not specified prerequisites will not be set up and the tool will (obviously) not be added to ToolSvc. It will still be registered though and other @@ -640,7 +644,7 @@ class Configuration: for name in self._BTaggingConfig_InitializedTools: returnlist.append(name) return returnlist - + def getToolName(self, tool, track, jetcol): """Returns the name of the tool with the collections. This is used because some tools should not be replicated (so there should be one even if using multiple prefix chains. @@ -679,9 +683,9 @@ class Configuration: to_check = [tool_type,] required = [] while len(to_check) > 0: - needed = self.checkPrerequisitesOneLevel(to_check[len(to_check)-1], - IgnoreList=required, - TrackCollection=TrackCollection, + needed = self.checkPrerequisitesOneLevel(to_check[len(to_check)-1], + IgnoreList=required, + TrackCollection=TrackCollection, JetCollection=JetCollection, CheckOnlyInsideToolCollection=CheckOnlyInsideToolCollection) to_check.pop() @@ -772,7 +776,7 @@ class Configuration: if Verbose: print self.BTagTag()+' - DEBUG - Setting up '+required[r]+' for '+TrackCollection+' tracks and the '+JetCollection+' jet collection...' # Note that we do not check for prerequisites because we just did so - self.addTool(required[r], ToolSvc, TrackCollections=TrackCollection, + self.addTool(required[r], ToolSvc, TrackCollections=TrackCollection, JetCollections=JetCollection, CheckPrerequisites = False, Verbose = Verbose, MuonCollection=MuonCollection, ElectronCollection=ElectronCollection, PhotonCollection=PhotonCollection, DoNotSetUpParticleAssociators=DoNotSetUpParticleAssociators) @@ -895,9 +899,9 @@ class Configuration: tool = self.getTool(tool_type, TrackCollection = track, JetCollection = jetcol) if tool is None: # setup the tool - tool = self.setupDefaultTool(tool_type, ToolSvc, Verbose=Verbose, track=track, + tool = self.setupDefaultTool(tool_type, ToolSvc, Verbose=Verbose, track=track, jetcol=jetcol, name=name, options=options, - MuonCollection=MuonCollection, + MuonCollection=MuonCollection, ElectronCollection=ElectronCollection,PhotonCollection=PhotonCollection) # Now it exists; we need to add it to the required jet collection self.addToolToJetCollection(tool_type, tool, jetcol, track) @@ -1170,7 +1174,7 @@ class Configuration: if VertexFinderPassByPointer: for element in VertexFinderPassByPointer: ToPass = self._BTaggingConfig_InitializedTools.get(self.getToolName(VertexFinderPassByPointer[element],track,jetcol), None) - if ToPass is None: + if ToPass is None: print self.BTagTag()+' - ERROR - Tool of type '+VertexFinderPassByPointer[element]+' to be passed as pointer to tool of type '+tool_type+' to the SecVertexingTool' print self.BTagTag()+' - ERROR - but this tool was not found/registered.' raise ValueError @@ -1190,7 +1194,7 @@ class Configuration: def getJetCollectionMainAssociatorAttribute(self, attribute, JetCollection, RaiseException=True): """Returns an attribute of a main associator. Technically the same can be returned by first getting a reference - to the tool via a getJetCollectionMainAssociatorTool() call and then just accessing the attribute directly. + to the tool via a getJetCollectionMainAssociatorTool() call and then just accessing the attribute directly. However at some point getTool will only return a PublicToolHandle and its attributes cannot be retrieved. At that point this function can be useful. @@ -1288,12 +1292,12 @@ class Configuration: author = self.getOutputFilesPrefix() + JetCollection # Get correct name with prefix if not (self._OutputFilesBaseName + author) in BTaggingFlags.btaggingAODList: BTaggingFlags.btaggingAODList.append(self._OutputFilesBaseName + author) - if not (self._OutputFilesBaseAuxName + author + 'Aux.') in BTaggingFlags.btaggingAODList: - BTaggingFlags.btaggingAODList.append(self._OutputFilesBaseAuxName + author + 'Aux.') + if not (self._OutputFilesBaseAuxName + author + 'Aux.-BTagTrackToJetAssociatorBB') in BTaggingFlags.btaggingAODList: + BTaggingFlags.btaggingAODList.append(self._OutputFilesBaseAuxName + author + 'Aux.-BTagTrackToJetAssociatorBB') if not (self._OutputFilesBaseName + author) in BTaggingFlags.btaggingESDList: BTaggingFlags.btaggingESDList.append(self._OutputFilesBaseName + author) - if not (self._OutputFilesBaseAuxName + author + 'Aux.') in BTaggingFlags.btaggingESDList: - BTaggingFlags.btaggingESDList.append(self._OutputFilesBaseAuxName + author + 'Aux.') + if not (self._OutputFilesBaseAuxName + author + 'Aux.-BTagTrackToJetAssociatorBB') in BTaggingFlags.btaggingESDList: + BTaggingFlags.btaggingESDList.append(self._OutputFilesBaseAuxName + author + 'Aux.-BTagTrackToJetAssociatorBB') # SeCVert if not (self._OutputFilesBaseNameSecVtx + author + self._OutputFilesSVname) in BTaggingFlags.btaggingAODList: BTaggingFlags.btaggingAODList.append(self._OutputFilesBaseNameSecVtx + author + self._OutputFilesSVname) @@ -1316,7 +1320,7 @@ class Configuration: print(self.BTagTag()+" - DEBUG - Added jet collection '"+JetCollection+"' to BTaggingFlags.btaggingAODList and BTaggingFlags.btaggingESDList.") def addJetCollectionTool(self, JetCollection, ToolSvc, Verbose = False, options={}): - """Adds a jet collection, and sets up the corresponding BTagTool and secondary vertexing tools. + """Adds a jet collection, and sets up the corresponding BTagTool and secondary vertexing tools. If it already exists it is simply returned. input: JetCollection: The name of the jet collections. @@ -1390,7 +1394,7 @@ class Configuration: (note the options storeSecondaryVerticesInJet is passed to the removal tool instead) The following default options exist: - + BTagLabelingTool default: None storeSecondaryVerticesInJet default: BTaggingFlags.writeSecondaryVertices @@ -1448,7 +1452,7 @@ class Configuration: CheckPrerequisites: Whether to set up default prerequisites as well (if needed). Prefix: Prefix to be used for this tool and all tools set up by default. name: The name of the tool. If not specified a default name is used which - is a combination of the prefix and the tool type. Note that it is + is a combination of the prefix and the tool type. Note that it is generally ill-advised to choose your own name. The reason is that some prerequisite tools refer to other tools by-name and not via a pointer. It is possible to break things by forcing your own name. Only do so when @@ -1518,7 +1522,7 @@ class Configuration: for folder in CalibrationFolders: ToAdd = broker.folderRoot + folder if not ToAdd in broker.folders: - broker.folders.append(ToAdd) + broker.folders.append(ToAdd) # Set up the actual tool try: exec('tool = tool'+tool_type+'(**options)') @@ -1660,13 +1664,13 @@ def getToolCollectionSize(ToolCollection): return 0 def checkToolCollectionStructure(CheckTransToolCollectionDependencies = True): - """Computationally intensive function which does a check on on consistency of the tools. - If checks whether there are no tools that depend on themselves, whether all tool types - that a part of a tools PassByPointer metadata are also in its DependsOn metadata and whether - all tools mentioned in dependencies actually exist. + """Computationally intensive function which does a check on on consistency of the tools. + If checks whether there are no tools that depend on themselves, whether all tool types + that a part of a tools PassByPointer metadata are also in its DependsOn metadata and whether + all tools mentioned in dependencies actually exist. - If CheckTransToolCollectionDependencies is True then it will print warnings for every instance - where a tool from a tool collection depends on another tool from another tool collection whose + If CheckTransToolCollectionDependencies is True then it will print warnings for every instance + where a tool from a tool collection depends on another tool from another tool collection whose size is bigger than one.""" print '#BTAG# - DEBUG - Checking tool collection structure.' for tcoll in _BTaggingConfig_ToolCollections: @@ -1869,7 +1873,7 @@ def JetCollectionIsSupported(JetCollection): def toolMainBTaggingTool(name, useBTagFlagsDefaults = True, **options): """Sets up the main B-tagging tool and returns it. - + The following options have BTaggingFlags defaults: Runmodus default: BTaggingFlags.Runmodus diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_DL1Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_DL1Tag.py index e155ce016240c5d8f96f33b0fa01681699f5555c..a353ea62a8b3da7cc5ca8dae93cc035b969aa105 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_DL1Tag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_DL1Tag.py @@ -4,16 +4,20 @@ # Author: Marie Lanfermann (September 2015) from BTagging.BTaggingFlags import BTaggingFlags -metaDL1Tag = { 'IsATagger' : False,#True, - 'xAODBaseName' : 'DL1', + + +def buildDL1(basename): + + metaInstance = { 'IsATagger' : False, + 'xAODBaseName' : basename, 'DependsOn' : ['AtlasExtrapolator', 'BTagCalibrationBrokerTool', 'BTagTrackToVertexTool'], - 'CalibrationFolders' : ['DL1',], + 'CalibrationFolders' : [basename], 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, - 'ToolCollection' : 'DL1Tag'} + 'ToolCollection' : basename+'Tag'} -def toolDL1Tag(name, useBTagFlagsDefaults = True, **options): + def DL1Instance(name, useBTagFlagsDefaults = True, **options): """Sets up a DL1Tag tool and returns it. The following options have BTaggingFlags defaults: @@ -34,6 +38,7 @@ def toolDL1Tag(name, useBTagFlagsDefaults = True, **options): 'Runmodus' : BTaggingFlags.Runmodus, 'forceDL1CalibrationAlias' : BTaggingFlags.ForceDL1CalibrationAlias, 'DL1CalibAlias' : BTaggingFlags.DL1CalibAlias, + 'calibration_directory' : basename, } for option in defaults: options.setdefault(option, defaults[option]) @@ -41,3 +46,9 @@ def toolDL1Tag(name, useBTagFlagsDefaults = True, **options): options['LocalNNConfigurationFile'] = BTaggingFlags.DL1LocalNNConfig from JetTagTools.JetTagToolsConf import Analysis__DL1Tag return Analysis__DL1Tag(**options) + + return DL1Instance, metaInstance + +toolDL1muTag, metaDL1muTag = buildDL1("DL1mu") +toolDL1Tag, metaDL1Tag = buildDL1("DL1") +toolDL1rnnTag, metaDL1rnnTag = buildDL1("DL1rnn") \ No newline at end of file diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTag.py index 57ac2ecffb3eafca0ce2f75b278f0014b9bb1873..5942c63c430f1b2302e129ea725a2e6c816b2fff 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP2DTag.py @@ -77,6 +77,9 @@ def toolIP2DTag(name, useBTagFlagsDefaults = True, **options): 'unbiasIPEstimation' : False, 'UseCHypo' : True, 'SecVxFinderName' : 'SV1', + 'storeTrackParticles': True, + 'storeTrackParameters': True, + 'storeIpValues': False, } for option in defaults: options.setdefault(option, defaults[option]) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTag.py index 574d893acbf4ba02bc2ebbd56b666347266113ad..d479440a9e3329fa0e63ec8084bc3f587994af5f 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_IP3DTag.py @@ -86,6 +86,9 @@ def toolIP3DTag(name, useBTagFlagsDefaults = True, **options): #'trackAssociation' : "Tracks" } 'UseCHypo' : True, 'SecVxFinderName' : 'SV1', + 'storeTrackParameters': True, + 'storeTrackParticles': True, + 'storeIpValues': True } for option in defaults: options.setdefault(option, defaults[option]) @@ -93,71 +96,6 @@ def toolIP3DTag(name, useBTagFlagsDefaults = True, **options): from JetTagTools.JetTagToolsConf import Analysis__IPTag return Analysis__IPTag(**options) -metaRNNIPTag = {'IsATagger' : True, - 'xAODBaseName' : 'RNNIP', - 'CalibrationFolders' : ['RNNIP'], - 'DependsOn' : ['AtlasExtrapolator', - 'BTagCalibrationBrokerTool', - 'BTagTrackToVertexTool', - 'InDetVKalVxInJetTool', - 'BTagTrackToVertexIPEstimator', - 'IP3DTrackSelector', - 'InDetTrackSelector', - 'SpecialTrackAssociator', - 'SVForIPTool_IP3D', - 'IP3DBasicTrackGradeFactory', - 'IP3DDetailedTrackGradeFactory'], - 'PassByPointer' : {'SVForIPTool' : 'SVForIPTool_IP3D', - 'trackSelectorTool' : 'IP3DTrackSelector', - 'calibrationTool' : 'BTagCalibrationBrokerTool', - 'trackGradeFactory' : 'IP3DDetailedTrackGradeFactory', - 'TrackToVertexIPEstimator' : 'BTagTrackToVertexIPEstimator'}, - 'PassTracksAs' : 'trackAssociationName', - 'ToolCollection' : 'IP3DTag' } - -def toolRNNIPTag(name, useBTagFlagsDefaults = True, **options): - """Sets up a IP3DTag tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - trackGradePartitions default: [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ] - RejectBadTracks default: True - originalTPCollectionName default: BTaggingFlags.TrackParticleCollectionName - unbiasIPEstimation default: False (switch to true (better!) when creating new PDFs) - SecVxFinderName default: "SV1" - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - grades= [ "0HitIn0HitNInExp2","0HitIn0HitNInExpIn","0HitIn0HitNInExpNIn","0HitIn0HitNIn", - "0HitInExp", "0HitIn", - "0HitNInExp", "0HitNIn", - "InANDNInShared", "PixShared", "SctShared", - "InANDNInSplit", "PixSplit", - "Good"] - if btagrun1: grades=[ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ] - - defaults = { - 'OutputLevel' : BTaggingFlags.OutputLevel, - 'trackGradePartitions' : grades , - 'RejectBadTracks' : True, - 'originalTPCollectionName' : BTaggingFlags.TrackParticleCollectionName, - 'NetworkConfig' : BTaggingFlags.RNNIPConfig, - 'unbiasIPEstimation' : False, - #'trackAssociation' : "Tracks" } - 'SecVxFinderName' : 'SV1', - 'calibration_directory' : 'RNNIP', - 'writeInputsToBtagObject': BTaggingFlags.WriteRNNInputs - } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__RNNIPTag - return Analysis__RNNIPTag(**options) - #------------------------------------------------------------------ diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterCOMB.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterCOMB.py deleted file mode 100644 index 84ffb1e292e31ccf2ea355e4cd85f0dac3f753f1..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterCOMB.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# Configuration functions for JetFitterCOMB -# Author: Wouter van den Wollenberg (2013-2014) -from BTagging.BTaggingFlags import BTaggingFlags - -metaJetFitterCOMB = { 'IsATagger' : True, - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'JetFitterTag', - 'InDetVKalVxInJetTool', - 'BTagFullLinearizedTrackFactory', - 'BTagTrackToVertexIPEstimator', - 'IP3DTag'], - 'ToolCollection' : 'JetFitterCOMB' } - -def toolJetFitterCOMB(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterCOMB tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - combinedTagString default: "JetFitterCOMB" - listTaggers default: [ "JetFitterTag","IP3D" ] - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'combinedTagString' : 'JetFitterCOMB', - 'listTaggers' : [ "JetFitterTag","IP3D" ] } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__CombinerToolTag - return Analysis__CombinerToolTag(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTag.py deleted file mode 100644 index 6d36e3b33ff9c51b8427d5503e9145a9e988e3ce..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTag.py +++ /dev/null @@ -1,280 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# Configuration functions for JetFitterTag -# Author: Wouter van den Wollenberg (2013-2014) -from BTagging.BTaggingFlags import BTaggingFlags - -metaJetFitterTag = { 'IsATagger' : True, - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'JetFitterVxFinder', - 'JetFitterLikelihood', - 'JetFitterVariablesFactory', - 'JetFitterNtupleWriter'], - 'PassByPointer' : {'JetFitterVariablesFactory' : 'JetFitterVariablesFactory', - 'JetFitterLikelihood' : 'JetFitterLikelihood', - 'JetFitterNtupleWriter' : 'JetFitterNtupleWriter'}, - 'PassByName' : {'SecVxFinderName' : 'JetFitterVxFinder'}, - 'JetCollectionList' : 'jetCollectionList', - 'ToolCollection' : 'JetFitterTag' } - -def toolJetFitterTag(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterTag tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - Runmodus default: BTaggingFlags.Runmodus - jetCollectionList default: BTaggingFlags.Jets - SecVxFinderName default: "JetFitterVxFinder" - useForcedCalibration default: False - storeOnlyBaseObject default: False - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'Runmodus' : BTaggingFlags.Runmodus, - 'jetCollectionList' : BTaggingFlags.Jets, - 'SecVxFinderName' : 'JetFitterVxFinder', - 'useForcedCalibration' : False, - 'storeOnlyBaseObject' : False } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag - return Analysis__JetFitterTag(**options) - -#----------------------------------------------------------------------- - -metaJetFitterLikelihood = { 'CalibrationFolders' : ['JetFitter',], - 'DependsOn' : ['BTagCalibrationBrokerTool',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, - 'ToolCollection' : 'JetFitterTag' } - -def toolJetFitterLikelihood(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterLikelihood tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - CalibrationDirectory default: "JetFitter" - CalibrationSubDirectory default: "RooFitLikelihood" - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'CalibrationDirectory' : 'JetFitter', - 'CalibrationSubDirectory' : 'RooFitLikelihood' } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterLikelihood - return Analysis__JetFitterLikelihood(**options) - -#----------------------------------------------------------------------- - -metaJetFitterVariablesFactory = { 'PassByName' : {'JetFitterInstance' : 'JetFitterTag' }, - 'ToolCollection' : 'JetFitterTag' } - -def toolJetFitterVariablesFactory(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterVariablesFactory tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - JetFitterInstance default: "JetFitterTag" - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'JetFitterInstance' : 'JetFitterTag' } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory - return Analysis__JetFitterVariablesFactory(**options) - -#----------------------------------------------------------------------- - -metaJetFitterNtupleWriter = { 'ToolCollection' : 'JetFitterTag' } - -def toolJetFitterNtupleWriter(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterNtupleWriter tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterNtupleWriter - return Analysis__JetFitterNtupleWriter(**options) - -#----------------------------------------------------------------------- - -metaJetFitterRoutines = { 'DependsOn' : ['JetFitterInitializationHelper',], - 'PassByPointer' : {'JetFitterInitializationHelper' : 'JetFitterInitializationHelper'}, - 'ToolCollection' : 'JetFitterTag' } - -def toolJetFitterRoutines(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterRoutines tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - BeFast default: False - maxDRshift default: 0.0 - noPrimaryVertexRefit default: False - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'BeFast' : False, - 'maxDRshift' : 0.0, - 'noPrimaryVertexRefit' : False } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterRoutines - return Trk__JetFitterRoutines(**options) - -#----------------------------------------------------------------------- - -metaJetFitterInitializationHelper = { 'DependsOn' : ['JetFitterFullLinearizedTrackFactory',], - 'PassByPointer' : { 'LinearizedTrackFactory' : 'JetFitterFullLinearizedTrackFactory' }, - 'ToolCollection' : 'JetFitterTag' } - -def toolJetFitterInitializationHelper(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterInitializationHelper tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterInitializationHelper - return Trk__JetFitterInitializationHelper(**options) - -#----------------------------------------------------------------------- - -metaInDetJetFitterTrackSelectorTool = { 'DependsOn' : ['JetFitterExtrapolator',], - 'PassByPointer' : {'Extrapolator' : 'JetFitterExtrapolator' }, - 'ToolCollection' : 'JetFitterTag' } - -def toolInDetJetFitterTrackSelectorTool(name, useBTagFlagsDefaults = True, **options): - """Sets up a InDetJetFitterTrackSelectorTool tool and returns it. - - The following options have BTaggingFlags defaults: - - pTMin default: 769.2 - IPd0Max default: 3.5 - IPz0Max default: 5 - sigIPd0Max default: 0.35 - sigIPz0Max default: 2.5 - etaMax default: 9999.0 - useTrackSummaryInfo default: True - nHitBLayer default: 0 - nHitPix default: 1 - nHitSct default: 4 - nHitSi default: 7 - nHitTrt default: 0 - useSharedHitInfo default: False - useTrackQualityInfo default: True - fitChi2OnNdfMax default: 3.5 - TrackSummaryTool default: None - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'pTMin' : 769.2, - 'IPd0Max' : 3.5, - 'IPz0Max' : 5, - 'sigIPd0Max' : 0.35, - 'sigIPz0Max' : 2.5, - 'etaMax' : 9999.0, - 'useTrackSummaryInfo' : True, - 'nHitBLayer' : 0, - 'nHitPix' : 1, - 'nHitSct' : 4, - 'nHitSi' : 7, - 'nHitTrt' : 0, - 'useSharedHitInfo' : False, - 'useTrackQualityInfo' : True, - 'fitChi2OnNdfMax' : 3.5, - 'TrackSummaryTool' : None } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetDetailedTrackSelectorTool - return InDet__InDetDetailedTrackSelectorTool(**options) - -#----------------------------------------------------------------------- - -metaJetFitterVxFinder = { 'IsAVertexFinder' : True, - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'JetFitterExtrapolator', - 'InDetJetFitterTrackSelectorTool', - 'JetFitterInitializationHelper', - 'JetFitterRoutines', - 'JetFitterFullLinearizedTrackFactory'], - 'PassByPointer' : {'JetFitterInitializationHelper' : 'JetFitterInitializationHelper', - 'JetFitterRoutines' : 'JetFitterRoutines', - 'TrackSelector' : 'InDetJetFitterTrackSelectorTool' }, - 'ToolCollection' : 'JetFitterTag' } - -def toolJetFitterVxFinder(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterVxFinder tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - MaxNumDeleteIterations default: 30 - VertexProbCut default: 0.01 - MaxClusteringIterations default: 30 - VertexClusteringProbabilityCut default: 0.01 - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'MaxNumDeleteIterations' : 30, - 'VertexProbCut' : 0.01, - 'MaxClusteringIterations' : 30, - 'VertexClusteringProbabilityCut' : 0.01 } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetJetFitterVxFinder - return InDet__InDetJetFitterVxFinder(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagCOMBNN.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagCOMBNN.py deleted file mode 100644 index df98f88f79fece9e8fc0625bca50811a2f687a86..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagCOMBNN.py +++ /dev/null @@ -1,169 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# Configuration functions for JetFitterTagCOMBNN -# Author: Wouter van den Wollenberg (2013-2014) -from BTagging.BTaggingFlags import BTaggingFlags - -metaJetFitterTagCOMBNN = { 'IsATagger' : True, - 'xAODBaseName' : 'JetFitterCombNN', - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'JetFitterTagNN', - 'IP3DTag', - 'InDetVKalVxInJetTool', - 'BTagFullLinearizedTrackFactory', - 'BTagTrackToVertexIPEstimator', - 'JetFitterCOMBNNTool', - 'NeuralNetworkToHistoToolCOMBNN', -# 'JetFitterVariablesFactoryCOMBNN', - 'JetFitterNtupleWriterCOMBNN'], - 'PassByPointer' : { -# 'jetfitterVariablesFactory' : 'JetFitterVariablesFactoryCOMBNN', - 'jetfitterClassifier' : 'JetFitterCOMBNNTool', - 'jetfitterNtupleWriter' : 'JetFitterNtupleWriterCOMBNN'}, -# 'PassByName' : {'secVxFinderName' : 'NewJetFitterVxFinder' }, - 'JetCollectionList' : 'jetCollectionList', - 'ToolCollection' : 'JetFitterTagCOMBNN' } - -def toolJetFitterTagCOMBNN(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterTagCOMBNN tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - Runmodus default: BTaggingFlags.Runmodus - jetCollectionList default: BTaggingFlags.Jets - SecVxFinderName default: "JetFitter" - useForcedCalibration default: False - ipinfoTaggerName default: "IP3D" - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'Runmodus' : BTaggingFlags.Runmodus, - 'jetCollectionList' : BTaggingFlags.Jets, - 'SecVxFinderName' : 'JetFitter', - 'useForcedCalibration' : False, -# 'supplementalTaggers' : ['IP3D'], -# 'storeOnlyBaseObject' : True } - 'ipinfoTaggerName' : 'IP3D', - } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag - return Analysis__JetFitterTag(**options) - -#----------------------------------------------------------------------------- - -metaJetFitterCOMBNNTool = { 'CalibrationFolders' : ['JetFitter',], - 'DependsOn' : ['NeuralNetworkToHistoToolCOMBNN', - 'BTagCalibrationBrokerTool'], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool', - 'NeuralNetworkToHistoTool' : 'NeuralNetworkToHistoToolCOMBNN'}, - 'ToolCollection' : 'JetFitterTagCOMBNN' } - -def toolJetFitterCOMBNNTool(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterCOMBNNTool tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - CalibrationDirectory default: "JetFitter" - CalibrationSubDirectory default: "NeuralNetwork" - useCombinedIPNN default: True - usePtCorrectedMass default: True - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'CalibrationDirectory' : 'JetFitter', - 'CalibrationSubDirectory' : 'NeuralNetwork', - 'useCombinedIPNN' : True, - 'usePtCorrectedMass' : True } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterNNTool - return Analysis__JetFitterNNTool(**options) - -#----------------------------------------------------------------------------- - -metaNeuralNetworkToHistoToolCOMBNN = { 'ToolCollection' : 'JetFitterTagCOMBNN' } - -def toolNeuralNetworkToHistoToolCOMBNN(name, useBTagFlagsDefaults = True, **options): - """Sets up a NeuralNetworkToHistoToolCOMBNN tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from TrkNeuralNetworkUtils.TrkNeuralNetworkUtilsConf import Trk__NeuralNetworkToHistoTool - return Trk__NeuralNetworkToHistoTool(**options) - -#----------------------------------------------------------------------------- - -metaJetFitterVariablesFactoryCOMBNN = { 'PassByName' : {'JetFitterInstance' : 'JetFitterTagCOMBNN'}, - 'ToolCollection' : 'JetFitterTagCOMBNN' } - -def toolJetFitterVariablesFactoryCOMBNN(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterVariablesFactoryCOMBNN tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - JetFitterInstance default: "JetFitterTagCOMBNN" - usePtCorrectedMass default: True - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'JetFitterInstance' : 'JetFitterTagCOMBNN', - 'usePtCorrectedMass' : True } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory - return Analysis__JetFitterVariablesFactory(**options) - -#----------------------------------------------------------------------------- - -metaJetFitterNtupleWriterCOMBNN = { 'ToolCollection' : 'JetFitterTagCOMBNN' } - -def toolJetFitterNtupleWriterCOMBNN(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterNtupleWriterCOMBNN tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterNtupleWriter - return Analysis__JetFitterNtupleWriter(**options) - diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagCOMBNNIP3DNeg.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagCOMBNNIP3DNeg.py deleted file mode 100644 index f854de843de43df1f46edd9331d5ee1a3f86f698..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagCOMBNNIP3DNeg.py +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# Configuration functions for JetFitterTagCOMBNNIP3DNeg -# Author: Wouter van den Wollenberg (2013-2014) -from BTagging.BTaggingFlags import BTaggingFlags - -metaJetFitterTagCOMBNNIP3DNeg = { 'IsATagger' : True, - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'JetFitterTagNNFlip', - 'IP3DNegTag', - 'JetFitterCOMBNNTool', - 'NeuralNetworkToHistoToolCOMBNN', - 'JetFitterVariablesFactoryCOMBNNIP3DNeg', - 'JetFitterNtupleWriterCOMBNN'], - 'PassByPointer' : {'jetfitterVariablesFactory' : 'JetFitterVariablesFactoryCOMBNNIP3DNeg', - 'jetfitterClassifier' : 'JetFitterCOMBNNTool', - 'jetfitterNtupleWriter' : 'JetFitterNtupleWriterCOMBNN'}, - 'PassByName' : {'secVxFinderName' : 'NewJetFitterVxFinderFlip'}, - 'JetCollectionList' : 'jetCollectionList', - 'ToolCollection' : 'JetFitterTagCOMBNNIP3DNeg' } - -def toolJetFitterTagCOMBNNIP3DNeg(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterTagCOMBNNIP3DNeg tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - Runmodus default: BTaggingFlags.Runmodus - jetCollectionList default: BTaggingFlags.Jets - secVxFinderName default: "NewJetFitterVxFinderFlip" - useForcedCalibration default: False - storeOnlyBaseObject default: True - useNN default: True - useNNWithIP3D default: True - IP3DinfoName default: "IP3DNeg" - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'Runmodus' : BTaggingFlags.Runmodus, - 'jetCollectionList' : BTaggingFlags.Jets, - 'secVxFinderName' : 'NewJetFitterVxFinderFlip', - 'useForcedCalibration' : False, - 'storeOnlyBaseObject' : True, - 'useNN' : True, - 'useNNWithIP3D' : True, - 'IP3DinfoName' : 'IP3DNeg' } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag - return Analysis__JetFitterTag(**options) - -#------------------------------------------------------------------------------------ - -metaJetFitterVariablesFactoryCOMBNNIP3DNeg = { 'PassByName' : {'JetFitterInstance' : 'JetFitterTagCOMBNNIP3DNeg'}, - 'ToolCollection' : 'JetFitterTagCOMBNNIP3DNeg' } - -def toolJetFitterVariablesFactoryCOMBNNIP3DNeg(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterVariablesFactoryCOMBNNIP3DNeg tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - JetFitterInstance default: "JetFitterTagCOMBNNIP3DNeg" - usePtCorrectedMass default: True - revertFromPositiveToNegativeTags default: True - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'JetFitterInstance' : 'JetFitterTagCOMBNNIP3DNeg', - 'usePtCorrectedMass' : True, - 'revertFromPositiveToNegativeTags' : True } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory - return Analysis__JetFitterVariablesFactory(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagCOMBNNIP3DPos.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagCOMBNNIP3DPos.py deleted file mode 100644 index 62f53dbb81af6c2a859abc71cf33f43a60a9ee8f..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagCOMBNNIP3DPos.py +++ /dev/null @@ -1,86 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# Configuration functions for JetFitterTagCOMBNNIP3DPos -# Author: Wouter van den Wollenberg (2013-2014) -from BTagging.BTaggingFlags import BTaggingFlags - -metaJetFitterTagCOMBNNIP3DPos = { 'IsATagger' : True, - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'JetFitterTagNNFlip', - 'IP3DPosTag', - 'JetFitterCOMBNNTool', - 'NeuralNetworkToHistoToolCOMBNN', - 'JetFitterVariablesFactoryCOMBNNIP3DPos', - 'JetFitterNtupleWriterCOMBNN'], - 'PassByPointer' : {'jetfitterVariablesFactory' : 'JetFitterVariablesFactoryCOMBNNIP3DPos', - 'jetfitterClassifier' : 'JetFitterCOMBNNTool', - 'jetfitterNtupleWriter' : 'JetFitterNtupleWriterCOMBNN'}, - 'PassByName' : {'secVxFinderName' : 'NewJetFitterVxFinderFlip'}, - 'JetCollectionList' : 'jetCollectionList', - 'ToolCollection' : 'JetFitterTagCOMBNNIP3DPos' } - -def toolJetFitterTagCOMBNNIP3DPos(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterTagCOMBNNIP3DPos tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - Runmodus default: BTaggingFlags.Runmodus - jetCollectionList default: BTaggingFlags.Jets - secVxFinderName default: "NewJetFitterVxFinderFlip" - useForcedCalibration default: False - storeOnlyBaseObject default: True - useNN default: True - useNNWithIP3D default: True - IP3DinfoName default: "IP3DPos" - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'Runmodus' : BTaggingFlags.Runmodus, - 'jetCollectionList' : BTaggingFlags.Jets, - 'secVxFinderName' : 'NewJetFitterVxFinderFlip', - 'useForcedCalibration' : False, - 'storeOnlyBaseObject' : True, - 'useNN' : True, - 'useNNWithIP3D' : True, - 'IP3DinfoName' : 'IP3DPos' } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag - return Analysis__JetFitterTag(**options) - -#------------------------------------------------------------------------------------ - -metaJetFitterVariablesFactoryCOMBNNIP3DPos = { 'PassByName' : {'JetFitterInstance' : 'JetFitterTagCOMBNNIP3DPos'}, - 'ToolCollection' : 'JetFitterTagCOMBNNIP3DPos' } - -def toolJetFitterVariablesFactoryCOMBNNIP3DPos(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterVariablesFactoryCOMBNNIP3DPos tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - JetFitterInstance default: "JetFitterTagCOMBNNIP3DPos" - usePtCorrectedMass default: True - revertFromPositiveToNegativeTags default: True - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'JetFitterInstance' : 'JetFitterTagCOMBNNIP3DPos', - 'usePtCorrectedMass' : True, - 'revertFromPositiveToNegativeTags' : True } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory - return Analysis__JetFitterVariablesFactory(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagNN.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagNN.py deleted file mode 100644 index 32386c6bdfd4a451ab9bfaba92c56fee2ad4d764..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagNN.py +++ /dev/null @@ -1,166 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# Configuration functions for JetFitterTagNN -# Author: Wouter van den Wollenberg (2013-2014) -from BTagging.BTaggingFlags import BTaggingFlags - -metaJetFitterTagNN = { 'IsATagger' : True, - 'xAODBaseName' : 'JetFitter', - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'NewJetFitterVxFinder', - 'JetFitterNNTool', - 'NeuralNetworkToHistoToolNN', -# 'JetFitterVariablesFactoryNN', - 'JetFitterNtupleWriterNN'], - 'PassByPointer' : { -# 'jetfitterVariablesFactory' : 'JetFitterVariablesFactoryNN', - 'jetfitterClassifier' : 'JetFitterNNTool', - 'jetfitterNtupleWriter' : 'JetFitterNtupleWriterNN' }, -# 'PassByName' : {'secVxFinderName' : 'NewJetFitterVxFinder'}, - 'JetCollectionList' : 'jetCollectionList', - 'ToolCollection' : 'JetFitterTagNN' } - -def toolJetFitterTagNN(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterTagNN tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - Runmodus default: BTaggingFlags.Runmodus - jetCollectionList default: BTaggingFlags.Jets - SecVxFinderName default: "JetFitter" - useForcedCalibration default: False - ipinfoTaggerName default: "" - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'Runmodus' : BTaggingFlags.Runmodus, - 'jetCollectionList' : BTaggingFlags.Jets, - 'SecVxFinderName' : 'JetFitter', - 'useForcedCalibration' : False, -# 'supplementalTaggers' : [], -# 'storeOnlyBaseObject' : True, - 'ipinfoTaggerName' : "", - } -# if not BTaggingFlags.JetFitterTag: -# defaults['storeOnlyBaseObject'] = False - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag - return Analysis__JetFitterTag(**options) - -#------------------------------------------------------------------------- - -metaJetFitterNNTool = { 'CalibrationFolders' : ['JetFitter',], - 'DependsOn' : ['NeuralNetworkToHistoToolNN', - 'BTagCalibrationBrokerTool'], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool', - 'NeuralNetworkToHistoTool' : 'NeuralNetworkToHistoToolNN'}, - 'ToolCollection' : 'JetFitterTagNN' } - -def toolJetFitterNNTool(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterNNTool tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - CalibrationDirectory default: "JetFitter" - CalibrationSubDirectory default: "NeuralNetwork" - useCombinedIPNN default: False - usePtCorrectedMass default: True - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'CalibrationDirectory' : 'JetFitter', - 'CalibrationSubDirectory' : 'NeuralNetwork', - 'useCombinedIPNN' : False, - 'usePtCorrectedMass' : True, } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterNNTool - return Analysis__JetFitterNNTool(**options) - -#------------------------------------------------------------------------- - -metaNeuralNetworkToHistoToolNN = { 'ToolCollection' : 'JetFitterTagNN' } - -def toolNeuralNetworkToHistoToolNN(name, useBTagFlagsDefaults = True, **options): - """Sets up a NeuralNetworkToHistoToolNN tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from TrkNeuralNetworkUtils.TrkNeuralNetworkUtilsConf import Trk__NeuralNetworkToHistoTool - return Trk__NeuralNetworkToHistoTool(**options) - -#------------------------------------------------------------------------- - -metaJetFitterVariablesFactoryNN = { 'PassByName' : {'JetFitterInstance' : 'JetFitterTagNN'}, - 'ToolCollection' : 'JetFitterTagNN' } - -def toolJetFitterVariablesFactoryNN(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterVariablesFactoryNN tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - JetFitterInstance default: "JetFitterTagNN" - usePtCorrectedMass default: True - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'JetFitterInstance' : 'JetFitterTagNN', - 'usePtCorrectedMass' : True } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory - return Analysis__JetFitterVariablesFactory(**options) - -#------------------------------------------------------------------------- - -metaJetFitterNtupleWriterNN = { 'ToolCollection' : 'JetFitterTagNN' } - -def toolJetFitterNtupleWriterNN(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterNtupleWriterNN tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterNtupleWriter - return Analysis__JetFitterNtupleWriter(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagNNFlip.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagNNFlip.py deleted file mode 100644 index b34ead9edb110711b3c6c12189744b14b09595b2..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_JetFitterTagNNFlip.py +++ /dev/null @@ -1,85 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# Configuration functions for JetFitterTagNNFlip -# Author: Wouter van den Wollenberg (2013-2014) -from BTagging.BTaggingFlags import BTaggingFlags - -metaJetFitterTagNNFlip = { 'IsATagger' : True, - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'NewJetFitterVxFinderFlip', - 'JetFitterNNTool', - 'NeuralNetworkToHistoToolNN', - 'JetFitterVariablesFactoryNNFlip', - 'JetFitterNtupleWriterNN'], - 'PassByPointer' : {'jetfitterVariablesFactory' : 'JetFitterVariablesFactoryNNFlip', - 'jetfitterClassifier' : 'JetFitterNNTool', - 'jetfitterNtupleWriter' : 'JetFitterNtupleWriterNN'}, - 'PassByName' : {'secVxFinderName' : 'NewJetFitterVxFinderFlip'}, - 'JetCollectionList' : 'jetCollectionList', - 'ToolCollection' : 'JetFitterTagNNFlip' } - -def toolJetFitterTagNNFlip(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterTagNNFlip tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - Runmodus default: BTaggingFlags.Runmodus - jetCollectionList default: BTaggingFlags.Jets - secVxFinderName default: "NewJetFitterVxFinderFlip" - useForcedCalibration default: False - storeOnlyBaseObject default: True (False if not BTaggingFlags.JetFitterTag) - useNN default: True - useNNWithIP3D default: False - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'Runmodus' : BTaggingFlags.Runmodus, - 'jetCollectionList' : BTaggingFlags.Jets, - 'secVxFinderName' : 'NewJetFitterVxFinderFlip', - 'useForcedCalibration' : False, - 'storeOnlyBaseObject' : True, - 'useNN' : True, - 'useNNWithIP3D' : False } - if not BTaggingFlags.JetFitterTag: - defaults['storeOnlyBaseObject'] = False - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag - return Analysis__JetFitterTag(**options) - -#----------------------------------------------------------------------------- - -metaJetFitterVariablesFactoryNNFlip = { 'PassByName' : {'JetFitterInstance' : 'JetFitterTagNNFlip'}, - 'ToolCollection' : 'JetFitterTagNNFlip' } - -def toolJetFitterVariablesFactoryNNFlip(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterVariablesFactoryNNFlip tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - JetFitterInstance default: "JetFitterTagNNFlip" - usePtCorrectedMass default: True - revertFromPositiveToNegativeTags default: True - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'JetFitterInstance' : 'JetFitterTagNNFlip', - 'usePtCorrectedMass' : True, - 'revertFromPositiveToNegativeTags' : True } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory - return Analysis__JetFitterVariablesFactory(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py index e13d21e409907c5aae13958875b35682c4c32d11..fe3a9a0e8b7d5435e71d037226a13250597b017e 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_LoadTools.py @@ -49,6 +49,14 @@ def Initiate(ConfInstance=None): BTaggingFlags.JetFitterNN=True BTaggingFlags.SV2 =True BTaggingFlags.JetVertexCharge=False + BTaggingFlags.SoftMu=False + BTaggingFlags.MV2c10mu=False + BTaggingFlags.MV2c10rnn=False + BTaggingFlags.MV2cl100=False + BTaggingFlags.RNNIP=False + BTaggingFlags.DL1=False + BTaggingFlags.DL1mu=False + BTaggingFlags.DL1rnn=False else: print ConfInstance.BTagTag()+' - INFO - Setting up Run 2 configuration' @@ -396,8 +404,9 @@ def SetupJetCollectionDefault(JetCollection, TaggerList, ConfInstance = None): # addTool('NewJetFitterCOMB', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) if 'JetFitterNN' in TaggerList: ConfInstance.addTool('JetFitterTagNN', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - if 'IP3D' in TaggerList: - ConfInstance.addTool('JetFitterTagCOMBNN', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + + if 'JetFitterCOMBNN' in TaggerList: + ConfInstance.addTool('JetFitterTagCOMBNN', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) # if BTaggingFlags.JetFitterTagFlip: # addTool('NewJetFitterTagFlip', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) @@ -418,7 +427,10 @@ def SetupJetCollectionDefault(JetCollection, TaggerList, ConfInstance = None): #MultivariateTagManager if (set(['DL1','MV2c00','MV2c10','MV2c20','MV2c100','MV2cl100','MV2m']) & set(TaggerList)): MVTM = ConfInstance.addTool('MultivariateTagManager', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - MVTM.arbitraryAuxData = BTaggingFlags.MultivariateTagManagerAuxBranches + if 'RNNIP' in TaggerList: + MVTM.arbitraryAuxData = BTaggingFlags.MultivariateTagManagerAuxBranches + else: + MVTM.arbitraryAuxData=[] if (set(['DL1Flip','MV2c00Flip','MV2c10Flip','MV2c20Flip','MV2c100Flip','MV2cl100Flip','MV2mFlip']) & set(TaggerList)): MVTMFlip = ConfInstance.addTool('MultivariateFlipTagManager', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) @@ -446,6 +458,18 @@ def SetupJetCollectionDefault(JetCollection, TaggerList, ConfInstance = None): if 'MV2c10Flip' in TaggerList: tag = ConfInstance.addTool('MV2c10FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTMFlip.MVTagToolList += [tag,] + if 'MV2c10mu' in TaggerList: + tag = ConfInstance.addTool('MV2c10muTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTM.MVTagToolList += [tag,] + if 'MV2c10muFlip' in TaggerList: + tag = ConfInstance.addTool('MV2c10muFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTMFlip.MVTagToolList += [tag,] + if 'MV2c10rnn' in TaggerList: + tag = ConfInstance.addTool('MV2c10rnnTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTM.MVTagToolList += [tag,] + if 'MV2c10rnnFlip' in TaggerList: + tag = ConfInstance.addTool('MV2c10rnnFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTMFlip.MVTagToolList += [tag,] if 'MV2c20' in TaggerList: tag = ConfInstance.addTool('MV2c20Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTM.MVTagToolList += [tag,] @@ -455,9 +479,6 @@ def SetupJetCollectionDefault(JetCollection, TaggerList, ConfInstance = None): if 'MV2c100' in TaggerList: tag = ConfInstance.addTool('MV2c100Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTM.MVTagToolList += [tag,] - if 'Myc100' in TaggerList: - tag = ConfInstance.addTool('Myc100Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - MVTM.MVTagToolList += [tag,] if 'MV2c100Flip' in TaggerList: tag = ConfInstance.addTool('MV2c100FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTMFlip.MVTagToolList += [tag,] @@ -486,9 +507,20 @@ def SetupJetCollectionDefault(JetCollection, TaggerList, ConfInstance = None): tag = ConfInstance.addTool('DL1Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTM.MVTagToolList += [tag,] if 'DL1Flip'in TaggerList: -# obj = ConfInstance.addTool('MultivariateFlipTagManager', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) tag = ConfInstance.addTool('DL1FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTMFlip.MVTagToolList += [tag,] + if 'DL1mu' in TaggerList: + tag = ConfInstance.addTool('DL1muTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTM.MVTagToolList += [tag,] + if 'DL1muFlip'in TaggerList: + tag = ConfInstance.addTool('DL1muFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTMFlip.MVTagToolList += [tag,] + if 'DL1rnn' in TaggerList: + tag = ConfInstance.addTool('DL1rnnTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTM.MVTagToolList += [tag,] + if 'DL1rnnFlip'in TaggerList: + tag = ConfInstance.addTool('DL1rnnFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTMFlip.MVTagToolList += [tag,] if 'TagNtupleDumper' in TaggerList: tag = ConfInstance.addTool('TagNtupleDumper', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTM.MVTagToolList.append(tag) @@ -604,7 +636,10 @@ def SetupJetCollectionRetag(JetCollection, TaggerList, ConfInstance = None): if (set(['DL1','MV2c00','MV2c10','MV2c20','MV2c100','MV2cl100','MV2m']) & set(TaggerList)): MVTM = ConfInstance.addTool('MultivariateTagManager', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - MVTM.arbitraryAuxData = BTaggingFlags.MultivariateTagManagerAuxBranches + if 'RNNIP' in TaggerList: + MVTM.arbitraryAuxData = BTaggingFlags.MultivariateTagManagerAuxBranches + else: + MVTM.arbitraryAuxData=[] if (set(['DL1Flip','MV2c00Flip','MV2c10Flip','MV2c20Flip','MV2c100Flip','MV2cl100Flip','MV2mFlip']) & set(TaggerList)): MVTMFlip = ConfInstance.addTool('MultivariateFlipTagManager', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) @@ -627,42 +662,40 @@ def SetupJetCollectionRetag(JetCollection, TaggerList, ConfInstance = None): if 'MV2c10Flip' in TaggerList: tag = ConfInstance.addTool('MV2c10FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTMFlip.MVTagToolList += [tag,] - #ConfInstance.addTool('MV2c10FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3, - # CheckOnlyInsideToolCollection=True, DoNotSetUpParticleAssociators=True) + if 'MV2c10mu' in TaggerList: + tag = ConfInstance.addTool('MV2c10muTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3, + CheckOnlyInsideToolCollection=True, DoNotSetUpParticleAssociators=True) + MVTM.MVTagToolList += [tag,] + if 'MV2c10muFlip' in TaggerList: + tag = ConfInstance.addTool('MV2c10muFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3, + CheckOnlyInsideToolCollection=True, DoNotSetUpParticleAssociators=True) + MVTMFlip.MVTagToolList += [tag,] + if 'MV2c10rnn' in TaggerList: + tag = ConfInstance.addTool('MV2c10rnnTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3, + CheckOnlyInsideToolCollection=True, DoNotSetUpParticleAssociators=True) + MVTM.MVTagToolList += [tag,] + if 'MV2c10rnnFlip' in TaggerList: + tag = ConfInstance.addTool('MV2c10rnnFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3, + CheckOnlyInsideToolCollection=True, DoNotSetUpParticleAssociators=True) + MVTMFlip.MVTagToolList += [tag,] if 'MV2c10hp' in TaggerList: tag = ConfInstance.addTool('MV2c10hpTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTM.MVTagToolList += [tag,] - #ConfInstance.addTool('MV2c10hpTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3, - # CheckOnlyInsideToolCollection=True, DoNotSetUpParticleAssociators=True) if 'MV2c10hpFlip' in TaggerList: tag = ConfInstance.addTool('MV2c10hpFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTMFlip.MVTagToolList += [tag,] - #ConfInstance.addTool('MV2c10hpFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3, - # CheckOnlyInsideToolCollection=True, DoNotSetUpParticleAssociators=True) if 'MV2c20' in TaggerList: tag = ConfInstance.addTool('MV2c20Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTM.MVTagToolList += [tag,] - #ConfInstance.addTool('MV2c20Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3, - # CheckOnlyInsideToolCollection=True, DoNotSetUpParticleAssociators=True) if 'MV2c20Flip' in TaggerList: tag = ConfInstance.addTool('MV2c20FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTMFlip.MVTagToolList += [tag,] - #ConfInstance.addTool('MV2c20FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3, - # CheckOnlyInsideToolCollection=True, DoNotSetUpParticleAssociators=True) if 'MV2c100' in TaggerList: tag = ConfInstance.addTool('MV2c100Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTM.MVTagToolList += [tag,] - #ConfInstance.addTool('MV2c100Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3, - # CheckOnlyInsideToolCollection=True, DoNotSetUpParticleAssociators=True) - if 'Myc100' in TaggerList: - tag = ConfInstance.addTool('Myc100Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3, - CheckOnlyInsideToolCollection=True, DoNotSetUpParticleAssociators=True) - MVTMFlip.MVTagToolList += [tag,] if 'MV2c100Flip' in TaggerList: tag = ConfInstance.addTool('MV2c100FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTMFlip.MVTagToolList += [tag,] - #ConfInstance.addTool('MV2c100FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3, - # CheckOnlyInsideToolCollection=True, DoNotSetUpParticleAssociators=True) if 'MV2cl100' in TaggerList: tag = ConfInstance.addTool('MV2cl100Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTM.MVTagToolList += [tag,] @@ -693,7 +726,18 @@ def SetupJetCollectionRetag(JetCollection, TaggerList, ConfInstance = None): if 'DL1Flip'in TaggerList: tag = ConfInstance.addTool('DL1FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTMFlip.MVTagToolList += [tag,] - + if 'DL1mu' in TaggerList: + tag = ConfInstance.addTool('DL1muTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTM.MVTagToolList += [tag,] + if 'DL1muFlip'in TaggerList: + tag = ConfInstance.addTool('DL1muFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTMFlip.MVTagToolList += [tag,] + if 'DL1rnn' in TaggerList: + tag = ConfInstance.addTool('DL1rnnTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTM.MVTagToolList += [tag,] + if 'DL1rnnFlip'in TaggerList: + tag = ConfInstance.addTool('DL1rnnFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTMFlip.MVTagToolList += [tag,] if BTaggingFlags.OutputLevel < 3: ConfInstance.printAllTools() # NOTE: Printing all tools might be excessive; however the adding of future tools might affect the earlier ones; so printing @@ -775,8 +819,9 @@ def SetupJetCollectionTrig(JetCollection, TaggerList, ConfInstance = None): if 'JetFitterNN' in TaggerList: ConfInstance.addTool('JetFitterTagNN', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) - if 'IP3D' in TaggerList: - ConfInstance.addTool('JetFitterTagCOMBNN', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + + if 'JetFitterCOMBNN' in TaggerList: + ConfInstance.addTool('JetFitterTagCOMBNN', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) if 'JetFitterNNFlip' in TaggerList: ConfInstance.addTool('JetFitterTagNNFlip', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) @@ -807,6 +852,18 @@ def SetupJetCollectionTrig(JetCollection, TaggerList, ConfInstance = None): if 'MV2c10Flip' in TaggerList: tag = ConfInstance.addTool('MV2c10FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTMFlip.MVTagToolList += [tag,] + if 'MV2c10mu' in TaggerList: + tag = ConfInstance.addTool('MV2c10muTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTM.MVTagToolList += [tag,] + if 'MV2c10muFlip' in TaggerList: + tag = ConfInstance.addTool('MV2c10muFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTMFlip.MVTagToolList += [tag,] + if 'MV2c10rnn' in TaggerList: + tag = ConfInstance.addTool('MV2c10rnnTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTM.MVTagToolList += [tag,] + if 'MV2c10rnnFlip' in TaggerList: + tag = ConfInstance.addTool('MV2c10rnnFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTMFlip.MVTagToolList += [tag,] if 'MV2c20' in TaggerList: tag = ConfInstance.addTool('MV2c20Tag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTM.MVTagToolList += [tag,] @@ -837,6 +894,18 @@ def SetupJetCollectionTrig(JetCollection, TaggerList, ConfInstance = None): if 'DL1Flip'in TaggerList: tag = ConfInstance.addTool('DL1FlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) MVTMFlip.MVTagToolList += [tag,] + if 'DL1mu' in TaggerList: + tag = ConfInstance.addTool('DL1muTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTM.MVTagToolList += [tag,] + if 'DL1muFlip'in TaggerList: + tag = ConfInstance.addTool('DL1muFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTMFlip.MVTagToolList += [tag,] + if 'DL1rnn' in TaggerList: + tag = ConfInstance.addTool('DL1rnnTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTM.MVTagToolList += [tag,] + if 'DL1rnnFlip'in TaggerList: + tag = ConfInstance.addTool('DL1rnnFlipTag', ToolSvc, 'BTagTrackToJetAssociator', JetCollection, Verbose = BTaggingFlags.OutputLevel < 3) + MVTMFlip.MVTagToolList += [tag,] if BTaggingFlags.OutputLevel < 3: ConfInstance.printAllTools() diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2Tag.py index 993a54e554f16ee621ff086f780a7aeeb36b053d..473cfc3840be6ad27cba62971136ff7200252273 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2Tag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2Tag.py @@ -37,5 +37,5 @@ def toolMV2Tag(name, useBTagFlagsDefaults = True, **options): for option in defaults: options.setdefault(option, defaults[option]) options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__MV1Tag - return Analysis__MV1Tag(**options) + from JetTagTools.JetTagToolsConf import Analysis__MV2Tag + return Analysis__MV2Tag(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10muFlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10muFlipTag.py new file mode 100644 index 0000000000000000000000000000000000000000..1c882e778bc9dffc0a85e4fcf9200ce7d66d8d47 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10muFlipTag.py @@ -0,0 +1,50 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +# Configuration functions for MV2c10muFlipTag +# Author: Wouter van den Wollenberg (2013-2014) +from BTagging.BTaggingFlags import BTaggingFlags + +metaMV2c10muFlipTag = { 'IsATagger' : False,#True, + 'xAODBaseName' : 'MV2c10muFlip', + 'DependsOn' : ['AtlasExtrapolator', + 'BTagCalibrationBrokerTool', + 'SoftMuonTag', + 'BTagTrackToVertexTool'], + 'CalibrationFolders' : ['MV2c10mu',], + 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, + 'ToolCollection' : 'MV2c10muFlipTag'} + +def toolMV2c10muFlipTag(name, useBTagFlagsDefaults = True, **options): + """Sets up a MV2c10muTag tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + Runmodus default: BTaggingFlags.Runmodus + taggerName default: "MV2c10muFlip" + taggerNameBase default: "MV2c10mu" + forceMV2CalibrationAlias default: BTaggingFlags.ForceMV2CalibrationAlias + MV2CalibAlias default: BTaggingFlags.MV2CalibAlias + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + from BTagging.MV2defaultValues import default_values + from BTagging.MV2defaultValues import MVTM_varNames + + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'Runmodus' : BTaggingFlags.Runmodus, + 'taggerName' : 'MV2c10muFlip', + 'taggerNameBase' : 'MV2c10mu', + 'forceMV2CalibrationAlias' : BTaggingFlags.ForceMV2CalibrationAlias, + 'MV2CalibAlias' : BTaggingFlags.MV2CalibAlias, + 'defaultvals' : default_values, + 'MVTMvariableNames' : MVTM_varNames, + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__MV2Tag + return Analysis__MV2Tag(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_Myc100Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10muTag.py similarity index 76% rename from PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_Myc100Tag.py rename to PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10muTag.py index 9508bee322b74691f72d5c07d61726968251eb9b..f42f031341c1b163969049d945b2f5bc313bd447 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_Myc100Tag.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10muTag.py @@ -1,10 +1,10 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -# Configuration functions for Myc100Tag +# Configuration functions for MV2c10mu (MV2 variant with softmuon variables) # Author: Wouter van den Wollenberg (2013-2014) from BTagging.BTaggingFlags import BTaggingFlags -metaMyc100Tag = { 'IsATagger' : False,#True, +metaMV2c10muTag = { 'IsATagger' : False,#True, 'xAODBaseName' : 'MV2c10mu', 'DependsOn' : ['AtlasExtrapolator', 'BTagCalibrationBrokerTool', @@ -12,10 +12,10 @@ metaMyc100Tag = { 'IsATagger' : False,#True, 'BTagTrackToVertexTool'], 'CalibrationFolders' : ['MV2c10mu',], 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, - 'ToolCollection' : 'Myc100Tag'} + 'ToolCollection' : 'MV2c10muTag'} -def toolMyc100Tag(name, useBTagFlagsDefaults = True, **options): - """Sets up a Myc100Tag tool and returns it. +def toolMV2c10muTag(name, useBTagFlagsDefaults = True, **options): + """Sets up a MV2c10muTag tool and returns it. The following options have BTaggingFlags defaults: @@ -30,6 +30,9 @@ def toolMyc100Tag(name, useBTagFlagsDefaults = True, **options): useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. **options: Python dictionary with options for the tool. output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + from BTagging.MV2defaultValues import default_values + from BTagging.MV2defaultValues import MVTM_varNames + if useBTagFlagsDefaults: defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, 'Runmodus' : BTaggingFlags.Runmodus, @@ -37,9 +40,11 @@ def toolMyc100Tag(name, useBTagFlagsDefaults = True, **options): 'taggerNameBase' : 'MV2c10mu', 'forceMV2CalibrationAlias' : BTaggingFlags.ForceMV2CalibrationAlias, 'MV2CalibAlias' : BTaggingFlags.MV2CalibAlias, + 'defaultvals' : default_values, + 'MVTMvariableNames' : MVTM_varNames, } for option in defaults: options.setdefault(option, defaults[option]) options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__MyTag - return Analysis__MyTag(**options) + from JetTagTools.JetTagToolsConf import Analysis__MV2Tag + return Analysis__MV2Tag(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10rnnFlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10rnnFlipTag.py new file mode 100644 index 0000000000000000000000000000000000000000..1a5ff5d4c70213091d39821f2aa7de2d918bf6a0 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10rnnFlipTag.py @@ -0,0 +1,50 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +# Configuration functions for MV2c10rnnFlipTag +# Author: Wouter van den Wollenberg (2013-2014) +from BTagging.BTaggingFlags import BTaggingFlags + +metaMV2c10rnnFlipTag = { 'IsATagger' : False,#True, + 'xAODBaseName' : 'MV2c10rnnFlip', + 'DependsOn' : ['AtlasExtrapolator', + 'BTagCalibrationBrokerTool', + 'SoftMuonTag', + 'BTagTrackToVertexTool'], + 'CalibrationFolders' : ['MV2c10rnn',], + 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, + 'ToolCollection' : 'MV2c10rnnFlipTag'} + +def toolMV2c10rnnFlipTag(name, useBTagFlagsDefaults = True, **options): + """Sets up a MV2c10rnnTag tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + Runmodus default: BTaggingFlags.Runmodus + taggerName default: "MV2c10rnnFlip" + taggerNameBase default: "MV2c10rnn" + forceMV2CalibrationAlias default: BTaggingFlags.ForceMV2CalibrationAlias + MV2CalibAlias default: BTaggingFlags.MV2CalibAlias + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + from BTagging.MV2defaultValues import default_values + from BTagging.MV2defaultValues import MVTM_varNames + + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'Runmodus' : BTaggingFlags.Runmodus, + 'taggerName' : 'MV2c10rnnFlip', + 'taggerNameBase' : 'MV2c10rnn', + 'forceMV2CalibrationAlias' : BTaggingFlags.ForceMV2CalibrationAlias, + 'MV2CalibAlias' : BTaggingFlags.MV2CalibAlias, + 'defaultvals' : default_values, + 'MVTMvariableNames' : MVTM_varNames, + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__MV2Tag + return Analysis__MV2Tag(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10rnnTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10rnnTag.py new file mode 100644 index 0000000000000000000000000000000000000000..7ad7078b7ae8b610d53916659d00eaf44382d531 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MV2c10rnnTag.py @@ -0,0 +1,51 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +# Configuration functions for MV2c10Tag +# Author: Wouter van den Wollenberg (2013-2014) +from BTagging.BTaggingFlags import BTaggingFlags + +metaMV2c10rnnTag = { 'IsATagger' : False,#True, + 'xAODBaseName' : 'MV2c10rnn', + 'DependsOn' : ['AtlasExtrapolator', + 'BTagCalibrationBrokerTool', + 'SoftMuonTag', + 'BTagTrackToVertexTool'], + 'CalibrationFolders' : ['MV2c10rnn',], + 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, + 'ToolCollection' : 'MV2c10rnnTag'} + +def toolMV2c10rnnTag(name, useBTagFlagsDefaults = True, **options): + """Sets up a MV2c10rnnTag tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + Runmodus default: BTaggingFlags.Runmodus + taggerName default: "MV2c10rnn" + taggerNameBase default: "MV2c10rnn" + forceMV2CalibrationAlias default: BTaggingFlags.ForceMV2CalibrationAlias + MV2CalibAlias default: BTaggingFlags.MV2CalibAlias + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + from BTagging.MV2defaultValues import default_values + from BTagging.MV2defaultValues import MVTM_varNames + + + if useBTagFlagsDefaults: + defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'Runmodus' : BTaggingFlags.Runmodus, + 'taggerName' : 'MV2c10rnn', + 'taggerNameBase' : 'MV2c10rnn', + 'forceMV2CalibrationAlias' : BTaggingFlags.ForceMV2CalibrationAlias, + 'MV2CalibAlias' : BTaggingFlags.MV2CalibAlias, + 'defaultvals' : default_values, + 'MVTMvariableNames' : MVTM_varNames, + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__MV2Tag + return Analysis__MV2Tag(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultivariateTagManager.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultivariateTagManager.py index fe02d198357a8a887211b32ec9d81112fa40f3a2..395308ff8e8f8deea9968ea5ef5c0a1bdda57195 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultivariateTagManager.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_MultivariateTagManager.py @@ -11,7 +11,6 @@ metaMultivariateTagManager = { 'IsATagger' : True, 'IP2DTag', 'IP3DTag', 'NewJetFitterVxFinder', - 'SV0Tag', 'SV1Tag'], 'ToolCollection' : 'MultivariateTagManager' } diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCOMB.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCOMB.py deleted file mode 100644 index 1af111876c12e86caa9a7406e180e3766e00b2df..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCOMB.py +++ /dev/null @@ -1,38 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# Configuration functions for NewJetFitterCOMB -# Author: Wouter van den Wollenberg (2013-2014) -from BTagging.BTaggingFlags import BTaggingFlags - -metaNewJetFitterCOMB = { 'IsATagger' : True, - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'NewJetFitterTag', - 'InDetVKalVxInJetTool', - 'BTagFullLinearizedTrackFactory', - 'BTagTrackToVertexIPEstimator', - 'IP3DTag'], - 'ToolCollection' : 'NewJetFitterCOMB' } - -def toolNewJetFitterCOMB(name, useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterCOMB tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - combinedTagString default: "JetFitterCOMB" - listTaggers default: [ "JetFitterTag","IP3D" ] - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'combinedTagString' : 'JetFitterCOMB', - 'listTaggers' : [ "JetFitterTag","IP3D" ] } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__CombinerToolTag - return Analysis__CombinerToolTag(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py index fc87bd4aa034984e59d8d04409666eb54e06c2d0..02924058e193b9f864cb781bfed691162e137bc3 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterCollection.py @@ -452,6 +452,16 @@ metaJetFitterNNTool = { 'CalibrationFolders' : ['JetFitter',], 'NeuralNetworkToHistoTool' : 'NeuralNetworkToHistoToolNN'}, 'ToolCollection' : 'JetFitterCollection' } +def _slim_jf_options(options): + new_opts = {} + removed = set( + ['CalibrationDirectory', 'CalibrationSubDirectory', + 'calibrationTool', 'NeuralNetworkToHistoTool']) + kept = set(options) - removed + for optname in kept: + new_opts[optname] = options[optname] + return new_opts + def toolJetFitterNNTool(name, useBTagFlagsDefaults = True, **options): """Sets up a JetFitterNNTool tool and returns it. @@ -469,15 +479,19 @@ def toolJetFitterNNTool(name, useBTagFlagsDefaults = True, **options): output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" if useBTagFlagsDefaults: defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, + 'useCombinedIPNN' : False, 'CalibrationDirectory' : 'JetFitter', 'CalibrationSubDirectory' : 'NeuralNetwork', - 'useCombinedIPNN' : False, 'usePtCorrectedMass' : True, } for option in defaults: options.setdefault(option, defaults[option]) options['name'] = name from JetTagTools.JetTagToolsConf import Analysis__JetFitterNNTool - return Analysis__JetFitterNNTool(**options) + from JetTagTools.JetTagToolsConf import Analysis__JetFitterInputWriter + if BTaggingFlags.RunJetFitterNNTool: + return Analysis__JetFitterNNTool(**options) + else: + return Analysis__JetFitterInputWriter(**_slim_jf_options(options)) #------------------------------------------------------------------------- @@ -604,7 +618,12 @@ def toolJetFitterCOMBNNTool(name, useBTagFlagsDefaults = True, **options): options.setdefault(option, defaults[option]) options['name'] = name from JetTagTools.JetTagToolsConf import Analysis__JetFitterNNTool - return Analysis__JetFitterNNTool(**options) + from JetTagTools.JetTagToolsConf import Analysis__JetFitterInputWriter + if BTaggingFlags.RunJetFitterNNTool: + return Analysis__JetFitterNNTool(**options) + else: + return Analysis__JetFitterInputWriter(**_slim_jf_options(options)) + #----------------------------------------------------------------------------- diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterFlipCOMB.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterFlipCOMB.py deleted file mode 100644 index da99d1d7b6a9f961aa40280381fa444d9021e2b8..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterFlipCOMB.py +++ /dev/null @@ -1,35 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# Configuration functions for NewJetFitterFlipCOMB -# Author: Wouter van den Wollenberg (2013-2014) -from BTagging.BTaggingFlags import BTaggingFlags - -metaNewJetFitterFlipCOMB = { 'IsATagger' : True, - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'NewJetFitterTagFlip', - 'IP3DNegTag'], - 'ToolCollection' : 'NewJetFitterFlipCOMB' } - -def toolNewJetFitterFlipCOMB(name, useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterFlipCOMB tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - combinedTagString default: "JetFitterCOMBFlip" - listTaggers default: [ "JetFitterTagFlip","IP3DNeg" ] - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'combinedTagString' : 'JetFitterCOMBFlip', - 'listTaggers' : [ "JetFitterTagFlip","IP3DNeg" ] } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__CombinerToolTag - return Analysis__CombinerToolTag(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTag.py deleted file mode 100644 index 648acf00d41e79aa1c11b8a5c584a92f816b5b0d..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTag.py +++ /dev/null @@ -1,492 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# Configuration functions for NewJetFitterTag -# Author: Wouter van den Wollenberg (2013-2014) -from BTagging.BTaggingFlags import BTaggingFlags - -metaNewJetFitterTag = { 'IsATagger' : True, - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'NewJetFitterVxFinder', - 'NewJetFitterLikelihood', - 'NewJetFitterVariablesFactory', - 'NewJetFitterNtupleWriter'], - 'PassByPointer' : {'JetFitterVariablesFactory' : 'NewJetFitterVariablesFactory', - 'JetFitterLikelihood' : 'NewJetFitterLikelihood', - 'JetFitterNtupleWriter' : 'NewJetFitterNtupleWriter'}, - 'PassByName' : {'SecVxFinderName' : 'NewJetFitterVxFinder'}, - 'JetCollectionList' : 'jetCollectionList', - 'ToolCollection' : 'NewJetFitterTag' } - -def toolNewJetFitterTag(name, useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterTag tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - Runmodus default: BTaggingFlags.Runmodus - jetCollectionList default: BTaggingFlags.Jets - SecVxFinderName default: "NewJetFitterVxFinder" - useForcedCalibration default: False - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'Runmodus' : BTaggingFlags.Runmodus, - 'jetCollectionList' : BTaggingFlags.Jets, - 'SecVxFinderName' : 'NewJetFitterVxFinder', - 'useForcedCalibration' : False } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag - return Analysis__JetFitterTag(**options) - -#----------------------------------------------------------------------- - -metaJetFitterExtrapolator = {'OneInTotal' : True, - 'ToolCollection' : 'NewJetFitterTag' } - -def toolJetFitterExtrapolator(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterExtrapolator tool and returns it. - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - from TrkExTools.AtlasExtrapolator import AtlasExtrapolator - return AtlasExtrapolator(**options) - -#----------------------------------------------------------------------- - -metaJetFitterFullLinearizedTrackFactory = {'DependsOn' : ['JetFitterExtrapolator',], - 'PassByPointer' : {'Extrapolator' : 'JetFitterExtrapolator' }, - 'ToolCollection': 'NewJetFitterTag' } - -def toolJetFitterFullLinearizedTrackFactory(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterFullLinearizedTrackFactory tool and returns it. - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - Note however that this tool has no BTaggingFlags defaults; the option is - here only for consistency. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - options['name'] = name - from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory - return Trk__FullLinearizedTrackFactory(**options) - -#----------------------------------------------------------------------- - -metaVxInternalEdmFactory = {'DependsOn' : ['JetFitterFullLinearizedTrackFactory',], - 'PassByPointer' : {'LinearizedTrackFactory' : 'JetFitterFullLinearizedTrackFactory' }, - 'ToolCollection': 'NewJetFitterTag' } - -def toolVxInternalEdmFactory(name, useBTagFlagsDefaults = True, **options): - """Sets up a VxInternalEdmFactory tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from TrkVxEdmCnv.TrkVxEdmCnvConf import Trk__VxCandidateXAODVertex - return Trk__VxCandidateXAODVertex(**options) - -#-------------------------------------------------------------------------- - -metaNewJetFitterLikelihood = { 'CalibrationFolders' : ['JetFitter',], - 'DependsOn' : ['BTagCalibrationBrokerTool',], - 'PassByPointer' : {'calibrationTool' : 'BTagCalibrationBrokerTool'}, - 'ToolCollection' : 'NewJetFitterTag' } - -def toolNewJetFitterLikelihood(name, useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterLikelihood tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - CalibrationDirectory default: "JetFitter" - CalibrationSubDirectory default: "RooFitLikelihood" - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'CalibrationDirectory' : 'JetFitter', - 'CalibrationSubDirectory' : 'RooFitLikelihood' } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterLikelihood - return Analysis__JetFitterLikelihood(**options) - -#-------------------------------------------------------------------------- - -metaNewJetFitterVariablesFactory = { 'PassByName' : {'JetFitterInstance' : 'NewJetFitterTag', - 'secVxFinderName' : 'NewJetFitterVxFinder' }, - 'ToolCollection' : 'NewJetFitterTag' } - -def toolNewJetFitterVariablesFactory(name, useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterVariablesFactory tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - JetFitterInstance default: "JetFitterTag" - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'JetFitterInstance' : 'JetFitterTag' } -# 'usePtCorrectedMass' : True } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory - return Analysis__JetFitterVariablesFactory(**options) - -#-------------------------------------------------------------------------- - -metaNewJetFitterNtupleWriter = { 'ToolCollection' : 'NewJetFitterTag' } - -def toolNewJetFitterNtupleWriter(name, useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterNtupleWriter tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterNtupleWriter - return Analysis__JetFitterNtupleWriter(**options) - -#-------------------------------------------------------------------------- - -metaNewJetFitterVxFinder = { 'IsAVertexFinder' : True, - 'VertexFinderxAODBaseName' : 'JetFitter', - 'VertexFinderPassByPointer': {'JetFitterVariableFactory' : 'NewJetFitterVariablesFactory' }, - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'InDetJetFitterUtils', - 'ImprovedJetFitterRoutines', - 'TrkDistanceFinderNeutralCharged', - 'TrkDistanceFinderNeutralNeutral', - 'ImprovedJetFitterInitializationHelper', - 'JetFitterSequentialVertexFitter', - 'JetFitterSequentialVertexSmoother', - 'JetFitterMode3dTo1dFinder', - 'InDetImprovedJetFitterTrackSelectorTool', - 'JetFitterExtrapolator', - 'JetFitterFullLinearizedTrackFactory', - 'NewJetFitterVariablesFactory', - 'VxInternalEdmFactory'], - 'PassByPointer' : { 'Mode3dFinder' : 'JetFitterMode3dTo1dFinder', - 'JetFitterInitializationHelper' : 'ImprovedJetFitterInitializationHelper', - 'TrackSelector' : 'InDetImprovedJetFitterTrackSelectorTool', - 'InDetJetFitterUtils' : 'InDetJetFitterUtils', - 'Extrapolator' : 'JetFitterExtrapolator', - 'SequentialVertexFitter' : 'JetFitterSequentialVertexFitter', - 'JetFitterRoutines' : 'ImprovedJetFitterRoutines', - 'VertexEdmFactory' : 'VxInternalEdmFactory' }, - 'ToolCollection' : 'NewJetFitterTag' } - -def toolNewJetFitterVxFinder(name, useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterVxFinder tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - VxPrimaryContainer default: "PrimaryVertices" - MaxNumDeleteIterations default: 30 - VertexProbCut default: 0.001 - MaxClusteringIterations default: 30 - VertexClusteringProbabilityCut default: 0.005 - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - if not 'InDetKeys' in dir(): - from InDetRecExample.InDetKeys import InDetKeys - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'VxPrimaryContainer' : 'PrimaryVertices', - 'MaxNumDeleteIterations' : 30, - 'VertexProbCut' : 0.001, - 'MaxClusteringIterations' : 30, - 'VertexClusteringProbabilityCut' : 0.005 } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder - return InDet__InDetImprovedJetFitterVxFinder(**options) - -#-------------------------------------------------------------------------- - -metaInDetJetFitterUtils = { 'DependsOn' : ['JetFitterFullLinearizedTrackFactory', - 'JetFitterExtrapolator'], - 'PassByPointer' : {'LinearizedTrackFactory' : 'JetFitterFullLinearizedTrackFactory', - 'Extrapolator' : 'JetFitterExtrapolator' }, - 'ToolCollection' : 'NewJetFitterTag' } - -def toolInDetJetFitterUtils(name, useBTagFlagsDefaults = True, **options): - """Sets up a InDetJetFitterUtils tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetJetFitterUtils - return InDet__InDetJetFitterUtils(**options) - -#-------------------------------------------------------------------------- - -metaImprovedJetFitterRoutines = { 'DependsOn' : ['ImprovedJetFitterInitializationHelper', - 'TrkDistanceFinderNeutralNeutral', - 'TrkDistanceFinderNeutralCharged'], - 'PassByPointer' : {'JetFitterInitializationHelper' : 'ImprovedJetFitterInitializationHelper', - 'JetFitterMinimumDistanceFinderNeutral' : 'TrkDistanceFinderNeutralNeutral', - 'JetFitterMinimumDistanceFinder' : 'TrkDistanceFinderNeutralCharged' }, - 'ToolCollection' : 'NewJetFitterTag' } - -def toolImprovedJetFitterRoutines(name, useBTagFlagsDefaults = True, **options): - """Sets up a ImprovedJetFitterRoutines tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - BeFast default: False - maxDRshift default: 0.0 - noPrimaryVertexRefit default: False - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'BeFast' : False, - 'maxDRshift' : 0.0, - 'noPrimaryVertexRefit' : False } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterRoutines - return Trk__JetFitterRoutines(**options) - -#-------------------------------------------------------------------------- - -metaTrkDistanceFinderNeutralCharged = { 'ToolCollection' : 'NewJetFitterTag' } - -def toolTrkDistanceFinderNeutralCharged(name, useBTagFlagsDefaults = True, **options): - """Sets up a TrkDistanceFinderNeutralCharged tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from TrkJetVxFitter.TrkJetVxFitterConf import Trk__TrkDistanceFinderNeutralCharged - return Trk__TrkDistanceFinderNeutralCharged(**options) - -#-------------------------------------------------------------------------- - -metaTrkDistanceFinderNeutralNeutral = { 'ToolCollection' : 'NewJetFitterTag' } - -def toolTrkDistanceFinderNeutralNeutral(name, useBTagFlagsDefaults = True, **options): - """Sets up a TrkDistanceFinderNeutralNeutral tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from TrkJetVxFitter.TrkJetVxFitterConf import Trk__TrkDistanceFinderNeutralNeutral - return Trk__TrkDistanceFinderNeutralNeutral(**options) - -#-------------------------------------------------------------------------- - -metaImprovedJetFitterInitializationHelper = { 'DependsOn' : ['JetFitterFullLinearizedTrackFactory',], - 'PassByPointer' : {'LinearizedTrackFactory' : 'JetFitterFullLinearizedTrackFactory' }, - 'ToolCollection' : 'NewJetFitterTag' } - -def toolImprovedJetFitterInitializationHelper(name, useBTagFlagsDefaults = True, **options): - """Sets up a ImprovedJetFitterInitializationHelper tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterInitializationHelper - return Trk__JetFitterInitializationHelper(**options) - -#-------------------------------------------------------------------------- - -metaJetFitterSequentialVertexFitter = { 'DependsOn' : ['JetFitterSequentialVertexSmoother', - 'JetFitterFullLinearizedTrackFactory', - 'VxInternalEdmFactory'], - 'PassByPointer' : {'VertexSmoother' : 'JetFitterSequentialVertexSmoother', - 'LinearizedTrackFactory' : 'JetFitterFullLinearizedTrackFactory', - 'XAODConverter' : 'VxInternalEdmFactory' }, - 'ToolCollection' : 'NewJetFitterTag' } - -def toolJetFitterSequentialVertexFitter(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterSequentialVertexFitter tool and returns it. - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - Note however that this tool has no BTaggingFlags defaults; the option is - here only for consistency. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - options['name'] = name - from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexFitter - return Trk__SequentialVertexFitter(**options) - -#-------------------------------------------------------------------------- - -metaJetFitterSequentialVertexSmoother = { 'ToolCollection' : 'NewJetFitterTag' } - -def toolJetFitterSequentialVertexSmoother(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterSequentialVertexSmoother tool and returns it. - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - Note however that this tool has no BTaggingFlags defaults; the option is - here only for consistency. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - options['name'] = name - from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexSmoother - return Trk__SequentialVertexSmoother(**options) - -#-------------------------------------------------------------------------- - -metaJetFitterMode3dTo1dFinder = { 'ToolCollection' : 'NewJetFitterTag' } - -def toolJetFitterMode3dTo1dFinder(name, useBTagFlagsDefaults = True, **options): - """Sets up a JetFitterMode3dTo1dFinder tool and returns it. - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - Note however that this tool has no BTaggingFlags defaults; the option is - here only for consistency. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - options['name'] = name - from TrkVertexSeedFinderUtils.TrkVertexSeedFinderUtilsConf import Trk__Mode3dTo1dFinder - return Trk__Mode3dTo1dFinder(**options) - -#-------------------------------------------------------------------------- - -metaInDetImprovedJetFitterTrackSelectorTool = { 'DependsOn' : ['JetFitterExtrapolator',], - 'PassByPointer' : {'Extrapolator' : 'JetFitterExtrapolator'}, - 'ToolCollection' : 'NewJetFitterTag' } - -def toolInDetImprovedJetFitterTrackSelectorTool(name, useBTagFlagsDefaults = True, **options): - """Sets up a InDetImprovedJetFitterTrackSelectorTool tool and returns it. - - The following options have BTaggingFlags defaults: - - pTMin default: 500.0 - IPd0Max default: 7.0 - IPz0Max default: 10.0 - sigIPd0Max default: 0.35 - sigIPz0Max default: 2.5 - etaMax default: 9999.0 - useTrackSummaryInfo default: True - nHitBLayer default: 0 - nHitPix default: 1 - nHitSct default: 4 - nHitSi default: 7 - nHitTrt default: 0 - useSharedHitInfo default: False - useTrackQualityInfo default: True - fitChi2OnNdfMax default: 3.5 - TrackSummaryTool default: None - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'pTMin' : 500.0, - 'IPd0Max' : 7.0, - 'IPz0Max' : 10.0, - 'sigIPd0Max' : 0.35, - 'sigIPz0Max' : 2.5, - 'etaMax' : 9999.0, - 'useTrackSummaryInfo' : True, - 'nHitBLayer' : 0, - 'nHitPix' : 1, - 'nHitSct' : 4, - 'nHitSi' : 7, - 'nHitTrt' : 0, - 'useSharedHitInfo' : False, - 'useTrackQualityInfo' : True, - 'fitChi2OnNdfMax' : 3.5, - 'TrackSummaryTool' : None } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetDetailedTrackSelectorTool - return InDet__InDetDetailedTrackSelectorTool(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTagFlip.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTagFlip.py deleted file mode 100644 index 4894a74228a3d0616a255e111dd3afcb380620b0..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_NewJetFitterTagFlip.py +++ /dev/null @@ -1,134 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -# Configuration functions for NewJetFitterTagFlip -# Author: Wouter van den Wollenberg (2013-2014) -from BTagging.BTaggingFlags import BTaggingFlags - -metaNewJetFitterTagFlip = { 'IsATagger' : True, - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'NewJetFitterVxFinderFlip', - 'NewJetFitterVariablesFactoryFlip', - 'NewJetFitterNtupleWriter', - 'NewJetFitterLikelihood'], - 'PassByPointer' : {'JetFitterVariablesFactory' : 'NewJetFitterVariablesFactoryFlip', - 'JetFitterLikelihood' : 'NewJetFitterLikelihood', - 'JetFitterNtupleWriter' : 'NewJetFitterNtupleWriter'}, - 'PassByName' : {'SecVxFinderName' : 'NewJetFitterVxFinder'}, - 'JetCollectionList' : 'jetCollectionList', - 'ToolCollection' : 'NewJetFitterTagFlip' } - -def toolNewJetFitterTagFlip(name, useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterTagFlip tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - Runmodus default: BTaggingFlags.Runmodus - jetCollectionList default: BTaggingFlags.Jets - SecVxFinderName default: "NewJetFitterVxFinderFlip" - useForcedCalibration default: False - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'Runmodus' : BTaggingFlags.Runmodus, - 'jetCollectionList' : BTaggingFlags.Jets, - 'SecVxFinderName' : 'NewJetFitterVxFinderFlip', - 'useForcedCalibration' : False } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag - return Analysis__JetFitterTag(**options) - -#------------------------------------------------------------------------------ - -metaNewJetFitterVariablesFactoryFlip = { 'PassByName' : {'JetFitterInstance' : 'JetFitterTagFlip'}, - 'ToolCollection' : 'NewJetFitterTagFlip' } - -def toolNewJetFitterVariablesFactoryFlip(name, useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterVariablesFactoryFlip tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - JetFitterInstance default: "JetFitterTagFlip" - usePtCorrectedMass default: True - revertFromPositiveToNegativeTags default: True - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'JetFitterInstance' : 'JetFitterTagFlip', - 'usePtCorrectedMass' : True, - 'revertFromPositiveToNegativeTags' : True } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory - return Analysis__JetFitterVariablesFactory(**options) - -#------------------------------------------------------------------------------ - -metaNewJetFitterVxFinderFlip = { 'IsAVertexFinder' : True, - 'DependsOn' : ['AtlasExtrapolator', - 'BTagTrackToVertexTool', - 'InDetJetFitterUtils', - 'ImprovedJetFitterRoutines', - 'TrkDistanceFinderNeutralCharged', - 'TrkDistanceFinderNeutralNeutral', - 'ImprovedJetFitterInitializationHelper', - 'JetFitterSequentialVertexFitter', - 'JetFitterSequentialVertexSmoother', - 'JetFitterMode3dTo1dFinder', - 'JetFitterFullLinearizedTrackFactory', - 'InDetImprovedJetFitterTrackSelectorTool', - 'JetFitterExtrapolator'], - 'PassByPointer' : { 'Mode3dFinder' : 'JetFitterMode3dTo1dFinder', - 'JetFitterInitializationHelper' : 'ImprovedJetFitterInitializationHelper', - 'TrackSelector' : 'InDetImprovedJetFitterTrackSelectorTool', - 'InDetJetFitterUtils' : 'InDetJetFitterUtils', - 'Extrapolator' : 'JetFitterExtrapolator', - 'SequentialVertexFitter' : 'JetFitterSequentialVertexFitter', - 'JetFitterRoutines' : 'ImprovedJetFitterRoutines' }, - 'ToolCollection' : 'NewJetFitterTagFlip' } - -def toolNewJetFitterVxFinderFlip(name, useBTagFlagsDefaults = True, **options): - """Sets up a NewJetFitterVxFinderFlip tool and returns it. - - The following options have BTaggingFlags defaults: - - OutputLevel default: BTaggingFlags.OutputLevel - VxPrimaryContainer default: InDetKeys.PrimaryVertices() - MaxNumDeleteIterations default: 30 - VertexProbCut default: 0.001 - MaxClusteringIterations default: 30 - VertexClusteringProbabilityCut default: 0.005 - revertFromPositiveToNegativeTags default: True - - input: name: The name of the tool (should be unique). - useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. - **options: Python dictionary with options for the tool. - output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" - if useBTagFlagsDefaults: - if not 'InDetKeys' in dir(): - from InDetRecExample.InDetKeys import InDetKeys - defaults = { 'OutputLevel' : BTaggingFlags.OutputLevel, - 'VxPrimaryContainer' : InDetKeys.PrimaryVertices(), - 'MaxNumDeleteIterations' : 30, - 'VertexProbCut' : 0.001, - 'MaxClusteringIterations' : 30, - 'VertexClusteringProbabilityCut' : 0.005, - 'revertFromPositiveToNegativeTags' : True } - for option in defaults: - options.setdefault(option, defaults[option]) - options['name'] = name - from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder - return InDet__InDetImprovedJetFitterVxFinder(**options) diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_RNNIPTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_RNNIPTag.py new file mode 100644 index 0000000000000000000000000000000000000000..7c13359cfcb075615738a1595f83cd4c3f183c36 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingConfiguration_RNNIPTag.py @@ -0,0 +1,73 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +# Configuration for RNNIP +# +# Note that a lot of tools and settings are borrowed from IP3D, so +# this probably won't work without IP3D also turned on. We'll need an +# expter to figure out how to make taggers independant. +from BTagging.BTaggingFlags import BTaggingFlags + +metaRNNIPTag = {'IsATagger' : True, + 'xAODBaseName' : 'RNNIP', + 'CalibrationFolders' : ['RNNIP'], + 'DependsOn' : ['AtlasExtrapolator', + 'BTagCalibrationBrokerTool', + 'BTagTrackToVertexTool', + 'InDetVKalVxInJetTool', + 'BTagTrackToVertexIPEstimator', + 'IP3DTrackSelector', + 'InDetTrackSelector', + 'SpecialTrackAssociator', + 'SVForIPTool_IP3D', + 'IP3DBasicTrackGradeFactory', + 'IP3DDetailedTrackGradeFactory'], + 'PassByPointer' : {'SVForIPTool' : 'SVForIPTool_IP3D', + 'trackSelectorTool' : 'IP3DTrackSelector', + 'calibrationTool' : 'BTagCalibrationBrokerTool', + 'trackGradeFactory' : 'IP3DDetailedTrackGradeFactory', + 'TrackToVertexIPEstimator' : 'BTagTrackToVertexIPEstimator'}, + 'PassTracksAs' : 'trackAssociationName', + 'ToolCollection' : 'IP3DTag' } + +def toolRNNIPTag(name, useBTagFlagsDefaults = True, **options): + """Sets up a IP3DTag tool and returns it. + + The following options have BTaggingFlags defaults: + + OutputLevel default: BTaggingFlags.OutputLevel + trackGradePartitions default: [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ] + RejectBadTracks default: True + originalTPCollectionName default: BTaggingFlags.TrackParticleCollectionName + unbiasIPEstimation default: False (switch to true (better!) when creating new PDFs) + SecVxFinderName default: "SV1" + + input: name: The name of the tool (should be unique). + useBTagFlagsDefaults : Whether to use BTaggingFlags defaults for options that are not specified. + **options: Python dictionary with options for the tool. + output: The actual tool, which can then by added to ToolSvc via ToolSvc += output.""" + if useBTagFlagsDefaults: + grades= [ "0HitIn0HitNInExp2","0HitIn0HitNInExpIn","0HitIn0HitNInExpNIn","0HitIn0HitNIn", + "0HitInExp", "0HitIn", + "0HitNInExp", "0HitNIn", + "InANDNInShared", "PixShared", "SctShared", + "InANDNInSplit", "PixSplit", + "Good"] + + defaults = { + 'OutputLevel' : BTaggingFlags.OutputLevel, + 'trackGradePartitions' : grades , + 'RejectBadTracks' : True, + 'originalTPCollectionName' : BTaggingFlags.TrackParticleCollectionName, + 'NetworkConfig' : BTaggingFlags.RNNIPConfig, + 'unbiasIPEstimation' : False, + #'trackAssociation' : "Tracks" } + 'SecVxFinderName' : 'SV1', + 'calibration_directory' : 'RNNIP', + 'writeInputsToBtagObject': BTaggingFlags.WriteRNNInputs + } + for option in defaults: + options.setdefault(option, defaults[option]) + options['name'] = name + from JetTagTools.JetTagToolsConf import Analysis__RNNIPTag + return Analysis__RNNIPTag(**options) + diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingFlags.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingFlags.py index e84f572127598da668e1415161cb65084ff49060..759a492fff38894d5e8c9980e6e086d0ad31f562 100755 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingFlags.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/BTaggingFlags.py @@ -24,15 +24,15 @@ class _BTaggingFlags: 'IPFordG', 'IPFordGNeg', 'SoftEl', 'SoftMu', 'SoftMuChi2', - 'BasicJetFitter', 'JetFitterTag', 'JetFitterTagFlip','JetFitterNN', 'JetFitterNNFlip', + 'BasicJetFitter', 'JetFitterTag', 'JetFitterTagFlip','JetFitterNN', 'JetFitterCOMBNN', 'JetFitterNNFlip', 'TrackCounting', 'TrackCountingFlip', 'QGTag', - 'MV1', 'MV1c', 'MV2', 'Myc100', - 'MV2c00','MV2c10','MV2c20','MV2c100','MV2cl100','MV2m', 'MV2c10hp', + 'MV1', 'MV1c', 'MV2', 'MV2c10', + 'MV2c10mu','MV2c10rnn','MV2c100','MV2cl100', 'MV1Flip', 'MV1cFlip', 'MV2Flip', - 'MV2c00Flip','MV2c10Flip','MV2c20Flip','MV2c100Flip','MV2cl100Flip','MV2mFlip', 'MV2c10hpFlip', + 'MV2c10Flip','MV2c10muFlip','MV2c10rnnFlip','MV2c100Flip','MV2cl100Flip', 'RNNIP', - 'DL1', 'DL1Flip', + 'DL1', 'DL1Flip','DL1mu', 'DL1muFlip','DL1rnn', 'DL1rnnFlip', 'TagNtupleDumper', 'JetVertexCharge'] @@ -149,16 +149,27 @@ class _BTaggingFlags: self.DL1 = True self.DL1Flip = False + self.DL1mu = True + self.DL1muFlip = False + + self.DL1rnn = True + self.DL1rnnFlip = False + self.TagNtupleDumper = False self.TagNtupleStream = 'FTAG' self.RNNIP = True - self.RNNIPConfig = {'ipmp_hits':''} + self.RNNIPConfig = {'rnnip':''} self.WriteRNNInputs = False - self.MultivariateTagManagerAuxBranches = [ - 'ipmp_hits_p' + x for x in ['b','c','u','tau'] + self.MultivariateTagManagerAuxBranches=[ + 'rnnip_p' + x for x in ['b','c','u','tau'] ] + self.MultivariateTagManagerAuxBranches+= ['SMT_discriminant'] + + # you can force the NN tool off with this flag (avoids loading + # old jetfitter nns which sometimes crash + self.RunJetFitterNNTool = True for attr in self._Active: setattr(self, attr, True) @@ -210,7 +221,7 @@ class _BTaggingFlags: if attr == 'IP3DSpcNeg': setattr(self, attr, False) if attr == 'SV0': - setattr(self, attr, True) + setattr(self, attr, False) if attr == 'MultiSVbb1': setattr(self, attr, True) if attr == 'MultiSVbb2': @@ -243,6 +254,8 @@ class _BTaggingFlags: setattr(self, attr, False) if attr == 'JetFitterNNFlip': setattr(self, attr, False) + if attr == 'JetFitterCOMBNN': + setattr(self, attr, False) if attr == 'IPFordG': setattr(self, attr, False) if attr == 'IPFordGNeg': @@ -261,11 +274,13 @@ class _BTaggingFlags: setattr(self, attr, True) if attr == 'MV2c10': setattr(self, attr, True) + if attr == 'MV2c10rnn': + setattr(self, attr, True) if attr == 'MV2c20': setattr(self, attr, True) if attr == 'MV2c100': setattr(self, attr, True) - if attr == 'Myc100': + if attr == 'MV2c10mu': setattr(self, attr, True) if attr == 'MV2cl100': setattr(self, attr, True) @@ -277,6 +292,10 @@ class _BTaggingFlags: setattr(self, attr, False) if attr == 'MV2c10Flip': setattr(self, attr, False) + if attr == 'MV2c10muFlip': + setattr(self, attr, False) + if attr == 'MV2c10rnnFlip': + setattr(self, attr, False) if attr == 'MV2c20Flip': setattr(self, attr, False) if attr == 'MV2c100Flip': @@ -303,7 +322,7 @@ class _BTaggingFlags: setattr(self, attr, 'MV1') for attr in self._HighPriorityTaggers: - setattr(self, attr, ['IP3D','SV1','BasicJetFitter','JetFitterTag','JetFitterNN','MV1','MV1c','MV2c00','MV2c10','MV2c20','MV2c100','Myc100','MV2cl100','MV2m','MV2c10hp', 'IP3DFlip','IP3DPos','IP3DNeg','IP3DSpc','IP3DSpcPos','IP3DSpcNeg','SV1Flip','JetFitterTagFlip','JetFitterNNFlip','MV1Flip','MV1cFlip','MV2c00Flip','MV2c10Flip','MV2c20Flip','MV2c100Flip','MV2cl100Flip','MV2mFlip', 'MV2c10hpFlip', 'JetVertexCharge', 'DL1', 'DL1Flip', 'SoftMu']) + setattr(self, attr, ['IP3D','SV1','BasicJetFitter','JetFitterTag','JetFitterNN','MV2c10','MV2c10mu','MV2c100','MV2c10rnn','MV2cl100', 'IP3DFlip','IP3DPos','IP3DNeg','IP3DSpc','IP3DSpcPos','IP3DSpcNeg','SV1Flip','JetFitterTagFlip','JetFitterNNFlip','MV1Flip','MV1cFlip','MV2c10Flip','MV2c10muFlip','MV2c10rnnFlip','MV2c100Flip','MV2cl100Flip','JetVertexCharge', 'DL1', 'DL1Flip','DL1mu', 'DL1muFlip','DL1rnn', 'DL1rnnFlip', 'SoftMu']) for attr in self._MediumPriorityTaggers: setattr(self, attr, ['SV0','IP2D','IP2DFlip','IP2DPos','IP2DNeg','IP2DSpc','IP2DSpcPos','IP2DSpcNeg','SoftEl','SoftMuChi2','MV2','MV2Flip']) for attr in self._LowPriorityTaggers: diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/MV2defaultValues.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/MV2defaultValues.py index 1ef3535e33d148cf44fb5e1b786839165b587241..c2a124f6d82a20b5c14c9edd768297e61c29b461 100644 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/MV2defaultValues.py +++ b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/python/MV2defaultValues.py @@ -71,6 +71,7 @@ default_values = { "MaxTrkRapidity_jf_path" : 0.0, "MinTrkRapidity_jf_path" : 0.0, "AvgTrkRapidity_jf_path" : 0.0, +"my_smt" : -1, "sm_mu_pt" : -1, "sm_dR" : -1, "sm_qOverPratio" : -99, @@ -80,10 +81,10 @@ default_values = { "sm_mu_d0" : -99, "sm_mu_z0" : -99, "sm_ID_qOverP" : -99, -"ipmp_pb" : -1, -"ipmp_pc" : -1, -"ipmp_pu" : -1, - +"rnnip_pb" : -20, +"rnnip_pc" : -20, +"rnnip_pu" : -20, +"rnnip_ptau" : -20, } @@ -157,6 +158,7 @@ MVTM_varNames = { "MaxTrkRapidity_jf_path" : "MaxTrkRapidity_jf_path", "MinTrkRapidity_jf_path" : "MinTrkRapidity_jf_path", "AvgTrkRapidity_jf_path" : "AvgTrkRapidity_jf_path", +"SMT_discriminant" : "my_smt", "sm_mu_pt" : "sm_mu_pt", "sm_dR" : "sm_dR", "sm_qOverPratio" : "sm_qOverPratio", @@ -166,8 +168,9 @@ MVTM_varNames = { "sm_mu_d0" : "sm_mu_d0", "sm_mu_z0" : "sm_mu_z0", "sm_ID_qOverP" : "sm_ID_qOverP", -"ipmp_pb" : "ipmp_pb", -"ipmp_pc" : "ipmp_pc", -"ipmp_pu" : "ipmp_pu", +"rnnip_pb" : "rnnip_pb" , +"rnnip_pc" : "rnnip_pc" , +"rnnip_pu" : "rnnip_pu" , +"rnnip_ptau" : "rnnip_ptau" , } \ No newline at end of file diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP1DTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP1DTag.py deleted file mode 100755 index b355bf319c9249c27a52fc31d121b6a828c613c2..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP1DTag.py +++ /dev/null @@ -1,68 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP1DNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP1DNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP1D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP1DNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP1DNewLikelihood - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP1DTrackSelector = Analysis__TrackSelector( - name = "IP1DTrackSelector", - OutputLevel = BTaggingFlags.OutputLevel, - trackToVertexTool = BTagTrackToVertexTool - ) -ToolSvc += IP1DTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP1DTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP1D = Analysis__SVForIPTool(name = "SVForIPTool_IP1D", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP1D -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP1D - - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP1DBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP1DBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -ToolSvc += IP1DBasicTrackGradeFactory -if BTaggingFlags.OutputLevel < 3: - print IP1DBasicTrackGradeFactory - - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP1DTagTool = Analysis__IPTag( - name = "IP1DTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "1D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP1DNewLikelihood, - trackSelectorTool = IP1DTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, - trackGradePartitions = [ "Good", "Shared" ], - RejectBadTracks = False, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP1D, - trackGradeFactory = IP1DBasicTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP1DTagTool -if BTaggingFlags.OutputLevel < 3: - print IP1DTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DFlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DFlipTag.py deleted file mode 100755 index 50e8c324f74c45a682d3b55c0d470d6efb5c7940..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DFlipTag.py +++ /dev/null @@ -1,86 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP2DFlipNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP2DFlipNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP2D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP2DFlipNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP2DFlipNewLikelihood - - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP2DFlipTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP2DFlipTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP2DFlipTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP2DFlipTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP2DFlip = Analysis__SVForIPTool(name = "SVForIPTool_IP2DFlip", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP2DFlip -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP2DFlip - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP2DFlipBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP2DFlipBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP2DFlipDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP2DFlipDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP2DFlipBasicTrackGradeFactory -ToolSvc += IP2DFlipDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP2DFlipBasicTrackGradeFactory - print IP2DFlipDetailedTrackGradeFactory - - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP2DFlipTagTool = Analysis__IPTag( - name = "IP2DFlipTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "2D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP2DFlipNewLikelihood, - trackSelectorTool = IP2DFlipTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - flipIPSign = True, - writeInfoPlus = False, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP2DFlip, -# trackGradeFactory = IP2DFlipBasicTrackGradeFactory, - trackGradeFactory = IP2DFlipDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - UseCHypo=True, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) - -ToolSvc += IP2DFlipTagTool -if BTaggingFlags.OutputLevel < 3: - print IP2DFlipTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DNegTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DNegTag.py deleted file mode 100755 index 3e6b40e29a773f003c01d434fa3b004a51a8244b..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DNegTag.py +++ /dev/null @@ -1,87 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP2DNegNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP2DNegNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP2D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP2DNegNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP2DNegNewLikelihood - - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP2DNegTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP2DNegTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP2DNegTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP2DNegTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP2DNeg = Analysis__SVForIPTool(name = "SVForIPTool_IP2DNeg", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP2DNeg -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP2DNeg - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP2DNegBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP2DNegBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP2DNegDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP2DNegDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP2DNegBasicTrackGradeFactory -ToolSvc += IP2DNegDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP2DNegBasicTrackGradeFactory - print IP2DNegDetailedTrackGradeFactory - - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP2DNegTagTool = Analysis__IPTag( - name = "IP2DNegTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "2D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP2DNegNewLikelihood, - trackSelectorTool = IP2DNegTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - usePosIP = True, - useNegIP = False, - flipIPSign = True, - writeInfoPlus = False, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP2DNeg, -# trackGradeFactory = IP2DNegBasicTrackGradeFactory, - trackGradeFactory = IP2DNegDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - UseCHypo=True, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP2DNegTagTool -if BTaggingFlags.OutputLevel < 3: - print IP2DNegTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DPosTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DPosTag.py deleted file mode 100755 index 1d69becc22071f11f76159cdf23d8f59e1b1528b..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DPosTag.py +++ /dev/null @@ -1,87 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP2DPosNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP2DPosNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP2D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP2DPosNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP2DPosNewLikelihood - - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP2DPosTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP2DPosTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP2DPosTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP2DPosTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP2DPos = Analysis__SVForIPTool(name = "SVForIPTool_IP2DPos", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP2DPos -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP2DPos - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP2DPosBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP2DPosBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP2DPosDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP2DPosDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP2DPosBasicTrackGradeFactory -ToolSvc += IP2DPosDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP2DPosBasicTrackGradeFactory - print IP2DPosDetailedTrackGradeFactory - - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP2DPosTagTool = Analysis__IPTag( - name = "IP2DPosTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "2D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP2DPosNewLikelihood, - trackSelectorTool = IP2DPosTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - usePosIP = True, - useNegIP = False, - flipIPSign = False, - writeInfoPlus = False, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP2DPos, -# trackGradeFactory = IP2DPosBasicTrackGradeFactory, - trackGradeFactory = IP2DPosDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - UseCHypo=True, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP2DPosTagTool -if BTaggingFlags.OutputLevel < 3: - print IP2DPosTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DSpcFlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DSpcFlipTag.py deleted file mode 100755 index 0f10a400d0a78545642dd15527c40e8141f62ba0..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DSpcFlipTag.py +++ /dev/null @@ -1,85 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP2DSpcFlipNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP2DSpcFlipNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP2D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP2DSpcFlipNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcFlipNewLikelihood - - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP2DSpcFlipTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP2DSpcFlipTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP2DSpcFlipTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcFlipTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP2DSpcFlip = Analysis__SVForIPTool(name = "SVForIPTool_IP2DSpcFlip", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP2DSpcFlip -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP2DSpcFlip - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP2DSpcFlipBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP2DSpcFlipBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP2DSpcFlipDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP2DSpcFlipDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP2DSpcFlipBasicTrackGradeFactory -ToolSvc += IP2DSpcFlipDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcFlipBasicTrackGradeFactory - print IP2DSpcFlipDetailedTrackGradeFactory - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP2DSpcFlipTagTool = Analysis__IPTag( - name = "IP2DSpcFlipTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "2D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP2DSpcFlipNewLikelihood, - trackSelectorTool = IP2DSpcFlipTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - SignWithSvx = True, - flipIPSign = True, - writeInfoPlus = False, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP2DSpcFlip, -# trackGradeFactory = IP2DSpcFlipBasicTrackGradeFactory, - trackGradeFactory = IP2DSpcFlipDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - UseCHypo=True, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP2DSpcFlipTagTool -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcFlipTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DSpcNegTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DSpcNegTag.py deleted file mode 100755 index 76d5ee9939a28d7408d65279125fb5cb863ea37d..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DSpcNegTag.py +++ /dev/null @@ -1,88 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP2DSpcNegNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP2DSpcNegNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP2D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP2DSpcNegNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcNegNewLikelihood - - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP2DSpcNegTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP2DSpcNegTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP2DSpcNegTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcNegTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP2DSpcNeg = Analysis__SVForIPTool(name = "SVForIPTool_IP2DSpcNeg", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP2DSpcNeg -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP2DSpcNeg - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP2DSpcNegBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP2DSpcNegBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP2DSpcNegDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP2DSpcNegDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP2DSpcNegBasicTrackGradeFactory -ToolSvc += IP2DSpcNegDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcNegBasicTrackGradeFactory - print IP2DSpcNegDetailedTrackGradeFactory - - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP2DSpcNegTagTool = Analysis__IPTag( - name = "IP2DSpcNegTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "2D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP2DSpcNegNewLikelihood, - trackSelectorTool = IP2DSpcNegTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - usePosIP = True, - useNegIP = False, - flipIPSign = True, - writeInfoPlus = False, - SignWithSvx = True, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP2DSpcNeg, -# trackGradeFactory = IP2DSpcNegBasicTrackGradeFactory, - trackGradeFactory = IP2DSpcNegDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - UseCHypo=True, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP2DSpcNegTagTool -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcNegTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DSpcPosTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DSpcPosTag.py deleted file mode 100755 index fef58e448b3312ca13912b9a7698e8703d526004..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DSpcPosTag.py +++ /dev/null @@ -1,88 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP2DSpcPosNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP2DSpcPosNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP2D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP2DSpcPosNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcPosNewLikelihood - - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP2DSpcPosTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP2DSpcPosTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP2DSpcPosTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcPosTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP2DSpcPos = Analysis__SVForIPTool(name = "SVForIPTool_IP2DSpcPos", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP2DSpcPos -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP2DSpcPos - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP2DSpcPosBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP2DSpcPosBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP2DSpcPosDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP2DSpcPosDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP2DSpcPosBasicTrackGradeFactory -ToolSvc += IP2DSpcPosDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcPosBasicTrackGradeFactory - print IP2DSpcPosDetailedTrackGradeFactory - - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP2DSpcPosTagTool = Analysis__IPTag( - name = "IP2DSpcPosTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "2D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP2DSpcPosNewLikelihood, - trackSelectorTool = IP2DSpcPosTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - usePosIP = True, - useNegIP = False, - flipIPSign = False, - writeInfoPlus = False, - SignWithSvx = True, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP2DSpcPos, -# trackGradeFactory = IP2DSpcPosBasicTrackGradeFactory, - trackGradeFactory = IP2DSpcPosDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - UseCHypo=True, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP2DSpcPosTagTool -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcPosTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DSpcTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DSpcTag.py deleted file mode 100755 index c9c101b82d39ca53c5c30e7f8d45bf11c0bb7a9e..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DSpcTag.py +++ /dev/null @@ -1,85 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP2DSpcNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP2DSpcNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP2D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP2DSpcNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcNewLikelihood - - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP2DSpcTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP2DSpcTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP2DSpcTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP2DSpc = Analysis__SVForIPTool(name = "SVForIPTool_IP2DSpc", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP2DSpc -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP2DSpc - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP2DSpcBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP2DSpcBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP2DSpcDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP2DSpcDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP2DSpcBasicTrackGradeFactory -ToolSvc += IP2DSpcDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcBasicTrackGradeFactory - print IP2DSpcDetailedTrackGradeFactory - - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP2DSpcTagTool = Analysis__IPTag( - name = "IP2DSpcTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "2D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP2DSpcNewLikelihood, - trackSelectorTool = IP2DSpcTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - SignWithSvx = True, - infoPlusName = "IPSpcInfoPlus", - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP2DSpc, -# trackGradeFactory = IP2DSpcBasicTrackGradeFactory, - trackGradeFactory = IP2DSpcDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - UseCHypo=True, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP2DSpcTagTool -if BTaggingFlags.OutputLevel < 3: - print IP2DSpcTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DTag.py deleted file mode 100755 index fa12b4bf80fb88ac8dd95b787d197f817aa66274..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP2DTag.py +++ /dev/null @@ -1,84 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP2DNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP2DNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP2D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP2DNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP2DNewLikelihood - - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP2DTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP2DTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP2DTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP2DTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP2D = Analysis__SVForIPTool(name = "SVForIPTool_IP2D", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP2D -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP2D - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP2DBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP2DBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - #TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP2DDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP2DDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - #TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP2DBasicTrackGradeFactory -ToolSvc += IP2DDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP2DBasicTrackGradeFactory - print IP2DDetailedTrackGradeFactory - - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP2DTagTool = Analysis__IPTag( - name = "IP2DTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "2D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP2DNewLikelihood, - trackSelectorTool = IP2DTrackSelector, - #trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - #jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - #SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderName = "SV1", - SVForIPTool = SVForIPTool_IP2D, -# trackGradeFactory = IP2DBasicTrackGradeFactory, - trackGradeFactory = IP2DDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - UseCHypo=True, - xAODBaseName="IP2D", - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP2DTagTool -if BTaggingFlags.OutputLevel < 3: - print IP2DTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DFlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DFlipTag.py deleted file mode 100755 index 4dee0ffa7412a720854ec2b60c6102db3ee92868..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DFlipTag.py +++ /dev/null @@ -1,82 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP3DFlipNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP3DFlipNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP3D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP3DFlipNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP3DFlipNewLikelihood - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP3DFlipTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP3DFlipTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP3DFlipTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP3DFlipTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP3DFlip = Analysis__SVForIPTool(name = "SVForIPTool_IP3DFlip", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP3DFlip -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP3DFlip - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP3DFlipBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP3DFlipBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP3DFlipDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP3DFlipDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP3DFlipBasicTrackGradeFactory -ToolSvc += IP3DFlipDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP3DFlipBasicTrackGradeFactory - print IP3DFlipDetailedTrackGradeFactory - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP3DFlipTagTool = Analysis__IPTag( - name = "IP3DFlipTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "3D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP3DFlipNewLikelihood, - trackSelectorTool = IP3DFlipTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - flipIPSign = True, - writeInfoPlus = False, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP3DFlip, -# trackGradeFactory = IP3DFlipBasicTrackGradeFactory, - trackGradeFactory = IP3DFlipDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP3DFlipTagTool -if BTaggingFlags.OutputLevel < 3: - print IP3DFlipTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DNegTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DNegTag.py deleted file mode 100755 index 446b03a004b5e1026ae3ed93c787ff719dcedd43..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DNegTag.py +++ /dev/null @@ -1,84 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP3DNegNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP3DNegNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP3D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP3DNegNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP3DNegNewLikelihood - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP3DNegTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP3DNegTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP3DNegTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP3DNegTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP3DNeg = Analysis__SVForIPTool(name = "SVForIPTool_IP3DNeg", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP3DNeg -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP3DNeg - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP3DNegBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP3DNegBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP3DNegDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP3DNegDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP3DNegBasicTrackGradeFactory -ToolSvc += IP3DNegDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP3DNegBasicTrackGradeFactory - print IP3DNegDetailedTrackGradeFactory - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP3DNegTagTool = Analysis__IPTag( - name = "IP3DNegTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "3D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP3DNegNewLikelihood, - trackSelectorTool = IP3DNegTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - usePosIP = True, - useNegIP = False, - flipIPSign = True, - writeInfoPlus = False, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP3DNeg, -# trackGradeFactory = IP3DNegBasicTrackGradeFactory, - trackGradeFactory = IP3DNegDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP3DNegTagTool -if BTaggingFlags.OutputLevel < 3: - print IP3DNegTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DPosTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DPosTag.py deleted file mode 100755 index 6dca9a30050031c30245f2a347b54db1876f6cc7..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DPosTag.py +++ /dev/null @@ -1,84 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP3DPosNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP3DPosNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP3D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP3DPosNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP3DPosNewLikelihood - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP3DPosTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP3DPosTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP3DPosTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP3DPosTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP3DPos = Analysis__SVForIPTool(name = "SVForIPTool_IP3DPos", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP3DPos -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP3DPos - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP3DPosBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP3DPosBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP3DPosDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP3DPosDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP3DPosBasicTrackGradeFactory -ToolSvc += IP3DPosDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP3DPosBasicTrackGradeFactory - print IP3DPosDetailedTrackGradeFactory - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP3DPosTagTool = Analysis__IPTag( - name = "IP3DPosTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "3D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP3DPosNewLikelihood, - trackSelectorTool = IP3DPosTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - usePosIP = True, - useNegIP = False, - flipIPSign = False, - writeInfoPlus = False, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP3DPos, -# trackGradeFactory = IP3DPosBasicTrackGradeFactory, - trackGradeFactory = IP3DPosDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP3DPosTagTool -if BTaggingFlags.OutputLevel < 3: - print IP3DPosTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DSpcFlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DSpcFlipTag.py deleted file mode 100755 index a00eca23f78dc99e34353deffe55145aedbee889..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DSpcFlipTag.py +++ /dev/null @@ -1,85 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP3DSpcFlipNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP3DSpcFlipNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP3D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP3DSpcFlipNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcFlipNewLikelihood - - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP3DSpcFlipTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP3DSpcFlipTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP3DSpcFlipTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcFlipTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP3DSpcFlip = Analysis__SVForIPTool(name = "SVForIPTool_IP3DSpcFlip", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP3DSpcFlip -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP3DSpcFlip - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP3DSpcFlipBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP3DSpcFlipBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP3DSpcFlipDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP3DSpcFlipDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP3DSpcFlipBasicTrackGradeFactory -ToolSvc += IP3DSpcFlipDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcFlipBasicTrackGradeFactory - print IP3DSpcFlipDetailedTrackGradeFactory - - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP3DSpcFlipTagTool = Analysis__IPTag( - name = "IP3DSpcFlipTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "3D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP3DSpcFlipNewLikelihood, - trackSelectorTool = IP3DSpcFlipTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - SignWithSvx = True, - flipIPSign = True, - writeInfoPlus = False, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP3DSpcFlip, -# trackGradeFactory = IP3DSpcFlipBasicTrackGradeFactory, - trackGradeFactory = IP3DSpcFlipDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP3DSpcFlipTagTool -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcFlipTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DSpcNegTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DSpcNegTag.py deleted file mode 100755 index 66c40837592b36389a9ae7151d7e91cedd0c3aef..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DSpcNegTag.py +++ /dev/null @@ -1,85 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP3DSpcNegNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP3DSpcNegNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP3D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP3DSpcNegNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcNegNewLikelihood - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP3DSpcNegTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP3DSpcNegTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP3DSpcNegTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcNegTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP3DSpcNeg = Analysis__SVForIPTool(name = "SVForIPTool_IP3DSpcNeg", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP3DSpcNeg -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP3DSpcNeg - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP3DSpcNegBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP3DSpcNegBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP3DSpcNegDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP3DSpcNegDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP3DSpcNegBasicTrackGradeFactory -ToolSvc += IP3DSpcNegDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcNegBasicTrackGradeFactory - print IP3DSpcNegDetailedTrackGradeFactory - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP3DSpcNegTagTool = Analysis__IPTag( - name = "IP3DSpcNegTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "3D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP3DSpcNegNewLikelihood, - trackSelectorTool = IP3DSpcNegTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - usePosIP = True, - useNegIP = False, - flipIPSign = True, - SignWithSvx = True, - writeInfoPlus = False, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP3DSpcNeg, -# trackGradeFactory = IP3DSpcNegBasicTrackGradeFactory, - trackGradeFactory = IP3DSpcNegDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP3DSpcNegTagTool -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcNegTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DSpcPosTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DSpcPosTag.py deleted file mode 100755 index 89e5650d7fd8cfb0de373b43e658e4b35f0c7712..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DSpcPosTag.py +++ /dev/null @@ -1,85 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP3DSpcPosNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP3DSpcPosNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP3D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP3DSpcPosNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcPosNewLikelihood - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP3DSpcPosTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP3DSpcPosTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP3DSpcPosTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcPosTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP3DSpcPos = Analysis__SVForIPTool(name = "SVForIPTool_IP3DSpcPos", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP3DSpcPos -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP3DSpcPos - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP3DSpcPosBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP3DSpcPosBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP3DSpcPosDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP3DSpcPosDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP3DSpcPosBasicTrackGradeFactory -ToolSvc += IP3DSpcPosDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcPosBasicTrackGradeFactory - print IP3DSpcPosDetailedTrackGradeFactory - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP3DSpcPosTagTool = Analysis__IPTag( - name = "IP3DSpcPosTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "3D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP3DSpcPosNewLikelihood, - trackSelectorTool = IP3DSpcPosTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - usePosIP = True, - useNegIP = False, - flipIPSign = False, - SignWithSvx = True, - writeInfoPlus = False, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP3DSpcPos, -# trackGradeFactory = IP3DSpcPosBasicTrackGradeFactory, - trackGradeFactory = IP3DSpcPosDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP3DSpcPosTagTool -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcPosTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DSpcTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DSpcTag.py deleted file mode 100755 index baf2889daa3eabe46900ac605ee3bb9a5152ce55..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DSpcTag.py +++ /dev/null @@ -1,84 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP3DSpcNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP3DSpcNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP3D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP3DSpcNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcNewLikelihood - - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP3DSpcTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP3DSpcTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP3DSpcTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP3DSpc = Analysis__SVForIPTool(name = "SVForIPTool_IP3DSpc", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP3DSpc -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP3DSpc - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP3DSpcBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP3DSpcBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP3DSpcDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP3DSpcDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, - TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - -ToolSvc += IP3DSpcBasicTrackGradeFactory -ToolSvc += IP3DSpcDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcBasicTrackGradeFactory - print IP3DSpcDetailedTrackGradeFactory - - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP3DSpcTagTool = Analysis__IPTag( - name = "IP3DSpcTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "3D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP3DSpcNewLikelihood, - trackSelectorTool = IP3DSpcTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - SignWithSvx = True, - infoPlusName = "IPSpcInfoPlus", - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_IP3DSpc, -# trackGradeFactory = IP3DSpcBasicTrackGradeFactory, - trackGradeFactory = IP3DSpcDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP3DSpcTagTool -if BTaggingFlags.OutputLevel < 3: - print IP3DSpcTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DTag.py deleted file mode 100755 index 4fa8d8f9cf212e60ac4b6409423e94120d281fbf..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_IP3DTag.py +++ /dev/null @@ -1,84 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -IP3DNewLikelihood = Analysis__NewLikelihoodTool( - name = "IP3DNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "IP3D", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += IP3DNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print IP3DNewLikelihood - -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP3DTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP3DTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP3DTrackSelector -if BTaggingFlags.OutputLevel < 3: - print IP3DTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_IP3D = Analysis__SVForIPTool(name = "SVForIPTool_IP3D", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_IP3D -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_IP3D - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -IP3DBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP3DBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, -# TrackSummaryTool = None, - useSharedHitInfo = True) - -from JetTagTools.JetTagToolsConf import Analysis__DetailedTrackGradeFactory -IP3DDetailedTrackGradeFactory = Analysis__DetailedTrackGradeFactory(name = "IP3DDetailedTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - hitBLayerGrade=True, -# TrackSummaryTool = None, - useDetailSharedHitInfo = True, - useSharedHitInfo = True) - - -ToolSvc += IP3DBasicTrackGradeFactory -ToolSvc += IP3DDetailedTrackGradeFactory - -if BTaggingFlags.OutputLevel < 3: - print IP3DBasicTrackGradeFactory - print IP3DDetailedTrackGradeFactory - -from JetTagTools.JetTagToolsConf import Analysis__IPTag -IP3DTagTool = Analysis__IPTag( - name = "IP3DTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - impactParameterView = "3D", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = IP3DNewLikelihood, - trackSelectorTool = IP3DTrackSelector, -# trackToVertexTool = BTagTrackToVertexTool, -# trackGradePartitions = [ "Good", "Shared" ], - trackGradePartitions = [ "Good", "BlaShared", "PixShared", "SctShared", "0HitBLayer" ], - RejectBadTracks = False, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - jetCollectionList = BTaggingFlags.Jets, # not used -# jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, -# SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", -# SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SecVxFinderName = "SV1", - SVForIPTool = SVForIPTool_IP3D, -# trackGradeFactory = IP3DBasicTrackGradeFactory, - trackGradeFactory = IP3DDetailedTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - UseCHypo=True, - xAODBaseName="IP3D", - unbiasIPEstimation = False #switch to true (better!) when creating new PDFs - ) -ToolSvc += IP3DTagTool -if BTaggingFlags.OutputLevel < 3: - print IP3DTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_InDetVKalMultiVxInJetTool.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_InDetVKalMultiVxInJetTool.py deleted file mode 100644 index 3d511e9d4942b606907677c8ec814eb34490bde7..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_InDetVKalMultiVxInJetTool.py +++ /dev/null @@ -1,30 +0,0 @@ -#load the VKalVertex in Jet finder tool, configured to keep also vertices with negative Lxy - -from AthenaCommon.AppMgr import ToolSvc -#There two possible configuration of InDetVKalVxInJetTool -from InDetVKalVxInJetTool.InDetVKalVxInJetToolConf import InDet__InDetVKalVxInJetTool -InDetVKalMultiVxInJetTool = InDet__InDetVKalVxInJetTool(name = "InDetVKalMultiVxInJetTool", - getNegativeTail = False, - ConeForTag = 1., - MultiVertex = True, - OutputLevel = BTaggingFlags.OutputLevel) - -#from InDetVKalVxInJetTool.InDetVKalVxInJetFinder import AtlasVKalVxInJetFinder -#InDetVKalMultiVxInJetTool = AtlasVKalVxInJetFinder(name = "InDetVKalMultiVxInJetTool") -#InDetVKalMultiVxInJetTool.getNegativeTail = False -#InDetVKalMultiVxInJetTool.ConeForTag = 1. -#InDetVKalMultiVxInJetTool.MultiVertex = True -#InDetVKalMultiVxInJetTool.OutputLevel = BTaggingFlags.OutputLevel - -ToolSvc += InDetVKalMultiVxInJetTool -if BTaggingFlags.OutputLevel < 3: - print InDetVKalMultiVxInJetTool - -## factory for BTagSecVertexing -from JetTagTools.JetTagToolsConf import Analysis__MSVVariablesFactory -MSVVariablesFactory = Analysis__MSVVariablesFactory( name = "MSVVariablesFactory", - OutputLevel = BTaggingFlags.OutputLevel) -ToolSvc += MSVVariablesFactory - -if BTaggingFlags.OutputLevel < 3: - print MSVVariablesFactory diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_InDetVKalVxInJetTool.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_InDetVKalVxInJetTool.py deleted file mode 100644 index a93bed6033cf08c445f365ac91f44b74f4a4b456..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_InDetVKalVxInJetTool.py +++ /dev/null @@ -1,12 +0,0 @@ -#load the VKalVertex in Jet finder tool - -from AthenaCommon.AppMgr import ToolSvc -from InDetVKalVxInJetTool.InDetVKalVxInJetToolConf import InDet__InDetVKalVxInJetTool -InDetVKalVxInJetTool = InDet__InDetVKalVxInJetTool(name = "InDetVKalVxInJetTool", -# TrackSummaryTool = None, #Do not need it in b-tagging - OutputLevel = BTaggingFlags.OutputLevel) - - -ToolSvc += InDetVKalVxInJetTool -if BTaggingFlags.OutputLevel < 3: - print InDetVKalVxInJetTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_InDetVKalVxNegInJetTool.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_InDetVKalVxNegInJetTool.py deleted file mode 100644 index 435c1b6fa3a91f3b0bb825dc7a4fa026cfde78bd..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_InDetVKalVxNegInJetTool.py +++ /dev/null @@ -1,11 +0,0 @@ -#load the VKalVertex in Jet finder tool, configured to keep also vertices with negative Lxy - -from AthenaCommon.AppMgr import ToolSvc -from InDetVKalVxInJetTool.InDetVKalVxInJetToolConf import InDet__InDetVKalVxInJetTool -InDetVKalVxNegInJetTool = InDet__InDetVKalVxInJetTool(name = "InDetVKalVxNegInJetTool", - getNegativeTail = True, - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += InDetVKalVxNegInJetTool -if BTaggingFlags.OutputLevel < 3: - print InDetVKalVxNegInJetTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_InDetVKalVxNegativeTagInJetTool.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_InDetVKalVxNegativeTagInJetTool.py deleted file mode 100644 index 0513b8fb0ae2c7290f2fa2d6170ece3daead11e3..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_InDetVKalVxNegativeTagInJetTool.py +++ /dev/null @@ -1,15 +0,0 @@ -#load the VKalVertex in Jet finder tool, configured to keep also vertices with negative Lxy - -from AthenaCommon.AppMgr import ToolSvc -from InDetVKalVxInJetTool.InDetVKalVxInJetToolConf import InDet__InDetVKalVxInJetTool -InDetVKalVxNegativeTagInJetTool = InDet__InDetVKalVxInJetTool(name = "InDetVKalVxNegativeTagInJetTool", - getNegativeTag = True, - CutA0 = 2.0, # new tuned cuts for SV0 (Sara) - CutZVrt = 2.0, - CutPixelHits = 2, - TrackSummaryTool = None, #Do not need it in b-tagging - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += InDetVKalVxNegativeTagInJetTool -if BTaggingFlags.OutputLevel < 3: - print InDetVKalVxNegativeTagInJetTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterCOMB.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterCOMB.py deleted file mode 100755 index 8762d464543f7cef52c1b56130a8b40b4691a843..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterCOMB.py +++ /dev/null @@ -1,9 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__CombinerToolTag -JetFitterCOMB = Analysis__CombinerToolTag( name = "JetFitterCOMB", - OutputLevel = BTaggingFlags.OutputLevel, - combinedTagString = "JetFitterCOMB", - listTaggers = [ "JetFitterTag","IP3D" ] ) - -ToolSvc += JetFitterCOMB -if BTaggingFlags.OutputLevel < 3: - print JetFitterCOMB diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterCOMBNN.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterCOMBNN.py deleted file mode 100644 index fc587d6e7629be97e55d6b3e21e9da63def53b18..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterCOMBNN.py +++ /dev/null @@ -1,60 +0,0 @@ -useNNcombinedWithIP3D=True - -from AthenaCommon.AppMgr import ToolSvc - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterNtupleWriter -JetFitterNtupleWriterCOMBNN = Analysis__JetFitterNtupleWriter( name = "JetFitterNtupleWriterCOMBNN", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += JetFitterNtupleWriterCOMBNN -if BTaggingFlags.OutputLevel < 3: - print JetFitterNtupleWriterCOMBNN - - - -from TrkNeuralNetworkUtils.TrkNeuralNetworkUtilsConf import Trk__NeuralNetworkToHistoTool -NeuralNetworkToHistoCOMBNNTool = Trk__NeuralNetworkToHistoTool ( name = "NeuralNetworkToHistoToolCOMBNN", - OutputLevel = BTaggingFlags.OutputLevel) - - - -ToolSvc += NeuralNetworkToHistoCOMBNNTool -if BTaggingFlags.OutputLevel < 3: - print NeuralNetworkToHistoCOMBNNTool - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterNNTool -JetFitterCOMBNNTool = Analysis__JetFitterNNTool( name = "JetFitterCOMBNNTool", - CalibrationDirectory="JetFitter", - CalibrationSubDirectory="NeuralNetwork", - OutputLevel = BTaggingFlags.OutputLevel, - NeuralNetworkToHistoTool = NeuralNetworkToHistoNNTool, - usePtCorrectedMass = True, - useCombinedIPNN = useNNcombinedWithIP3D, - calibrationTool=BTagCalibrationBrokerTool - ) -ToolSvc += JetFitterCOMBNNTool -if BTaggingFlags.OutputLevel < 3: - print JetFitterCOMBNNTool - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag -JetFitterCOMBNN = Analysis__JetFitterTag( name = "JetFitterTagCOMBNN", - OutputLevel = BTaggingFlags.OutputLevel, - Runmodus = BTaggingFlags.Runmodus, - jetfitterNtupleWriter = JetFitterNtupleWriterCOMBNN, - jetfitterClassifier = JetFitterCOMBNNTool, - useForcedCalibration = False, - ipinfoTaggerName = "IP3D" if useNNcombinedWithIP3D else "", - SecVxFinderName="JetFitter", - xAODBaseName="JetFitterCombNN" - ) - -ToolSvc += JetFitterCOMBNN - - -JetFitterCOMBNN.jetCollectionList = [] -for key in BTaggingFlags.Jets: - JetFitterCOMBNN.jetCollectionList += [key] -# if (key == 'Cone4Tower' or key == 'Cone7Tower'): - -if BTaggingFlags.OutputLevel < 3: - print JetFitterCOMBNN diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterCOMBNN_IP3DNeg.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterCOMBNN_IP3DNeg.py deleted file mode 100644 index 60f327e79dff51a2a0e3d50a69ada1abf9886e2c..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterCOMBNN_IP3DNeg.py +++ /dev/null @@ -1,71 +0,0 @@ -useNNcombinedWithIP3D=True - -from AthenaCommon.AppMgr import ToolSvc - -if not BTaggingFlags.JetFitterNN: - from JetTagTools.JetTagToolsConf import Analysis__JetFitterNtupleWriter - JetFitterNtupleWriterCOMBNN = Analysis__JetFitterNtupleWriter( name = "JetFitterNtupleWriterCOMBNN", - OutputLevel = BTaggingFlags.OutputLevel) - - ToolSvc += JetFitterNtupleWriterCOMBNN - if BTaggingFlags.OutputLevel < 3: - print JetFitterNtupleWriterCOMBNN - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory -JetFitterVariablesFactoryCOMBNNIP3DNeg = Analysis__JetFitterVariablesFactory( name = "JetFitterVariablesFactoryCOMBNNIP3DNeg", - OutputLevel = BTaggingFlags.OutputLevel, - JetFitterInstance = "JetFitterCOMBNNIP3DNeg", - secVxFinderName = "NewJetFitterVxFinderFlip", - usePtCorrectedMass = True, - revertFromPositiveToNegativeTags = True) -ToolSvc += JetFitterVariablesFactoryCOMBNNIP3DNeg -if BTaggingFlags.OutputLevel < 3: - print JetFitterVariablesFactoryCOMBNNIP3DNeg - - -if not BTaggingFlags.JetFitterNN: - from TrkNeuralNetworkUtils.TrkNeuralNetworkUtilsConf import Trk__NeuralNetworkToHistoTool - NeuralNetworkToHistoCOMBNNTool = Trk__NeuralNetworkToHistoTool ( name = "NeuralNetworkToHistoToolCOMBNN", - OutputLevel = BTaggingFlags.OutputLevel) - - - - ToolSvc += NeuralNetworkToHistoCOMBNNTool - if BTaggingFlags.OutputLevel < 3: - print NeuralNetworkToHistoCOMBNNTool - - from JetTagTools.JetTagToolsConf import Analysis__JetFitterNNTool - JetFitterCOMBNNTool = Analysis__JetFitterNNTool( name = "JetFitterCOMBNNTool", - CalibrationDirectory="JetFitter", - CalibrationSubDirectory="NeuralNetwork", - OutputLevel = BTaggingFlags.OutputLevel, - NeuralNetworkToHistoTool = NeuralNetworkToHistoNNTool, - useCombinedIPNN = useNNcombinedWithIP3D, - calibrationTool=BTagCalibrationBrokerTool - ) - ToolSvc += JetFitterCOMBNNTool - if BTaggingFlags.OutputLevel < 3: - print JetFitterCOMBNNTool - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag -JetFitterIP3DNegCOMBNN = Analysis__JetFitterTag( name = "JetFitterTagCOMBNNIP3DNeg", - OutputLevel = BTaggingFlags.OutputLevel, - Runmodus = BTaggingFlags.Runmodus, - jetfitterNtupleWriter = JetFitterNtupleWriterCOMBNN, - jetfitterClassifier = JetFitterCOMBNNTool, - jetfitterVariablesFactory = JetFitterVariablesFactoryCOMBNNIP3DNeg, - useForcedCalibration = False, - supplementalTaggers = ["IP3DNeg"] if useNNcombinedWithIP3D else [], - storeOnlyBaseObject = True - ) - -ToolSvc += JetFitterIP3DNegCOMBNN - - -JetFitterIP3DNegCOMBNN.jetCollectionList = [] -for key in BTaggingFlags.Jets: - JetFitterIP3DNegCOMBNN.jetCollectionList += [key] -# if (key == 'Cone4Tower' or key == 'Cone7Tower'): - -if BTaggingFlags.OutputLevel < 3: - print JetFitterIP3DNegCOMBNN diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterCOMBNN_IP3DPos.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterCOMBNN_IP3DPos.py deleted file mode 100644 index 58ddbb80239d10fc522e121c792c5d43b714c805..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterCOMBNN_IP3DPos.py +++ /dev/null @@ -1,71 +0,0 @@ -useNNcombinedWithIP3D=True - -from AthenaCommon.AppMgr import ToolSvc - -if not BTaggingFlags.JetFitterNN: - from JetTagTools.JetTagToolsConf import Analysis__JetFitterNtupleWriter - JetFitterNtupleWriterCOMBNN = Analysis__JetFitterNtupleWriter( name = "JetFitterNtupleWriterCOMBNN", - OutputLevel = BTaggingFlags.OutputLevel) - - ToolSvc += JetFitterNtupleWriterCOMBNN - if BTaggingFlags.OutputLevel < 3: - print JetFitterNtupleWriterCOMBNN - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory -JetFitterVariablesFactoryCOMBNNIP3DPos = Analysis__JetFitterVariablesFactory( name = "JetFitterVariablesFactoryCOMBNNIP3DPos", - OutputLevel = BTaggingFlags.OutputLevel, - JetFitterInstance = "JetFitterCOMBNNIP3DPos", - secVxFinderName = "NewJetFitterVxFinderFlip", - usePtCorrectedMass = True, - revertFromPositiveToNegativeTags = True) -ToolSvc += JetFitterVariablesFactoryCOMBNNIP3DPos -if BTaggingFlags.OutputLevel < 3: - print JetFitterVariablesFactoryCOMBNNIP3DPos - - -if not BTaggingFlags.JetFitterNN: - from TrkNeuralNetworkUtils.TrkNeuralNetworkUtilsConf import Trk__NeuralNetworkToHistoTool - NeuralNetworkToHistoCOMBNNTool = Trk__NeuralNetworkToHistoTool ( name = "NeuralNetworkToHistoToolCOMBNN", - OutputLevel = BTaggingFlags.OutputLevel) - - - - ToolSvc += NeuralNetworkToHistoCOMBNNTool - if BTaggingFlags.OutputLevel < 3: - print NeuralNetworkToHistoCOMBNNTool - - from JetTagTools.JetTagToolsConf import Analysis__JetFitterNNTool - JetFitterCOMBNNTool = Analysis__JetFitterNNTool( name = "JetFitterCOMBNNTool", - CalibrationDirectory="JetFitter", - CalibrationSubDirectory="NeuralNetwork", - OutputLevel = BTaggingFlags.OutputLevel, - NeuralNetworkToHistoTool = NeuralNetworkToHistoNNTool, - useCombinedIPNN = useNNcombinedWithIP3D, - calibrationTool=BTagCalibrationBrokerTool - ) - ToolSvc += JetFitterCOMBNNTool - if BTaggingFlags.OutputLevel < 3: - print JetFitterCOMBNNTool - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag -JetFitterIP3DPosCOMBNN = Analysis__JetFitterTag( name = "JetFitterTagCOMBNNIP3DPos", - OutputLevel = BTaggingFlags.OutputLevel, - Runmodus = BTaggingFlags.Runmodus, - jetfitterNtupleWriter = JetFitterNtupleWriterCOMBNN, - jetfitterClassifier = JetFitterCOMBNNTool, - jetfitterVariablesFactory = JetFitterVariablesFactoryCOMBNNIP3DPos, - useForcedCalibration = False, - supplementalTaggers = ['IP3DPos'] if useNNcombinedWithIP3D else [], - storeOnlyBaseObject = True - ) - -ToolSvc += JetFitterIP3DPosCOMBNN - - -JetFitterIP3DPosCOMBNN.jetCollectionList = [] -for key in BTaggingFlags.Jets: - JetFitterIP3DPosCOMBNN.jetCollectionList += [key] -# if (key == 'Cone4Tower' or key == 'Cone7Tower'): - -if BTaggingFlags.OutputLevel < 3: - print JetFitterIP3DPosCOMBNN diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterFinder.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterFinder.py deleted file mode 100644 index 2a48d771d0b27dd12a97cf85c361d637a32f3f99..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterFinder.py +++ /dev/null @@ -1,78 +0,0 @@ -from AthenaCommon.AppMgr import ToolSvc - -from TrkExTools.AtlasExtrapolator import AtlasExtrapolator -JetFitterExtrapolator = AtlasExtrapolator() - -ToolSvc += JetFitterExtrapolator -if BTaggingFlags.OutputLevel < 3: - print JetFitterExtrapolator - -# each tagger needs own instance, can't be shared! ( -from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetDetailedTrackSelectorTool -InDetJetFitterTrackSelectorTool = InDet__InDetDetailedTrackSelectorTool(name = "InDetJetFitterTrackSelectorTool", - pTMin = 769.2, - IPd0Max = 3.5, - IPz0Max = 5, - sigIPd0Max = 0.35, - sigIPz0Max = 2.5, - etaMax = 9999., - useTrackSummaryInfo = True, - nHitBLayer = 0, - nHitPix = 1, - nHitSct = 4, - nHitSi = 7, - nHitTrt = 0, - useSharedHitInfo = False, - useTrackQualityInfo = True, - fitChi2OnNdfMax = 3.5, - TrackSummaryTool = None, - Extrapolator = JetFitterExtrapolator) - -ToolSvc +=InDetJetFitterTrackSelectorTool -if BTaggingFlags.OutputLevel < 3: - print InDetJetFitterTrackSelectorTool - - - -from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory -JetFitterLinFactory = Trk__FullLinearizedTrackFactory(name = "JetFitterFullLinearizedTrackFactory", - Extrapolator = JetFitterExtrapolator) -ToolSvc += JetFitterLinFactory -if BTaggingFlags.OutputLevel < 3: - print JetFitterLinFactory - -from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterInitializationHelper -JetFitterInitializationHelper = Trk__JetFitterInitializationHelper( name = "JetFitterInitializationHelper", - LinearizedTrackFactory = JetFitterLinFactory, - OutputLevel = BTaggingFlags.OutputLevel) -ToolSvc += JetFitterInitializationHelper -if BTaggingFlags.OutputLevel < 3: - print JetFitterInitializationHelper - -from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterRoutines -jetFitterRoutines = Trk__JetFitterRoutines( name = "JetFitterRoutines", - JetFitterInitializationHelper = JetFitterInitializationHelper, - BeFast = False, - maxDRshift = 0., - noPrimaryVertexRefit = False, - OutputLevel = BTaggingFlags.OutputLevel) -ToolSvc += jetFitterRoutines -if BTaggingFlags.OutputLevel < 3: - print jetFitterRoutines - -from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetJetFitterVxFinder -JetFitterVxFinder = InDet__InDetJetFitterVxFinder( name = "JetFitterVxFinder", - JetFitterRoutines = jetFitterRoutines, - OutputLevel = BTaggingFlags.OutputLevel, - MaxNumDeleteIterations = 30, - VertexProbCut = 0.01, - MaxClusteringIterations = 30, - VertexClusteringProbabilityCut = 0.01, - JetFitterInitializationHelper = JetFitterInitializationHelper, - TrackSelector = InDetJetFitterTrackSelectorTool) -ToolSvc += JetFitterVxFinder -if BTaggingFlags.OutputLevel < 3: - print JetFitterVxFinder - -#JetFitterVxFinder.MaxTracksToFitAtOnce = 10 to be added in bugfix version - diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterTag.py deleted file mode 100755 index 609cf3615266a173c7e82b2b357844968c445bf6..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterTag.py +++ /dev/null @@ -1,37 +0,0 @@ -from AthenaCommon.AppMgr import ToolSvc - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterNtupleWriter -jetFitterNtupleWriter = Analysis__JetFitterNtupleWriter( name = "JetFitterNtupleWriter", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += jetFitterNtupleWriter -if BTaggingFlags.OutputLevel < 3: - print jetFitterNtupleWriter - - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterLikelihood -jetFitterLikelihood = Analysis__JetFitterLikelihood( name = "JetFitterLikelihood", - CalibrationDirectory = "JetFitter", - CalibrationSubDirectory = "RooFitLikelihood", - calibrationTool = BTagCalibrationBrokerTool, - OutputLevel = BTaggingFlags.OutputLevel ) -ToolSvc += jetFitterLikelihood -if BTaggingFlags.OutputLevel < 3: - print jetFitterLikelihood - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag -JetFitterTagTool = Analysis__JetFitterTag( name = "JetFitterTag", - OutputLevel = BTaggingFlags.OutputLevel, - Runmodus = BTaggingFlags.Runmodus, - jetCollectionList = BTaggingFlags.Jets, - jetfitterNtupleWriter = jetFitterNtupleWriter, - jetfitterClassifier = jetFitterLikelihood, - jetfitterVariablesFactory = JetFitterVariablesFactory, - useForcedCalibration = False, - storeOnlyBaseObject = False - ) - -ToolSvc += JetFitterTagTool - -if BTaggingFlags.OutputLevel < 3: - print JetFitterTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterTagNN.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterTagNN.py deleted file mode 100644 index 5ad9426db3d557431b8647c3754ca837f77181e1..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterTagNN.py +++ /dev/null @@ -1,59 +0,0 @@ -useNNcombinedWithIP3D=False -from AthenaCommon.AppMgr import ToolSvc - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterNtupleWriter -JetFitterNtupleWriterNN = Analysis__JetFitterNtupleWriter( name = "JetFitterNtupleWriterNN", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += JetFitterNtupleWriterNN -if BTaggingFlags.OutputLevel < 3: - print JetFitterNtupleWriterNN - - -from TrkNeuralNetworkUtils.TrkNeuralNetworkUtilsConf import Trk__NeuralNetworkToHistoTool -NeuralNetworkToHistoNNTool = Trk__NeuralNetworkToHistoTool ( name = "NeuralNetworkToHistoToolNN", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += NeuralNetworkToHistoNNTool -if BTaggingFlags.OutputLevel < 3: - print NeuralNetworkToHistoNNTool - - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterNNTool -JetFitterNNTool = Analysis__JetFitterNNTool( name = "JetFitterNNTool", - CalibrationDirectory="JetFitter", - CalibrationSubDirectory="NeuralNetwork", - OutputLevel = BTaggingFlags.OutputLevel, - NeuralNetworkToHistoTool = NeuralNetworkToHistoNNTool, - useCombinedIPNN = useNNcombinedWithIP3D, - usePtCorrectedMass = True, - calibrationTool=BTagCalibrationBrokerTool - ) -ToolSvc += JetFitterNNTool -if BTaggingFlags.OutputLevel < 3: - print JetFitterNNTool - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag -JetFitterTagToolNN = Analysis__JetFitterTag( name = "JetFitterTagNN", - OutputLevel = BTaggingFlags.OutputLevel, - Runmodus = BTaggingFlags.Runmodus, - jetfitterNtupleWriter = JetFitterNtupleWriterNN, - jetfitterClassifier = JetFitterNNTool, - jetCollectionList = BTaggingFlags.Jets, - useForcedCalibration = False, - ipinfoTaggerName = "IP3D" if useNNcombinedWithIP3D else "", - SecVxFinderName="JetFitter", - xAODBaseName="JetFitter" - ) - - - - - -#if not BTaggingFlags.JetFitterTag: -# JetFitterTagToolNN.storeOnlyBaseObject = False - -ToolSvc += JetFitterTagToolNN - -if BTaggingFlags.OutputLevel < 3: - print JetFitterTagToolNN diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterTagNNNeg.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterTagNNNeg.py deleted file mode 100644 index 02c6d74f9269a8806c458539e6bb667b784e7e39..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetFitterTagNNNeg.py +++ /dev/null @@ -1,68 +0,0 @@ -useNNcombinedWithIP3D=False - -from AthenaCommon.AppMgr import ToolSvc - -if not BTaggingFlags.JetFitterNN: - from JetTagTools.JetTagToolsConf import Analysis__JetFitterNtupleWriter - JetFitterNtupleWriterNN = Analysis__JetFitterNtupleWriter( name = "JetFitterNtupleWriterNN", - OutputLevel = BTaggingFlags.OutputLevel) - - ToolSvc += JetFitterNtupleWriterNN - if BTaggingFlags.OutputLevel < 3: - print JetFitterNtupleWriterNN - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory -JetFitterVariablesFactoryNNFlip = Analysis__JetFitterVariablesFactory( name = "JetFitterVariablesFactoryNNFlip", - OutputLevel = BTaggingFlags.OutputLevel, - secVxFinderName = "NewJetFitterVxFinderFlip", - JetFitterInstance = "JetFitterTagNNFlip", - usePtCorrectedMass = True, - revertFromPositiveToNegativeTags = True) -ToolSvc += JetFitterVariablesFactoryNNFlip -if BTaggingFlags.OutputLevel < 3: - print JetFitterVariablesFactoryNNFlip - - -if not BTaggingFlags.JetFitterNN: - from TrkNeuralNetworkUtils.TrkNeuralNetworkUtilsConf import Trk__NeuralNetworkToHistoTool - NeuralNetworkToHistoNNTool = Trk__NeuralNetworkToHistoTool ( name = "NeuralNetworkToHistoToolNN", - OutputLevel = BTaggingFlags.OutputLevel) - - ToolSvc += NeuralNetworkToHistoNNTool - if BTaggingFlags.OutputLevel < 3: - print NeuralNetworkToHistoNNTool - - - from JetTagTools.JetTagToolsConf import Analysis__JetFitterNNTool - JetFitterNNTool = Analysis__JetFitterNNTool( name = "JetFitterNNTool", - CalibrationDirectory="JetFitter", - CalibrationSubDirectory="NeuralNetwork", - OutputLevel = BTaggingFlags.OutputLevel, - NeuralNetworkToHistoTool = NeuralNetworkToHistoNNTool, - useCombinedIPNN = useNNcombinedWithIP3D, - calibrationTool=BTagCalibrationBrokerTool - ) - ToolSvc += JetFitterNNTool - if BTaggingFlags.OutputLevel < 3: - print JetFitterNNTool - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag -JetFitterFlipTagToolNN = Analysis__JetFitterTag( name = "JetFitterTagNNFlip", - OutputLevel = BTaggingFlags.OutputLevel, - Runmodus = BTaggingFlags.Runmodus, - jetfitterNtupleWriter = JetFitterNtupleWriterNN, - jetfitterClassifier = JetFitterNNTool, - jetfitterVariablesFactory = JetFitterVariablesFactoryNNFlip, - jetCollectionList = BTaggingFlags.Jets, - useForcedCalibration = False, - supplementalTaggers = ['IP3D'] if useNNcombinedWithIP3D else [], - storeOnlyBaseObject = True - ) - -if not BTaggingFlags.JetFitterTagFlip: - JetFitterFlipTagToolNN.storeOnlyBaseObject = False - -ToolSvc += JetFitterFlipTagToolNN - -if BTaggingFlags.OutputLevel < 3: - print JetFitterFlipTagToolNN diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetProbFlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetProbFlipTag.py deleted file mode 100755 index feb8efae2440b2c4b5ec737a607abf61ebc76b64..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetProbFlipTag.py +++ /dev/null @@ -1,29 +0,0 @@ - -from JetTagTools.JetTagToolsConf import Analysis__JetProbTag -JetProbFlipTagTool = Analysis__JetProbTag( - name = "JetProbFlipTag", - Runmodus = BTaggingFlags.Runmodus, - impactParameterView = "2D", - flipIPSign = True, - UseNegIP = True, - UsePosIP = False, - OutputLevel = BTaggingFlags.OutputLevel, - trackSelectorTool = JetProbTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, - trackGradePartitions = [ "Good", "Shared" ], - RejectBadTracks = False, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_JetProb, - calibrationTool = BTagCalibrationBrokerTool, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - trackGradeFactory = JetProbBasicTrackGradeFactory, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - unbiasIPEstimation = False, #switch to true (better!) when creating new PDFs - InputType = globalflags.DataSource() - ) -ToolSvc += JetProbFlipTagTool -if BTaggingFlags.OutputLevel < 3: - print JetProbFlipTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetProbTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetProbTag.py deleted file mode 100755 index bf4db14b1a4fe0dfebabc167b33cd02bc5218353..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_JetProbTag.py +++ /dev/null @@ -1,55 +0,0 @@ -# each tagger needs own instance, can't be shared! ( -> not sure here ... ask Laurent, JB) -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -JetProbTrackSelector = Analysis__TrackSelector( - name = "JetProbTrackSelector", - OutputLevel = BTaggingFlags.OutputLevel, - trackToVertexTool = BTagTrackToVertexTool - ) -ToolSvc += JetProbTrackSelector -if BTaggingFlags.OutputLevel < 3: - print JetProbTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_JetProb = Analysis__SVForIPTool(name = "SVForIPTool_JetProb", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_JetProb -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_JetProb - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -JetProbBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "JetProbBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -ToolSvc += JetProbBasicTrackGradeFactory -if BTaggingFlags.OutputLevel < 3: - print JetProbBasicTrackGradeFactory - -from JetTagTools.JetTagToolsConf import Analysis__JetProbTag -JetProbTagTool = Analysis__JetProbTag( - name = "JetProbTag", - Runmodus = BTaggingFlags.Runmodus, - impactParameterView = "2D", - OutputLevel = BTaggingFlags.OutputLevel, - trackSelectorTool = JetProbTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, - trackGradePartitions = [ "Good", "Shared" ], - UseNegIP = False, - RejectBadTracks = False, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_JetProb, - calibrationTool = BTagCalibrationBrokerTool, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - trackGradeFactory = JetProbBasicTrackGradeFactory, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - unbiasIPEstimation = False, #switch to true (better!) when creating new PDFs - InputType = globalflags.DataSource() - ) -ToolSvc += JetProbTagTool -if BTaggingFlags.OutputLevel < 3: - print JetProbTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_LoadTools.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_LoadTools.py deleted file mode 100755 index 0f47e5c3cb102552bf86dc5187d87e57dc89f0d8..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_LoadTools.py +++ /dev/null @@ -1,647 +0,0 @@ -print '#BTAG# - MANU' -# This python script loads and configures -# all the services, algorithms and tools -# needed for b-tagging. -# devivie@lal.in2p3.fr -# vacavant@in2p3.fr - -import string - -# -# ========== First tweak flags if needed -# -from AthenaCommon.BFieldFlags import jobproperties - -if not 'BTaggingFlags' in dir(): - from BTagging.BTaggingFlags import BTaggingFlags - -# -- disable whole b-tagging if not in collision mode or if solenoid is off: -if not jobproperties.Beam.beamType == "collisions": - print '#BTAG# - Disabling the whole b-tagging since beamType is not collisions...' - BTaggingFlags.Active = False - -if jobproperties.BField.solenoidOn() == False: - print '#BTAG# - Disabling the whole b-tagging since solenoid is OFF...' - BTaggingFlags.Active = False - -# -- for reference mode: -if BTaggingFlags.Runmodus == 'reference': - BTaggingFlags.JetProbFlip = False - BTaggingFlags.IP2DFlip = False - BTaggingFlags.IP2DPos = False - BTaggingFlags.IP2DNeg = False - BTaggingFlags.IP2DSpcFlip = False - BTaggingFlags.IP2DSpcPos = False - BTaggingFlags.IP2DSpcNeg = False - BTaggingFlags.IP3DFlip = False - BTaggingFlags.IP3DPos = False - BTaggingFlags.IP3DNeg = False - BTaggingFlags.IP3DSpcFlip = False - BTaggingFlags.IP3DSpcPos = False - BTaggingFlags.IP3DSpcNeg = False - BTaggingFlags.SV1Flip = False - BTaggingFlags.SV2Flip = False - BTaggingFlags.TrackCountingFlip = False - BTaggingFlags.MultiSVTag = False - BTaggingFlags.QGTag = False - BTaggingFlags.MV1 = False - BTaggingFlags.MV1c = False - BTaggingFlags.MV2 = False - BTaggingFlags.MV2c00 = False - BTaggingFlags.MV2c10 = False - BTaggingFlags.MV2c20 = False - BTaggingFlags.MV1Flip = False - BTaggingFlags.MV1cFlip = False - BTaggingFlags.MV2Flip = False - BTaggingFlags.MV2c00Flip = False - BTaggingFlags.MV2c10Flip = False - BTaggingFlags.MV2c20Flip = False - - -# -- disable taggers accordingly to reconstruction scoping levels: -from RecExConfig.RecFlags import rec -print '#BTAG# B-tagging descoping: level = ', rec.ScopingLevel() -if rec.ScopingLevel() >= 2: - print '#BTAG# - Disabling low-priority b-tagging algorithms:', - for tagger in BTaggingFlags._tags: - if ( tagger in BTaggingFlags.LowPriorityTaggers ): - print tagger, - BTaggingFlags.Disable(tagger) - print -if rec.ScopingLevel() >= 3: - print '#BTAG# - Disabling medium-priority b-tagging algorithms:', - for tagger in BTaggingFlags._tags: - if ( tagger in BTaggingFlags.MediumPriorityTaggers ): - print tagger, - BTaggingFlags.Disable(tagger) - print -if rec.ScopingLevel() >= 4: - print '#BTAG# - Disabling high-priority b-tagging algorithms:', - for tagger in BTaggingFlags._tags: - if ( tagger in BTaggingFlags.HighPriorityTaggers ): - print tagger, - BTaggingFlags.Disable(tagger) - print - -# -- now disable specific taggers if geometry not defined: -from AthenaCommon.DetFlags import DetFlags -if not DetFlags.detdescr.Muon_on(): - print '#BTAG# - Disabling soft-muon tagger since muon detdescr. not found' - BTaggingFlags.Disable('SoftMu') - BTaggingFlags.Disable('SoftMuChi2') -if not DetFlags.detdescr.Calo_on(): - print '#BTAG# - Disabling soft-electron tagger since calo detdescr. not found' - BTaggingFlags.Disable('SoftEl') -if not DetFlags.detdescr.ID_on(): - print '#BTAG# - Disabling all b-tagging algorithms since ID detdescr. not found:', - for tagger in BTaggingFlags._tags: - print tagger, - BTaggingFlags.Disable(tagger) - print - -# -- flags are now fully defined: -BTaggingFlags.Print() - -if BTaggingFlags.Active: - - # -- determine the keys of the McEventCollection to be used and of the JetCollections already there in the input - TheTruthCollectionKey = 'TruthEvent' - BTaggingFlags.RetagJets = BTaggingFlags.Jets - if BTaggingFlags.AutoInspectInputFile: - from AthenaCommon.GlobalFlags import globalflags - if globalflags.InputFormat == 'pool': - try: - from RecExConfig.InputFilePeeker import inputFileSummary - BTaggingFlags.RetagJets = [ ] - for i in inputFileSummary['eventdata_items']: - if i[0] == 'McEventCollection': - TheTruthCollectionKey = i[1] - if i[0] == 'JetCollection': - jetC1 = (i[1]).replace('AODJets','') - jetC = jetC1.replace('Jets','') - if jetC in BTaggingFlags.Jets: - BTaggingFlags.RetagJets += [ jetC ] - except Exception, err: - print '#BTAG# - b-tagging: automatic inspection of input file failed (file too old?)' - print '#BTAG# --> b-tagging: using ',TheTruthCollectionKey, ' as truth key' - print '#BTAG# --> b-tagging: re-tagging those jet collections: ', BTaggingFlags.RetagJets - - # - # ========== Add services - # - - from AthenaCommon.AppMgr import ServiceMgr as svcMgr - if not hasattr(svcMgr, 'THistSvc'): - from GaudiSvc.GaudiSvcConf import THistSvc - svcMgr += THistSvc() - - # - # ========== Add algorithms that must run before b-tagging - # - - if not 'topSequence' in dir(): - from AthenaCommon.AlgSequence import AlgSequence - topSequence = AlgSequence() - - # -- Converter ParticleJets -> Jets if needed to read PJets (old AODs like r13) - if BTaggingFlags.ConvertParticleJets: - include ("JetRec/ParticleJetCompatibility.py") - - # - # ========== Add tools now - # - from AthenaCommon.AppMgr import ToolSvc - - # -- for calibration from COOL - include( "JetTagCalibration/BTagCalibrationBroker_jobOptions.py" ) - - # -- to label jets with truth information - from RecExConfig.RecFlags import rec - if rec.doTruth: - # Jet Label - if BTaggingFlags.jetTruthMatching == 'matchQuark' or BTaggingFlags.jetTruthMatching == 'jetTrackTruthMatching': - if BTaggingFlags.jetTruthMatching == 'matchQuark': # this is default! - from ParticleJetTools.ParticleJetToolsConf import Analysis__JetQuarkLabel - BTagJetTruthMatching = Analysis__JetQuarkLabel(name = "BTagJetTruthMatching") - elif BTaggingFlags.jetTruthMatching == 'jetTrackTruthMatching': - from ParticleJetTools.ParticleJetToolsConf import Analysis__JetTrackTruthMatching - BTagJetTruthMatching = Analysis__JetTrackTruthMatching( - name = "BTagJetTruthMatching", - TrackParticlesName = BTaggingFlags.TrackParticleCollectionName, - TrackParticleTruthMapName = BTaggingFlags.TrackParticleTruthCollectionName - ) - BTagJetTruthMatching.McEventCollection = TheTruthCollectionKey - ToolSvc += BTagJetTruthMatching - if BTaggingFlags.OutputLevel < 3: - print BTagJetTruthMatching - - if BTaggingFlags.QGTag: - from ParticleJetTools.ParticleJetToolsConf import Analysis__JetQGPartonLabel - BTagJetQGPartonTruthMatching = Analysis__JetQGPartonLabel(name = "BTagJetQGPartonTruthMatching") - BTagJetQGPartonTruthMatching.McEventCollection = TheTruthCollectionKey - ToolSvc += BTagJetQGPartonTruthMatching - if BTaggingFlags.OutputLevel < 3: - print BTagJetQGPartonTruthMatching - else: - BTagJetQGPartonTruthMatching = None - - # Lepton Truth Match - #if (BTaggingFlags.SoftMu | BTaggingFlags.SoftEl): - from ParticleJetTools.ParticleJetToolsConf import Analysis__FindLeptonTruth - BTagLeptonTruthTool = Analysis__FindLeptonTruth(name = "BTagLeptonTruthTool") - BTagLeptonTruthTool.McEventCollection = TheTruthCollectionKey - ToolSvc += BTagLeptonTruthTool - if BTaggingFlags.OutputLevel < 3: - print BTagLeptonTruthTool - - # Labeling tool: - from BTagging.BTaggingConf import Analysis__BTagLabeling - thisBTagLabeling = Analysis__BTagLabeling( - name = "thisBTagLabeling", - JetTruthMatchTool = BTagJetTruthMatching, - JetQGPartonTruthMatchTool = BTagJetQGPartonTruthMatching, #MANU?? - LeptonTruthTool = BTagLeptonTruthTool - ) - ToolSvc += thisBTagLabeling - if BTaggingFlags.OutputLevel < 3: - print thisBTagLabeling - - else: #rec.doTruth - BTagJetTruthMatching = None - BTagJetQGPartonTruthMatching = None - BTagLeptonTruthTool = None - thisBTagLabeling = None - - # Secondary vertex reconsruction tool: - from BTagging.BTaggingConf import Analysis__BTagSecVertexing - thisBTagSecVertexing = Analysis__BTagSecVertexing( - name = "thisBTagSecVertexing" - ) - ToolSvc += thisBTagSecVertexing - if BTaggingFlags.OutputLevel < 3: - print thisBTagSecVertexing - - # Removing tool: - from BTagging.BTaggingConf import Analysis__BTagRemoving - thisBTagRemoving = Analysis__BTagRemoving( - name = "thisBTagRemoving", - storeSecondaryVerticesInJet = BTaggingFlags.writeSecondaryVertices, - listOfTracksToRemove = [], - listOfSvxToRemove = [] - ) - ToolSvc += thisBTagRemoving - if BTaggingFlags.OutputLevel < 3: - print thisBTagRemoving - - # -- MAIN b-tagging tool: - from BTagging.BTaggingConf import Analysis__BTagTool - myBTagTool = Analysis__BTagTool( - name = "myBTagTool", - Runmodus = BTaggingFlags.Runmodus, - PrimaryVertexName = BTaggingFlags.PrimaryVertexCollectionName, - BaselineTagger = BTaggingFlags.BaselineTagger, - BTagLabelingTool = thisBTagLabeling, - BTagSecVertexingTool = thisBTagSecVertexing, - BTagRemovingTool = thisBTagRemoving, - OutputLevel = BTaggingFlags.OutputLevel - ) - ToolSvc += myBTagTool - - # -- associate tracks to jet: (moved back to use only one tool for the time being for all jet collections) - from ParticleJetTools.ParticleJetToolsConf import Analysis__ParticleToJetAssociator - BTagTrackToJetAssociator = Analysis__ParticleToJetAssociator( - name = "BTagTrackToJetAssociator", - OutputLevel = BTaggingFlags.OutputLevel - ) - ToolSvc += BTagTrackToJetAssociator - if BTaggingFlags.OutputLevel < 3: - print BTagTrackToJetAssociator - - # -- associate leptons to jet: (same tool for all jet collections) - if ( BTaggingFlags.SoftMu | BTaggingFlags.SoftMuChi2 ): - BTagMuonToJetAssociator = Analysis__ParticleToJetAssociator( - name = "BTagMuonToJetAssociator", - trackCone = 1.0, #for the time being... has to be studied - useVariableSizedTrackCone = False, - OutputLevel = BTaggingFlags.OutputLevel - ) - ToolSvc += BTagMuonToJetAssociator - if BTaggingFlags.OutputLevel < 3: - print BTagMuonToJetAssociator - else: - BTagMuonToJetAssociator = None - - if BTaggingFlags.SoftEl: - BTagElectronToJetAssociator = Analysis__ParticleToJetAssociator( - name = "BTagElectronToJetAssociator", - trackCone = 0.4, #for the time being... has to be studied - useVariableSizedTrackCone = False, - OutputLevel = BTaggingFlags.OutputLevel # does not work right now - ) - ToolSvc += BTagElectronToJetAssociator - if BTaggingFlags.OutputLevel < 3: - print BTagElectronToJetAssociator - else: - BTagElectronToJetAssociator = None - - - # -- extrapolation to propagate tracks to primary vertex: - from TrkExTools.AtlasExtrapolator import AtlasExtrapolator - AtlasExtrapolator = AtlasExtrapolator() - ToolSvc += AtlasExtrapolator - - from TrackToVertex.TrackToVertexConf import Reco__TrackToVertex - BTagTrackToVertexTool = Reco__TrackToVertex( - name = "BTagTrackToVertexTool", - Extrapolator = AtlasExtrapolator - ) - ToolSvc += BTagTrackToVertexTool - if BTaggingFlags.OutputLevel < 3: - print BTagTrackToVertexTool - - # -- tracking tools to sign the impact parameter: - if (BTaggingFlags.IP1D | BTaggingFlags.IP2D | BTaggingFlags.IP3D | - BTaggingFlags.JetProb | - BTaggingFlags.TrackCounting | - BTaggingFlags.SoftMu | BTaggingFlags.SoftMuChi2 | BTaggingFlags.SoftEl): - from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory - BTagLinTrkFactory = Trk__FullLinearizedTrackFactory(name = "BTagFullLinearizedTrackFactory", - Extrapolator = AtlasExtrapolator) - ToolSvc += BTagLinTrkFactory - if BTaggingFlags.OutputLevel < 3: - print BTagLinTrkFactory - from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator - BTagTrackToVertexIPEstimator = Trk__TrackToVertexIPEstimator(name="BTagTrackToVertexIPEstimator", - OutputLevel = BTaggingFlags.OutputLevel, - Extrapolator=AtlasExtrapolator, - LinearizedTrackFactory=BTagLinTrkFactory) - ToolSvc += BTagTrackToVertexIPEstimator - if BTaggingFlags.OutputLevel < 3: - print BTagTrackToVertexIPEstimator - - # -- load secondary vertex tools: - if (BTaggingFlags.SV1 | BTaggingFlags.SV2 | - BTaggingFlags.IP1D | BTaggingFlags.IP2D | BTaggingFlags.IP3D | - BTaggingFlags.JetProb | - BTaggingFlags.TrackCounting): - include( "BTagging/BTagging_InDetVKalVxInJetTool.py" ) - # myBTagTool.SecVtxFinderList+= [ InDetVKalVxInJetTool ] - # myBTagTool.SecVtxFinderTrackNameList+=["Tracks"] - thisBTagSecVertexing.SecVtxFinderList+= [ InDetVKalVxInJetTool ] - thisBTagSecVertexing.SecVtxFinderTrackNameList+=["Tracks"] - thisBTagRemoving.listOfSvxToRemove+= ["InDetVKalVxInJetTool"] - - if BTaggingFlags.SV0: - include( "BTagging/BTagging_InDetVKalVxNegInJetTool.py" ) - # myBTagTool.SecVtxFinderList+= [ InDetVKalVxNegInJetTool ] - # myBTagTool.SecVtxFinderTrackNameList+=["Tracks"] - thisBTagSecVertexing.SecVtxFinderList+= [ InDetVKalVxNegInJetTool ] - thisBTagSecVertexing.SecVtxFinderTrackNameList+=["Tracks"] - thisBTagRemoving.listOfSvxToRemove+= ["InDetVKalVxNegInJetTool"] - - if BTaggingFlags.MultiSV: - -### different track association for bb - BTagTrackToJetAssociatorBB = Analysis__ParticleToJetAssociator( - name = "BTagTrackToJetAssociatorBB", - OutputLevel = BTaggingFlags.OutputLevel, - shareTracks=False, - useVariableSizedTrackCone= True, - coneSizeFitPar1 = 3.15265e-01, - coneSizeFitPar2 = -3.66502e-01, - coneSizeFitPar3 = -1.56387e-05, - ) - ToolSvc += BTagTrackToJetAssociatorBB - include( "BTagging/BTagging_InDetVKalMultiVxInJetTool.py" ) - # myBTagTool.SecVtxFinderList+= [ InDetVKalMultiVxInJetTool ] - # myBTagTool.SecVtxFinderTrackNameList+=["TracksBB"] - thisBTagSecVertexing.SecVtxFinderList+= [ InDetVKalMultiVxInJetTool ] - thisBTagSecVertexing.SecVtxFinderTrackNameList+=["TracksBB"] - thisBTagRemoving.listOfSvxToRemove+= ["InDetVKalMultiVxInJetTool"] - thisBTagRemoving.listOfTracksToRemove = ["TracksBB"] - - from BTagging.BTaggingConf import Analysis__BTagTrackAssociation - thisBTagTrackAssociation = Analysis__BTagTrackAssociation( - name = "thisBTagTrackAssociation", - BTagAssociation = BTaggingFlags.doStandardAssoc, - TrackParticleContainerName = BTaggingFlags.TrackParticleCollectionName, - MuonToJetAssociator = BTagMuonToJetAssociator, # OK: always the same - ElectronToJetAssociator = BTagElectronToJetAssociator) # will also not be duplicated in memory - - # -- configure leptons: - # and configure removal tool - if BTaggingFlags.SoftMu: - thisBTagTrackAssociation.MuonContainerName = BTaggingFlags.MuonCollectionName - if BTaggingFlags.SoftMuChi2: - thisBTagTrackAssociation.MuonContainerName = BTaggingFlags.MuonCollectionName - if BTaggingFlags.SoftEl: - thisBTagTrackAssociation.ElectronContainerName = BTaggingFlags.ElectronCollectionName - thisBTagTrackAssociation.PhotonContainerName = BTaggingFlags.PhotonCollectionName - if BTaggingFlags.MultiSV: - thisBTagTrackAssociation.AdditionalTrackToJetAssocName = [ "TracksBB" ] - thisBTagTrackAssociation.AdditionalTrackToJetAssociator = [ToolSvc.BTagTrackToJetAssociatorBB ] - thisBTagRemoving.listOfTracksToRemove = ["TracksBB"] - - - ToolSvc += thisBTagTrackAssociation - if BTaggingFlags.OutputLevel < 3: - print thisBTagTrackAssociation - - - - if (BTaggingFlags.SV1Flip | BTaggingFlags.SV2Flip): - include( "BTagging/BTagging_InDetVKalVxNegativeTagInJetTool.py" ) - # myBTagTool.SecVtxFinderList+= [ InDetVKalVxNegativeTagInJetTool ] - # myBTagTool.SecVtxFinderTrackNameList+=["Tracks"] - thisBTagSecVertexing.SecVtxFinderList+= [ InDetVKalVxNegativeTagInJetTool ] - thisBTagSecVertexing.SecVtxFinderTrackNameList+=["Tracks"] - thisBTagRemoving.listOfSvxToRemove+= ["InDetVKalVxNegativeTagInJetTool"] - - if BTaggingFlags.BasicJetFitter: - include( "BTagging/BTagging_JetFitterFinder.py" ) - # myBTagTool.SecVtxFinderList+= [ JetFitterVxFinder ] - # myBTagTool.SecVtxFinderTrackNameList+=["Tracks"] - thisBTagSecVertexing.SecVtxFinderList+= [ JetFitterVxFinder ] - thisBTagSecVertexing.SecVtxFinderTrackNameList+=["Tracks"] - thisBTagRemoving.listOfSvxToRemove+= ["JetFitterVxFinder"] - - if BTaggingFlags.JetFitterTag | BTaggingFlags.JetFitterNN: - include( "BTagging/BTagging_NewJetFitterFinder.py" ) - # myBTagTool.SecVtxFinderList+= [ NewJetFitterVxFinder ] - # myBTagTool.SecVtxFinderTrackNameList+=["Tracks"] - thisBTagSecVertexing.SecVtxFinderList+= [ NewJetFitterVxFinder ] - thisBTagSecVertexing.SecVtxFinderTrackNameList+=["Tracks"] - thisBTagRemoving.listOfSvxToRemove+= ["NewJetFitterVxFinder"] - - if BTaggingFlags.JetFitterTagFlip | BTaggingFlags.JetFitterNNFlip: - include( "BTagging/BTagging_NewJetFitterFinderNeg.py" ) - # myBTagTool.SecVtxFinderList+= [ NewJetFitterVxFinderFlip ] - # myBTagTool.SecVtxFinderTrackNameList+=["Tracks"] - thisBTagSecVertexing.SecVtxFinderList+= [ NewJetFitterVxFinderFlip ] - thisBTagSecVertexing.SecVtxFinderTrackNameList+=["Tracks"] - thisBTagRemoving.listOfSvxToRemove+= ["NewJetFitterVxFinderFlip"] - - # check removal tool - print thisBTagRemoving.listOfTracksToRemove - print thisBTagRemoving.listOfSvxToRemove - - # -- load all the taggers ! : - - - if BTaggingFlags.IP1D: - include( "BTagging/BTagging_IP1DTag.py" ) - myBTagTool.TagToolList += [ IP1DTagTool ] - if BTaggingFlags.IP2D: - include( "BTagging/BTagging_IP2DTag.py" ) - myBTagTool.TagToolList += [ IP2DTagTool ] - if BTaggingFlags.IP2DFlip: - include( "BTagging/BTagging_IP2DFlipTag.py" ) - myBTagTool.TagToolList += [ IP2DFlipTagTool ] - if BTaggingFlags.IP2DPos: - include( "BTagging/BTagging_IP2DPosTag.py" ) - myBTagTool.TagToolList += [ IP2DPosTagTool ] - if BTaggingFlags.IP2DNeg: - include( "BTagging/BTagging_IP2DNegTag.py" ) - myBTagTool.TagToolList += [ IP2DNegTagTool ] - if BTaggingFlags.IP2DSpc: - include( "BTagging/BTagging_IP2DSpcTag.py" ) - myBTagTool.TagToolList += [ IP2DSpcTagTool ] - if BTaggingFlags.IP2DSpcFlip: - include( "BTagging/BTagging_IP2DSpcFlipTag.py" ) - myBTagTool.TagToolList += [ IP2DSpcFlipTagTool ] - if BTaggingFlags.IP2DSpcPos: - include( "BTagging/BTagging_IP2DSpcPosTag.py" ) - myBTagTool.TagToolList += [ IP2DSpcPosTagTool ] - if BTaggingFlags.IP2DSpcNeg: - include( "BTagging/BTagging_IP2DSpcNegTag.py" ) - myBTagTool.TagToolList += [ IP2DSpcNegTagTool ] - if BTaggingFlags.IP3D: - include( "BTagging/BTagging_IP3DTag.py" ) - myBTagTool.TagToolList += [ IP3DTagTool ] - if BTaggingFlags.IP3DFlip: - include( "BTagging/BTagging_IP3DFlipTag.py" ) - myBTagTool.TagToolList += [ IP3DFlipTagTool ] - if BTaggingFlags.IP3DPos: - include( "BTagging/BTagging_IP3DPosTag.py" ) - myBTagTool.TagToolList += [ IP3DPosTagTool ] - if BTaggingFlags.IP3DNeg: - include( "BTagging/BTagging_IP3DNegTag.py" ) - myBTagTool.TagToolList += [ IP3DNegTagTool ] - if BTaggingFlags.IP3DSpc: - include( "BTagging/BTagging_IP3DSpcTag.py" ) - myBTagTool.TagToolList += [ IP3DSpcTagTool ] - if BTaggingFlags.IP3DSpcFlip: - include( "BTagging/BTagging_IP3DSpcFlipTag.py" ) - myBTagTool.TagToolList += [ IP3DSpcFlipTagTool ] - if BTaggingFlags.IP3DSpcPos: - include( "BTagging/BTagging_IP3DSpcPosTag.py" ) - myBTagTool.TagToolList += [ IP3DSpcPosTagTool ] - if BTaggingFlags.IP3DSpcNeg: - include( "BTagging/BTagging_IP3DSpcNegTag.py" ) - myBTagTool.TagToolList += [ IP3DSpcNegTagTool ] - - if BTaggingFlags.SV1: - include( "BTagging/BTagging_SV1Tag.py" ) - myBTagTool.TagToolList += [ SV1TagTool ] - if BTaggingFlags.SV1Flip: - include( "BTagging/BTagging_SV1FlipTag.py" ) - myBTagTool.TagToolList += [ SV1FlipTagTool ] - if BTaggingFlags.SV2: - include( "BTagging/BTagging_SV2Tag.py" ) - myBTagTool.TagToolList += [ SV2TagTool ] - if BTaggingFlags.SV2Flip: - include( "BTagging/BTagging_SV2FlipTag.py" ) - myBTagTool.TagToolList += [ SV2FlipTagTool ] - if BTaggingFlags.SV0: - include( "BTagging/BTagging_SV0Tag.py" ) - myBTagTool.TagToolList += [ SV0TagTool ] - - if BTaggingFlags.MultiSV: - include( "BTagging/BTagging_MultiSVTag.py" ) - myBTagTool.TagToolList += [ MultiSVTagTool ] - - if BTaggingFlags.JetProb: - include( "BTagging/BTagging_JetProbTag.py" ) - myBTagTool.TagToolList += [ JetProbTagTool ] - if BTaggingFlags.JetProbFlip: - include( "BTagging/BTagging_JetProbFlipTag.py" ) - myBTagTool.TagToolList += [ JetProbFlipTagTool ] - - if BTaggingFlags.SoftEl: - include( "BTagging/BTagging_SoftElectronTag.py" ) - myBTagTool.TagToolList += [ SoftElectronTagTool ] - if BTaggingFlags.SoftMu: - include( "BTagging/BTagging_SoftMuonTag.py" ) - myBTagTool.TagToolList += [ SoftMuonTagTool ] - if BTaggingFlags.SoftMuChi2: - include( "BTagging/BTagging_SoftMuonTagChi2.py" ) - myBTagTool.TagToolList += [ SoftMuonTagChi2Tool ] - - if BTaggingFlags.BasicJetFitter: - include( "BTagging/BTagging_JetFitterTag.py" ) - myBTagTool.TagToolList += [ JetFitterTagTool ] - if BTaggingFlags.IP3D: - include( "BTagging/BTagging_JetFitterCOMB.py" ) - myBTagTool.TagToolList += [ JetFitterCOMB ]; - if BTaggingFlags.JetFitterTag: - include( "BTagging/BTagging_NewJetFitterTag.py" ) - myBTagTool.TagToolList += [ NewJetFitterTagTool ] - if BTaggingFlags.IP3D: - include( "BTagging/BTagging_NewJetFitterCOMB.py" ) - myBTagTool.TagToolList += [ NewJetFitterCOMB ] - if BTaggingFlags.JetFitterNN: - include( "BTagging/BTagging_JetFitterTagNN.py" ) - myBTagTool.TagToolList += [ JetFitterTagToolNN ] - if BTaggingFlags.IP3D: - include( "BTagging/BTagging_JetFitterCOMBNN.py" ) - myBTagTool.TagToolList += [ JetFitterCOMBNN ] - - if BTaggingFlags.JetFitterTagFlip: - include( "BTagging/BTagging_NewJetFitterTagNeg.py" ) - myBTagTool.TagToolList += [ NewJetFitterFlipTagTool ] - if BTaggingFlags.IP3DNeg: - include( "BTagging/BTagging_NewJetFitterCOMBNeg.py" ) - myBTagTool.TagToolList += [ NewJetFitterFlipCOMB ] - if BTaggingFlags.JetFitterNNFlip: - include( "BTagging/BTagging_JetFitterTagNNNeg.py" ) - myBTagTool.TagToolList += [ JetFitterFlipTagToolNN ] - if BTaggingFlags.IP3DPos: - include( "BTagging/BTagging_JetFitterCOMBNN_IP3DPos.py" ) - myBTagTool.TagToolList += [ JetFitterIP3DPosCOMBNN ] - if BTaggingFlags.IP3DNeg: - include( "BTagging/BTagging_JetFitterCOMBNN_IP3DNeg.py" ) - myBTagTool.TagToolList += [ JetFitterIP3DNegCOMBNN ] - if BTaggingFlags.IPFordG: - from BTagging.IPFordG import add_ipfordg - ipfordg = add_ipfordg( - ToolSvc, BTagCalibrationBrokerTool, BTaggingFlags, - BTagTrackToVertexTool, BTagTrackToVertexIPEstimator) - myBTagTool.TagToolList += [ipfordg] - if BTaggingFlags.TrackCounting: - include( "BTagging/BTagging_TrackCounting.py" ) - myBTagTool.TagToolList += [ TrackCountingTool ] - if BTaggingFlags.TrackCountingFlip: - include( "BTagging/BTagging_TrackCountingFlip.py" ) - myBTagTool.TagToolList += [ TrackCountingFlipTool ] - - if BTaggingFlags.QGTag: - include( "BTagging/BTagging_QGTag.py" ) - myBTagTool.TagToolList += [ QGTag ] - - if BTaggingFlags.MV1: - include( "BTagging/BTagging_MV1Tag.py" ) - myBTagTool.TagToolList += [ MV1TagTool ] - if BTaggingFlags.MV1Flip: - include( "BTagging/BTagging_MV1FlipTag.py" ) - myBTagTool.TagToolList += [ MV1FlipTagTool ] - if BTaggingFlags.MV1c: - include( "BTagging/BTagging_MV1cTag.py" ) - myBTagTool.TagToolList += [ MV1cTagTool ] - if BTaggingFlags.MV1cFlip: - include( "BTagging/BTagging_MV1cFlipTag.py" ) - myBTagTool.TagToolList += [ MV1cFlipTagTool ] - if BTaggingFlags.MV2: - include( "BTagging/BTagging_MV2Tag.py" ) - myBTagTool.TagToolList += [ MV2TagTool ] - if BTaggingFlags.MV2c00: - include( "BTagging/BTagging_MV2c00Tag.py" ) - myBTagTool.TagToolList += [ MV2c00TagTool ] - if BTaggingFlags.MV2c10: - include( "BTagging/BTagging_MV2c10Tag.py" ) - myBTagTool.TagToolList += [ MV2c10TagTool ] - if BTaggingFlags.MV2c20: - include( "BTagging/BTagging_MV2c20Tag.py" ) - myBTagTool.TagToolList += [ MV2c20TagTool ] - if BTaggingFlags.MV2Flip: - include( "BTagging/BTagging_MV2FlipTag.py" ) - myBTagTool.TagToolList += [ MV2FlipTagTool ] - if BTaggingFlags.MV2c00Flip: - include( "BTagging/BTagging_MV2c00FlipTag.py" ) - myBTagTool.TagToolList += [ MV2c00FlipTagTool ] - if BTaggingFlags.MV2c10Flip: - include( "BTagging/BTagging_MV2c10FlipTag.py" ) - myBTagTool.TagToolList += [ MV2c10FlipTagTool ] - if BTaggingFlags.MV2c20Flip: - include( "BTagging/BTagging_MV2c20FlipTag.py" ) - myBTagTool.TagToolList += [ MV2c20FlipTagTool ] - - - - # -- b-tagging tool is now fully configured. - - # - # ========== Deal with calibration histogram files - # - - # -- for analysis (should be in COOL now): - if BTaggingFlags.Runmodus == 'analysis': - - if ( BTaggingFlags.lifetime1D | BTaggingFlags.lifetime2D | BTaggingFlags.lifetime3D | - BTaggingFlags.secVtxFitBU | BTaggingFlags.secVtxFitTD ): - dataPathList = os.environ[ 'DATAPATH' ].split(os.pathsep) - dataPathList.insert(0, os.curdir) - from AthenaCommon.Utils.unixtools import FindFile - JetTagsigname = FindFile( 'all_Cone4TowerParticleJets_matchQuark_FastVertexFitter_sig.root', dataPathList, os.R_OK ) - JetTagbkgname = FindFile( 'all_Cone4TowerParticleJets_matchQuark_FastVertexFitter_bkg.root', dataPathList, os.R_OK ) - svcMgr.THistSvc.Input += ["SigCali DATAFILE='"+JetTagsigname+"' OPT='OLD'"] - svcMgr.THistSvc.Input += ["BkgCali DATAFILE='"+JetTagbkgname+"' OPT='OLD'"] - - writeSmoothedHistos = False - if writeSmoothedHistos: - svcMgr.THistSvc.Output += ["ControlFile DATAFILE='smoothcontrol.root' OPT='RECREATE'"] - - # -- for reference mode: - if BTaggingFlags.Runmodus == 'reference': - - svcMgr.THistSvc.Output += ["RefFile DATAFILE='BTagCalibALL.root' OPT='RECREATE'"] - #for key in BTaggingFlags.Jets: - # for tagger in ['JetProb','IP1D','IP2D','IP2DSpc','IP3D','IP3DSpc','SV1','SV2','SoftMu','SoftEl']: - # if BTaggingFlags.IsEnabled(tagger): - # RefileName = "BTaggingRef"+tagger+key+".root" - # svcMgr.THistSvc.Output += ["RefFile"+tagger+key+" DATAFILE='"+RefileName+"' OPT='RECREATE'"] - - if ( BTaggingFlags.lifetime1D | BTaggingFlags.lifetime2D | BTaggingFlags.lifetime3D | - BTaggingFlags.secVtxFitBU | BTaggingFlags.secVtxFitTD ): - svcMgr.THistSvc.Output += ["SigCali DATAFILE='cern.sig.referencehistos.root' OPT='RECREATE'"] - svcMgr.THistSvc.Output += ["BkgCali DATAFILE='cern.bkg.referencehistos.root' OPT='RECREATE'"] - diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV1FlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV1FlipTag.py deleted file mode 100755 index 91ed753e267c89f07179c773864f39c30714dc83..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV1FlipTag.py +++ /dev/null @@ -1,13 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__MV1Tag -MV1FlipTagTool = Analysis__MV1Tag( - name = "MV1FlipTag", - Runmodus = BTaggingFlags.Runmodus, - calibrationTool = BTagCalibrationBrokerTool, - inputIP3DWeightName = "IP3DNeg", - inputSV1WeightName = "SV1Flip", - inputJetFitterWeightName = "JetFitterCOMBNNIP3DNeg", - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += MV1FlipTagTool -if BTaggingFlags.OutputLevel < 3: - print MV1FlipTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV1Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV1Tag.py deleted file mode 100755 index 5821a957ef0755d91664e451af72f7df36f503b5..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV1Tag.py +++ /dev/null @@ -1,14 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__MV1Tag -MV1TagTool = Analysis__MV1Tag( - name = "MV1Tag", - Runmodus = BTaggingFlags.Runmodus, - calibrationTool = BTagCalibrationBrokerTool, - xAODBaseName="MV1", - inputIP3DWeightName="IP3D", - inputSV1WeightName="SV1", - inputJetFitterWeightName="JetFitterCombNN", - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += MV1TagTool -if BTaggingFlags.OutputLevel < 3: - print MV1TagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV1cFlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV1cFlipTag.py deleted file mode 100755 index 53273ab7628db4abb199cb9f7d932a9f6cc74d68..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV1cFlipTag.py +++ /dev/null @@ -1,13 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__MV1cTag -MV1cFlipTagTool = Analysis__MV1cTag( - name = "MV1cFlipTag", - Runmodus = BTaggingFlags.Runmodus, - calibrationTool = BTagCalibrationBrokerTool, - inputIP3DWeightName = "IP3DNeg", - inputSV1WeightName = "SV1Flip", - inputJetFitterWeightName = "JetFitterCOMBNNIP3DNeg", - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += MV1cFlipTagTool -if BTaggingFlags.OutputLevel < 3: - print MV1cFlipTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV1cTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV1cTag.py deleted file mode 100755 index 341a32421243ce8cd55f7fcb040ca6db2a8551f5..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV1cTag.py +++ /dev/null @@ -1,14 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__MV1cTag -MV1cTagTool = Analysis__MV1cTag( - name = "MV1cTag", - Runmodus = BTaggingFlags.Runmodus, - calibrationTool = BTagCalibrationBrokerTool, - xAODBaseName="MV1c", - inputIP3DWeightName="IP3D", - inputSV1WeightName="SV1", - inputJetFitterWeightName="JetFitterCombNN", - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += MV1cTagTool -if BTaggingFlags.OutputLevel < 3: - print MV1cTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2FlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2FlipTag.py deleted file mode 100755 index 5fdfa22cea20730f528b3aea4051fd883cb5b39f..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2FlipTag.py +++ /dev/null @@ -1,13 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__MV1Tag -MV2FlipTagTool = Analysis__MV1Tag( - name = "MV2FlipTag", - Runmodus = BTaggingFlags.Runmodus, - calibrationTool = BTagCalibrationBrokerTool, - inputIP3DWeightName = "IP3DNeg", - inputSV1WeightName = "SV1Flip", - inputJetFitterWeightName = "JetFitterCOMBNNIP3DNeg", - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += MV2FlipTagTool -if BTaggingFlags.OutputLevel < 3: - print MV2FlipTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2Tag.py deleted file mode 100755 index cc352d493c9bc7b37d4bfc51fcf8138da0b62fab..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2Tag.py +++ /dev/null @@ -1,10 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__MV1Tag -MV2TagTool = Analysis__MV1Tag( - name = "MV2Tag", - Runmodus = BTaggingFlags.Runmodus, - calibrationTool = BTagCalibrationBrokerTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += MV2TagTool -if BTaggingFlags.OutputLevel < 3: - print MV2TagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c00FlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c00FlipTag.py deleted file mode 100644 index 1070e1499ed1310333fc79309028bb02ab86052f..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c00FlipTag.py +++ /dev/null @@ -1,13 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__MV2Tag -MV2c00FlipTagTool = Analysis__MV2Tag( - name = "MV2c00FlipTag", - Runmodus = BTaggingFlags.Runmodus, - calibrationTool = BTagCalibrationBrokerTool, - forceMV2CalibrationAlias = BTaggingFlags.ForceMV2CalibrationAlias, - MV2CalibAlias = BTaggingFlags.MV2CalibAlias, - OutputLevel = BTaggingFlags.OutputLevel, - flipMV2 = True - ) -ToolSvc += MV2c00FlipTagTool -if BTaggingFlags.OutputLevel < 3: - print MV2c00FlipTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c00Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c00Tag.py deleted file mode 100644 index 63f07ef11e0977fb1d5eee42e82608cabe121277..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c00Tag.py +++ /dev/null @@ -1,19 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__MV2Tag -MV2c00TagTool = Analysis__MV2Tag( - name = "MV2c00Tag", - Runmodus = BTaggingFlags.Runmodus, - calibrationTool = BTagCalibrationBrokerTool, - forceMV2CalibrationAlias = BTaggingFlags.ForceMV2CalibrationAlias, - MV2CalibAlias = BTaggingFlags.MV2CalibAlias, - xAODBaseName="MV2c00", - inputSV0SourceName = "SV0", - inputSV1SourceName = "SV1", - inputIP2DSourceName = "IP2D", - inputIP3DSourceName = "IP3D", - inputJFSourceName = "JetFitter", - inputJFProbSourceName = "JetFitterCombNN", - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += MV2c00TagTool -if BTaggingFlags.OutputLevel < 3: - print MV2c00TagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c10FlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c10FlipTag.py deleted file mode 100644 index a97080c62e3c9751bf92541682f5de0f262d75ee..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c10FlipTag.py +++ /dev/null @@ -1,13 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__MV2Tag -MV2c10FlipTagTool = Analysis__MV2Tag( - name = "MV2c10FlipTag", - Runmodus = BTaggingFlags.Runmodus, - calibrationTool = BTagCalibrationBrokerTool, - forceMV2CalibrationAlias = BTaggingFlags.ForceMV2CalibrationAlias, - MV2CalibAlias = BTaggingFlags.MV2CalibAlias, - OutputLevel = BTaggingFlags.OutputLevel, - flipMV2 = True - ) -ToolSvc += MV2c10FlipTagTool -if BTaggingFlags.OutputLevel < 3: - print MV2c10FlipTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c10Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c10Tag.py deleted file mode 100644 index 426156b9c18909f95c301b8d658327c71f49470d..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c10Tag.py +++ /dev/null @@ -1,19 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__MV2Tag -MV2c10TagTool = Analysis__MV2Tag( - name = "MV2c10Tag", - Runmodus = BTaggingFlags.Runmodus, - calibrationTool = BTagCalibrationBrokerTool, - forceMV2CalibrationAlias = BTaggingFlags.ForceMV2CalibrationAlias, - MV2CalibAlias = BTaggingFlags.MV2CalibAlias, - xAODBaseName="MV2c10", - inputSV0SourceName = "SV0", - inputSV1SourceName = "SV1", - inputIP2DSourceName = "IP2D", - inputIP3DSourceName = "IP3D", - inputJFSourceName = "JetFitter", - inputJFProbSourceName = "JetFitterCombNN", - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += MV2c10TagTool -if BTaggingFlags.OutputLevel < 3: - print MV2c10TagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c20FlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c20FlipTag.py deleted file mode 100644 index 9849b5ed5080f5c8116425820fd6e58b54569890..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c20FlipTag.py +++ /dev/null @@ -1,13 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__MV2Tag -MV2c20FlipTagTool = Analysis__MV2Tag( - name = "MV2c20FlipTag", - Runmodus = BTaggingFlags.Runmodus, - calibrationTool = BTagCalibrationBrokerTool, - forceMV2CalibrationAlias = BTaggingFlags.ForceMV2CalibrationAlias, - MV2CalibAlias = BTaggingFlags.MV2CalibAlias, - OutputLevel = BTaggingFlags.OutputLevel, - flipMV2 = True - ) -ToolSvc += MV2c20FlipTagTool -if BTaggingFlags.OutputLevel < 3: - print MV2c20FlipTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c20Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c20Tag.py deleted file mode 100644 index 4ca8079a4ed531da4048e8d944314d88b6c7b04a..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MV2c20Tag.py +++ /dev/null @@ -1,19 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__MV2Tag -MV2c20TagTool = Analysis__MV2Tag( - name = "MV2c20Tag", - Runmodus = BTaggingFlags.Runmodus, - calibrationTool = BTagCalibrationBrokerTool, - forceMV2CalibrationAlias = BTaggingFlags.ForceMV2CalibrationAlias, - MV2CalibAlias = BTaggingFlags.MV2CalibAlias, - xAODBaseName="MV2c20", - inputSV0SourceName = "SV0", - inputSV1SourceName = "SV1", - inputIP2DSourceName = "IP2D", - inputIP3DSourceName = "IP3D", - inputJFSourceName = "JetFitter", - inputJFProbSourceName = "JetFitterCombNN", - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += MV2c20TagTool -if BTaggingFlags.OutputLevel < 3: - print MV2c20TagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MultiSVTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MultiSVTag.py deleted file mode 100755 index 11766f865074cf35f1134b777d49e1c38b07c60f..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MultiSVTag.py +++ /dev/null @@ -1,15 +0,0 @@ - -from JetTagTools.JetTagToolsConf import Analysis__MultiSVTag -MultiSVTagTool = Analysis__MultiSVTag( - name = "MutliSVTag", - Runmodus = BTaggingFlags.Runmodus, - infoPlusName = "MultiSVInfoPlus", - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - OutputLevel = BTaggingFlags.OutputLevel, - jetCollectionList = BTaggingFlags.Jets, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - SecVxFinderName = "InDetVKalMultiVxInJetTool" - ) -ToolSvc += MultiSVTagTool -if BTaggingFlags.OutputLevel < 3: - print MultiSVTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MultiSVbb1Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MultiSVbb1Tag.py deleted file mode 100755 index 7a716c8942cf82caacc0d65c78445fc2608e8cb4..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MultiSVbb1Tag.py +++ /dev/null @@ -1,20 +0,0 @@ - -from JetTagTools.JetTagToolsConf import Analysis__MultiSVTag -MultiSVbb1TagTool = Analysis__MultiSVTag( - name = "MultiSVbb1Tag", - Runmodus = BTaggingFlags.Runmodus, - calibrationTool = BTagCalibrationBrokerTool, - #SVAlgType = "MSV", - xAODBaseName = "MSV", - taggerNameBase = "MultiSVbb1", - #infoPlusName = "MultiSVInfoPlus", - #originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - OutputLevel = BTaggingFlags.OutputLevel, - jetCollectionList = BTaggingFlags.Jets, - #jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - #SecVxFinderName = "InDetVKalMultiVxInJetTool" - SecVxFinderName = "MSV" - ) -ToolSvc += MultiSVbb1TagTool -if BTaggingFlags.OutputLevel < 3: - print MultiSVbb1TagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MultiSVbb2Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MultiSVbb2Tag.py deleted file mode 100755 index 3dac5ac1a26c9ff60878dd2d59e4dbd3b8af6cde..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_MultiSVbb2Tag.py +++ /dev/null @@ -1,20 +0,0 @@ - -from JetTagTools.JetTagToolsConf import Analysis__MultiSVTag -MultiSVbb2TagTool = Analysis__MultiSVTag( - name = "MultiSVbb2Tag", - Runmodus = BTaggingFlags.Runmodus, - calibrationTool = BTagCalibrationBrokerTool, - #SVAlgType = "MSV", - xAODBaseName = "MSV", - taggerNameBase = "MultiSVbb2", - #infoPlusName = "MultiSVInfoPlus", - #originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName, - OutputLevel = BTaggingFlags.OutputLevel, - jetCollectionList = BTaggingFlags.Jets, - #jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - #SecVxFinderName = "InDetVKalMultiVxInJetTool" - SecVxFinderName = "MSV" - ) -ToolSvc += MultiSVbb2TagTool -if BTaggingFlags.OutputLevel < 3: - print MultiSVbb2TagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterCOMB.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterCOMB.py deleted file mode 100644 index b1bf473841853cc1f91cb51f04f9b5f6238b6533..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterCOMB.py +++ /dev/null @@ -1,9 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__CombinerToolTag -NewJetFitterCOMB = Analysis__CombinerToolTag( name = "NewJetFitterCOMB", - OutputLevel = BTaggingFlags.OutputLevel, - combinedTagString = "JetFitterCOMB", - listTaggers = [ "JetFitterTag","IP3D" ] ) - -ToolSvc += NewJetFitterCOMB -if BTaggingFlags.OutputLevel < 3: - print NewJetFitterCOMB diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterCOMBNeg.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterCOMBNeg.py deleted file mode 100644 index 2a5a03fcd78792f1f4714133459b54f24ede11dc..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterCOMBNeg.py +++ /dev/null @@ -1,9 +0,0 @@ -from JetTagTools.JetTagToolsConf import Analysis__CombinerToolTag -NewJetFitterFlipCOMB = Analysis__CombinerToolTag( name = "NewJetFitterFlipCOMB", - OutputLevel = BTaggingFlags.OutputLevel, - combinedTagString = "JetFitterCOMBFlip", - listTaggers = [ "JetFitterTagFlip","IP3DNeg" ] ) - -ToolSvc += NewJetFitterFlipCOMB -if BTaggingFlags.OutputLevel < 3: - print NewJetFitterFlipCOMB diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterFinder.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterFinder.py deleted file mode 100644 index 2c5c7f2aa66b079e104fb05237150b71ff3e5754..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterFinder.py +++ /dev/null @@ -1,175 +0,0 @@ -from AthenaCommon.AppMgr import ToolSvc -from TrkExTools.AtlasExtrapolator import AtlasExtrapolator -JetFitterExtrapolator = AtlasExtrapolator() - -ToolSvc += JetFitterExtrapolator -if BTaggingFlags.OutputLevel < 3: - print JetFitterExtrapolator - -# Track Selector for JetFitter -from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetDetailedTrackSelectorTool -NewInDetJetFitterTrackSelectorTool = InDet__InDetDetailedTrackSelectorTool(name = "InDetImprovedJetFitterTrackSelectorTool", - pTMin = 500., - IPd0Max = 7., - IPz0Max = 10., - sigIPd0Max = 0.35, - sigIPz0Max = 2.5, - etaMax = 9999., - useTrackSummaryInfo = True, - nHitBLayer = 0, - nHitPix = 1, - nHitSct = 4, - nHitSi = 7, - nHitTrt = 0, - useSharedHitInfo = False, - useTrackQualityInfo = True, - fitChi2OnNdfMax = 3.5, - TrackSummaryTool = None, - Extrapolator = JetFitterExtrapolator) - -ToolSvc += NewInDetJetFitterTrackSelectorTool -if BTaggingFlags.OutputLevel < 3: - print NewInDetJetFitterTrackSelectorTool - -#LOAD CONVENTIONAL VERTEXING TOOLS - -from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory -JetFitterLinFactory = Trk__FullLinearizedTrackFactory(name = "JetFitterFullLinearizedTrackFactory", - Extrapolator = JetFitterExtrapolator) -ToolSvc += JetFitterLinFactory -if BTaggingFlags.OutputLevel < 3: - print JetFitterLinFactory - -from TrkVertexSeedFinderUtils.TrkVertexSeedFinderUtilsConf import Trk__Mode3dTo1dFinder -mode3dfinder = Trk__Mode3dTo1dFinder(name = "JetFitterMode3dTo1dFinder") - -ToolSvc += mode3dfinder -if BTaggingFlags.OutputLevel < 3: - print mode3dfinder - -from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexSmoother -vertexsmoother = Trk__SequentialVertexSmoother(name = "JetFitterSequentialVertexSmoother") - -ToolSvc += vertexsmoother -if BTaggingFlags.OutputLevel < 3: - print vertexsmoother - - -from TrkVxEdmCnv.TrkVxEdmCnvConf import Trk__VxCandidateXAODVertex -InDetVxIntEdmCnv = Trk__VxCandidateXAODVertex(name="VxInternalEdmFactory", - LinearizedTrackFactory=JetFitterLinFactory, - OutputLevel =BTaggingFlags.OutputLevel) -ToolSvc += InDetVxIntEdmCnv -if BTaggingFlags.OutputLevel < 3: - print InDetVxIntEdmCnv - -from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexFitter -sequentialVtxFitter = Trk__SequentialVertexFitter(name = "JetFitterSequentialVertexFitter", - VertexSmoother= vertexsmoother, - LinearizedTrackFactory=JetFitterLinFactory, - XAODConverter=InDetVxIntEdmCnv) - - -ToolSvc += sequentialVtxFitter -if BTaggingFlags.OutputLevel < 3: - print sequentialVtxFitter - - -#LOAD JETFITTER TOOLS - -from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterInitializationHelper -NewJetFitterInitializationHelper = Trk__JetFitterInitializationHelper( name = "ImprovedJetFitterInitializationHelper", - LinearizedTrackFactory = JetFitterLinFactory, - OutputLevel = BTaggingFlags.OutputLevel) -# errphiJetAxis = 0.15, -# erretaJetAxis = 0.15) - -ToolSvc += NewJetFitterInitializationHelper -if BTaggingFlags.OutputLevel < 3: - print NewJetFitterInitializationHelper - -from TrkJetVxFitter.TrkJetVxFitterConf import Trk__TrkDistanceFinderNeutralNeutral -TrkDistanceFinderNeutralNeutral=Trk__TrkDistanceFinderNeutralNeutral("TrkDistanceFinderNeutralNeutral", - OutputLevel=BTaggingFlags.OutputLevel) - -ToolSvc+=TrkDistanceFinderNeutralNeutral -if BTaggingFlags.OutputLevel < 3: - print TrkDistanceFinderNeutralNeutral - -from TrkJetVxFitter.TrkJetVxFitterConf import Trk__TrkDistanceFinderNeutralCharged -TrkDistanceFinderNeutralCharged=Trk__TrkDistanceFinderNeutralCharged("TrkDistanceFinderNeutralCharged", - OutputLevel=BTaggingFlags.OutputLevel) - -ToolSvc+=TrkDistanceFinderNeutralCharged -if BTaggingFlags.OutputLevel < 3: - print TrkDistanceFinderNeutralCharged - -from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterRoutines -NewJetFitterRoutines = Trk__JetFitterRoutines( name = "ImprovedJetFitterRoutines", - JetFitterInitializationHelper = NewJetFitterInitializationHelper, - BeFast = False, - maxDRshift = 0., - noPrimaryVertexRefit = False, - JetFitterMinimumDistanceFinder=TrkDistanceFinderNeutralCharged, - JetFitterMinimumDistanceFinderNeutral=TrkDistanceFinderNeutralNeutral, - OutputLevel = BTaggingFlags.OutputLevel) -ToolSvc += NewJetFitterRoutines -if BTaggingFlags.OutputLevel < 3: - print NewJetFitterRoutines - -#LOAD JETFITTER VERTEX FINDER - -from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetJetFitterUtils -NewInDetJetFitterUtils = InDet__InDetJetFitterUtils(name = "InDetJetFitterUtils", - LinearizedTrackFactory = JetFitterLinFactory, - Extrapolator = JetFitterExtrapolator, - OutputLevel =BTaggingFlags.OutputLevel) - -ToolSvc += NewInDetJetFitterUtils -if BTaggingFlags.OutputLevel < 3: - print NewInDetJetFitterUtils - -if not 'InDetKeys' in dir(): - from InDetRecExample.InDetKeys import InDetKeys -#?? InDetKeys.lock_JobProperties() - - - - -from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder -NewJetFitterVxFinder = InDet__InDetImprovedJetFitterVxFinder( name = "NewJetFitterVxFinder", - JetFitterInitializationHelper = NewJetFitterInitializationHelper, - JetFitterRoutines = NewJetFitterRoutines, - InDetJetFitterUtils=NewInDetJetFitterUtils, - Extrapolator=JetFitterExtrapolator, - TrackSelector = NewInDetJetFitterTrackSelectorTool, - Mode3dFinder=mode3dfinder, - SequentialVertexFitter=sequentialVtxFitter, - VxPrimaryContainer="PrimaryVertices", -# VxPrimaryContainer=InDetKeys.PrimaryVertices(), - VertexEdmFactory=InDetVxIntEdmCnv, - OutputLevel = BTaggingFlags.OutputLevel, - MaxNumDeleteIterations = 30, - VertexProbCut = 0.001, - MaxClusteringIterations = 30, - VertexClusteringProbabilityCut = 0.005) - - - -ToolSvc += NewJetFitterVxFinder -if BTaggingFlags.OutputLevel < 3: - print NewJetFitterVxFinder - -#JetFitterVxFinder.MaxTracksToFitAtOnce = 3000 -#to be added in bugfix version - - -##and the factory for BTagSecVertexing -from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory -JetFitterVariablesFactory = Analysis__JetFitterVariablesFactory( name = "JetFitterVariablesFactory", - OutputLevel = BTaggingFlags.OutputLevel, - secVxFinderName = "JetFitterVxFinder", - JetFitterInstance = "JetFitterTag") -ToolSvc += JetFitterVariablesFactory -if BTaggingFlags.OutputLevel < 3: - print JetFitterVariablesFactory diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterFinderNeg.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterFinderNeg.py deleted file mode 100644 index 97bf30c3a155f0fec79be7971b14ecfbfe094e08..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterFinderNeg.py +++ /dev/null @@ -1,153 +0,0 @@ -if (not BTaggingFlags.JetFitterTag) and (not BTaggingFlags.JetFitterNN): - - from AthenaCommon.AppMgr import ToolSvc - from TrkExTools.AtlasExtrapolator import AtlasExtrapolator - JetFitterExtrapolator = AtlasExtrapolator() - - ToolSvc += JetFitterExtrapolator - if BTaggingFlags.OutputLevel < 3: - print JetFitterExtrapolator - - # Track Selector for JetFitter - from InDetTrackSelectorTool.InDetTrackSelectorToolConf import InDet__InDetDetailedTrackSelectorTool - NewInDetJetFitterTrackSelectorTool = InDet__InDetDetailedTrackSelectorTool(name = "InDetImprovedJetFitterTrackSelectorTool", - pTMin = 500., - IPd0Max = 7., - IPz0Max = 10., - sigIPd0Max = 0.35, - sigIPz0Max = 2.5, - etaMax = 9999., - useTrackSummaryInfo = True, - nHitBLayer = 0, - nHitPix = 1, - nHitSct = 4, - nHitSi = 7, - nHitTrt = 0, - useSharedHitInfo = False, - useTrackQualityInfo = True, - fitChi2OnNdfMax = 3.5, - TrackSummaryTool = None, - Extrapolator = JetFitterExtrapolator) - - ToolSvc += NewInDetJetFitterTrackSelectorTool - if BTaggingFlags.OutputLevel < 3: - print NewInDetJetFitterTrackSelectorTool - - #LOAD CONVENTIONAL VERTEXING TOOLS - - from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory - JetFitterLinFactory = Trk__FullLinearizedTrackFactory(name = "JetFitterFullLinearizedTrackFactory", - Extrapolator = JetFitterExtrapolator) - ToolSvc += JetFitterLinFactory - if BTaggingFlags.OutputLevel < 3: - print JetFitterLinFactory - - from TrkVertexSeedFinderUtils.TrkVertexSeedFinderUtilsConf import Trk__Mode3dTo1dFinder - mode3dfinder = Trk__Mode3dTo1dFinder(name = "JetFitterMode3dTo1dFinder") - - ToolSvc += mode3dfinder - if BTaggingFlags.OutputLevel < 3: - print mode3dfinder - - from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexSmoother - vertexsmoother = Trk__SequentialVertexSmoother(name = "JetFitterSequentialVertexSmoother") - - ToolSvc += vertexsmoother - if BTaggingFlags.OutputLevel < 3: - print vertexsmoother - - from TrkVertexFitters.TrkVertexFittersConf import Trk__SequentialVertexFitter - sequentialVtxFitter = Trk__SequentialVertexFitter(name = "JetFitterSequentialVertexFitter", - VertexSmoother= vertexsmoother, - LinearizedTrackFactory=JetFitterLinFactory) - - ToolSvc += sequentialVtxFitter - if BTaggingFlags.OutputLevel < 3: - print sequentialVtxFitter - - - #LOAD JETFITTER TOOLS - - from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterInitializationHelper - NewJetFitterInitializationHelper = Trk__JetFitterInitializationHelper( name = "ImprovedJetFitterInitializationHelper", - LinearizedTrackFactory = JetFitterLinFactory, - OutputLevel = BTaggingFlags.OutputLevel) - # errphiJetAxis = 0.15, - # erretaJetAxis = 0.15) - - ToolSvc += NewJetFitterInitializationHelper - if BTaggingFlags.OutputLevel < 3: - print NewJetFitterInitializationHelper - - from TrkJetVxFitter.TrkJetVxFitterConf import Trk__TrkDistanceFinderNeutralNeutral - TrkDistanceFinderNeutralNeutral=Trk__TrkDistanceFinderNeutralNeutral("TrkDistanceFinderNeutralNeutral", - OutputLevel=BTaggingFlags.OutputLevel) - - ToolSvc+=TrkDistanceFinderNeutralNeutral - if BTaggingFlags.OutputLevel < 3: - print TrkDistanceFinderNeutralNeutral - - from TrkJetVxFitter.TrkJetVxFitterConf import Trk__TrkDistanceFinderNeutralCharged - TrkDistanceFinderNeutralCharged=Trk__TrkDistanceFinderNeutralCharged("TrkDistanceFinderNeutralCharged", - OutputLevel=BTaggingFlags.OutputLevel) - - ToolSvc+=TrkDistanceFinderNeutralCharged - if BTaggingFlags.OutputLevel < 3: - print TrkDistanceFinderNeutralCharged - - from TrkJetVxFitter.TrkJetVxFitterConf import Trk__JetFitterRoutines - NewJetFitterRoutines = Trk__JetFitterRoutines( name = "ImprovedJetFitterRoutines", - JetFitterInitializationHelper = NewJetFitterInitializationHelper, - BeFast = False, - maxDRshift = 0., - noPrimaryVertexRefit = False, - JetFitterMinimumDistanceFinder=TrkDistanceFinderNeutralCharged, - JetFitterMinimumDistanceFinderNeutral=TrkDistanceFinderNeutralNeutral, - OutputLevel = BTaggingFlags.OutputLevel) - ToolSvc += NewJetFitterRoutines - if BTaggingFlags.OutputLevel < 3: - print NewJetFitterRoutines - -#LOAD JETFITTER VERTEX FINDER - - from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetJetFitterUtils - NewInDetJetFitterUtils = InDet__InDetJetFitterUtils(name = "InDetJetFitterUtils", - LinearizedTrackFactory = JetFitterLinFactory, - Extrapolator = JetFitterExtrapolator, - OutputLevel =BTaggingFlags.OutputLevel) - - ToolSvc += NewInDetJetFitterUtils - if BTaggingFlags.OutputLevel < 3: - print NewInDetJetFitterUtils - - if not 'InDetKeys' in dir(): - from InDetRecExample.InDetKeys import InDetKeys -#?? InDetKeys.lock_JobProperties() - -from InDetSecVxFinderTool.InDetSecVxFinderToolConf import InDet__InDetImprovedJetFitterVxFinder -NewJetFitterVxFinderFlip = InDet__InDetImprovedJetFitterVxFinder( name = "NewJetFitterVxFinderFlip", - JetFitterInitializationHelper = NewJetFitterInitializationHelper, - JetFitterRoutines = NewJetFitterRoutines, - InDetJetFitterUtils=NewInDetJetFitterUtils, - Extrapolator=JetFitterExtrapolator, - TrackSelector = NewInDetJetFitterTrackSelectorTool, - Mode3dFinder=mode3dfinder, - SequentialVertexFitter=sequentialVtxFitter, - #VxPrimaryContainer="VxPrimaryCandidateAOD", - VxPrimaryContainer=InDetKeys.PrimaryVertices(), - OutputLevel = BTaggingFlags.OutputLevel, - MaxNumDeleteIterations = 30, - VertexProbCut = 0.001, - MaxClusteringIterations = 30, - VertexClusteringProbabilityCut = 0.005, - revertFromPositiveToNegativeTags=True) - - - -ToolSvc += NewJetFitterVxFinderFlip -if BTaggingFlags.OutputLevel < 3: - print NewJetFitterVxFinderFlip - -#JetFitterVxFinder.MaxTracksToFitAtOnce = 3000 -#to be added in bugfix version - diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterTag.py deleted file mode 100644 index a88a617a86fa2050f35785c4b113cec171561d81..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterTag.py +++ /dev/null @@ -1,47 +0,0 @@ -from AthenaCommon.AppMgr import ToolSvc - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterNtupleWriter -NewJetFitterNtupleWriter = Analysis__JetFitterNtupleWriter( name = "NewJetFitterNtupleWriter", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += NewJetFitterNtupleWriter -if BTaggingFlags.OutputLevel < 3: - print NewJetFitterNtupleWriter - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory -NewJetFitterVariablesFactory = Analysis__JetFitterVariablesFactory( name = "NewJetFitterVariablesFactory", - OutputLevel = BTaggingFlags.OutputLevel, - JetFitterInstance = "JetFitterTag", - usePtCorrectedMass = True) -ToolSvc += NewJetFitterVariablesFactory -if BTaggingFlags.OutputLevel < 3: - print NewJetFitterVariablesFactory - - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterLikelihood -NewJetFitterLikelihood = Analysis__JetFitterLikelihood( name = "NewJetFitterLikelihood", - CalibrationDirectory = "JetFitter", - CalibrationSubDirectory = "RooFitLikelihood", - calibrationTool = BTagCalibrationBrokerTool, - OutputLevel = BTaggingFlags.OutputLevel ) -ToolSvc += NewJetFitterLikelihood -if BTaggingFlags.OutputLevel < 3: - print NewJetFitterLikelihood - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag -NewJetFitterTagTool = Analysis__JetFitterTag( name = "NewJetFitterTag", - OutputLevel = BTaggingFlags.OutputLevel, - Runmodus = BTaggingFlags.Runmodus, - jetfitterNtupleWriter = NewJetFitterNtupleWriter, - jetfitterLikelihood = NewJetFitterLikelihood, - jetCollectionList = BTaggingFlags.Jets, - jetfitterVariablesFactory = NewJetFitterVariablesFactory, - secVxFinderName = "NewJetFitterVxFinder", - useForcedCalibration = False - ) - -ToolSvc += NewJetFitterTagTool - - -if BTaggingFlags.OutputLevel < 3: - print NewJetFitterTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterTagNeg.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterTagNeg.py deleted file mode 100644 index 481f1d3c92ee37a1baf3dba4066b60e4a3c41853..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_NewJetFitterTagNeg.py +++ /dev/null @@ -1,49 +0,0 @@ -from AthenaCommon.AppMgr import ToolSvc - -if (not BTaggingFlags.JetFitterTag): - from JetTagTools.JetTagToolsConf import Analysis__JetFitterNtupleWriter - NewJetFitterNtupleWriter = Analysis__JetFitterNtupleWriter( name = "NewJetFitterNtupleWriter", - OutputLevel = BTaggingFlags.OutputLevel) - - ToolSvc += NewJetFitterNtupleWriter - if BTaggingFlags.OutputLevel < 3: - print NewJetFitterNtupleWriter - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterVariablesFactory -NewJetFitterVariablesFactoryFlip = Analysis__JetFitterVariablesFactory( name = "NewJetFitterVariablesFactoryFlip", - OutputLevel = BTaggingFlags.OutputLevel, - JetFitterInstance = "JetFitterTagFlip", - usePtCorrectedMass = True, - revertFromPositiveToNegativeTags = True) -ToolSvc += NewJetFitterVariablesFactoryFlip -if BTaggingFlags.OutputLevel < 3: - print NewJetFitterVariablesFactoryFlip - -if (not BTaggingFlags.JetFitterTag): - from JetTagTools.JetTagToolsConf import Analysis__JetFitterLikelihood - NewJetFitterLikelihood = Analysis__JetFitterLikelihood( name = "NewJetFitterLikelihood", - CalibrationDirectory = "JetFitter", - CalibrationSubDirectory = "RooFitLikelihood", - calibrationTool = BTagCalibrationBrokerTool, - OutputLevel = BTaggingFlags.OutputLevel ) - ToolSvc += NewJetFitterLikelihood - if BTaggingFlags.OutputLevel < 3: - print NewJetFitterLikelihood - -from JetTagTools.JetTagToolsConf import Analysis__JetFitterTag -NewJetFitterFlipTagTool = Analysis__JetFitterTag( name = "NewJetFitterTagFlip", - OutputLevel = BTaggingFlags.OutputLevel, - Runmodus = BTaggingFlags.Runmodus, - JetFitterNtupleWriter = NewJetFitterNtupleWriter, - JetFitterLikelihood = NewJetFitterLikelihoodFlip, - jetCollectionList = BTaggingFlags.Jets, - JetFitterVariablesFactory = NewJetFitterVariablesFactoryFlip, - SecVxFinderName = "NewJetFitterVxFinderFlip", - useForcedCalibration = False - ) - -ToolSvc += NewJetFitterFlipTagTool - - -if BTaggingFlags.OutputLevel < 3: - print NewJetFitterFlipTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_QGTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_QGTag.py deleted file mode 100755 index 71cfb6b0b3cd624e5d869d42476108a51b688333..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_QGTag.py +++ /dev/null @@ -1,57 +0,0 @@ -# Get THistSVC so I can grab likelihood LUT - -#from AthenaCommon.AppMgr import ServiceMgr as svcMgr -#if not hasattr(svcMgr, 'THistSvc'): -# from GaudiSvc.GaudiSvcConf import THistSvc -# svcMgr += THistSvc() -# -#import os -#dataPathList = os.environ[ 'DATAPATH' ].split(os.pathsep) -#dataPathList.insert(0, os.curdir) -#from AthenaCommon.Utils.unixtools import FindFile -# -#QGLikelihoodMCFileName = "QGLikelihood_MC_v0001.root" -#QGLikelihoodDATAFileName = "QGLikelihood_DATA_v0001.root" -# -#QGLikelihoodMCFile = FindFile(QGLikelihoodMCFileNameFileName , dataPathList, os.R_OK ) -#QGLikelihoodDATAFile = FindFile(QGLikelihoodDATAFileNameFileName , dataPathList, os.R_OK ) -# -#svcMgr.THistSvc.Input += ["QGLikelihoodMCFile DATAFILE='"+QGLikelihoodMCFile+"' OPT='OLD'"] -#svcMgr.THistSvc.Input += ["QGLikelihoodDATAFile DATAFILE='"+QGLikelihoodDATAFile+"' OPT='OLD'"] - -# Track selector tool -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -QGTagTrackSelector = Analysis__TrackSelector( - name = "QGTagTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel, - pTMin = 1000., - d0Max = 1.0, - z0Max = 1.0, - nHitPix = 1, - nHitSct = 6, - fitChi2OnNdfMax = 3.0, - ) -ToolSvc += QGTagTrackSelector -if BTaggingFlags.OutputLevel < 3: - print QGTagTrackSelector - -# -from JetTagTools.JetTagToolsConf import Analysis__HadFlavorTag -QGTag = Analysis__HadFlavorTag( name = "QGTag", - OutputLevel = BTaggingFlags.OutputLevel, - tagMode = "QG", - Runmodus = BTaggingFlags.Runmodus, - trackSelectorTool = QGTagTrackSelector, - QGLikelihoodMCFileName = "QGLikelihood_MC_v0001.root", - QGLikelihoodDATAFileName = "QGLikelihood_DATA_v0001.root", - QGPtBounds = [40,60,80,120,160,210,260,310,400], - QGEtaBounds = [0,0.8,1.2,2.5], - ) - -ToolSvc += QGTag - -if BTaggingFlags.OutputLevel < 3: - print QGTag - - diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_Rel19_LoadTools.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_Rel19_LoadTools.py deleted file mode 100644 index d8d4d96d3bede890dd2efb6587fb914ff5c84304..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_Rel19_LoadTools.py +++ /dev/null @@ -1,370 +0,0 @@ -# BTagging_Rel19_LoadTools.py -# This python script loads and configures -# all the services, algorithms and tools -# needed for b-tagging in release 19. -# guirriec@in2p3.fr -# March 2014 - - -# Import the jet flags. - -#from JetRec.JetToolSupport import jtm - -from BTagging.BTaggingFlags import BTaggingFlags -print "Using output level ", BTaggingFlags.OutputLevel -###### btagging -from BTagging.BTaggingConf import Analysis__JetBTaggerTool as JetBTaggerTool - -from AthenaCommon.AppMgr import ToolSvc - -#Secondary vertex reconstruction tool: -from BTagging.BTaggingConf import Analysis__BTagSecVertexing -myBTagSecVtx = Analysis__BTagSecVertexing( - name = "myBTagSecVtx", - OutputLevel = BTaggingFlags.OutputLevel -) -ToolSvc += myBTagSecVtx - - -#Add services -from AthenaCommon.AppMgr import ServiceMgr as svcMgr -if not hasattr(svcMgr, 'THistSvc'): - from GaudiSvc.GaudiSvcConf import THistSvc - svcMgr += THistSvc() - - - -# -- determine the keys of the McEventCollection to be used and of the JetCollections already there in the input -TheTruthCollectionKey = 'TruthEvent' -BTaggingFlags.RetagJets = BTaggingFlags.Jets -if BTaggingFlags.AutoInspectInputFile: - from AthenaCommon.GlobalFlags import globalflags - if globalflags.InputFormat == 'pool': - try: - from RecExConfig.InputFilePeeker import inputFileSummary - BTaggingFlags.RetagJets = [ ] - for i in inputFileSummary['eventdata_items']: - if i[0] == 'McEventCollection': - TheTruthCollectionKey = i[1] - if i[0] == 'JetCollection': - jetC1 = (i[1]).replace('AODJets','') - jetC = jetC1.replace('Jets','') - if jetC in BTaggingFlags.Jets: - BTaggingFlags.RetagJets += [ jetC ] - except Exception, err: - print '#BTAG# - b-tagging: automatic inspection of input file failed (file too old?)' -print '#BTAG# --> b-tagging: using ',TheTruthCollectionKey, ' as truth key' -print '#BTAG# --> b-tagging: re-tagging those jet collections: ', BTaggingFlags.RetagJets - - - -# -- Truth labeling tool: -from JetRec.JetRecFlags import jetFlags -if jetFlags.useTruth(): - from ParticleJetTools.ParticleJetToolsConf import Analysis__JetQuarkLabel - BTagJetTruthMatching = Analysis__JetQuarkLabel(name = "BTagJetTruthMatching") - BTagJetTruthMatching.McEventCollection = TheTruthCollectionKey - ToolSvc += BTagJetTruthMatching - if BTaggingFlags.OutputLevel < 3: - print BTagJetTruthMatching - - from BTagging.BTaggingConf import Analysis__BTagLabeling - thisBTagLabeling = Analysis__BTagLabeling( - name = "thisBTagLabeling", - JetTruthMatchTool = BTagJetTruthMatching - #JetQGPartonTruthMatchTool = BTagJetQGPartonTruthMatching, #MANU?? - #LeptonTruthTool = BTagLeptonTruthTool - ) - ToolSvc += thisBTagLabeling - if BTaggingFlags.OutputLevel < 3: - print thisBTagLabeling - -else: #useTruth() - BTagJetTruthMatching = None - thisBTagLabeling = None - -# -- MAIN b-tagging tool: -from BTagging.BTaggingConf import Analysis__BTagTool -myBTagTool = Analysis__BTagTool( - name = "myBTagTool", - Runmodus = BTaggingFlags.Runmodus, - #PrimaryVertexName = BTaggingFlags.PrimaryVertexCollectionName, - #BaselineTagger = BTaggingFlags.BaselineTagger, - BTagLabelingTool = thisBTagLabeling, - #BTagSecVertexing = myBTagSecVtx, - #BTagRemovingTool = thisBTagRemoving, - OutputLevel = BTaggingFlags.OutputLevel -) -ToolSvc += myBTagTool - - - - -from ParticleJetTools.ParticleJetToolsConf import Analysis__ParticleToJetAssociator -BTagTrackToJetAssociator = Analysis__ParticleToJetAssociator( - name = "BTagTrackToJetAssociator" - ) -ToolSvc += BTagTrackToJetAssociator - -from BTagging.BTaggingConf import Analysis__BTagTrackAssociation -myBTagTrackAssociation = Analysis__BTagTrackAssociation( - name = "myBTagTrackAssociation", - TrackToJetAssociatorList = [ BTagTrackToJetAssociator ], - TrackToJetAssocNameList = ["BTagTrackToJetAssociator"], - TrackContainerNameList = ["InDetTrackParticles"], - #TrackParticleContainerName = BTaggingFlags.TrackParticleCollectionName, - #Runmodus = BTaggingFlags.Runmodus, - #PrimaryVertexName = BTaggingFlags.PrimaryVertexCollectionName, - #BaselineTagger = BTaggingFlags.BaselineTagger, - #BTagLabelingTool = thisBTagLabeling, - #BTagSecVertexingTool = thisBTagSecVertexing, - #BTagRemovingTool = thisBTagRemoving, - OutputLevel = BTaggingFlags.OutputLevel -) -ToolSvc += myBTagTrackAssociation -# track assoc for bb-tag -if BTaggingFlags.MultiSVbb1 | BTaggingFlags.MultiSVbb2: - - BTagTrackToJetAssociatorBB = Analysis__ParticleToJetAssociator( - name = "BTagTrackToJetAssociatorBB", - OutputLevel = BTaggingFlags.OutputLevel, - shareTracks = False, - useVariableSizedTrackCone = True, - coneSizeFitPar1 = 3.15265e-01, - coneSizeFitPar2 = -3.66502e-01, - coneSizeFitPar3 = -1.56387e-05, - ) - ToolSvc += BTagTrackToJetAssociatorBB - - myBTagTrackAssociation.TrackToJetAssociatorList += [ BTagTrackToJetAssociatorBB ] - myBTagTrackAssociation.TrackToJetAssocNameList += ["BTagTrackToJetAssociatorBB"] - myBTagTrackAssociation.TrackContainerNameList += ["InDetTrackParticles"] - - include( "BTagging/BTagging_InDetVKalMultiVxInJetTool.py" ) - myBTagSecVtx.SecVtxFinderList += [ InDetVKalMultiVxInJetTool ] - myBTagSecVtx.SecVtxFinderTrackNameList += ["BTagTrackToJetAssociatorBB"] - myBTagSecVtx.SecVtxFinderxAODBaseNameList += ["MSV"] - myBTagSecVtx.MSVVariableFactory = MSVVariablesFactory -# -from AthenaCommon.Resilience import treatException,protectedInclude -protectedInclude( "JetTagCalibration/BTagCalibrationBroker_jobOptions.py" ) - -BTaggingFlags.CalibrationSingleFolder = True - - -#myJets=["AntiKt4Truth"] -#myJets=["AntiKt4TopoEM"] - - -#myJetCollectionForCalib = [] -#myJetCollectionForCalib+= myJets -#theFolders = [] -#myCalibrationChannelAliases = ['AntiKt4Truth->AntiKt4TopoEM'] -#from JetTagCalibration.JetTagCalibrationConf import Analysis__CalibrationBroker -#BTagCalibrationBrokerTool = Analysis__CalibrationBroker( -# name = "BTagCalibrationBrokerTool", -# folderRoot = "/GLOBAL/BTagCalib/", -# folders = theFolders, -# channels = myJetCollectionForCalib, -# channelAliases = myCalibrationChannelAliases, -# shadowFoldersAndChannels = True, -# ) -#ToolSvc += BTagCalibrationBrokerTool - -# from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -# IP3DNewLikelihood = Analysis__NewLikelihoodTool( -# name = "IP3DNewLikelihoodTool", -# OutputLevel = BTaggingFlags.OutputLevel, -# taggerName = "IP3D", -# calibrationTool = BTagCalibrationBrokerTool -# ) -# ToolSvc += IP3DNewLikelihood - - - - - -# from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -# IP3DBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "IP3DBasicTrackGradeFactory", -# OutputLevel = BTaggingFlags.OutputLevel, -# TrackSummaryTool = None, -# useSharedHitInfo = True, -# ) -# ToolSvc += IP3DBasicTrackGradeFactory - -# TrackToVertex tool -# -# -- extrapolation to propagate tracks to primary vertex: -from TrkExTools.AtlasExtrapolator import AtlasExtrapolator -AtlasExtrapolator = AtlasExtrapolator() -ToolSvc += AtlasExtrapolator - -from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__FullLinearizedTrackFactory -myBTagLinTrkFactory = Trk__FullLinearizedTrackFactory(name = "BTagFullLinearizedTrackFactory", - Extrapolator = AtlasExtrapolator) -ToolSvc += myBTagLinTrkFactory - -from TrkVertexFitterUtils.TrkVertexFitterUtilsConf import Trk__TrackToVertexIPEstimator -BTagTrackToVertexIPEstimator = Trk__TrackToVertexIPEstimator(name="BTagTrackToVertexIPEstimator", - Extrapolator=AtlasExtrapolator, - LinearizedTrackFactory=myBTagLinTrkFactory) -ToolSvc += BTagTrackToVertexIPEstimator - -from TrackToVertex.TrackToVertexConf import Reco__TrackToVertex -BTagTrackToVertexTool = Reco__TrackToVertex( - name = "BTagTrackToVertexTool", - Extrapolator = AtlasExtrapolator - ) -ToolSvc += BTagTrackToVertexTool - - -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -IP3DTrackSelector = Analysis__TrackSelector( - useBLayerHitPrediction = True, - name = "IP3DTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += IP3DTrackSelector - -# -- load secondary vertex tools: -if (BTaggingFlags.SV1 | BTaggingFlags.SV2 | - BTaggingFlags.IP1D | BTaggingFlags.IP2D | BTaggingFlags.IP3D | - BTaggingFlags.JetProb | - BTaggingFlags.TrackCounting): - include( "BTagging/BTagging_InDetVKalVxInJetTool.py" ) - myBTagSecVtx.SecVtxFinderList+= [ InDetVKalVxInJetTool ] - myBTagSecVtx.SecVtxFinderTrackNameList+=["BTagTrackToJetAssociator"] - myBTagSecVtx.SecVtxFinderxAODBaseNameList+=["SV1"] - - -if BTaggingFlags.SV0: - include( "BTagging/BTagging_InDetVKalVxNegInJetTool.py" ) - myBTagSecVtx.SecVtxFinderList+= [ InDetVKalVxNegInJetTool ] - myBTagSecVtx.SecVtxFinderTrackNameList+=["BTagTrackToJetAssociator"] - myBTagSecVtx.SecVtxFinderxAODBaseNameList+=["SV0"] - - -#jet fitter vertexing (flags off for the moment) -if BTaggingFlags.JetFitterTag | BTaggingFlags.JetFitterNN: - include( "BTagging/BTagging_NewJetFitterFinder.py" ) - myBTagSecVtx.SecVtxFinderList+= [ NewJetFitterVxFinder ] - myBTagSecVtx.SecVtxFinderTrackNameList+=["BTagTrackToJetAssociator"] - myBTagSecVtx.SecVtxFinderxAODBaseNameList+=["JetFitter"] - myBTagSecVtx.JetFitterVariableFactory = JetFitterVariablesFactory - - - - -# -- load all the taggers ! : -#from JetTagTools.JetTagToolsConf import Analysis__DummyTag -#DummyTagTool = Analysis__DummyTag("mydummy") -#ToolSvc+=DummyTagTool -#myBTagTool.TagToolList+= [DummyTagTool] - -#IP2D -if BTaggingFlags.IP2D : - include( "BTagging/BTagging_IP2DTag.py" ) - myBTagTool.TagToolList+= [ IP2DTagTool ] - -#IP3D -if BTaggingFlags.IP3D : - include( "BTagging/BTagging_IP3DTag.py" ) - myBTagTool.TagToolList+= [ IP3DTagTool ] - -#SV1 -if BTaggingFlags.SV1 : - include( "BTagging/BTagging_SV1Tag.py" ) - myBTagTool.TagToolList += [ SV1TagTool ] - - -#SV0 -if BTaggingFlags.SV0 : - include( "BTagging/BTagging_SV0Tag.py" ) - myBTagTool.TagToolList += [ SV0TagTool ] - -#JetFitter -if BTaggingFlags.JetFitterNN: - include( "BTagging/BTagging_JetFitterTagNN.py" ) - myBTagTool.TagToolList += [ JetFitterTagToolNN ] - if BTaggingFlags.IP3D: - include( "BTagging/BTagging_JetFitterCOMBNN.py" ) - myBTagTool.TagToolList += [ JetFitterCOMBNN ] - - -#MV1 -if BTaggingFlags.MV1 : - include( "BTagging/BTagging_MV1Tag.py" ) - myBTagTool.TagToolList += [ MV1TagTool ] - - -#MV1c -if BTaggingFlags.MV1c : - include( "BTagging/BTagging_MV1cTag.py" ) - myBTagTool.TagToolList += [ MV1cTagTool ] - -# MV2 -if BTaggingFlags.MV2c00: - include( "BTagging/BTagging_MV2c00Tag.py" ) - myBTagTool.TagToolList += [ MV2c00TagTool ] -if BTaggingFlags.MV2c10: - include( "BTagging/BTagging_MV2c10Tag.py" ) - myBTagTool.TagToolList += [ MV2c10TagTool ] -if BTaggingFlags.MV2c20: - include( "BTagging/BTagging_MV2c20Tag.py" ) - myBTagTool.TagToolList += [ MV2c20TagTool ] - - -#MVb -if BTaggingFlags.MVb: - include( "BTagging/BTagging_MVbTag.py" ) - myBTagTool.TagToolList += [ MVbTagTool ] -#MSV -if BTaggingFlags.MultiSVbb1: - include( "BTagging/BTagging_MultiSVbb1Tag.py" ) - myBTagTool.TagToolList += [ MultiSVbb1TagTool ] -if BTaggingFlags.MultiSVbb2: - include( "BTagging/BTagging_MultiSVbb2Tag.py" ) - myBTagTool.TagToolList += [ MultiSVbb2TagTool ] - -from BTagging.BTaggingConf import Analysis__JetBTaggerTool -myJetBTaggerTool = Analysis__JetBTaggerTool( - name = "myJetBTaggerTool", - BTagTool = myBTagTool, - BTagTrackAssocTool = myBTagTrackAssociation, - BTagSecVertexing = myBTagSecVtx, - OutputLevel = BTaggingFlags.OutputLevel -) -ToolSvc += myJetBTaggerTool - -if BTaggingFlags.OutputLevel < 3: - print myBTagSecVtx - print myJetBTaggerTool - - - - -# -- for reference mode: -if BTaggingFlags.Runmodus == 'reference': - - svcMgr.THistSvc.Output += ["RefFile DATAFILE='BTagCalibALL.root' OPT='RECREATE'"] - #for key in BTaggingFlags.Jets: - # for tagger in ['JetProb','IP1D','IP2D','IP2DSpc','IP3D','IP3DSpc','SV1','SV2','SoftMu','SoftEl','JetFitterTagNN','JetFitterCOMBNN']: - # if BTaggingFlags.IsEnabled(tagger): - # RefileName = "BTaggingRef"+tagger+key+".root" - # svcMgr.THistSvc.Output += ["RefFile"+tagger+key+" DATAFILE='"+RefileName+"' OPT='RECREATE'"] - -if ( BTaggingFlags.lifetime1D | BTaggingFlags.lifetime2D | BTaggingFlags.lifetime3D | - BTaggingFlags.secVtxFitBU | BTaggingFlags.secVtxFitTD ): - svcMgr.THistSvc.Output += ["SigCali DATAFILE='cern.sig.referencehistos.root' OPT='RECREATE'"] - svcMgr.THistSvc.Output += ["BkgCali DATAFILE='cern.bkg.referencehistos.root' OPT='RECREATE'"] - - - - -#### should be unique per collection -#### replaces the jet rec JetBTaggerTool config or the BJetBuilder config in case of retagging -#jbtt = JetBTaggerTool("antikt4_btagger", DummyProp=99, BTagTool=myBTagTool, BTagName = "Rel19", BTagTrackAssocTool = myBTagTrackAssociation) - -#jtm+=jbtt - diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV0Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV0Tag.py deleted file mode 100755 index feee8fb0a8e0e0f781daa45892432547fdf2774f..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV0Tag.py +++ /dev/null @@ -1,15 +0,0 @@ - -from JetTagTools.JetTagToolsConf import Analysis__SVTag -SV0TagTool = Analysis__SVTag( - name = "SV0Tag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - SVAlgType = "SV0", - SecVxFinderName = "SV0", - xAODBaseName = "SV0", - OutputLevel = BTaggingFlags.OutputLevel, - jetCollectionList = BTaggingFlags.Jets - ) -ToolSvc += SV0TagTool -if BTaggingFlags.OutputLevel < 3: - print SV0TagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV1FlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV1FlipTag.py deleted file mode 100755 index 9676b24405cb425cef4b4197b6d404484fed6168..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV1FlipTag.py +++ /dev/null @@ -1,32 +0,0 @@ -if BTaggingFlags.Runmodus == 'analysis': - # each tagger needs own instance, can't be shared! - from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool - SV1FlipNewLikelihood = Analysis__NewLikelihoodTool( - name = "SV1FlipNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "SV1", - calibrationTool = BTagCalibrationBrokerTool - ) - ToolSvc += SV1FlipNewLikelihood - if BTaggingFlags.OutputLevel < 3: - print SV1FlipNewLikelihood -else: - SV1FlipNewLikelihood = None - -from JetTagTools.JetTagToolsConf import Analysis__SVTag -SV1FlipTagTool = Analysis__SVTag( - name = "SV1FlipTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - SVAlgType = "SV1", - SecVxFinderName = "InDetVKalVxNegativeTagInJetTool", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = SV1FlipNewLikelihood, - jetCollectionList = BTaggingFlags.Jets, - writeInfoPlus = False, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName - ) -ToolSvc += SV1FlipTagTool -if BTaggingFlags.OutputLevel < 3: - print SV1FlipTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV1Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV1Tag.py deleted file mode 100755 index 2c9b66445f1c2ce4bc73ca6b623f562f2d2a3d77..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV1Tag.py +++ /dev/null @@ -1,31 +0,0 @@ -if BTaggingFlags.Runmodus == 'analysis': - # each tagger needs own instance, can't be shared! - from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool - SV1NewLikelihood = Analysis__NewLikelihoodTool( - name = "SV1NewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "SV1", - calibrationTool = BTagCalibrationBrokerTool - ) - ToolSvc += SV1NewLikelihood - if BTaggingFlags.OutputLevel < 3: - print SV1NewLikelihood -else: - SV1NewLikelihood = None - -from JetTagTools.JetTagToolsConf import Analysis__SVTag -SV1TagTool = Analysis__SVTag( - name = "SV1Tag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - SVAlgType = "SV1", - xAODBaseName = "SV1", - SecVxFinderName = "SV1", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = SV1NewLikelihood, - jetCollectionList = BTaggingFlags.Jets, - UseCHypo=True - ) -ToolSvc += SV1TagTool -if BTaggingFlags.OutputLevel < 3: - print SV1TagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV2FlipTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV2FlipTag.py deleted file mode 100755 index b2e2b0f8bcfee8e79c412024e3100e894d993e2f..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV2FlipTag.py +++ /dev/null @@ -1,32 +0,0 @@ -if BTaggingFlags.Runmodus == 'analysis': - # each tagger needs own instance, can't be shared! - from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool - SV2FlipNewLikelihood = Analysis__NewLikelihoodTool( - name = "SV2FlipNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "SV2", - calibrationTool = BTagCalibrationBrokerTool - ) - ToolSvc += SV2FlipNewLikelihood - if BTaggingFlags.OutputLevel < 3: - print SV2FlipNewLikelihood -else: - SV2FlipNewLikelihood = None - -from JetTagTools.JetTagToolsConf import Analysis__SVTag -SV2FlipTagTool = Analysis__SVTag( - name = "SV2FlipTag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - SVAlgType = "SV2", - SecVxFinderName = "InDetVKalVxNegativeTagInJetTool", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = SV2FlipNewLikelihood, - jetCollectionList = BTaggingFlags.Jets, - writeInfoPlus = False, - jetWithInfoPlus = BTaggingFlags.JetsWithInfoPlus, - originalTPCollectionName = BTaggingFlags.TrackParticleCollectionName - ) -ToolSvc += SV2FlipTagTool -if BTaggingFlags.OutputLevel < 3: - print SV2FlipTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV2Tag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV2Tag.py deleted file mode 100755 index e8320b9fb67b71b76cb46ea2cee1521dff8120b4..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SV2Tag.py +++ /dev/null @@ -1,31 +0,0 @@ -if BTaggingFlags.Runmodus == 'analysis': - # each tagger needs own instance, can't be shared! - from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool - SV2NewLikelihood = Analysis__NewLikelihoodTool( - name = "SV2NewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "SV2", - calibrationTool = BTagCalibrationBrokerTool - ) - ToolSvc += SV2NewLikelihood - if BTaggingFlags.OutputLevel < 3: - print SV2NewLikelihood -else: - SV2NewLikelihood = None - -from JetTagTools.JetTagToolsConf import Analysis__SVTag -SV2TagTool = Analysis__SVTag( - name = "SV2Tag", - Runmodus = BTaggingFlags.Runmodus, - referenceType = BTaggingFlags.ReferenceType, - SVAlgType = "SV2", - xAODBaseName = "SV2", - SecVxFinderName = "SV2", - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = SV2NewLikelihood, - jetCollectionList = BTaggingFlags.Jets, - UseCHypo=True - ) -ToolSvc += SV2TagTool -if BTaggingFlags.OutputLevel < 3: - print SV2TagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SoftElectronTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SoftElectronTag.py deleted file mode 100755 index b240adc0b64abd49b1aee0dc0436c94cabd1befe..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SoftElectronTag.py +++ /dev/null @@ -1,43 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool - -# Likelihood tool -SoftElelectronTagNewLikelihood = Analysis__NewLikelihoodTool( - name = "SoftElectronTagNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "SoftEl", - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += SoftElelectronTagNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print SoftElelectronTagNewLikelihood - -# Track selector tool -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -SoftElectronTagTrackSelector = Analysis__TrackSelector( - name = "SoftElectronTagTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += SoftElectronTagTrackSelector -if BTaggingFlags.OutputLevel < 3: - print SoftElectronTagTrackSelector - -# -from JetTagTools.JetTagToolsConf import Analysis__SoftElectronTag -SoftElectronTagTool = Analysis__SoftElectronTag( - name = "SoftElectronTag", - Runmodus = BTaggingFlags.Runmodus, - OutputLevel = BTaggingFlags.OutputLevel, - originalElCollectionName = "ElectronAODCollection", - writeInfoPlus = True, - LikelihoodTool = SoftElelectronTagNewLikelihood, - trackSelectorTool = SoftElectronTagTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - jetCollectionList = BTaggingFlags.Jets, - calibrationTool = BTagCalibrationBrokerTool - ) -ToolSvc += SoftElectronTagTool -if BTaggingFlags.OutputLevel < 3: - print SoftElectronTagTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SoftMuonTag.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SoftMuonTag.py deleted file mode 100755 index bbdbd1e8b26f176bd309c931748c71da4960b59d..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SoftMuonTag.py +++ /dev/null @@ -1,37 +0,0 @@ - -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -SoftMuonTagNewLikelihood = Analysis__NewLikelihoodTool( - name = "SoftMuonTagNewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "SoftMu", - calibrationTool = BTagCalibrationBrokerTool, - smoothNTimes = 0, - normalizedProb = True, - interpolate = True - ) -ToolSvc += SoftMuonTagNewLikelihood -if BTaggingFlags.OutputLevel < 3: - print SoftMuonTagNewLikelihood - -from JetTagTools.JetTagToolsConf import Analysis__SoftMuonTag - -SoftMuonTagTool = Analysis__SoftMuonTag( - name = "SoftMuonTag", - Runmodus = BTaggingFlags.Runmodus, - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = SoftMuonTagNewLikelihood, - TrackToVertexTool = BTagTrackToVertexTool, - jetCollectionList = BTaggingFlags.Jets, - originalMuCollectionName = BTaggingFlags.MuonCollectionName - ) -if BTaggingFlags.Runmodus == 'reference': - SoftMuonTagTool.BTagJetEtamin = 2.5 - SoftMuonTagNewLikelihood.smoothNTimes = 1 - -ToolSvc += SoftMuonTagTool -if BTaggingFlags.OutputLevel < 3: - print SoftMuonTagTool - - - diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SoftMuonTagChi2.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SoftMuonTagChi2.py deleted file mode 100644 index e3c6d87209259ed842e4cef70b29070e47ebcd01..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_SoftMuonTagChi2.py +++ /dev/null @@ -1,39 +0,0 @@ - -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__NewLikelihoodTool -SoftMuonTagChi2NewLikelihood = Analysis__NewLikelihoodTool( - name = "SoftMuonTagChi2NewLikelihoodTool", - OutputLevel = BTaggingFlags.OutputLevel, - taggerName = "SoftMuChi2", - calibrationTool = BTagCalibrationBrokerTool, - smoothNTimes = 0, - normalizedProb = True, - interpolate = True - ) -ToolSvc += SoftMuonTagChi2NewLikelihood -if BTaggingFlags.OutputLevel < 3: - print SoftMuonTagChi2NewLikelihood - -from JetTagTools.JetTagToolsConf import Analysis__SoftMuonTag - -SoftMuonTagChi2Tool = Analysis__SoftMuonTag( - name = "SoftMuonTagChi2", - Runmodus = BTaggingFlags.Runmodus, - OutputLevel = BTaggingFlags.OutputLevel, - LikelihoodTool = SoftMuonTagChi2NewLikelihood, - TrackToVertexTool = BTagTrackToVertexTool, - MuonAssociationName="Muons", - jetCollectionList = BTaggingFlags.Jets, - originalMuCollectionName = BTaggingFlags.MuonCollectionName - ) -SoftMuonTagChi2Tool.TaggingAlgType = "CHI2" # this is what switches the chi2 tagger ON -SoftMuonTagChi2Tool.RecAlgorithm = 0 # use only combined muons -SoftMuonTagChi2Tool.writeInfoPlus = 1 # turn InfoPlus off because the L1D tagger takes care of it (albeit cuts on the chi2...) --> # Turn-on (for rel 17.2) -SoftMuonTagChi2Tool.CutMatchChi2 = 10000 # no match-chi2 cut - -ToolSvc += SoftMuonTagChi2Tool -if BTaggingFlags.OutputLevel < 3: - print SoftMuonTagChi2Tool - - - diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_TrackCounting.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_TrackCounting.py deleted file mode 100755 index 3dd846079b329b43f7e8479f08cb4962db6014d3..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_TrackCounting.py +++ /dev/null @@ -1,47 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -TrackCountingTrackSelector = Analysis__TrackSelector( - name = "TrackCountingTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += TrackCountingTrackSelector -if BTaggingFlags.OutputLevel < 3: - print TrackCountingTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_TrackCounting = Analysis__SVForIPTool(name = "SVForIPTool_TrackCounting", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_TrackCounting -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_TrackCounting - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -TrackCountingBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "TrackCountingBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -ToolSvc += TrackCountingBasicTrackGradeFactory -if BTaggingFlags.OutputLevel < 3: - print TrackCountingBasicTrackGradeFactory - -from JetTagTools.JetTagToolsConf import Analysis__TrackCounting -TrackCountingTool = Analysis__TrackCounting( - name = "TrackCounting", - OutputLevel = BTaggingFlags.OutputLevel, - trackSelectorTool = TrackCountingTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, - trackGradePartitions = [ "Good", "Shared" ], - RejectBadTracks = False, - SignWithSvx = False, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_TrackCounting, - trackGradeFactory = TrackCountingBasicTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - unbiasIPEstimation = False ) -ToolSvc += TrackCountingTool -if BTaggingFlags.OutputLevel < 3: - print TrackCountingTool diff --git a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_TrackCountingFlip.py b/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_TrackCountingFlip.py deleted file mode 100755 index 9c1ebafb230e9df42367bad50a6683e057b9e567..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/JetTagging/JetTagAlgs/BTagging/share/BTagging_TrackCountingFlip.py +++ /dev/null @@ -1,48 +0,0 @@ -# each tagger needs own instance, can't be shared! -from JetTagTools.JetTagToolsConf import Analysis__TrackSelector -TrackCountingFlipTrackSelector = Analysis__TrackSelector( - name = "TrackCountingFlipTrackSelector", - trackToVertexTool = BTagTrackToVertexTool, - OutputLevel = BTaggingFlags.OutputLevel - ) -ToolSvc += TrackCountingFlipTrackSelector -if BTaggingFlags.OutputLevel < 3: - print TrackCountingFlipTrackSelector - -from JetTagTools.JetTagToolsConf import Analysis__SVForIPTool -SVForIPTool_TrackCountingFlip = Analysis__SVForIPTool(name = "SVForIPTool_TrackCountingFlip", - OutputLevel = BTaggingFlags.OutputLevel) - -ToolSvc += SVForIPTool_TrackCountingFlip -if BTaggingFlags.OutputLevel < 3: - print SVForIPTool_TrackCountingFlip - -from JetTagTools.JetTagToolsConf import Analysis__BasicTrackGradeFactory -TrackCountingFlipBasicTrackGradeFactory = Analysis__BasicTrackGradeFactory(name = "TrackCountingFlipBasicTrackGradeFactory", - OutputLevel = BTaggingFlags.OutputLevel, - TrackSummaryTool = None, - useSharedHitInfo = True) - -ToolSvc += TrackCountingFlipBasicTrackGradeFactory -if BTaggingFlags.OutputLevel < 3: - print TrackCountingFlipBasicTrackGradeFactory - -from JetTagTools.JetTagToolsConf import Analysis__TrackCounting -TrackCountingFlipTool = Analysis__TrackCounting( - name = "TrackCountingFlip", - OutputLevel = BTaggingFlags.OutputLevel, - trackSelectorTool = TrackCountingFlipTrackSelector, - trackToVertexTool = BTagTrackToVertexTool, - trackGradePartitions = [ "Good", "Shared" ], - RejectBadTracks = False, - SignWithSvx = False, - flipIPSign = True, - SecVxFinderNameForV0Removal = "InDetVKalVxInJetTool", - SecVxFinderNameForIPSign = "InDetVKalVxInJetTool", - SVForIPTool = SVForIPTool_TrackCountingFlip, - trackGradeFactory = TrackCountingFlipBasicTrackGradeFactory, - TrackToVertexIPEstimator = BTagTrackToVertexIPEstimator, - unbiasIPEstimation = False ) -ToolSvc += TrackCountingFlipTool -if BTaggingFlags.OutputLevel < 3: - print TrackCountingFlipTool diff --git a/PhysicsAnalysis/JetTagging/JetTagMonitoring/src/JetTagMonitoring.cxx b/PhysicsAnalysis/JetTagging/JetTagMonitoring/src/JetTagMonitoring.cxx index 6577c843755f29d9b5ffd40930e60891eda791a9..c50f1785921fe0cea88540481c7f70dbadc413e1 100755 --- a/PhysicsAnalysis/JetTagging/JetTagMonitoring/src/JetTagMonitoring.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagMonitoring/src/JetTagMonitoring.cxx @@ -107,7 +107,7 @@ JetTagMonitoring::~JetTagMonitoring() {} StatusCode JetTagMonitoring::registerHist(MonGroup& theGroup, TH1* h1) { - // msg(MSG::VERBOSE) << "in JetTagMonitoring::registerHist " << h1->GetName() << endreq; + // msg(MSG::VERBOSE) << "in JetTagMonitoring::registerHist " << h1->GetName() << endmsg; ATH_MSG_VERBOSE("in JetTagMonitoring::registerHist " << h1->GetName()); StatusCode sc = theGroup.regHist(h1); @@ -184,8 +184,8 @@ StatusCode JetTagMonitoring::bookHistograms() { ATH_MSG_DEBUG("bookHistograms()"); - m_isNewLumiBlock = newLumiBlock; - if ( !newRun ) { + m_isNewLumiBlock = newLumiBlockFlag(); + if ( !newRunFlag() ) { // Only book run-length histogram return StatusCode::SUCCESS; } @@ -234,7 +234,7 @@ StatusCode JetTagMonitoring::bookHistograms() { registerHist(*m_monGr_shift, m_tag_ip3d_c_sj = TH1F_LW::create("tag_IP3D_c_sj","IP3D Pc (Suspect Jets)",100,0.,1.)); registerHist(*m_monGr_shift, m_tag_ip3d_llr_sj = TH1F_LW::create("tag_IP3D_llr_sj","IP3D llr (Suspect Jets)",160,-40.,40.)); - registerHist(*m_monGr_shift, m_tag_sv0_sig3d = TH1F_LW::create("tag_SV0_sig3d","SV0 sig3d",100, 0.,100.)); + registerHist(*m_monGr_shift, m_tag_sv0_sig3d = TH1F_LW::create("tag_SV0_sig3d","SV1 sig3d",100, 0.,100.)); registerHist(*m_monGr_shift, m_tag_sv1_b = TH1F_LW::create("tag_SV1_b","SV1 Pb (Quality Jets)",100,0.,1.)); registerHist(*m_monGr_shift, m_tag_sv1_u = TH1F_LW::create("tag_SV1_u","SV1 Pu (Quality Jets)",100,0.,1.)); @@ -253,86 +253,86 @@ StatusCode JetTagMonitoring::bookHistograms() { registerHist(*m_monGr_shift, m_tag_jfcnn_llr_sj = TH1F_LW::create("tag_JFCNN_llr_sj","Combined weight JetFitterCOMBNN (Suspect Jets)",160,-40.,40.)); registerHist(*m_monGr_shift, m_tag_sv1ip3d_w = TH1F_LW::create("tag_SV1IP3D_w","Combined weight SV1IP3D (quality jet)",100,-10.,10.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w = TH1F_LW::create("tag_MV2c20_w","Combined weight MV2c20 (quality jet)",100,-1.,1.)); - - registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT10_20 = TH1F_LW::create("tag_MV2c20_w_pT10_20" ,"Combined weight MV2c20 (quality jet), jet pT = [10,20] GeV" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT20_50 = TH1F_LW::create("tag_MV2c20_w_pT20_50" ,"Combined weight MV2c20 (quality jet), jet pT = [20,50] GeV" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT50_100 = TH1F_LW::create("tag_MV2c20_w_pT50_100" ,"Combined weight MV2c20 (quality jet), jet pT = [50,100] GeV" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT100_200 = TH1F_LW::create("tag_MV2c20_w_pT100_200","Combined weight MV2c20 (quality jet), jet pT = [100,200] GeV",100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT200 = TH1F_LW::create("tag_MV2c20_w_pT200" ,"Combined weight MV2c20 (quality jet), jet pT > 200 GeV" ,100,-1.,1.)); - - registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta0_05 = TH1F_LW::create("tag_MV2c20_w_eta0_05" ,"Combined weight MV2c20 (quality jet), jet |eta| = [0.0,0.5]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta05_10 = TH1F_LW::create("tag_MV2c20_w_eta05_10","Combined weight MV2c20 (quality jet), jet |eta| = [0.5,1.0]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta10_15 = TH1F_LW::create("tag_MV2c20_w_eta10_15","Combined weight MV2c20 (quality jet), jet |eta| = [1.0,1.5]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta15_20 = TH1F_LW::create("tag_MV2c20_w_eta15_20","Combined weight MV2c20 (quality jet), jet |eta| = [1.5,2.0]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta20_25 = TH1F_LW::create("tag_MV2c20_w_eta20_25","Combined weight MV2c20 (quality jet), jet |eta| = [2.0,2.5]" ,100,-1.,1.)); - - registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi0_07 = TH1F_LW::create("tag_MV2c20_w_phi0_07" ,"Combined weight MV2c20 (quality jet), jet |phi| = [0.0,0.7]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi07_14 = TH1F_LW::create("tag_MV2c20_w_phi07_14","Combined weight MV2c20 (quality jet), jet |phi| = [0.7,1.4]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi14_21 = TH1F_LW::create("tag_MV2c20_w_phi14_21","Combined weight MV2c20 (quality jet), jet |phi| = [1.4,2.1]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi21_28 = TH1F_LW::create("tag_MV2c20_w_phi21_28","Combined weight MV2c20 (quality jet), jet |phi| = [2.1,2.8]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi28 = TH1F_LW::create("tag_MV2c20_w_phi28","Combined weight MV2c20 (quality jet), jet |phi| > 2.8" ,100,-1.,1.)); - - registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_sum85OP = TH1F_LW::create("tag_MV2c20_w_phi_sum85OP","Sum weight MV2c20 > 85% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_sum77OP = TH1F_LW::create("tag_MV2c20_w_phi_sum77OP","Sum weight MV2c20 > 77% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_sum70OP = TH1F_LW::create("tag_MV2c20_w_phi_sum70OP","Sum weight MV2c20 > 70% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_sum50OP = TH1F_LW::create("tag_MV2c20_w_phi_sum50OP","Sum weight MV2c20 > 50% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_sumAll = TH1F_LW::create("tag_MV2c20_w_phi_sumAll" ,"Sum weight MV2c20 All (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_frac85OP = TH1F_LW::create("tag_MV2c20_w_phi_frac85OP","Frac weight MV2c20 > 85% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_frac77OP = TH1F_LW::create("tag_MV2c20_w_phi_frac77OP","Frac weight MV2c20 > 77% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_frac70OP = TH1F_LW::create("tag_MV2c20_w_phi_frac70OP","Frac weight MV2c20 > 70% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_frac50OP = TH1F_LW::create("tag_MV2c20_w_phi_frac50OP","Frac weight MV2c20 > 50% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); - - registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_sum85OP = TH1F_LW::create("tag_MV2c20_w_eta_sum85OP","Sum weight MV2c20 > 85% OP (quality jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_sum77OP = TH1F_LW::create("tag_MV2c20_w_eta_sum77OP","Sum weight MV2c20 > 77% OP (quality jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_sum70OP = TH1F_LW::create("tag_MV2c20_w_eta_sum70OP","Sum weight MV2c20 > 70% OP (quality jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_sum50OP = TH1F_LW::create("tag_MV2c20_w_eta_sum50OP","Sum weight MV2c20 > 50% OP (quality jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_sumAll = TH1F_LW::create("tag_MV2c20_w_eta_sumAll" ,"Sum weight MV2c20 All (quality jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_frac85OP = TH1F_LW::create("tag_MV2c20_w_eta_frac85OP","Frac weight MV2c20 > 85% OP (quality jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_frac77OP = TH1F_LW::create("tag_MV2c20_w_eta_frac77OP","Frac weight MV2c20 > 77% OP (quality jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_frac70OP = TH1F_LW::create("tag_MV2c20_w_eta_frac70OP","Frac weight MV2c20 > 70% OP (quality jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_frac50OP = TH1F_LW::create("tag_MV2c20_w_eta_frac50OP","Frac weight MV2c20 > 50% OP (quality jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w = TH1F_LW::create("tag_MV2c20_w","Combined weight Mv2c10 (quality jet)",100,-1.,1.)); + + registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT10_20 = TH1F_LW::create("tag_MV2c20_w_pT10_20" ,"Combined weight Mv2c10 (quality jet), jet pT = [10,20] GeV" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT20_50 = TH1F_LW::create("tag_MV2c20_w_pT20_50" ,"Combined weight Mv2c10 (quality jet), jet pT = [20,50] GeV" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT50_100 = TH1F_LW::create("tag_MV2c20_w_pT50_100" ,"Combined weight Mv2c10 (quality jet), jet pT = [50,100] GeV" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT100_200 = TH1F_LW::create("tag_MV2c20_w_pT100_200","Combined weight Mv2c10 (quality jet), jet pT = [100,200] GeV",100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT200 = TH1F_LW::create("tag_MV2c20_w_pT200" ,"Combined weight Mv2c10 (quality jet), jet pT > 200 GeV" ,100,-1.,1.)); + + registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta0_05 = TH1F_LW::create("tag_MV2c20_w_eta0_05" ,"Combined weight Mv2c10 (quality jet), jet |eta| = [0.0,0.5]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta05_10 = TH1F_LW::create("tag_MV2c20_w_eta05_10","Combined weight Mv2c10 (quality jet), jet |eta| = [0.5,1.0]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta10_15 = TH1F_LW::create("tag_MV2c20_w_eta10_15","Combined weight Mv2c10 (quality jet), jet |eta| = [1.0,1.5]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta15_20 = TH1F_LW::create("tag_MV2c20_w_eta15_20","Combined weight Mv2c10 (quality jet), jet |eta| = [1.5,2.0]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta20_25 = TH1F_LW::create("tag_MV2c20_w_eta20_25","Combined weight Mv2c10 (quality jet), jet |eta| = [2.0,2.5]" ,100,-1.,1.)); + + registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi0_07 = TH1F_LW::create("tag_MV2c20_w_phi0_07" ,"Combined weight Mv2c10 (quality jet), jet |phi| = [0.0,0.7]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi07_14 = TH1F_LW::create("tag_MV2c20_w_phi07_14","Combined weight Mv2c10 (quality jet), jet |phi| = [0.7,1.4]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi14_21 = TH1F_LW::create("tag_MV2c20_w_phi14_21","Combined weight Mv2c10 (quality jet), jet |phi| = [1.4,2.1]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi21_28 = TH1F_LW::create("tag_MV2c20_w_phi21_28","Combined weight Mv2c10 (quality jet), jet |phi| = [2.1,2.8]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi28 = TH1F_LW::create("tag_MV2c20_w_phi28","Combined weight Mv2c10 (quality jet), jet |phi| > 2.8" ,100,-1.,1.)); + + registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_sum85OP = TH1F_LW::create("tag_MV2c20_w_phi_sum85OP","Sum weight Mv2c10 > 85% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_sum77OP = TH1F_LW::create("tag_MV2c20_w_phi_sum77OP","Sum weight Mv2c10 > 77% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_sum70OP = TH1F_LW::create("tag_MV2c20_w_phi_sum70OP","Sum weight Mv2c10 > 70% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_sum50OP = TH1F_LW::create("tag_MV2c20_w_phi_sum50OP","Sum weight Mv2c10 > 50% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_sumAll = TH1F_LW::create("tag_MV2c20_w_phi_sumAll" ,"Sum weight Mv2c10 All (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_frac85OP = TH1F_LW::create("tag_MV2c20_w_phi_frac85OP","Frac weight Mv2c10 > 85% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_frac77OP = TH1F_LW::create("tag_MV2c20_w_phi_frac77OP","Frac weight Mv2c10 > 77% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_frac70OP = TH1F_LW::create("tag_MV2c20_w_phi_frac70OP","Frac weight Mv2c10 > 70% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_phi_frac50OP = TH1F_LW::create("tag_MV2c20_w_phi_frac50OP","Frac weight Mv2c10 > 50% OP (quality jet)" ,14,-TMath::Pi(),TMath::Pi())); + + registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_sum85OP = TH1F_LW::create("tag_MV2c20_w_eta_sum85OP","Sum weight Mv2c10 > 85% OP (quality jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_sum77OP = TH1F_LW::create("tag_MV2c20_w_eta_sum77OP","Sum weight Mv2c10 > 77% OP (quality jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_sum70OP = TH1F_LW::create("tag_MV2c20_w_eta_sum70OP","Sum weight Mv2c10 > 70% OP (quality jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_sum50OP = TH1F_LW::create("tag_MV2c20_w_eta_sum50OP","Sum weight Mv2c10 > 50% OP (quality jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_sumAll = TH1F_LW::create("tag_MV2c20_w_eta_sumAll" ,"Sum weight Mv2c10 All (quality jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_frac85OP = TH1F_LW::create("tag_MV2c20_w_eta_frac85OP","Frac weight Mv2c10 > 85% OP (quality jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_frac77OP = TH1F_LW::create("tag_MV2c20_w_eta_frac77OP","Frac weight Mv2c10 > 77% OP (quality jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_frac70OP = TH1F_LW::create("tag_MV2c20_w_eta_frac70OP","Frac weight Mv2c10 > 70% OP (quality jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_eta_frac50OP = TH1F_LW::create("tag_MV2c20_w_eta_frac50OP","Frac weight Mv2c10 > 50% OP (quality jet)" ,20,-2.5,2.5)); registerHist(*m_monGr_shift, m_tag_sv1ip3d_w_sj = TH1F_LW::create("tag_SV1IP3D_w_sj","Combined weight SV1IP3D (suspect jet)",100,-10.,10.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj = TH1F_LW::create("tag_MV2c20_w_sj","Combined weight MV2c20 (suspect jet)",100,-1.,1.)); - - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_pT10_20 = TH1F_LW::create("tag_MV2c20_w_sj_pT10_20" ,"Combined weight MV2c20 (suspect jet), jet pT = [10,20] GeV" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_pT20_50 = TH1F_LW::create("tag_MV2c20_w_sj_pT20_50" ,"Combined weight MV2c20 (suspect jet), jet pT = [20,50] GeV" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_pT50_100 = TH1F_LW::create("tag_MV2c20_w_sj_pT50_100" ,"Combined weight MV2c20 (suspect jet), jet pT = [50,100] GeV" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_pT100_200 = TH1F_LW::create("tag_MV2c20_w_sj_pT100_200","Combined weight MV2c20 (suspect jet), jet pT = [100,200] GeV",100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_pT200 = TH1F_LW::create("tag_MV2c20_w_sj_pT200" ,"Combined weight MV2c20 (suspect jet), jet pT > 200 GeV" ,100,-1.,1.)); - - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta0_05 = TH1F_LW::create("tag_MV2c20_w_sj_eta0_05" ,"Combined weight MV2c20 (suspect jet), jet |eta| = [0.0,0.5]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta05_10 = TH1F_LW::create("tag_MV2c20_w_sj_eta05_10","Combined weight MV2c20 (suspect jet), jet |eta| = [0.5,1.0]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta10_15 = TH1F_LW::create("tag_MV2c20_w_sj_eta10_15","Combined weight MV2c20 (suspect jet), jet |eta| = [1.0,1.5]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta15_20 = TH1F_LW::create("tag_MV2c20_w_sj_eta15_20","Combined weight MV2c20 (suspect jet), jet |eta| = [1.5,2.0]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta20_25 = TH1F_LW::create("tag_MV2c20_w_sj_eta20_25","Combined weight MV2c20 (suspect jet), jet |eta| = [2.0,2.5]" ,100,-1.,1.)); - - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi0_07 = TH1F_LW::create("tag_MV2c20_w_sj_phi0_07" ,"Combined weight MV2c20 (suspect jet), jet |phi| = [0.0,0.7]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi07_14 = TH1F_LW::create("tag_MV2c20_w_sj_phi07_14","Combined weight MV2c20 (suspect jet), jet |phi| = [0.7,1.4]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi14_21 = TH1F_LW::create("tag_MV2c20_w_sj_phi14_21","Combined weight MV2c20 (suspect jet), jet |phi| = [1.4,2.1]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi21_28 = TH1F_LW::create("tag_MV2c20_w_sj_phi21_28","Combined weight MV2c20 (suspect jet), jet |phi| = [2.1,2.8]" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi28 = TH1F_LW::create("tag_MV2c20_w_sj_phi28","Combined weight MV2c20 (suspect jet), jet |phi| > 2.8" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj = TH1F_LW::create("tag_MV2c20_w_sj","Combined weight Mv2c10 (suspect jet)",100,-1.,1.)); + + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_pT10_20 = TH1F_LW::create("tag_MV2c20_w_sj_pT10_20" ,"Combined weight Mv2c10 (suspect jet), jet pT = [10,20] GeV" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_pT20_50 = TH1F_LW::create("tag_MV2c20_w_sj_pT20_50" ,"Combined weight Mv2c10 (suspect jet), jet pT = [20,50] GeV" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_pT50_100 = TH1F_LW::create("tag_MV2c20_w_sj_pT50_100" ,"Combined weight Mv2c10 (suspect jet), jet pT = [50,100] GeV" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_pT100_200 = TH1F_LW::create("tag_MV2c20_w_sj_pT100_200","Combined weight Mv2c10 (suspect jet), jet pT = [100,200] GeV",100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_pT200 = TH1F_LW::create("tag_MV2c20_w_sj_pT200" ,"Combined weight Mv2c10 (suspect jet), jet pT > 200 GeV" ,100,-1.,1.)); + + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta0_05 = TH1F_LW::create("tag_MV2c20_w_sj_eta0_05" ,"Combined weight Mv2c10 (suspect jet), jet |eta| = [0.0,0.5]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta05_10 = TH1F_LW::create("tag_MV2c20_w_sj_eta05_10","Combined weight MV2c10 (suspect jet), jet |eta| = [0.5,1.0]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta10_15 = TH1F_LW::create("tag_MV2c20_w_sj_eta10_15","Combined weight MV2c10 (suspect jet), jet |eta| = [1.0,1.5]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta15_20 = TH1F_LW::create("tag_MV2c20_w_sj_eta15_20","Combined weight MV2c10 (suspect jet), jet |eta| = [1.5,2.0]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta20_25 = TH1F_LW::create("tag_MV2c20_w_sj_eta20_25","Combined weight MV2c10 (suspect jet), jet |eta| = [2.0,2.5]" ,100,-1.,1.)); + + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi0_07 = TH1F_LW::create("tag_MV2c20_w_sj_phi0_07" ,"Combined weight MV2c10 (suspect jet), jet |phi| = [0.0,0.7]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi07_14 = TH1F_LW::create("tag_MV2c20_w_sj_phi07_14","Combined weight MV2c10 (suspect jet), jet |phi| = [0.7,1.4]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi14_21 = TH1F_LW::create("tag_MV2c20_w_sj_phi14_21","Combined weight MV2c10 (suspect jet), jet |phi| = [1.4,2.1]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi21_28 = TH1F_LW::create("tag_MV2c20_w_sj_phi21_28","Combined weight MV2c10 (suspect jet), jet |phi| = [2.1,2.8]" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi28 = TH1F_LW::create("tag_MV2c20_w_sj_phi28","Combined weight MV2c10 (suspect jet), jet |phi| > 2.8" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_sum85OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_sum85OP","Sum weight MV2c20 > 85% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_sum77OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_sum77OP","Sum weight MV2c20 > 77% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_sum70OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_sum70OP","Sum weight MV2c20 > 70% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_sum50OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_sum50OP","Sum weight MV2c20 > 50% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_sumAll = TH1F_LW::create("tag_MV2c20_w_sj_phi_sumAll" ,"Sum weight MV2c20 All (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_frac85OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_frac85OP","Frac weight MV2c20 > 85% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_frac77OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_frac77OP","Frac weight MV2c20 > 77% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_frac70OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_frac70OP","Frac weight MV2c20 > 70% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_frac50OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_frac50OP","Frac weight MV2c20 > 50% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); - - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_sum85OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_sum85OP","Sum weight MV2c20 > 85% OP (suspect jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_sum77OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_sum77OP","Sum weight MV2c20 > 77% OP (suspect jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_sum70OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_sum70OP","Sum weight MV2c20 > 70% OP (suspect jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_sum50OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_sum50OP","Sum weight MV2c20 > 50% OP (suspect jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_sumAll = TH1F_LW::create("tag_MV2c20_w_sj_eta_sumAll" ,"Sum weight MV2c20 All (suspect jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_frac85OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_frac85OP","Frac weight MV2c20 > 85% OP (suspect jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_frac77OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_frac77OP","Frac weight MV2c20 > 77% OP (suspect jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_frac70OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_frac70OP","Frac weight MV2c20 > 70% OP (suspect jet)" ,20,-2.5,2.5)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_frac50OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_frac50OP","Frac weight MV2c20 > 50% OP (suspect jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_sum85OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_sum85OP","Sum weight MV2c10 > 85% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_sum77OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_sum77OP","Sum weight MV2c10 > 77% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_sum70OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_sum70OP","Sum weight MV2c10 > 70% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_sum50OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_sum50OP","Sum weight MV2c10 > 50% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_sumAll = TH1F_LW::create("tag_MV2c20_w_sj_phi_sumAll" ,"Sum weight MV2c10 All (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_frac85OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_frac85OP","Frac weight MV2c10 > 85% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_frac77OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_frac77OP","Frac weight MV2c10 > 77% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_frac70OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_frac70OP","Frac weight MV2c10 > 70% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_phi_frac50OP = TH1F_LW::create("tag_MV2c20_w_sj_phi_frac50OP","Frac weight MV2c10 > 50% OP (suspect jet)" ,14,-TMath::Pi(),TMath::Pi())); + + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_sum85OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_sum85OP","Sum weight MV2c10 > 85% OP (suspect jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_sum77OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_sum77OP","Sum weight MV2c10 > 77% OP (suspect jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_sum70OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_sum70OP","Sum weight MV2c10 > 70% OP (suspect jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_sum50OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_sum50OP","Sum weight MV2c10 > 50% OP (suspect jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_sumAll = TH1F_LW::create("tag_MV2c20_w_sj_eta_sumAll" ,"Sum weight MV2c10 All (suspect jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_frac85OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_frac85OP","Frac weight MV2c10 > 85% OP (suspect jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_frac77OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_frac77OP","Frac weight MV2c10 > 77% OP (suspect jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_frac70OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_frac70OP","Frac weight MV2c10 > 70% OP (suspect jet)" ,20,-2.5,2.5)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_sj_eta_frac50OP = TH1F_LW::create("tag_MV2c20_w_sj_eta_frac50OP","Frac weight MV2c10 > 50% OP (suspect jet)" ,20,-2.5,2.5)); registerHist(*m_monGr_shift, m_jet_n = TH1F_LW::create("jet_n","number of jets",20,0.,20.)); @@ -431,9 +431,9 @@ StatusCode JetTagMonitoring::bookHistograms() { registerHist(*m_monGr_shift, m_sv1ip3d_tag_pos_rate_2D = TH2F_LW::create("sv1ip3d_tag_pos_rate_2D", "SV1+IP3D Tag Positive Rate;#eta;#phi", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); registerHist(*m_monGr_shift, m_sv1ip3d_tag_neg_rate_2D = TH2F_LW::create("sv1ip3d_tag_neg_rate_2D", "SV1+IP3D Tag Negative Rate;#eta;#phi", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); - registerHist(*m_monGr_shift, m_mv2c20_tag_50_2D = TH2F_LW::create("mv2c20_tag_50_rate_2D", "MV2c20 Tag 50%;#eta;#phi", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); - registerHist(*m_monGr_shift, m_mv2c20_tag_70_2D = TH2F_LW::create("mv2c20_tag_70_rate_2D", "MV2c20 Tag 70%;#eta;#phi", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); - registerHist(*m_monGr_shift, m_mv2c20_tag_80_2D = TH2F_LW::create("mv2c20_tag_80_rate_2D", "MV2c20 Tag 80%;#eta;#phi", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); + registerHist(*m_monGr_shift, m_mv2c20_tag_50_2D = TH2F_LW::create("mv2c20_tag_50_rate_2D", "MV2c10 Tag 50%;#eta;#phi", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); + registerHist(*m_monGr_shift, m_mv2c20_tag_70_2D = TH2F_LW::create("mv2c20_tag_70_rate_2D", "MV2c10 Tag 70%;#eta;#phi", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); + registerHist(*m_monGr_shift, m_mv2c20_tag_80_2D = TH2F_LW::create("mv2c20_tag_80_rate_2D", "MV2c10 Tag 80%;#eta;#phi", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); registerHist(*m_monGr_shift, m_tracks_all_2D = TH2F_LW::create("tracks_all_2D", "All Tracks", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); @@ -459,7 +459,7 @@ StatusCode JetTagMonitoring::bookHistograms() { /* Starting to register LowStat histograms: */ - if ( newRun || newLowStatInterval ) { + if ( newRunFlag() || newLowStatIntervalFlag() ) { registerHist(*m_monGr_LowStat, m_tracks_all_2D_LS = TH2F_LW::create("tracks_all_2D_LS", "All Tracks;#eta;#phi", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); registerHist(*m_monGr_LowStat, m_tracks_pTMin_2D_LS = TH2F_LW::create("tracks_pTMin_2D_LS", "Tracks Failed pTMin Cut;#eta;#phi", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); registerHist(*m_monGr_LowStat, m_tracks_d0Max_2D_LS = TH2F_LW::create("tracks_d0Max_2D_LS", "Tracks Failed d0Max Cut;#eta;#phi", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); @@ -483,11 +483,11 @@ StatusCode JetTagMonitoring::bookHistograms() { // registerHist(*m_monGr_LowStat, m_mv2c20_tag_80_2D_LS = TH2F_LW::create("mv2c20_tag_80_2D_LS", "MV2c20 Tag 80%", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); registerHist(*m_monGr_shift, m_tag_mv2c20_w_LS = TH1F_LW::create("tag_MV2c20_w_LS","Combined weight MV2c20 (quality jet)",100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT10_20_LS = TH1F_LW::create("tag_MV2c20_w_pT10_20_LS" ,"Combined weight MV2c20 (quality jet), jet pT = [10,20] GeV" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT20_50_LS = TH1F_LW::create("tag_MV2c20_w_pT20_50_LS" ,"Combined weight MV2c20 (quality jet), jet pT = [20,50] GeV" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT50_100_LS = TH1F_LW::create("tag_MV2c20_w_pT50_100_LS" ,"Combined weight MV2c20 (quality jet), jet pT = [50,100] GeV" ,100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT100_200_LS = TH1F_LW::create("tag_MV2c20_w_pT100_200_LS","Combined weight MV2c20 (quality jet), jet pT = [100,200] GeV",100,-1.,1.)); - registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT200_LS = TH1F_LW::create("tag_MV2c20_w_pT200_LS" ,"Combined weight MV2c20 (quality jet), jet pT > 200 GeV" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT10_20_LS = TH1F_LW::create("tag_MV2c20_w_pT10_20_LS" ,"Combined weight MV2c10 (quality jet), jet pT = [10,20] GeV" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT20_50_LS = TH1F_LW::create("tag_MV2c20_w_pT20_50_LS" ,"Combined weight MV2c10 (quality jet), jet pT = [20,50] GeV" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT50_100_LS = TH1F_LW::create("tag_MV2c20_w_pT50_100_LS" ,"Combined weight MV2c10 (quality jet), jet pT = [50,100] GeV" ,100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT100_200_LS = TH1F_LW::create("tag_MV2c20_w_pT100_200_LS","Combined weight MV2c10 (quality jet), jet pT = [100,200] GeV",100,-1.,1.)); + registerHist(*m_monGr_shift, m_tag_mv2c20_w_pT200_LS = TH1F_LW::create("tag_MV2c20_w_pT200_LS" ,"Combined weight MV2c10 (quality jet), jet pT > 200 GeV" ,100,-1.,1.)); registerHist(*m_monGr_LowStat, m_jet_2D_kinematic_LS = TH2F_LW::create("jet_2D_kinematic_LS", "Jet 2D plot (Kinematic Cuts);#eta;#phi", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); registerHist(*m_monGr_LowStat, m_track_selector_eff_LS = TH2F_LW::create("track_selector_eff_LS", "Efficiency of Track Selector Tool;#eta;#phi", 25, -2.5, 2.5, 25, -TMath::Pi(), TMath::Pi())); @@ -817,7 +817,7 @@ StatusCode JetTagMonitoring::procHistograms() { ATH_MSG_DEBUG("in procHistograms()"); /* Finalize the histograms */ - if ( m_histogramsCreated && (endOfRun || AthenaMonManager::environment() == AthenaMonManager::online) ) { + if ( m_histogramsCreated && (endOfRunFlag() || AthenaMonManager::environment() == AthenaMonManager::online) ) { m_track_selector_eff->getROOTHist()->Divide(m_track_selector_all->getROOTHist(),m_tracks_all_2D->getROOTHist()); @@ -931,7 +931,10 @@ void JetTagMonitoring::fillJetHistograms() { if(!btag) continue; double sv1ip3d = btag->SV1plusIP3D_discriminant(); - double mv2c20 = btag->auxdata<double>("MV2c20_discriminant"); + double mv2c10_tmp = 0; + btag->MVx_discriminant("MV2c10",mv2c10_tmp); + double mv2c20 = mv2c10_tmp; + /* fill the 2D SV1IP3D rate */ if ( sv1ip3d > m_sv1ip3d_weight_cut ) { @@ -1071,7 +1074,9 @@ void JetTagMonitoring::fillDetailedHistograms(const xAOD::Jet *jet, Jet_t qualit ATH_MSG_VERBOSE("InfoBase for IP2D: #tracks = " << ntrk << ", Pb = " << pb << ", Pu = " << pu<< ", Pc = " << pc << ", llr = " << llr); - m_tag_sv0_sig3d->Fill(btag->SV0_significance3D()); + float sig3d = 0; + btag->variable<float>("SV1", "significance3d" , sig3d); + m_tag_sv0_sig3d->Fill(sig3d); pb = btag->SV1_pb(); // b likelihood pu = btag->SV1_pu(); // u likelihood @@ -1101,7 +1106,9 @@ void JetTagMonitoring::fillDetailedHistograms(const xAOD::Jet *jet, Jet_t qualit m_tag_jetfitter_llr_sj->Fill(llr); } - llr = btag->JetFitterCombNN_loglikelihoodratio(); // log likelihood ratio + // log likelihood ratio + llr = btag->JetFitter_loglikelihoodratio(); + if ( quality == goodJet ) { m_tag_jfcnn_llr->Fill(llr); } @@ -1162,8 +1169,10 @@ void JetTagMonitoring::fillGoodJetHistos(const xAOD::Jet *jet) { const xAOD::BTagging* btag = jet->btagging(); double sv1ip3d = btag->SV1plusIP3D_discriminant(); - double mv2c20 = btag->auxdata<double>("MV2c20_discriminant"); - + double mv2c10_tmp = 0; + btag->MVx_discriminant("MV2c10",mv2c10_tmp); + double mv2c20 = mv2c10_tmp; + m_tag_sv1ip3d_w->Fill(sv1ip3d); m_tag_mv2c20_w->Fill(mv2c20); m_tag_mv2c20_w_LS->Fill(mv2c20); @@ -1263,9 +1272,11 @@ void JetTagMonitoring::fillSuspectJetHistos(const xAOD::Jet *jet) { const xAOD::BTagging* btag = jet->btagging(); - double sv1ip3d = btag->SV1plusIP3D_discriminant(); - double mv2c20 = btag->auxdata<double>("MV2c20_discriminant"); - + double sv1ip3d = btag->SV1plusIP3D_discriminant(); + double mv2c10_tmp = 0; + btag->MVx_discriminant("MV2c10",mv2c10_tmp); + double mv2c20 = mv2c10_tmp; + m_tag_sv1ip3d_w_sj->Fill(sv1ip3d); m_tag_mv2c20_w_sj->Fill(mv2c20); diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt b/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt index 5e9cb0879008f8439ceda6bbc83ecfa1d998bc0f..a0ac7dbfef828e4c77ba8374fe967b101ace773c 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt +++ b/PhysicsAnalysis/JetTagging/JetTagTools/CMakeLists.txt @@ -1,4 +1,4 @@ -# $Id: CMakeLists.txt 786110 2016-11-23 19:25:18Z ssnyder $ +# $Id: CMakeLists.txt 793433 2017-01-23 10:57:26Z dguest $ ################################################################################ # Package: JetTagTools ################################################################################ @@ -72,6 +72,7 @@ atlas_add_library( JetTagToolsLib src/GradedTrack.cxx src/IPTag.cxx src/JetTagUtils.cxx src/SVForIPTool.cxx src/SVTag.cxx src/JetFitterTag.cxx src/JetFitterNtupleWriter.cxx src/JetFitterNNTool.cxx + src/JetFitterInputWriter.cxx src/JetFitterDummyClassifier.cxx src/MV1Tag.cxx src/MV1cTag.cxx src/MV2Tag.cxx src/MyTag.cxx src/JetFitterVariablesFactory.cxx src/MSVVariablesFactory.cxx diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/IPTag.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/IPTag.h index 242ef6d7b74b1b1f01fbf94234c8b5bd43545052..89cd96cdfdfb00c78ac7bbcd09ff417fbe3ea850 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/IPTag.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/IPTag.h @@ -96,6 +96,10 @@ namespace Analysis { bool m_useCHypo; bool m_unbiasIPEstimation; // remove track from vertex when computing IP + // make the output smaller + bool m_storeTrackParticles; + bool m_storeIpValues; + bool m_storeTrackParameters; //// VD: other (non-bool) configurables /** Name of the track-to-jet association in the BTagging object */ @@ -110,8 +114,6 @@ namespace Analysis { /** forcing the calibration folder of a given collection */ std::string m_ForcedCalibName; - std::string m_infoPlusName; // key to store the IPInfoPlus (VD:???) - /** for reference mode: */ std::string m_referenceType; // label to use for reference mode std::string m_truthMatchingName; // name of truthMatchingTool instance to get TruthInfo diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterDummyClassifier.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterDummyClassifier.h new file mode 100644 index 0000000000000000000000000000000000000000..ba13671d7737e62295a6cfd695b6c976f4c8af4a --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterDummyClassifier.h @@ -0,0 +1,58 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef BTAGTOOL_JETFITTERDUMMYCLASSIFIER_C +#define BTAGTOOL_JETFITTERDUMMYCLASSIFIER_C + +/****************************************************** + @class JetFitterDummyClassifier + Package : JetTagTools + Created : March 2007 + + DESCRIPTION: filler for JetFitter classifier, does nothing + +********************************************************/ + +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ToolHandle.h" + +#include "JetTagTools/IJetFitterClassifierTool.h" + +namespace Analysis { + + +static const InterfaceID IID_JetFitterDummyClassifier("Analysis::JetFitterDummyClassifier", 1, 0); + + class IJetFitterTagInfo; + + class JetFitterDummyClassifier : public AthAlgTool, public IJetFitterClassifierTool { + + public: + + /** AlgTool interface methods */ + static const InterfaceID& interfaceID() { return IID_JetFitterDummyClassifier; }; + + JetFitterDummyClassifier(const std::string& name, + const std::string& n, const IInterface* p); + ~JetFitterDummyClassifier(); + + virtual StatusCode initialize(); + virtual StatusCode finalize(); + + // IJetFitterClassifier interface + StatusCode fillLikelihoodValues(xAOD::BTagging* BTag, + const std::string & jetauthor, + const std::string& inputbasename, + const std::string& outputbasename, + double jetpT, + double jeteta, + double IP3dlike=-5000); + + + private: + }; + +}//end Analysis namespace + +#endif diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterInputWriter.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterInputWriter.h new file mode 100644 index 0000000000000000000000000000000000000000..85a094ca7adbd1871c0f7f3332a3889c40f377a9 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/JetFitterInputWriter.h @@ -0,0 +1,71 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef BTAGTOOL_JETFITTERINPUTWRITER_C +#define BTAGTOOL_JETFITTERINPUTWRITER_C + +/****************************************************** + @class JetFitterInputWriter + Package : JetTagTools + Created : January 2008 + DESCRIPTION: write inputs to xAOD +********************************************************/ + +#include "AthenaBaseComps/AthAlgTool.h" +#include "GaudiKernel/ToolHandle.h" + +#include "JetTagTools/IJetFitterClassifierTool.h" +#include "xAODBTagging/BTagging.h" + +// #include <TString.h> + +class TTrainedNetwork; +class TH1; + +namespace Trk +{ + class NeuralNetworkToHistoTool; +} + + +namespace Analysis { + + + class IJetFitterTagInfo; + + static const InterfaceID IID_JetFitterInputWriter("Analysis::JetFitterInputWriter", 1, 0); + + class JetFitterInputWriter : public IJetFitterClassifierTool, public AthAlgTool + { + + public: + + /** AlgTool interface methods */ + static const InterfaceID& interfaceID() { return IID_JetFitterInputWriter; }; + + JetFitterInputWriter(const std::string& name, + const std::string& n, const IInterface* p); + ~JetFitterInputWriter(); + + virtual StatusCode initialize(); + virtual StatusCode finalize(); + + StatusCode fillLikelihoodValues(xAOD::BTagging* BTag, + const std::string & jetauthor, + const std::string& inputbasename, + const std::string& outputbasename, + double jetpT, + double jeteta, + double IP3dlike=-5000); + + private: + + bool m_useCombinedIPNN; + bool m_usePtCorrectedMass; + + }; + +}//end Analysis namespace + +#endif diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/RNNIPTag.h b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/RNNIPTag.h index 04558e3c9a2ba3c60b1d26bc7b35191c61e74fab..58ff7d0a53469a4adca47414df9caf54bf481aef 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/RNNIPTag.h +++ b/PhysicsAnalysis/JetTagging/JetTagTools/JetTagTools/RNNIPTag.h @@ -111,6 +111,7 @@ namespace Analysis { // we can save the sorted inputs for each tagger for debugging and // optimization bool m_writeInputsToBtagObject; + bool m_writeTrackLinks; //// VD: other (non-bool) configurables /** Name of the track-to-jet association in the BTagging object */ @@ -156,13 +157,6 @@ namespace Analysis { std::string m_secVxFinderNameForIPSign; std::string m_secVxFinderName; - /** additional switch for smart track selection */ - int m_NtrkMin; // minimum number of tracks to consider - int m_NtrkMax; // maximum number of tracks to consider - // (min will always prevail) - float m_trkFract; // fraction of total tracks to consider - // (min will alwayt prevail) - //// VD: auxiliary information to be stored /** information to persistify: */ std::string m_originalTPCollectionName; diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/IPTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/IPTag.cxx index fb5987689c8c5fb56946ef449ce8b8905a987429..d41a32482b9a6d6aeb182d07806a8bd343171b13 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/IPTag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/IPTag.cxx @@ -143,6 +143,11 @@ namespace Analysis { declareProperty("NtrkMax" , m_NtrkMax =6 ); declareProperty("NtrkFract" , m_trkFract=1.0 ); declareProperty("SortingMode" , m_sortOption="None"); //"None"); +#define PROP(name, def) declareProperty( #name, m_ ## name = def) + PROP(storeTrackParticles, true); + PROP(storeIpValues, false); + PROP(storeTrackParameters, true); +#undef PROP // tools: declareProperty("trackSelectorTool" , m_trackSelectorTool ); @@ -835,46 +840,60 @@ namespace Analysis { std::vector<int> i_vectGrades( vectGrades.begin(), vectGrades.end() ); // specific fast accessors for mainstream instances of IPTag: IP3D, IP2D if( "IP3D"==m_xAODBaseName ) { - BTag->setIP3D_TrackParticleLinks(IPTracks); - BTag->setTaggerInfo(f_vectD0, xAOD::BTagInfo::IP3D_valD0wrtPVofTracks); - BTag->setTaggerInfo(f_vectD0Signi, xAOD::BTagInfo::IP3D_sigD0wrtPVofTracks); - BTag->setTaggerInfo(f_vectZ0, xAOD::BTagInfo::IP3D_valZ0wrtPVofTracks); - BTag->setTaggerInfo(f_vectZ0Signi, xAOD::BTagInfo::IP3D_sigZ0wrtPVofTracks); - BTag->setTaggerInfo(vectWeightB, xAOD::BTagInfo::IP3D_weightBofTracks); - BTag->setTaggerInfo(vectWeightU, xAOD::BTagInfo::IP3D_weightUofTracks); - BTag->setTaggerInfo(vectWeightC, xAOD::BTagInfo::IP3D_weightCofTracks); - BTag->setTaggerInfo(vectFromV0, xAOD::BTagInfo::IP3D_flagFromV0ofTracks); - BTag->setTaggerInfo(i_vectGrades, xAOD::BTagInfo::IP3D_gradeOfTracks); + if (m_storeTrackParticles) BTag->setIP3D_TrackParticleLinks(IPTracks); + if (m_storeIpValues) { + BTag->setTaggerInfo(f_vectD0, xAOD::BTagInfo::IP3D_valD0wrtPVofTracks); + BTag->setTaggerInfo(f_vectZ0, xAOD::BTagInfo::IP3D_valZ0wrtPVofTracks); + } + if (m_storeTrackParameters) { + BTag->setTaggerInfo(f_vectD0Signi, xAOD::BTagInfo::IP3D_sigD0wrtPVofTracks); + BTag->setTaggerInfo(f_vectZ0Signi, xAOD::BTagInfo::IP3D_sigZ0wrtPVofTracks); + BTag->setTaggerInfo(vectWeightB, xAOD::BTagInfo::IP3D_weightBofTracks); + BTag->setTaggerInfo(vectWeightU, xAOD::BTagInfo::IP3D_weightUofTracks); + BTag->setTaggerInfo(vectWeightC, xAOD::BTagInfo::IP3D_weightCofTracks); + BTag->setTaggerInfo(vectFromV0, xAOD::BTagInfo::IP3D_flagFromV0ofTracks); + BTag->setTaggerInfo(i_vectGrades, xAOD::BTagInfo::IP3D_gradeOfTracks); + } } else { - if( "IP2D"==m_xAODBaseName ) { - BTag->setIP2D_TrackParticleLinks(IPTracks); - BTag->setTaggerInfo(f_vectD0, xAOD::BTagInfo::IP2D_valD0wrtPVofTracks); - BTag->setTaggerInfo(f_vectD0Signi, xAOD::BTagInfo::IP2D_sigD0wrtPVofTracks); - BTag->setTaggerInfo(vectWeightB, xAOD::BTagInfo::IP2D_weightBofTracks); - BTag->setTaggerInfo(vectWeightU, xAOD::BTagInfo::IP2D_weightUofTracks); - BTag->setTaggerInfo(vectWeightC, xAOD::BTagInfo::IP2D_weightCofTracks); - BTag->setTaggerInfo(vectFromV0, xAOD::BTagInfo::IP2D_flagFromV0ofTracks); - BTag->setTaggerInfo(i_vectGrades, xAOD::BTagInfo::IP2D_gradeOfTracks); - } else { // generic accessors - //// need to handle to persistify for dynamic values before adding this - BTag->setVariable<std::vector<ElementLink<xAOD::TrackParticleContainer> > > ( - m_xAODBaseName, "TrackParticleLinks", IPTracks ); - BTag->setDynTPELName( m_xAODBaseName, "TrackParticleLinks"); - BTag->setVariable< std::vector<float> > (m_xAODBaseName, "valD0wrtPVofTracks", f_vectD0); - BTag->setVariable< std::vector<float> > (m_xAODBaseName, "sigD0wrtPVofTracks", f_vectD0Signi); - if(m_impactParameterView=="3D") { - BTag->setVariable< std::vector<float> > (m_xAODBaseName, "valZ0wrtPVofTracks", f_vectZ0); - BTag->setVariable< std::vector<float> > (m_xAODBaseName, "sigZ0wrtPVofTracks", f_vectZ0Signi); - } - BTag->setVariable< std::vector<float> > (m_xAODBaseName, "weightBofTracks", vectWeightB); - BTag->setVariable< std::vector<float> > (m_xAODBaseName, "weightUofTracks", vectWeightU); - BTag->setVariable< std::vector<float> > (m_xAODBaseName, "weightCofTracks", vectWeightC); - BTag->setVariable< std::vector<bool> > (m_xAODBaseName, "flagFromV0ofTracks", vectFromV0); - BTag->setVariable< std::vector<int> > (m_xAODBaseName, "gradeOfTracks", i_vectGrades); - } + if( "IP2D"==m_xAODBaseName ) { + if (m_storeTrackParticles) BTag->setIP2D_TrackParticleLinks(IPTracks); + if (m_storeIpValues) BTag->setTaggerInfo(f_vectD0, xAOD::BTagInfo::IP2D_valD0wrtPVofTracks); + if (m_storeTrackParameters) { + BTag->setTaggerInfo(f_vectD0Signi, xAOD::BTagInfo::IP2D_sigD0wrtPVofTracks); + BTag->setTaggerInfo(vectWeightB, xAOD::BTagInfo::IP2D_weightBofTracks); + BTag->setTaggerInfo(vectWeightU, xAOD::BTagInfo::IP2D_weightUofTracks); + BTag->setTaggerInfo(vectWeightC, xAOD::BTagInfo::IP2D_weightCofTracks); + BTag->setTaggerInfo(vectFromV0, xAOD::BTagInfo::IP2D_flagFromV0ofTracks); + BTag->setTaggerInfo(i_vectGrades, xAOD::BTagInfo::IP2D_gradeOfTracks); + } + } else { // generic accessors + //// need to handle to persistify for dynamic values before adding this + if (m_storeTrackParticles) { + BTag->setVariable<std::vector<ElementLink<xAOD::TrackParticleContainer> > > ( + m_xAODBaseName, "TrackParticleLinks", IPTracks ); + BTag->setDynTPELName( m_xAODBaseName, "TrackParticleLinks"); + } + if (m_storeIpValues) { + BTag->setVariable< std::vector<float> > (m_xAODBaseName, "valD0wrtPVofTracks", f_vectD0); + if (m_impactParameterView=="3D") { + BTag->setVariable< std::vector<float> > (m_xAODBaseName, "valZ0wrtPVofTracks", f_vectZ0); + } + } + if (m_storeTrackParameters) { + BTag->setVariable< std::vector<float> > (m_xAODBaseName, "sigD0wrtPVofTracks", f_vectD0Signi); + if(m_impactParameterView=="3D") { + BTag->setVariable< std::vector<float> > (m_xAODBaseName, "sigZ0wrtPVofTracks", f_vectZ0Signi); + } + BTag->setVariable< std::vector<float> > (m_xAODBaseName, "weightBofTracks", vectWeightB); + BTag->setVariable< std::vector<float> > (m_xAODBaseName, "weightUofTracks", vectWeightU); + BTag->setVariable< std::vector<float> > (m_xAODBaseName, "weightCofTracks", vectWeightC); + BTag->setVariable< std::vector<bool> > (m_xAODBaseName, "flagFromV0ofTracks", vectFromV0); + BTag->setVariable< std::vector<int> > (m_xAODBaseName, "gradeOfTracks", i_vectGrades); + } + } } } - + IPTracks.clear(); m_likelihoodTool->clear(); diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterDummyClassifier.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterDummyClassifier.cxx new file mode 100644 index 0000000000000000000000000000000000000000..363a770a6e247a66bdec9081c5187b60a437f97e --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterDummyClassifier.cxx @@ -0,0 +1,65 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +///////////////////////////////////////////////////////////////////////////////////////////////////// +/// Name : JetFitterDummyClassifier.h +/// Package : BTagTools +/// Author : Dan Guest +/// Created : Jan 2017 +/// +/// DESCRIPTION: filler for JetFitter classifier, does nothing +/// +/// +/////////////////////////////////////////////////////////////////////////////////////////////////////// +#include <string> +#include "GaudiKernel/ITHistSvc.h" + + +#include "JetTagTools/IJetFitterClassifierTool.h" +#include "JetTagTools/JetFitterDummyClassifier.h" + +namespace Analysis { + + + JetFitterDummyClassifier::JetFitterDummyClassifier(const std::string& name, + const std::string& n, + const IInterface* p): + AthAlgTool(name, n,p) + { + declareInterface<IJetFitterClassifierTool>(this); + } + +///////////////////////////////////////////////////////////////////////////////////// +/// Destructor - check up memory allocation +/// delete any memory allocation on the heap + + JetFitterDummyClassifier::~JetFitterDummyClassifier() { + } + + StatusCode JetFitterDummyClassifier::initialize() { + ATH_MSG_INFO(" Initialization of JetFitterDummyClassifier succesfull"); + return StatusCode::SUCCESS; + } + + StatusCode JetFitterDummyClassifier::finalize() { + ATH_MSG_INFO(" Finalization of JetFitterDummyClassifier succesfull"); + return StatusCode::SUCCESS; + } + + + StatusCode JetFitterDummyClassifier + ::fillLikelihoodValues(xAOD::BTagging* /*BTag*/, + const std::string & /*jetauthor*/, + const std::string& /*inputbasename*/, + const std::string& /*outputbasename*/, + double /* jetpT */, + double /* jeteta */, + double /* IP3dlike=-5000 */) { + return StatusCode::SUCCESS; + + } + + + +}//end Analysis namespace diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterInputWriter.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterInputWriter.cxx new file mode 100644 index 0000000000000000000000000000000000000000..f59a6edf05de4c529d1bc1f5f4e369bea151fad5 --- /dev/null +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/JetFitterInputWriter.cxx @@ -0,0 +1,116 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +///////////////////////////////////////////////////////////////////////////////////////////////////// +/// Name : JetFitterInputWriter.h +/// Package : BTagTools +/// Author : Dan Guest +/// Created : January 2017 +/// +/// DESCRIPTION: +/// +/// Write JetFitter inputs to xAOD +/// +/////////////////////////////////////////////////////////////////////////////////////////////////////// +#include "GaudiKernel/ITHistSvc.h" + +// #include <TMath.h> +// #include <TH1.h> +// #include <TH1F.h> +// #include <TH2F.h> +#include <vector> +#include <string> +#include <map> + + +#include "JetTagTools/IJetFitterClassifierTool.h" +#include "JetTagTools/JetFitterInputWriter.h" + +#include <TString.h> + +namespace Analysis { + + + JetFitterInputWriter::JetFitterInputWriter(const std::string& name, + const std::string& n, const IInterface* p): + AthAlgTool(name, n,p), + m_useCombinedIPNN(true) + { + declareProperty("useCombinedIPNN",m_useCombinedIPNN); + declareProperty("usePtCorrectedMass",m_usePtCorrectedMass = false); + declareInterface<IJetFitterClassifierTool>(this); + } + +///////////////////////////////////////////////////////////////////////////////////// +/// Destructor - check up memory allocation +/// delete any memory allocation on the heap + + JetFitterInputWriter::~JetFitterInputWriter() { + + } + + StatusCode JetFitterInputWriter::initialize() { + + ATH_MSG_INFO(" Initialization of JetFitterInputWriter succesfull"); + return StatusCode::SUCCESS; + } + + StatusCode JetFitterInputWriter::finalize() { + ATH_MSG_INFO(" Finalization of JetFitterInputWriter succesfull"); + return StatusCode::SUCCESS; + } + + + + + StatusCode JetFitterInputWriter::fillLikelihoodValues( + xAOD::BTagging* BTag, + const std::string & jetauthor, + const std::string& inputbasename, + const std::string& /*outputbasename*/, + double /*jetpT*/, + double /*jeteta*/, + double /*IP3dlike*/) { + + if (jetauthor=="") { + ATH_MSG_WARNING(" Hypothesis or jetauthor is empty. No likelihood value given back. "); + } + + int nVTX, nTracksAtVtx, nSingleTracks; + float energyFraction, mass, significance3d; + bool status = true; + + if("JetFitter" == inputbasename){ + status &= BTag->taggerInfo(nVTX, xAOD::BTagInfo::JetFitter_nVTX); + status &= BTag->taggerInfo(nTracksAtVtx, xAOD::BTagInfo::JetFitter_nTracksAtVtx); + status &= BTag->taggerInfo(nSingleTracks, xAOD::BTagInfo::JetFitter_nSingleTracks); + status &= BTag->taggerInfo(energyFraction, xAOD::BTagInfo::JetFitter_energyFraction); + + if(m_usePtCorrectedMass){ + status &= BTag->taggerInfo(mass, xAOD::BTagInfo::JetFitter_mass); + } + else{ + status &= BTag->variable<float>(inputbasename, "massUncorr",mass ); + } + status &= BTag->taggerInfo(significance3d, xAOD::BTagInfo::JetFitter_significance3d); + } + else{ + if(m_usePtCorrectedMass){ + status &= BTag->variable<float>(inputbasename, "mass",mass ); + } + else{ + status &= BTag->variable<float>(inputbasename, "massUncorr",mass ); + } + status &= BTag->variable<float>(inputbasename, "significance3d", significance3d); + status &= BTag->variable<float>(inputbasename, "energyFraction", energyFraction); + status &= BTag->variable<int>(inputbasename, "nVTX", nVTX); + status &= BTag->variable<int>(inputbasename, "nTracksAtVtx", nTracksAtVtx); + status &= BTag->variable<int>(inputbasename, "nSingleTracks", nSingleTracks); + } + + return StatusCode::SUCCESS; + } + + +}//end Analysis namespace diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/MultiSVTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/MultiSVTag.cxx index 002839416c47d70fb181481de922d28657540918..3fecdb001635cb84af8aad266d5a055e54755b3a 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/MultiSVTag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/MultiSVTag.cxx @@ -380,15 +380,7 @@ namespace Analysis }else{ diffntrkSV1 = all_trks; } - int diffntrkSV0 = -999; - int SV0ntrk = 0; - std::vector< ElementLink< xAOD::VertexContainer > > SV0Vertice; - status &= BTag->variable<std::vector<ElementLink<xAOD::VertexContainer> > >(m_sv0_infosource, "vertices", SV0Vertice); - if (SV0Vertice.size()>0 && SV0Vertice[0].isValid()){ - status &= BTag->taggerInfo(SV0ntrk, xAOD::BTagInfo::SV0_NGTinSvx); - diffntrkSV0 = all_trks - SV0ntrk; - }else{ diffntrkSV0 = all_trks; - } + int diffntrkSV0 = diffntrkSV1; if (!status) { ATH_MSG_WARNING("Error retrieving input values; results will be incorrect!"); diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/RNNIPTag.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/RNNIPTag.cxx index ce586ba81491114cfd6b7716951f565033fdd621..696a3c2026695b63dfcaa77be0e692e4668155e0 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/RNNIPTag.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/RNNIPTag.cxx @@ -87,7 +87,6 @@ namespace trkvar { const std::string DPHI = "dPhi"; const std::string ABS_ETA = "absEta"; - // need to add const std::string PT_FRAC = "pTFrac"; const std::string DR = "dR"; @@ -104,6 +103,10 @@ namespace trkvar { const std::string N_SCT_HITS = "nSCTHits"; const std::string N_SHARED_SCT_HITS = "nsharedSCTHits"; const std::string EXPECT_BL_HIT = "expectBLayerHit"; + const std::string EXPECT_INNERMOST_PIX_HIT = + "expectInnermostPixelLayerHit"; + const std::string EXPECT_NEXT_TO_INNERMOST_PIX_HIT = + "expectNextToInnermostPixelLayerHit"; } namespace Analysis { @@ -174,6 +177,8 @@ namespace Analysis { declareProperty("unbiasIPEstimation" , m_unbiasIPEstimation); declareProperty("writeInputsToBtagObject", m_writeInputsToBtagObject = false); + declareProperty("writeTrackLinks", + m_writeTrackLinks = false); declareProperty("trackAssociationName" , m_trackAssociationName = "BTagTrackToJetAssociator"); @@ -188,10 +193,6 @@ namespace Analysis { declareProperty("SecVxFinderName" ,m_secVxFinderName); - declareProperty("NtrkMin" , m_NtrkMin =6 ); - declareProperty("NtrkMax" , m_NtrkMax =6 ); - declareProperty("NtrkFract" , m_trkFract=1.0 ); - // tools: declareProperty("trackSelectorTool" , m_trackSelectorTool ); declareProperty("SVForIPTool" , m_SVForIPTool ); @@ -401,21 +402,18 @@ namespace Analysis { // add the tags add_tags(*BTag, author, track_info); - TrackLinks ip_tracks; - for (const auto& trk: track_info) { - ip_tracks.push_back( trk.trk ); - } - - // specific fast accessors for mainstream instances of IPTag: IP3D, IP2D - //// need to handle to persistify for dynamic values before adding this - BTag->setVariable<TrackLinks> ( - m_xAODBaseName, "TrackParticleLinks", ip_tracks ); - BTag->setDynTPELName( m_xAODBaseName, "TrackParticleLinks"); - // TODO: we can create vectors with the inputs using the - // the `get_nn_inputs` function below. + if (m_writeTrackLinks) { + TrackLinks ip_tracks; + for (const auto& trk: track_info) { + ip_tracks.push_back( trk.trk ); + } - // BTag->setVariable< std::vector<float> >(m_xAODBaseName, - // "valD0wrtPVofTracks", f_vectD0); + // specific fast accessors for mainstream instances of IPTag: IP3D, IP2D + //// need to handle to persistify for dynamic values before adding this + BTag->setVariable<TrackLinks> ( + m_xAODBaseName, "TrackParticleLinks", ip_tracks ); + BTag->setDynTPELName( m_xAODBaseName, "TrackParticleLinks"); + } return StatusCode::SUCCESS; } @@ -697,7 +695,8 @@ namespace { PT_FRAC, DR, CHI2, N_INN_HITS, N_NEXT_TO_INN_HITS, N_BL_HITS, N_SHARED_BL_HITS, N_SPLIT_BL_HITS, N_PIX_HITS, N_SHARED_PIX_HITS, N_SPLIT_PIX_HITS, - N_SCT_HITS, N_SHARED_SCT_HITS, EXPECT_BL_HIT}; + N_SCT_HITS, N_SHARED_SCT_HITS, EXPECT_BL_HIT, + EXPECT_INNERMOST_PIX_HIT, EXPECT_NEXT_TO_INNERMOST_PIX_HIT}; VectorMap out; for (const auto& input: inputs) { out.emplace(input, std::vector<double>()); @@ -740,6 +739,10 @@ namespace { val(tp, xAOD::numberOfSCTSharedHits)); out.at(EXPECT_BL_HIT).push_back( val(tp, xAOD::expectBLayerHit)); + out.at(EXPECT_INNERMOST_PIX_HIT).push_back( + val(tp, xAOD::expectInnermostPixelLayerHit)); + out.at(EXPECT_NEXT_TO_INNERMOST_PIX_HIT).push_back( + val(tp, xAOD::expectNextToInnermostPixelLayerHit)); } return out; } diff --git a/PhysicsAnalysis/JetTagging/JetTagTools/src/components/JetTagTools_entries.cxx b/PhysicsAnalysis/JetTagging/JetTagTools/src/components/JetTagTools_entries.cxx index f002c63ebef8cfff9e00155626e975e4840a68e8..89232897d8d9f6a8f663945c478664653f9589d9 100644 --- a/PhysicsAnalysis/JetTagging/JetTagTools/src/components/JetTagTools_entries.cxx +++ b/PhysicsAnalysis/JetTagging/JetTagTools/src/components/JetTagTools_entries.cxx @@ -19,6 +19,8 @@ #include "JetTagTools/DL1Tag.h" #include "JetTagTools/TagNtupleDumper.h" #include "JetTagTools/JetFitterNNTool.h" +#include "JetTagTools/JetFitterDummyClassifier.h" +#include "JetTagTools/JetFitterInputWriter.h" #include "JetTagTools/SVForIPTool.h" #include "JetTagTools/BasicTrackGradeFactory.h" @@ -66,6 +68,8 @@ DECLARE_NAMESPACE_TOOL_FACTORY( Analysis, DL1Tag ) DECLARE_NAMESPACE_TOOL_FACTORY( Analysis, TagNtupleDumper ) DECLARE_NAMESPACE_TOOL_FACTORY( Analysis, MultivariateTagManager ) DECLARE_NAMESPACE_TOOL_FACTORY( Analysis, JetFitterNNTool ) +DECLARE_NAMESPACE_TOOL_FACTORY( Analysis, JetFitterDummyClassifier ) +DECLARE_NAMESPACE_TOOL_FACTORY( Analysis, JetFitterInputWriter ) //DECLARE_NAMESPACE_TOOL_FACTORY( Analysis, JetFitterCharmNNTool ) //DECLARE_NAMESPACE_TOOL_FACTORY( Analysis, GaiaNNTool ); DECLARE_NAMESPACE_TOOL_FACTORY( Analysis, SVForIPTool ) diff --git a/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonResonanceTools/Root/MuonResonanceSelectionTool.cxx b/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonResonanceTools/Root/MuonResonanceSelectionTool.cxx index 167870ead097e303ca3afe077f5f5095e07aeb8b..e02b7df59dddb331ad93081ad716085a1fa44c0c 100644 --- a/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonResonanceTools/Root/MuonResonanceSelectionTool.cxx +++ b/PhysicsAnalysis/MuonID/MuonPerformanceAnalysis/MuonResonanceTools/Root/MuonResonanceSelectionTool.cxx @@ -20,14 +20,15 @@ MuonResonanceSelectionTool::MuonResonanceSelectionTool(std::string myname) m_seliTool("CP::MuonSelectionTool/MuonSelectionTool", this), m_sfTool("CP::MuonEfficiencyScaleFactors/MuonEfficiencyScaleFactors", this ), m_calibTool("CP::MuonCalibrationAndSmearingTool/MuonCalibrationAndSmearingTool", this ), - m_matchTool("Trig::TrigMuonMatching/TrigMuonMatching", this), + m_matchTool(""), + m_trigTool("") #else m_seliTool("CP::MuonSelectionTool/MuonSelectionTool"), m_sfTool("CP::MuonEfficiencyScaleFactors/MuonEfficiencyScaleFactors" ), m_calibTool("CP::MuonCalibrationAndSmearingTool/MuonCalibrationAndSmearingTool" ), m_matchTool("Trig::TrigMuonMatching/TrigMuonMatching"), -#endif m_trigTool("Trig::TrigDecisionTool/TrigDecisionTool") +#endif { declareProperty("PtCut", m_ptCut = 20000.0); @@ -56,8 +57,8 @@ StatusCode MuonResonanceSelectionTool::initialize() ATH_CHECK( m_seliTool.retrieve() ); if (m_doEff) ATH_CHECK( m_sfTool.retrieve() ); if (m_doCalib) ATH_CHECK( m_calibTool.retrieve() ); - ATH_CHECK( m_trigTool.retrieve() ); - ATH_CHECK( m_matchTool.retrieve() ); + if (!m_trigTool.empty()) ATH_CHECK( m_trigTool.retrieve() ); + if (!m_matchTool.empty()) ATH_CHECK( m_matchTool.retrieve() ); ATH_MSG_INFO("Tools initialized:" ); ATH_MSG_INFO("SelectionTool :: \t" << m_seliTool ); @@ -102,11 +103,6 @@ std::pair<std::vector<const xAOD::Muon*>,std::vector<const xAOD::Muon*> > MuonRe // std::cout << " Event1 " << eventNb1 << std::endl; // std::cout << " Lumi1 " << lumiBL1 << std::endl; - if ( !hasPassedGRL () ){ - ATH_MSG_DEBUG("No GRL pass - rejecting event"); - return goodMuons; - } - // std::cout << " Run2 " << runNb1 << std::endl; // std::cout << " Event2 " << eventNb1 << std::endl; // std::cout << " Lumi2 " << lumiBL1 << std::endl; diff --git a/PhysicsAnalysis/PrimaryDPDMaker/share/PerfDPD_TtbarMuon.py b/PhysicsAnalysis/PrimaryDPDMaker/share/PerfDPD_TtbarMuon.py index 9c3b8d790edc51c43fedc25c1a0eacc3afa27803..988f8d48e0da092a8db941a802643eb0b2bb0abb 100644 --- a/PhysicsAnalysis/PrimaryDPDMaker/share/PerfDPD_TtbarMuon.py +++ b/PhysicsAnalysis/PrimaryDPDMaker/share/PerfDPD_TtbarMuon.py @@ -26,7 +26,7 @@ sel_muon = 'Muons.pt > 24*GeV && Muons.ptcone20/Muons.pt < 0.2' from AthenaCommon.BFieldFlags import jobproperties if jobproperties.BField.solenoidOn(): PerfDPD_TtbarMuon_log.info( "Configuring b-tagging selection with solenoid on" ) - sel_bjet = 'AntiKt4EMTopoJets.pt > 25*GeV && abs(AntiKt4EMTopoJets.eta) < 2.5 && BTagging_AntiKt4EMTopo.MV2c20_discriminant>0.0314' + sel_bjet = 'AntiKt4EMTopoJets.pt > 25*GeV && abs(AntiKt4EMTopoJets.eta) < 2.5 && BTagging_AntiKt4EMTopo.MV2c10_discriminant>0.0314' else: PerfDPD_TtbarMuon_log.info( "Configuring b-tagging selection with solenoid off" ) sel_bjet = 'AntiKt4EMTopoJets.pt > 25*GeV && abs(AntiKt4EMTopoJets.eta) < 2.5' diff --git a/PhysicsAnalysis/TauID/TauDiscriminant/CMakeLists.txt b/PhysicsAnalysis/TauID/TauDiscriminant/CMakeLists.txt index 1266a63addaf666b5944796118263fffeafc3305..614eb9f9a59ba0d3f5c8f45f8bc6ebb21ba560ba 100644 --- a/PhysicsAnalysis/TauID/TauDiscriminant/CMakeLists.txt +++ b/PhysicsAnalysis/TauID/TauDiscriminant/CMakeLists.txt @@ -18,6 +18,7 @@ atlas_depends_on_subdirs( PUBLIC PRIVATE Control/CxxUtils Control/StoreGate + Event/FourMomUtils Event/xAOD/xAODEventInfo Event/xAOD/xAODTracking PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools ) @@ -39,13 +40,13 @@ atlas_add_library( TauDiscriminantLib atlas_add_component( TauDiscriminant src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AthenaBaseComps xAODEgamma xAODTau GaudiKernel PATInterfaces tauRecToolsLib PathResolver CxxUtils StoreGateLib SGtests xAODEventInfo xAODTracking ElectronPhotonSelectorToolsLib TauDiscriminantLib ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AthenaBaseComps xAODEgamma xAODTau FourMomUtils GaudiKernel PATInterfaces tauRecToolsLib PathResolver CxxUtils StoreGateLib SGtests xAODEventInfo xAODTracking ElectronPhotonSelectorToolsLib TauDiscriminantLib ) atlas_add_dictionary( TauDiscriminantDict TauDiscriminant/TauDiscriminantDict.h TauDiscriminant/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AthenaBaseComps xAODEgamma xAODTau GaudiKernel PATInterfaces tauRecToolsLib PathResolver CxxUtils StoreGateLib SGtests xAODEventInfo xAODTracking ElectronPhotonSelectorToolsLib TauDiscriminantLib ) + LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools AthenaBaseComps xAODEgamma xAODTau FourMomUtils GaudiKernel PATInterfaces tauRecToolsLib PathResolver CxxUtils StoreGateLib SGtests xAODEventInfo xAODTracking ElectronPhotonSelectorToolsLib TauDiscriminantLib ) # Install files from the package: atlas_install_python_modules( python/*.py ) diff --git a/PhysicsAnalysis/TauID/TauDiscriminant/Root/LinkDef.h b/PhysicsAnalysis/TauID/TauDiscriminant/Root/LinkDef.h index b701f947cc0be2e8e76044c9224edfb53d9dab7d..01f0d50490af241c0eb5278eb8c20ac9641d263c 100644 --- a/PhysicsAnalysis/TauID/TauDiscriminant/Root/LinkDef.h +++ b/PhysicsAnalysis/TauID/TauDiscriminant/Root/LinkDef.h @@ -12,12 +12,8 @@ #include "TauDiscriminant/MethodTransform.h" #include "TauDiscriminant/Types.h" -#include "TauDiscriminant/TauDiscriToolBase.h" - #include "TauDiscriminant/TauJetBDT.h" #include "TauDiscriminant/TauEleBDT.h" -#include "TauDiscriminant/TauIDVarCalculator.h" -#include "TauDiscriminant/TauEleOLRDecorator.h" #include "TauDiscriminant/TauScoreFlatteningTool.h" #include "TauDiscriminant/TauMuonVeto.h" @@ -37,12 +33,8 @@ #pragma link C++ class TauID::MethodBDT; #pragma link C++ class TauID::MethodCuts; -#pragma link C++ class TauDiscriToolBase+; - #pragma link C++ class TauJetBDT+; #pragma link C++ class TauEleBDT+; -#pragma link C++ class TauIDVarCalculator+; -#pragma link C++ class TauEleOLRDecorator+; #pragma link C++ class TauScoreFlatteningTool+; #pragma link C++ class TauMuonVeto+; diff --git a/PhysicsAnalysis/TauID/TauDiscriminant/TauDiscriminant/ToolsDef.h b/PhysicsAnalysis/TauID/TauDiscriminant/TauDiscriminant/ToolsDef.h index 5660158902a460c417ae72dbc6e8dc0068e4ae0d..da6a80ecd9319ef2b2fa12d21cab250a464603bf 100644 --- a/PhysicsAnalysis/TauID/TauDiscriminant/TauDiscriminant/ToolsDef.h +++ b/PhysicsAnalysis/TauID/TauDiscriminant/TauDiscriminant/ToolsDef.h @@ -6,15 +6,11 @@ #include "TauDiscriminant/TauJetBDT.h" #include "TauDiscriminant/TauEleBDT.h" -#include "TauDiscriminant/TauIDVarCalculator.h" -#include "TauDiscriminant/TauEleOLRDecorator.h" #include "TauDiscriminant/TauScoreFlatteningTool.h" #include "TauDiscriminant/TauMuonVeto.h" REGISTER_TOOL(TauJetBDT) -REGISTER_TOOL(TauIDVarCalculator) REGISTER_TOOL(TauEleBDT) -REGISTER_TOOL(TauEleOLRDecorator) REGISTER_TOOL(TauScoreFlatteningTool) REGISTER_TOOL(TauMuonVeto) diff --git a/PhysicsAnalysis/TauID/TauDiscriminant/src/components/TauDiscri_entries.cxx b/PhysicsAnalysis/TauID/TauDiscriminant/src/components/TauDiscri_entries.cxx index 023630dfc0d6180aa083056e8e2991a9cb3f3733..be7d0b2929891333159cb6c12c9bca5ae26ea04b 100755 --- a/PhysicsAnalysis/TauID/TauDiscriminant/src/components/TauDiscri_entries.cxx +++ b/PhysicsAnalysis/TauID/TauDiscriminant/src/components/TauDiscri_entries.cxx @@ -1,24 +1,18 @@ -#include "TauDiscriminant/TauIDVarCalculator.h" #include "TauDiscriminant/TauJetBDT.h" #include "TauDiscriminant/TauEleBDT.h" #include "TauDiscriminant/TauMuonVeto.h" -#include "TauDiscriminant/TauEleOLRDecorator.h" #include "TauDiscriminant/TauScoreFlatteningTool.h" #include "GaudiKernel/DeclareFactoryEntries.h" -DECLARE_TOOL_FACTORY( TauIDVarCalculator ) DECLARE_TOOL_FACTORY( TauJetBDT ) DECLARE_TOOL_FACTORY( TauEleBDT ) DECLARE_TOOL_FACTORY( TauMuonVeto ) -DECLARE_TOOL_FACTORY( TauEleOLRDecorator ) DECLARE_TOOL_FACTORY( TauScoreFlatteningTool ) DECLARE_FACTORY_ENTRIES(TauDiscriminant) { - DECLARE_TOOL( TauIDVarCalculator ) DECLARE_TOOL( TauJetBDT ) DECLARE_TOOL( TauEleBDT ) DECLARE_TOOL( TauMuonVeto ) - DECLARE_TOOL( TauEleOLRDecorator ) DECLARE_TOOL( TauScoreFlatteningTool ) } diff --git a/PhysicsAnalysis/TauID/TauHistUtils/CMakeLists.txt b/PhysicsAnalysis/TauID/TauHistUtils/CMakeLists.txt index 54e9c80b231934a72ad7c91cd1a60c11317a161d..200506ac489e27b6c9dd34b546fa803a1790b48d 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/CMakeLists.txt +++ b/PhysicsAnalysis/TauID/TauHistUtils/CMakeLists.txt @@ -9,7 +9,8 @@ atlas_subdir( TauHistUtils ) atlas_depends_on_subdirs( PUBLIC Event/xAOD/xAODBase Event/xAOD/xAODPFlow - Event/xAOD/xAODTau ) + Event/xAOD/xAODTau + TrkValHistUtils) # External dependencies: find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) @@ -17,7 +18,7 @@ find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread ) # Component(s) in the package: atlas_add_library( TauHistUtils src/*.cxx - PUBLIC_HEADERS TauHistUtils + PUBLIC_HEADERS TrkValHistUtils INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} xAODBase xAODPFlow xAODTau ) diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/BDTinputPlots.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/BDTinputPlots.h index adbea5a6f7492afd6041c9dcafcf9b84803d9f6a..b523ee91723e15271387c701ed6ad104122b4981 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/BDTinputPlots.h +++ b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/BDTinputPlots.h @@ -5,7 +5,7 @@ #ifndef TAUHISTUTILS_BDTINPUTPLOTS_H #define TAUHISTUTILS_BDTINPUTPLOTS_H -#include "TauHistUtils/PlotBase.h" +#include "TrkValHistUtils/PlotBase.h" #include "TauHistUtils/ParamPlots.h" #include "xAODTau/TauDefs.h" #include "xAODTau/TauJet.h" diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EVetoPlots.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EVetoPlots.h index 7b3d83450a18fe0fa2db9bec69f0605111d02b5f..6c20f83560d8602ac07adbefe455c5cf62a05391 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EVetoPlots.h +++ b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EVetoPlots.h @@ -5,7 +5,7 @@ #ifndef TAUHISTUTILS_EVETOPLOTS_H #define TAUHISTUTILS_EVETOPLOTS_H -#include "TauHistUtils/PlotBase.h" +#include "TrkValHistUtils/PlotBase.h" #include "xAODTau/TauJet.h" namespace Tau{ @@ -16,13 +16,13 @@ class EVetoPlots: public PlotBase { virtual ~EVetoPlots(); void fill(const xAOD::TauJet& tau); - TH1* m_HadRadius; - TH1* m_EMRadius; - TH1* m_IsoFrac; - TH1* m_CentFrac; + TH1* m_HadRadius; + TH1* m_EMRadius; + TH1* m_IsoFrac; + TH1* m_CentFrac; TH1* m_id_BDTEleScore; TH1* m_pt_eleBDTloose; - TH1* m_pt_eleBDTmed; + TH1* m_pt_eleBDTmed; TH1* m_pt_eleBDTtight; private: diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EfficiencyPtPlots.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EfficiencyPtPlots.h index c1130c3349d29f3a6f9e0c917a052430305195c4..c5e4f3673c174ebe432ea9e3c0af3f866a5af686 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EfficiencyPtPlots.h +++ b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/EfficiencyPtPlots.h @@ -5,7 +5,7 @@ #ifndef TAUHISTUTILS_EFFICIENCYPTPLOTS_H #define TAUHISTUTILS_EFFICIENCYPTPLOTS_H -#include "TauHistUtils/PlotBase.h" +#include "TrkValHistUtils/PlotBase.h" #include "TauHistUtils/ParamPlots.h" #include "xAODTau/TauJet.h" #include "xAODTau/TauDefs.h" diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/GeneralTauPlots.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/GeneralTauPlots.h index a3cb45e4c2a06979e92a98ff0a22787c93e921d0..151ced0f00b5cf43395c60f73ec086382cf0e475 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/GeneralTauPlots.h +++ b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/GeneralTauPlots.h @@ -5,7 +5,7 @@ #ifndef TAUHISTUTILS_GENERALTAUPLOTS_H #define TAUHISTUTILS_GENERALTAUPLOTS_H -#include "TauHistUtils/PlotBase.h" +#include "TrkValHistUtils/PlotBase.h" #include "TauHistUtils/ParamPlots.h" #include "xAODTau/TauJet.h" #include "xAODTau/TauDefs.h" diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/Had3ProngPlots.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/Had3ProngPlots.h index a94114adb57e4adc9164936f7dd42253d349c02b..f0e5dc17fc51063c58e3db5afb10507a33c4cc27 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/Had3ProngPlots.h +++ b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/Had3ProngPlots.h @@ -18,21 +18,21 @@ class Had3ProngPlots: public PlotBase { void fill(const xAOD::TauJet& tau); Tau::GeneralTauPlots m_oGeneralTauPlots; - TH1* m_tauCoreFrac; - TH1* m_tauEoverPTrk; - TH1* m_tauTrkAvgDist; - TH1* m_tauDRMax; - TH1* m_tauSflight; - TH1* m_tauMtrks; - TH1* m_tauIpSig; - - TH1* m_innerTrkAvgDist; - TH1* m_ptRatioEflowApprox; - TH1* m_mEflowApprox; - - TH1* m_ChPiEMEOverCaloEME; - TH1* m_EMPOverTrkSysP; - + TH1* m_tauCoreFrac; + TH1* m_tauEoverPTrk; + TH1* m_tauTrkAvgDist; + TH1* m_tauDRMax; + TH1* m_tauSflight; + TH1* m_tauMtrks; + TH1* m_tauIpSig; + + TH1* m_innerTrkAvgDist; + TH1* m_ptRatioEflowApprox; + TH1* m_mEflowApprox; + + TH1* m_ChPiEMEOverCaloEME; + TH1* m_EMPOverTrkSysP; + private: void initializePlots(); std::string m_sTauJetContainerName; diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/Migration.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/Migration.h index ef90f35894f55fc66daeff7dabaac8023aae921c..d43b568f477a91d618c3379a8dd8d542c344a4a4 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/Migration.h +++ b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/Migration.h @@ -5,7 +5,7 @@ #ifndef TAUHISTUTILS_MIGRATION_H #define TAUHISTUTILS_MIGRATION_H -#include "TauHistUtils/PlotBase.h" +#include "TrkValHistUtils/PlotBase.h" #include "TauHistUtils/ParamPlots.h" #include "xAODTau/TauDefs.h" #include "xAODTau/TauJet.h" @@ -87,7 +87,6 @@ namespace Tau{ TH1* m_migration_tauRec; TH1* m_migration_eflow; TH1* m_migration_cellBased; - int rec_nProng,eflow_nNeu,eflow_nProng,rec_nNeu,cell_nProng,cell_nNeu; private: void initializePlots(); std::string m_sTauJetContainerName; diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/ParamPlots.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/ParamPlots.h index 6bab507d4a40251408822e4924769731ec41c270..fe4019f2316065016f990bb16e940bbf3357f2cd 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/ParamPlots.h +++ b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/ParamPlots.h @@ -5,7 +5,7 @@ #ifndef TAUHISTUTILS_PARAMPLOTS_H #define TAUHISTUTILS_PARAMPLOTS_H -#include "TauHistUtils/PlotBase.h" +#include "TrkValHistUtils/PlotBase.h" #include "xAODBase/IParticle.h" namespace Tau{ diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/PlotBase.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/PlotBase.h deleted file mode 100644 index 6e6c781ee49e18df124045ce06412a02a887500b..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/PlotBase.h +++ /dev/null @@ -1,87 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -// ------------------------------------------------------------- -// // Base class for Plot Collections -// // -// // author: Felix Socher <felix.socher@cern.ch> -// // ------------------------------------------------------------- -#ifndef TAUHISTUTILS_PLOTBASE_H -#define TAUHISTUTILS_PLOTBASE_H - -#include <string> -#include "TH1.h" -#include "TH2.h" -#include "TH3.h" -#include "TProfile.h" -#include "TProfile2D.h" -#include "TTree.h" -// -typedef std::pair<TH1*, std::string> HistData; -typedef std::pair<TTree*, std::string> TreeData; -// -class PlotBase { -public: - PlotBase(PlotBase *parent, const std::string & sDir); - virtual ~PlotBase(){} - void initialize(); - void finalize(); - void setDetailLevel(int iDetailLevel); - void RegisterSubPlot(PlotBase* pPlotBase){m_vSubNodes.push_back(pPlotBase);} - // - ///Retrieve all booked histograms - std::vector<HistData> retrieveBookedHistograms(); - // ///Retrieve all booked trees - std::vector<TreeData> retrieveBookedTrees(); - // - ///@name Methods to book monitoring histograms - ///@{ - - /// Book a TH1D histogram - TH1* Book1D(const std::string & name, const std::string & labels, int nBins, float start, float end, bool prependDir = true); - /// Book a TH1D histogram using refHist as reference for number of bins and axis range - TH1* Book1D(const std::string & name, TH1* refHist, const std::string & labels, bool prependDir = true); - - /// Book a TH2D histogram - TH2* Book2D(const std::string & name, const std::string & labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, bool prependDir = true); - /// Book a TH2D histogram using refHist as reference for number of bins and axis range - TH2* Book2D(const std::string & name, TH2* refHist, const std::string & labels, bool prependDir = true); - /// Book a TH2D histogram with variable x axis binning - TH2* Book2D(const std::string & name, const std::string & labels, int nBinsX, Double_t* binsX, int nBinsY, Double_t startY, Double_t endY, bool prependDir = true); - - /// Book a TH3D histogram - TH3* Book3D(const std::string & name, const std::string & labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, int nBinsZ, float startZ, float endZ, bool prependDir = true); - /// Book a TH3D histogram using refHist as reference for number of bins and axis range - TH3* Book3D(const std::string & name, TH3* refHist, const std::string & labels, bool prependDir = true); - - /// Book a TProfile histogram - TProfile* BookTProfile(const std::string &name, const std::string & labels, int nBinsX, float startX, float endX, float startY=-1, float endY=-1, bool prependDir = true); - /// Book a TProfile histogram with variable binning in x-axis - TProfile* BookTProfile(const std::string &name, const std::string & labels, int nBinsX, float* binsX, bool prependDir = true); - /// Book a TProfile histogram with variable binning in x-axis and limits in y-values - TProfile* BookTProfileRangeY(const std::string &name, const std::string & labels, int nBinsX, double* binsX, double startY, double endY, bool prependDir = true); //cannot overload, conflicts with previous definitions - /// Book a TProfile 2D histogram with variable binning in x-axis and limits in y-values - TProfile2D * BookTProfile2D(const std::string &name, const std::string & labels, const int nBinsX, - const double xlo, const double xhi, const int nBinsY, const double ylo, const double yhi, bool prependDir=true); - ///@} - /// Book a TTree - TTree* BookTree(const std::string & name, bool prependDir = true); - - std::string getDirectory(){return m_sDirectory;} - -private: - virtual void initializePlots(){;} - virtual void finalizePlots(){;} - std::string constructPrefix(std::string dir, bool prependDir); - -protected: - std::vector<PlotBase*> m_vSubNodes; - std::vector<HistData> m_vBookedHistograms; - std::vector<TreeData> m_vBookedTrees; - std::string m_sDirectory; - int m_iDetailLevel; -}; - -#endif - diff --git a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/RecoTauPlots.h b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/RecoTauPlots.h index 31dc5a75093e98adb071a277ca489b2bb5aa94bd..758ad287fde4dfecb72feb22554c87cef8709ff5 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/RecoTauPlots.h +++ b/PhysicsAnalysis/TauID/TauHistUtils/TauHistUtils/RecoTauPlots.h @@ -5,7 +5,7 @@ #ifndef TAUHISTUTILS_RECOTAUPLOTS_H #define TAUHISTUTILS_RECOTAUPLOTS_H -#include "TauHistUtils/PlotBase.h" +#include "TrkValHistUtils/PlotBase.h" #include "TauHistUtils/ParamPlots.h" #include "xAODTau/TauDefs.h" #include "xAODTau/TauJet.h" diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/BDTinputPlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/BDTinputPlots.cxx index 439997f88071944c3f68b8512a1dd8380a0e3784..56e6f874eddb879cb1f75c5ecae4141c6b1cab12 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/BDTinputPlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/BDTinputPlots.cxx @@ -6,8 +6,18 @@ namespace Tau{ -BDTinputPlots::BDTinputPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName):PlotBase(pParent, sDir), - m_sTauJetContainerName(sTauJetContainerName){ +BDTinputPlots::BDTinputPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName): + PlotBase(pParent, sDir), + m_id_BDTJetScore(nullptr), + m_id_BDTEleScore(nullptr), + m_pt_eleBDTloose(nullptr), + m_pt_eleBDTmed(nullptr), + m_pt_eleBDTtight(nullptr), + m_pt_jetBDTloose(nullptr), + m_pt_jetBDTmed(nullptr), + m_pt_jetBDTtight(nullptr), + m_sTauJetContainerName(sTauJetContainerName) +{ } @@ -23,14 +33,14 @@ void BDTinputPlots::initializePlots(){ +++++++++++++++++++BDT OUTPUT+++++++++++++++++++++ +++++++++++++++++++++++++++++++++++++++++++++++++*/ - m_id_BDTJetScore = Book1D("id_BDTJetScore",m_sTauJetContainerName + " BDTJetScore ; BDTJetScore; # Tau",10,0.,1.05); - m_id_BDTEleScore = Book1D("id_BDTEleScore",m_sTauJetContainerName + " BDTEleScore ; BDTEleScore; # Tau",10,0.,1.05); - m_pt_eleBDTloose = Book1D("Pt_eleBDTloose",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); - m_pt_eleBDTmed = Book1D("Pt_eleBDTmed",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); - m_pt_eleBDTtight = Book1D("Pt_eleBDTtight",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); - m_pt_jetBDTloose = Book1D("Pt_jetBDTloose",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); - m_pt_jetBDTmed = Book1D("Pt_jetBDTmed",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); - m_pt_jetBDTtight = Book1D("Pt_jetBDTtigth",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); + m_id_BDTJetScore = Book1D("id_BDTJetScore",m_sTauJetContainerName + " BDTJetScore ; BDTJetScore; # Tau",10,0.,1.05); + m_id_BDTEleScore = Book1D("id_BDTEleScore",m_sTauJetContainerName + " BDTEleScore ; BDTEleScore; # Tau",10,0.,1.05); + m_pt_eleBDTloose = Book1D("Pt_eleBDTloose",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); + m_pt_eleBDTmed = Book1D("Pt_eleBDTmed",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); + m_pt_eleBDTtight = Book1D("Pt_eleBDTtight",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); + m_pt_jetBDTloose = Book1D("Pt_jetBDTloose",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); + m_pt_jetBDTmed = Book1D("Pt_jetBDTmed",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); + m_pt_jetBDTtight = Book1D("Pt_jetBDTtigth",m_sTauJetContainerName + " Tau pt; pt; # Taus",20,0.,300.); diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/EVetoPlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/EVetoPlots.cxx index d34ed50568c6cbd9e14e922c287d8bcf380f2dc3..67392e0bc310759f1db159c19c0c4e6c82170b94 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/EVetoPlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/EVetoPlots.cxx @@ -6,13 +6,23 @@ namespace Tau{ - EVetoPlots::EVetoPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName):PlotBase(pParent, sDir), - m_sTauJetContainerName(sTauJetContainerName){ +EVetoPlots::EVetoPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName): + PlotBase(pParent, sDir), + m_HadRadius(nullptr), + m_EMRadius(nullptr), + m_IsoFrac(nullptr), + m_CentFrac(nullptr), + m_id_BDTEleScore(nullptr), + m_pt_eleBDTloose(nullptr), + m_pt_eleBDTmed(nullptr), + m_pt_eleBDTtight(nullptr), + m_sTauJetContainerName(sTauJetContainerName) +{ } - EVetoPlots::~EVetoPlots() - { - } +EVetoPlots::~EVetoPlots() +{ +} void EVetoPlots::initializePlots(){ diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/EfficiencyPtPlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/EfficiencyPtPlots.cxx index 4b940def27e8f3d4624f5a32c0a66f05721660b6..9aa1ecbcdc8ef2c2cf66bc2ab803012d29ca4b72 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/EfficiencyPtPlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/EfficiencyPtPlots.cxx @@ -6,23 +6,32 @@ namespace Tau{ - EfficiencyPtPlots::EfficiencyPtPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName):PlotBase(pParent, sDir), - m_sTauJetContainerName(sTauJetContainerName){ - } - EfficiencyPtPlots::~EfficiencyPtPlots() - { - } - -void EfficiencyPtPlots::initializePlots(){ +EfficiencyPtPlots::EfficiencyPtPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName): + PlotBase(pParent, sDir), + m_eff_pt_jetBDTloose(nullptr), + m_eff_pt_jetBDTmed(nullptr), + m_eff_pt_jetBDTtight(nullptr), + m_eff_jetBDTloose(nullptr), + m_eff_jetBDTmed(nullptr), + m_eff_jetBDTtight(nullptr), + m_sTauJetContainerName(sTauJetContainerName) +{ +} - m_eff_pt_jetBDTloose = BookTProfile("Eff_Pt_jetBDTloose"," Matched Tau loose eff in pt; pt; eff",15,0.,300.); - m_eff_pt_jetBDTmed = BookTProfile("Eff_Pt_jetBDTmed","Matched Tau med eff in pt; pt; eff",15,0.,300.); - m_eff_pt_jetBDTtight = BookTProfile("Eff_Pt_jetBDTtight","Matched Tau tight eff in pt; pt; eff",15,0.,300.); +EfficiencyPtPlots::~EfficiencyPtPlots() +{ +} - m_eff_jetBDTloose = BookTProfile("Eff_jetBDTloose"," Matched Tau loose eff total; bin; eff",3,-1.5,1.5); - m_eff_jetBDTmed = BookTProfile("Eff_jetBDTmed","Matched Tau med eff total; bin; eff",3,-1.5,1.5); - m_eff_jetBDTtight = BookTProfile("Eff_jetBDTtight","Matched Tau tight eff total; bin; eff",3,-1.5,1.5); +void EfficiencyPtPlots::initializePlots(){ + m_eff_pt_jetBDTloose = BookTProfile("Eff_Pt_jetBDTloose"," Matched Tau loose eff in pt; pt; eff",15,0.,300.); + m_eff_pt_jetBDTmed = BookTProfile("Eff_Pt_jetBDTmed","Matched Tau med eff in pt; pt; eff",15,0.,300.); + m_eff_pt_jetBDTtight = BookTProfile("Eff_Pt_jetBDTtight","Matched Tau tight eff in pt; pt; eff",15,0.,300.); + + m_eff_jetBDTloose = BookTProfile("Eff_jetBDTloose"," Matched Tau loose eff total; bin; eff",3,-1.5,1.5); + m_eff_jetBDTmed = BookTProfile("Eff_jetBDTmed","Matched Tau med eff total; bin; eff",3,-1.5,1.5); + m_eff_jetBDTtight = BookTProfile("Eff_jetBDTtight","Matched Tau tight eff total; bin; eff",3,-1.5,1.5); + } diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/GeneralTauPlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/GeneralTauPlots.cxx index c40a918a1eda52c0d4701527155c81349268dcf0..07ea300b67f9a16939fb0a0abbe40b7512fd33f4 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/GeneralTauPlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/GeneralTauPlots.cxx @@ -7,13 +7,23 @@ namespace Tau{ - GeneralTauPlots::GeneralTauPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName):PlotBase(pParent, sDir), - m_oParamPlots(this, "", sTauJetContainerName), - m_sTauJetContainerName(sTauJetContainerName){ - } - GeneralTauPlots::~GeneralTauPlots() - { - } +GeneralTauPlots::GeneralTauPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName): + PlotBase(pParent, sDir), + m_oParamPlots(this, "", sTauJetContainerName), + m_tauCharge(nullptr), + m_tauNCoreTracks(nullptr), + m_tauNWideTracks(nullptr), + m_id_BDTJetScore(nullptr), + m_pt_jetBDTloose(nullptr), + m_pt_jetBDTmed(nullptr), + m_pt_jetBDTtight(nullptr), + m_sTauJetContainerName(sTauJetContainerName) +{ +} + +GeneralTauPlots::~GeneralTauPlots() +{ +} void GeneralTauPlots::initializePlots(){ diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/Had1ProngPlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/Had1ProngPlots.cxx index 9bec39da515b3f79daca1362ff84fabc3b4bdfe2..7e6b176dedeefe3b0ac2e52d5bac6f5dcbeaaae8 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/Had1ProngPlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/Had1ProngPlots.cxx @@ -6,14 +6,34 @@ namespace Tau{ - Had1ProngPlots::Had1ProngPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName):PlotBase(pParent, sDir), - m_oGeneralTauPlots(this, "", sTauJetContainerName), - m_sTauJetContainerName(sTauJetContainerName){ - } +Had1ProngPlots::Had1ProngPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName): + PlotBase(pParent, sDir), + m_oGeneralTauPlots(this, "", sTauJetContainerName), + m_tauNWideTracks(nullptr), + m_tauCoreFrac(nullptr), + m_tauEoverPTrk(nullptr), + m_tauTrkAvgDist(nullptr), + m_tauIpSig(nullptr), + m_tauDRMax(nullptr), + m_tauSflight(nullptr), + m_tauMtrks(nullptr), + m_SumPtTrkFrac(nullptr), + m_innerTrkAvgDist(nullptr), + m_ptRatioEflowApprox(nullptr), + m_mEflowApprox(nullptr), + m_ChPiEMEOverCaloEME(nullptr), + m_EMPOverTrkSysP(nullptr), + m_HadRadius(nullptr), + m_EMRadius(nullptr), + m_IsoFrac(nullptr), + m_sTauJetContainerName(sTauJetContainerName) +{ +} - Had1ProngPlots::~Had1ProngPlots() - { - } +Had1ProngPlots::~Had1ProngPlots() +{ +} + void Had1ProngPlots::initializePlots(){ // m_oGeneralTauPlots.initialize(); diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/Had3ProngPlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/Had3ProngPlots.cxx index 3867fed896b84b2cd5ed4967fbc175c7e5b2eca0..3b5a91814bdc25725da25746dbc212506354d1ad 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/Had3ProngPlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/Had3ProngPlots.cxx @@ -6,30 +6,45 @@ namespace Tau{ - Had3ProngPlots::Had3ProngPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName):PlotBase(pParent, sDir), - m_oGeneralTauPlots(this, "", sTauJetContainerName), - m_sTauJetContainerName(sTauJetContainerName){ - } +Had3ProngPlots::Had3ProngPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName): + PlotBase(pParent, sDir), + m_oGeneralTauPlots(this, "", sTauJetContainerName), + m_tauCoreFrac(nullptr), + m_tauEoverPTrk(nullptr), + m_tauTrkAvgDist(nullptr), + m_tauDRMax(nullptr), + m_tauSflight(nullptr), + m_tauMtrks(nullptr), + m_tauIpSig(nullptr), + m_innerTrkAvgDist(nullptr), + m_ptRatioEflowApprox(nullptr), + m_mEflowApprox(nullptr), + m_ChPiEMEOverCaloEME(nullptr), + m_EMPOverTrkSysP(nullptr), + m_sTauJetContainerName(sTauJetContainerName) +{ +} Had3ProngPlots::~Had3ProngPlots() - { - } +{ +} + void Had3ProngPlots::initializePlots(){ // m_oGeneralTauPlots.initialize(); - m_tauCoreFrac = Book1D("CentFrac",m_sTauJetContainerName + " Tau CentFrac; CentFrac; # Taus",40,0.,2.); - m_tauEoverPTrk = Book1D("EoverPTrk",m_sTauJetContainerName + " Tau E over pLeadTrk; EoverP; # Taus",50,0.,4.); - m_tauTrkAvgDist = Book1D("TrkAvgDist",m_sTauJetContainerName + " Tau track avg dist; TrkAvgDist; # Taus",10,-0.2,.8); - m_tauDRMax = Book1D("DRMax",m_sTauJetContainerName + " Tau DR Max track-seed; DRMax; # Taus",20,0.,0.5); - m_tauSflight = Book1D("Sflight",m_sTauJetContainerName + " Tau flight sign. ; Sflight; # Taus",100,-10.,20.); - m_tauMtrks = Book1D("Mtracks",m_sTauJetContainerName + " Tau tracks mass ; Mtrks; # Taus",100,-10.,20.); - m_tauIpSig = Book1D("IpSig",m_sTauJetContainerName + " Tau lead track IP signif. ; IpSig; # Taus",30,-15.,15.); - - m_innerTrkAvgDist = Book1D("innerTrkAvgDist",m_sTauJetContainerName + "Tau innerTrkAvgDist; innerTrkAvgDist; # of Taus", 10,-0.2,.8); - m_ptRatioEflowApprox = Book1D("ptRatioEflowApprox",m_sTauJetContainerName + "Tau ptRatioEflowApprox; ptRatioEflowApprox; # of Taus", 10, 0, 10); - m_mEflowApprox = Book1D("mEflowApprox",m_sTauJetContainerName + "Tau mEflowApprox; mEflowApprox; #Taus",30,0,300); - m_ChPiEMEOverCaloEME = Book1D("ChPiEMEOverCaloEME",m_sTauJetContainerName + "Tau ChPiEMEOverCaloEME; ChPiEMEOverCaloEME; # of Taus", 30, -15, 15); - m_EMPOverTrkSysP = Book1D("EMPOverTrkSysP",m_sTauJetContainerName + "Tau EMPOverTrkSysP; EMPOverTrkSysP; # of Taus", 81, -1, 80); + m_tauCoreFrac = Book1D("CentFrac",m_sTauJetContainerName + " Tau CentFrac; CentFrac; # Taus",40,0.,2.); + m_tauEoverPTrk = Book1D("EoverPTrk",m_sTauJetContainerName + " Tau E over pLeadTrk; EoverP; # Taus",50,0.,4.); + m_tauTrkAvgDist = Book1D("TrkAvgDist",m_sTauJetContainerName + " Tau track avg dist; TrkAvgDist; # Taus",10,-0.2,.8); + m_tauDRMax = Book1D("DRMax",m_sTauJetContainerName + " Tau DR Max track-seed; DRMax; # Taus",20,0.,0.5); + m_tauSflight = Book1D("Sflight",m_sTauJetContainerName + " Tau flight sign. ; Sflight; # Taus",100,-10.,20.); + m_tauMtrks = Book1D("Mtracks",m_sTauJetContainerName + " Tau tracks mass ; Mtrks; # Taus",100,-10.,20.); + m_tauIpSig = Book1D("IpSig",m_sTauJetContainerName + " Tau lead track IP signif. ; IpSig; # Taus",30,-15.,15.); + + m_innerTrkAvgDist = Book1D("innerTrkAvgDist",m_sTauJetContainerName + "Tau innerTrkAvgDist; innerTrkAvgDist; # of Taus", 10,-0.2,.8); + m_ptRatioEflowApprox = Book1D("ptRatioEflowApprox",m_sTauJetContainerName + "Tau ptRatioEflowApprox; ptRatioEflowApprox; # of Taus", 10, 0, 10); + m_mEflowApprox = Book1D("mEflowApprox",m_sTauJetContainerName + "Tau mEflowApprox; mEflowApprox; #Taus",30,0,300); + m_ChPiEMEOverCaloEME = Book1D("ChPiEMEOverCaloEME",m_sTauJetContainerName + "Tau ChPiEMEOverCaloEME; ChPiEMEOverCaloEME; # of Taus", 30, -15, 15); + m_EMPOverTrkSysP = Book1D("EMPOverTrkSysP",m_sTauJetContainerName + "Tau EMPOverTrkSysP; EMPOverTrkSysP; # of Taus", 81, -1, 80); } diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/Migration.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/Migration.cxx index d725f6e1975e0878c447370b59ed24dd3fa6e5b0..1624c31a3bb08486845791b15a47c1977434244f 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/Migration.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/Migration.cxx @@ -6,14 +6,19 @@ namespace Tau{ - Migration::Migration(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName):PlotBase(pParent, sDir), - m_sTauJetContainerName(sTauJetContainerName){ - } - - - Migration::~Migration() - { - } +Migration::Migration(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName): + PlotBase(pParent, sDir), + m_migration_tauRec(nullptr), + m_migration_eflow(nullptr), + m_migration_cellBased(nullptr), + m_sTauJetContainerName(sTauJetContainerName) +{ +} + +Migration::~Migration() +{ +} + void Migration::initializePlots(){ m_migration_tauRec = Book1D("tauRec_migration",m_sTauJetContainerName + " TauRec migration",DECAYSIZE,0,DECAYSIZE); m_migration_eflow = Book1D("eflow_migration",m_sTauJetContainerName + " eflow migration",DECAYSIZE,0,DECAYSIZE); diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/NewCorePlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/NewCorePlots.cxx index 707d5d0862a1ed779ea4f7a9de51990a8f97719a..9cc2c23861e66c7012e0c7322370dae907b4c64d 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/NewCorePlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/NewCorePlots.cxx @@ -6,13 +6,46 @@ namespace Tau{ - NewCorePlots::NewCorePlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName):PlotBase(pParent, sDir), - m_sTauJetContainerName(sTauJetContainerName){ - } +NewCorePlots::NewCorePlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName): + PlotBase(pParent, sDir), + m_ipZ0SinThetaSigLeadTrk(nullptr), + m_etOverPtLeadTrk(nullptr), + m_ipSigLeadTrk(nullptr), + m_massTrkSys(nullptr), + m_trkWidth2(nullptr), + m_trFlightPathSig(nullptr), + m_etEflow(nullptr), + m_nPi0(nullptr), + m_tauDRMax(nullptr), + m_tauSflight(nullptr), + m_EMRadius(nullptr), + m_hadRadius(nullptr), + m_isolFrac(nullptr), + m_centFrac(nullptr), + m_stripWidth2(nullptr), + m_nStrip(nullptr), + m_trkAvgDist(nullptr), + m_lead2ClusterEOverAllClusterE(nullptr), + m_lead3ClusterEOverAllClusterE(nullptr), + m_caloIso(nullptr), + m_caloIsoCorrected(nullptr), + m_mEflowTopo(nullptr), + m_ptRatioEflowTopo(nullptr), + m_nPi0Topo(nullptr), + m_PSSFraction(nullptr), + m_ChPiEMEOverCaloEME(nullptr), + m_EMPOverTrkSysP(nullptr), + m_innerTrkAvgDist(nullptr), + m_ptRatioEflowApprox(nullptr), + m_mEflowApprox(nullptr), + m_sTauJetContainerName(sTauJetContainerName) +{ +} - NewCorePlots::~NewCorePlots() - { - } +NewCorePlots::~NewCorePlots() +{ +} + void NewCorePlots::initializePlots(){ // m_oParamPlots.initialize(); diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/PlotBase.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/PlotBase.cxx deleted file mode 100644 index b75057871b4df2a1c020fc441f2cdac519e04917..0000000000000000000000000000000000000000 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/PlotBase.cxx +++ /dev/null @@ -1,165 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#include "TauHistUtils/PlotBase.h" -#include "TH1D.h" -#include "TH2D.h" -#include "TH3D.h" -#include "TProfile.h" -#include <algorithm> - -PlotBase::PlotBase(PlotBase* pParent, const std::string & sDir){ - if (pParent != 0) pParent->RegisterSubPlot(this); - std::string sParentDirectory = (pParent != 0) ? pParent->getDirectory() : ""; - m_sDirectory = sParentDirectory + sDir; - m_iDetailLevel = 0; -} - -void PlotBase::initialize(){ - for (auto subNode: m_vSubNodes) subNode->initialize(); - initializePlots(); -} - -void PlotBase::finalize(){ - for (auto subNode: m_vSubNodes) subNode->finalize(); - finalizePlots(); -} - -void PlotBase::setDetailLevel(int iDetailLevel){ - for (auto subNode: m_vSubNodes) subNode->setDetailLevel(iDetailLevel); - m_iDetailLevel = iDetailLevel; -} - - -std::vector<HistData> PlotBase::retrieveBookedHistograms(){ - std::vector<HistData> vBookedHistograms = m_vBookedHistograms; - for (const auto & subNode: m_vSubNodes){ - std::vector<HistData> subNodeHists = subNode->retrieveBookedHistograms(); - vBookedHistograms.insert(vBookedHistograms.end(), subNodeHists.begin(), subNodeHists.end() ); - } - return vBookedHistograms; -} - - -std::vector<TreeData> PlotBase::retrieveBookedTrees(){ - std::vector<TreeData> vBookedTrees = m_vBookedTrees; - for (auto subNode: m_vSubNodes){ - std::vector<TreeData> subNodeTrees = subNode->retrieveBookedTrees(); - vBookedTrees.insert(vBookedTrees.end(), subNodeTrees.begin(), subNodeTrees.end() ); - } - return vBookedTrees; -} - - -TH1* PlotBase::Book1D(const std::string & name, const std::string & labels, int nBins, float start, float end, bool prependDir){ - std::string prefix = constructPrefix(m_sDirectory, prependDir); - TH1* hist = new TH1D((prefix + name).c_str(), labels.c_str(), nBins, start, end); - hist->Sumw2(); - m_vBookedHistograms.push_back(HistData(hist,m_sDirectory)); - return hist; -} - - -TH1* PlotBase::Book1D(const std::string & name, TH1* refHist, const std::string & labels, bool prependDir){ - std::string prefix = constructPrefix(m_sDirectory, prependDir); - TH1* hist = new TH1D((prefix + name).c_str(), labels.c_str(), refHist->GetNbinsX(), refHist->GetXaxis()->GetXbins()->GetArray()); - hist->Sumw2(); - m_vBookedHistograms.push_back(HistData(hist,m_sDirectory)); - return hist; -} - - -TH2* PlotBase::Book2D(const std::string & name, const std::string & labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, bool prependDir){ - std::string prefix = constructPrefix(m_sDirectory, prependDir); - TH2* hist = new TH2D((prefix + name).c_str(), labels.c_str(), nBinsX, startX, endX, nBinsY, startY,endY); - hist->Sumw2(); - m_vBookedHistograms.push_back(HistData(hist,m_sDirectory)); - return hist; -} - - -TH2* PlotBase::Book2D(const std::string & name, TH2* refHist, const std::string & labels, bool prependDir){ - return Book2D(name, labels, refHist->GetNbinsX(), refHist->GetXaxis()->GetXmin(), refHist->GetXaxis()->GetXmax(), - refHist->GetNbinsY(), refHist->GetYaxis()->GetXmin(), refHist->GetYaxis()->GetXmax(),prependDir); -} - -TH2* PlotBase::Book2D(const std::string & name, const std::string & labels, int nBinsX, Double_t* binsX, int nBinsY, Double_t startY, Double_t endY, bool prependDir){ - std::string prefix = constructPrefix(m_sDirectory, prependDir); - TH2* hist = new TH2D((prefix + name).c_str(), labels.c_str(), nBinsX, binsX, nBinsY, startY, endY); - hist->Sumw2(); - m_vBookedHistograms.push_back(HistData(hist,m_sDirectory)); - return hist; -} - -TH3* PlotBase::Book3D(const std::string & name, const std::string & labels, int nBinsX, float startX, float endX, int nBinsY, float startY, float endY, int nBinsZ, float startZ, float endZ, bool prependDir){ - std::string prefix = constructPrefix(m_sDirectory, prependDir); - TH3* hist = new TH3D((prefix + name).c_str(), labels.c_str(), nBinsX, startX, endX, nBinsY, startY, endY, nBinsZ, startZ, endZ); - hist->Sumw2(); - m_vBookedHistograms.push_back(HistData(hist,m_sDirectory)); - return hist; -} - - -TH3* PlotBase::Book3D(const std::string & name, TH3* refHist, const std::string & labels, bool prependDir){ - return Book3D(name, labels, refHist->GetNbinsX(), refHist->GetXaxis()->GetXmin(), refHist->GetXaxis()->GetXmax(), - refHist->GetNbinsY(), refHist->GetYaxis()->GetXmin(), refHist->GetYaxis()->GetXmax(), - refHist->GetNbinsZ(), refHist->GetZaxis()->GetXmin(), refHist->GetZaxis()->GetXmax(),prependDir); -} - -TProfile* PlotBase::BookTProfile(const std::string &name, const std::string & labels, int nBinsX, float startX, float endX, float startY, float endY, bool prependDir) -{ - std::string prefix = constructPrefix(m_sDirectory, prependDir); - TProfile* hist(0); - if (startY==-1 and endY==-1) - hist = new TProfile((prefix+name).c_str(), labels.c_str(), nBinsX, startX, endX); - else - hist = new TProfile((prefix+name).c_str(), labels.c_str(), nBinsX, startX, endX, startY, endY); - m_vBookedHistograms.push_back(HistData(hist,m_sDirectory)); - return hist; -} - - -TProfile* PlotBase::BookTProfile(const std::string &name, const std::string & labels, int nBinsX, float* binsX, bool prependDir) -{ - std::string prefix = constructPrefix(m_sDirectory, prependDir); - TProfile* hist(0); - hist = new TProfile((prefix+name).c_str(), labels.c_str(), nBinsX, binsX); - m_vBookedHistograms.push_back(HistData(hist,m_sDirectory)); - return hist; -} - - -TProfile* PlotBase::BookTProfileRangeY(const std::string &name, const std::string & labels, int nBinsX, double* binsX, double startY, double endY, bool prependDir) -{ - std::string prefix = constructPrefix(m_sDirectory, prependDir); - TProfile* hist(0); - hist = new TProfile((prefix+name).c_str(), labels.c_str(), (Int_t)nBinsX, binsX, startY, endY); - m_vBookedHistograms.push_back(HistData(hist,m_sDirectory)); - return hist; -} - -TProfile2D* PlotBase::BookTProfile2D(const std::string &name, const std::string & labels, const int nBinsX, - const double xlo, const double xhi, const int nBinsY, const double ylo, const double yhi, bool prependDir){ - std::string prefix = constructPrefix(m_sDirectory, prependDir); - TProfile2D* hist = new TProfile2D((prefix + name).c_str(), labels.c_str(), nBinsX, xlo, xhi, nBinsY, ylo,yhi); - return hist; -} - - -TTree* PlotBase::BookTree(const std::string & name, bool prependDir){ - std::string prefix = constructPrefix(m_sDirectory, prependDir); - TTree* tree = new TTree((prefix + name).c_str(), ""); - tree->SetAutoSave(0); - tree->SetAutoFlush(0); - tree->SetDirectory(0); - m_vBookedTrees.push_back(TreeData(tree,m_sDirectory)); - return tree; -} - - -std::string PlotBase::constructPrefix(std::string dir, bool prependDir){ - if (!prependDir) return ""; - std::replace( dir.begin(), dir.end(), '/', '_'); - return dir; -} diff --git a/PhysicsAnalysis/TauID/TauHistUtils/src/RecoTauPlots.cxx b/PhysicsAnalysis/TauID/TauHistUtils/src/RecoTauPlots.cxx index dc94b49dbc178c81f8e3cb1e28adc742012ff013..da56580e04ebf2ce3bd2270b21143008ac029927 100644 --- a/PhysicsAnalysis/TauID/TauHistUtils/src/RecoTauPlots.cxx +++ b/PhysicsAnalysis/TauID/TauHistUtils/src/RecoTauPlots.cxx @@ -6,15 +6,67 @@ namespace Tau{ - RecoTauPlots::RecoTauPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName):PlotBase(pParent, sDir), - m_oParamPlots(this, "", sTauJetContainerName), - m_sTauJetContainerName(sTauJetContainerName){ - } +RecoTauPlots::RecoTauPlots(PlotBase* pParent, std::string sDir, std::string sTauJetContainerName): + PlotBase(pParent, sDir), + m_oParamPlots(this, "", sTauJetContainerName), + m_eflowRec_charPFO_Pt(nullptr), + m_eflowRec_charPFO_Eta(nullptr), + m_eflowRec_charPFO_Phi(nullptr), + m_eflowRec_charPFO_E(nullptr), + m_eflowRec_neuPFO_Pt(nullptr), + m_eflowRec_neuPFO_Eta(nullptr), + m_eflowRec_neuPFO_Phi(nullptr), + m_eflowRec_neuPFO_E(nullptr), + m_eflowRec_neuPFO_bdtPi0Score(nullptr), + m_cellBased_charPFO_Pt(nullptr), + m_cellBased_charPFO_Eta(nullptr), + m_cellBased_charPFO_Phi(nullptr), + m_cellBased_charPFO_E(nullptr), + m_cellBased_neuPFO_Pt(nullptr), + m_cellBased_neuPFO_Eta(nullptr), + m_cellBased_neuPFO_Phi(nullptr), + m_cellBased_neuPFO_E(nullptr), + m_cellBased_neuPFO_bdtPi0Score(nullptr), + m_pantau_CellBasedInput_isPanTauCandidate(nullptr), + m_pantau_CellBasedInput_DecayMode(nullptr), + m_pantau_CellBasedInput_BDTValue_1p0n_vs_1p1n(nullptr), + m_pantau_CellBasedInput_BDTValue_1p1n_vs_1pXn(nullptr), + m_pantau_CellBasedInput_BDTValue_3p0n_vs_3pXn(nullptr), + m_pantau_CellBasedInput_BDTVar_Basic_NNeutralConsts(nullptr), + m_pantau_CellBasedInput_BDTVar_Charged_JetMoment_EtDRxTotalEt(nullptr), + m_pantau_CellBasedInput_BDTVar_Charged_StdDev_Et_WrtEtAllConsts(nullptr), + m_pantau_CellBasedInput_BDTVar_Neutral_HLV_SumM(nullptr), + m_pantau_CellBasedInput_BDTVar_Neutral_PID_BDTValues_BDTSort_1(nullptr), + m_pantau_CellBasedInput_BDTVar_Neutral_PID_BDTValues_BDTSort_2(nullptr), + m_pantau_CellBasedInput_BDTVar_Neutral_Ratio_1stBDTEtOverEtAllConsts(nullptr), + m_pantau_CellBasedInput_BDTVar_Neutral_Ratio_EtOverEtAllConsts(nullptr), + m_pantau_CellBasedInput_BDTVar_Neutral_Shots_NPhotonsInSeed(nullptr), + m_pantau_CellBasedInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged(nullptr), + m_pantau_eflowRecInput_isPanTauCandidate(nullptr), + m_pantau_eflowRecInput_DecayMode(nullptr), + m_pantau_eflowRecInput_BDTValue_1p0n_vs_1p1n(nullptr), + m_pantau_eflowRecInput_BDTValue_1p1n_vs_1pXn(nullptr), + m_pantau_eflowRecInput_BDTValue_3p0n_vs_3pXn(nullptr), + m_pantau_eflowRecInput_BDTVar_Basic_NPi0NeutConsts(nullptr), + m_pantau_eflowRecInput_BDTVar_Basic_NNeutralConsts(nullptr), + m_pantau_eflowRecInput_BDTVar_Charged_Ratio_EtOverEtAllConsts(nullptr), + m_pantau_eflowRecInput_BDTVar_Neutral_HLV_SumM(nullptr), + m_pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_EtSort_1(nullptr), + m_pantau_eflowRecInput_BDTVar_Neutral_PID_BDTValues_BDTSort_2(nullptr), + m_pantau_eflowRecInput_BDTVar_Neutral_Ratio_EtOverEtAllConsts(nullptr), + m_pantau_eflowRecInput_BDTVar_Neutral_Mean_DRToLeading_WrtEtAllConsts(nullptr), + m_pantau_eflowRecInput_BDTVar_Combined_DeltaR1stNeutralTo1stCharged(nullptr), + m_id_BDTJetScore(nullptr), + m_id_BDTEleScore(nullptr), + m_sTauJetContainerName(sTauJetContainerName) +{ +} - RecoTauPlots::~RecoTauPlots() - { - } - void RecoTauPlots::initializePlots(){ +RecoTauPlots::~RecoTauPlots() +{ +} + +void RecoTauPlots::initializePlots(){ // m_oParamPlots.initialize(); diff --git a/Reconstruction/HeavyIonRec/HIRecExample/share/hip_flagsESD.py b/Reconstruction/HeavyIonRec/HIRecExample/share/hip_flagsESD.py index 57146c4da2c4aac90c6605899e4738f5cc3e97ea..f439c65bf9edf9790ae093fc11e01f6e51abda40 100644 --- a/Reconstruction/HeavyIonRec/HIRecExample/share/hip_flagsESD.py +++ b/Reconstruction/HeavyIonRec/HIRecExample/share/hip_flagsESD.py @@ -9,6 +9,8 @@ if rec.doESD : from InDetRecExample.InDetJobProperties import InDetFlags InDetFlags.doMinBias.set_Value_and_Lock(True) + InDetFlags.doRefitInvalidCov.set_Value_and_Lock(False) + InDetFlags.doRejectInvalidCov.set_Value_and_Lock(True) InDetFlags.perigeeExpression.set_Value_and_Lock('Vertex') InDetFlags.doSplitVertexFindingForMonitoring.set_Value_and_Lock(False) InDetFlags.writeRDOs.set_Value_and_Lock(True) diff --git a/Reconstruction/Jet/JetCalibTools/CMakeLists.txt b/Reconstruction/Jet/JetCalibTools/CMakeLists.txt index 1484263caadddface1ecfe0710eb8166bf8139bc..d7b483712852feefcf8739f25090a777a7c72f1d 100644 --- a/Reconstruction/Jet/JetCalibTools/CMakeLists.txt +++ b/Reconstruction/Jet/JetCalibTools/CMakeLists.txt @@ -1,4 +1,4 @@ -# $Id: CMakeLists.txt 778391 2016-10-14 00:23:00Z krasznaa $ +# $Id: CMakeLists.txt 789330 2016-12-12 17:07:48Z khoo $ ################################################################################ # Package: JetCalibTools ################################################################################ @@ -27,6 +27,7 @@ atlas_depends_on_subdirs( PRIVATE Event/xAOD/xAODMuon Tools/PathResolver + PhysicsAnalysis/POOLRootAccess ${extra_deps} ) # External dependencies: @@ -59,4 +60,11 @@ if( XAOD_STANDALONE ) INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEventInfo xAODJet xAODEventShape xAODCore xAODRootAccess JetCalibToolsLib ) +else() + atlas_add_executable( JetCalibTools_Example + util/JetCalibTools_Example.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} AsgTools xAODEventInfo xAODJet + xAODEventShape xAODCore POOLRootAccess xAODRootAccess JetCalibToolsLib ) endif() + diff --git a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h index 82bcc14d3842119edc2f487ed3d99fccf82c569d..08b4277a807746e633398ae1704eb435992217f4 100644 --- a/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h +++ b/Reconstruction/Jet/JetCalibTools/JetCalibTools/JetCalibrationTool.h @@ -46,9 +46,6 @@ class JetCalibrationTool public: - // Default constructor: - JetCalibrationTool(); - /// Constructor with parameters: JetCalibrationTool(const std::string& name); diff --git a/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx b/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx index bfbd50d8e5ad3334d6c86dedf3ff4af64f6b44cd..9d377c109649295db347f1a23a5826d4db3090bf 100644 --- a/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx +++ b/Reconstruction/Jet/JetCalibTools/Root/JetCalibrationTool.cxx @@ -31,7 +31,6 @@ JetCalibrationTool::JetCalibrationTool(const std::string& name) declareProperty( "IsData", m_isData = true ); declareProperty( "ConfigDir", m_dir = "JetCalibTools/CalibrationConfigs/" ); declareProperty( "EventInfoName", m_eInfoName = "EventInfo"); - declareProperty( "DoSetDetectorEta", m_doSetDetectorEta=true); } @@ -83,7 +82,7 @@ StatusCode JetCalibrationTool::initializeTool(const std::string& name) { } if ( config.EqualTo("") || !config ) { ATH_MSG_FATAL("No configuration file specified."); return StatusCode::FAILURE; } - m_calibAreaTag.insert(0,"CalibArea-00-04-73/"); // Hard-coding the CalibArea tag + m_calibAreaTag.insert(0,"CalibArea-00-04-76/"); // Hard-coding the CalibArea tag if(calibSeq.Contains("DEV")){ m_devMode = true; ATH_MSG_WARNING("Dev Mode is ON!!! \n\n"); @@ -114,8 +113,9 @@ StatusCode JetCalibrationTool::initializeTool(const std::string& name) { //Set the default units to MeV, user can override by calling setUnitsGeV(true) setUnitsGeV(false); - // Origin-corrected clusters? (true for rel21 and/or 2.5.X) + // Settings for R21/2.5.X m_originCorrectedClusters = m_globalConfig->GetValue("OriginCorrectedClusters",false); + m_doSetDetectorEta = m_globalConfig->GetValue("SetDetectorEta",true); //Make sure the residual correction is turned on if requested, protect against applying it without the jet area subtraction if ( !calibSeq.Contains("JetArea") && !calibSeq.Contains("Residual") ) { @@ -393,31 +393,23 @@ StatusCode JetCalibrationTool::initializeEvent(JetEventInfo& jetEventInfo) const //Should be determined using EventShape object, use hard coded values if EventShape doesn't exist double rho=0; const xAOD::EventShape * eventShape = 0; - //std::string rhoKey = m_jetScale == EM ? "Kt4EMTopoEventShape" : "Kt4LCTopoEventShape"; - static unsigned int eventShapeWarnings = 0; if ( m_doJetArea && evtStore()->contains<xAOD::EventShape>(m_rhoKey) ) { ATH_MSG_VERBOSE(" Found event density container " << m_rhoKey); if ( evtStore()->retrieve(eventShape, m_rhoKey).isFailure() || !eventShape ) { ATH_MSG_VERBOSE(" Event shape container not found."); - ++eventShapeWarnings; - rho = ( m_jetScale == EM || m_jetScale == PFLOW ? 6000. : 12000.); - if ( eventShapeWarnings < 20 ) - ATH_MSG_WARNING("Could not retrieve xAOD::EventShape from evtStore, using hard-coded value, rho = " << rho/m_GeV << " GeV."); + ATH_MSG_FATAL("Could not retrieve xAOD::EventShape from evtStore."); + return StatusCode::FAILURE; } else if ( !eventShape->getDensity( xAOD::EventShape::Density, rho ) ) { ATH_MSG_VERBOSE(" Event density not found in container."); - ++eventShapeWarnings; - rho = ( m_jetScale == EM || m_jetScale == PFLOW ? 6000. : 12000.); - if ( eventShapeWarnings < 20 ) - ATH_MSG_WARNING("Could not retrieve xAOD::EventShape::Density from xAOD::EventShape, using hard-coded value, rho = " << rho/m_GeV << " GeV."); + ATH_MSG_FATAL("Could not retrieve xAOD::EventShape::Density from xAOD::EventShape."); + return StatusCode::FAILURE; } else { ATH_MSG_VERBOSE(" Event density retrieved."); } } else if ( m_doJetArea && !evtStore()->contains<xAOD::EventShape>(m_rhoKey) ) { ATH_MSG_VERBOSE(" Rho container not found: " << m_rhoKey); - ++eventShapeWarnings; - rho = ( m_jetScale == EM ? 6000. : 12000.); - if ( eventShapeWarnings < 20 ) - ATH_MSG_WARNING("Could not retrieve xAOD::EventShape from evtStore, using hard-coded value, rho = " << rho/m_GeV << " GeV."); + ATH_MSG_FATAL("Could not retrieve xAOD::EventShape from evtStore."); + return StatusCode::FAILURE; } jetEventInfo.setRho(rho); ATH_MSG_VERBOSE(" Rho = " << 0.001*rho << " GeV"); diff --git a/Reconstruction/Jet/JetCalibTools/cmt/requirements b/Reconstruction/Jet/JetCalibTools/cmt/requirements index 603fdf3f4a76f8603ed538d3329ef2a6dcf1f42e..80bb8c7bfced8eff730e65354064c241f80147f8 100644 --- a/Reconstruction/Jet/JetCalibTools/cmt/requirements +++ b/Reconstruction/Jet/JetCalibTools/cmt/requirements @@ -17,16 +17,26 @@ use JetInterface JetInterface-* Reconstruction/Jet private use GaudiInterface GaudiInterface-* External use xAODMuon xAODMuon-* Event/xAOD -use PathResolver PathResolver-* Tools +use PathResolver PathResolver-* Tools +use xAODRootAccess xAODRootAccess-* Control end_private -library JetCalibTools *.cxx ../Root/*.cxx -s=components *.cxx -apply_pattern component_library +#library JetCalibTools *.cxx ../Root/*.cxx -s=components *.cxx +#apply_pattern component_library -#apply_pattern dual_use_library files="*.cxx ../Root/*.cxx" +apply_pattern dual_use_library files="*.cxx ../Root/*.cxx" apply_pattern declare_calib files="-s=../share *" +private apply_pattern generic_declare_for_link files="../data/CalibrationConfigs/*.config" kind=calib prefix=share/JetCalibTools/CalibrationConfigs name=CalibrationConfigs apply_pattern generic_declare_for_link files="../data/CalibrationFactors/*.config ../data/CalibrationFactors/*.root" kind=calib prefix=share/JetCalibTools/CalibrationFactors name=CalibrationFactors apply_pattern generic_declare_for_link files="../data/InsituCalibration/*.root" kind=calib prefix=share/JetCalibTools/InsituCalibration name=InsituCalibration + +use_if tag=AthAnalysisBase pkg=POOLRootAccess ver=POOLRootAccess-* root=PhysicsAnalysis +use_if tag=AthAnalysisBase pkg=StoreGate ver=StoreGate-* root=Control +use_if tag=AthAnalysisBase pkg=xAODCore ver=xAODCore-* root=Event/xAOD + +application JetCalibTools_Example ../util/JetCalibTools_Example.cxx +macro_append JetCalibTools_Example_dependencies " JetCalibToolsLib " +end_private \ No newline at end of file diff --git a/Reconstruction/Jet/JetCalibTools/util/JetCalibTools_Example.cxx b/Reconstruction/Jet/JetCalibTools/util/JetCalibTools_Example.cxx index 2e7a31376ac696f24cd9325a652c102f67f76872..a076834f9999c0265815b30054db04dc9c826a6e 100644 --- a/Reconstruction/Jet/JetCalibTools/util/JetCalibTools_Example.cxx +++ b/Reconstruction/Jet/JetCalibTools/util/JetCalibTools_Example.cxx @@ -12,9 +12,6 @@ * 1 14/03/16 First Version J. Bossio (jbossios@cern.ch) * \************************************************************************/ -// This will only run in RootCore -#ifdef ROOTCORE - // System include(s): #include <memory> @@ -24,13 +21,19 @@ // ROOT #include "TFile.h" +#ifdef XAOD_STANDALONE +#include "xAODRootAccess/Init.h" +#include "xAODRootAccess/TEvent.h" +#include "xAODRootAccess/TStore.h" +#else +#include "POOLRootAccess/TEvent.h" +#include "StoreGate/StoreGateSvc.h" +#endif + //xAOD EDM classes #include "xAODEventInfo/EventInfo.h" #include "xAODJet/JetContainer.h" #include "xAODEventShape/EventShape.h" -#include "xAODRootAccess/Init.h" -#include "xAODRootAccess/TEvent.h" -#include "xAODRootAccess/TStore.h" #include "xAODRootAccess/tools/Message.h" #include "xAODRootAccess/tools/ReturnCheck.h" #include "xAODCore/tools/IOStats.h" @@ -124,7 +127,6 @@ int main(int argc, char* argv[]){ // Set up the job for xAOD access: static const char* APP_NAME = "JetCalibTools_Example"; - RETURN_CHECK( APP_NAME, xAOD::Init() ); //-------------------- // Opening input file @@ -132,12 +134,14 @@ int main(int argc, char* argv[]){ std::unique_ptr< TFile > ifile( TFile::Open( sample.c_str(), "READ" ) ); // Create a TEvent object. +#ifdef XAOD_STANDALONE + RETURN_CHECK( APP_NAME, xAOD::Init() ); xAOD::TEvent event( xAOD::TEvent::kClassAccess ); +#else // Athena "Store" is the same StoreGate used by the TEvent + POOL::TEvent event( POOL::TEvent::kClassAccess ); +#endif RETURN_CHECK( APP_NAME, event.readFrom( ifile.get() ) ); - // Create a transient object store. Needed for the tools. - xAOD::TStore store; - //---------------------------------- // Initialization of JetCalibTools //---------------------------------- @@ -201,5 +205,3 @@ int main(int argc, char* argv[]){ return 0; } - -#endif diff --git a/Reconstruction/Jet/JetEDM/Root/JetConstituentFiller.cxx b/Reconstruction/Jet/JetEDM/Root/JetConstituentFiller.cxx index 03306317fa9a713c4c5808598224271e04d795be..85e9d9a553e7b4d00784cfada51de80dc27a1232 100644 --- a/Reconstruction/Jet/JetEDM/Root/JetConstituentFiller.cxx +++ b/Reconstruction/Jet/JetEDM/Root/JetConstituentFiller.cxx @@ -9,9 +9,10 @@ #include "JetEDM/IConstituentUserInfo.h" #include "JetEDM/IndexedTConstituentUserInfo.h" #include "JetEDM/LabelIndex.h" -#include "xAODJet/Jet.h" +#include "xAODJet/JetContainer.h" #include "fastjet/PseudoJet.hh" #include "xAODMuon/MuonSegmentContainer.h" +#include <iostream> typedef std::vector<fastjet::PseudoJet> PseudoJetVector; using xAOD::IParticle; @@ -123,6 +124,15 @@ extractConstituents(xAOD::Jet& jet, const NameList* pghostlabs, ParType& partype = partypes[i]; std::string cname = pli->label(i) + "Count"; std::string ptname = pli->label(i) + "Pt"; + // Check if this is in the parent jet + int count_test; // dummy var to retrieve into -- we don't care about the value + const static SG::AuxElement::ConstAccessor<ElementLink<xAOD::JetContainer> > cacc_parent("Parent"); + if(cacc_parent.isAvailable(jet) && cacc_parent(jet).isValid()) { + if(!(*cacc_parent(jet))->getAttribute(cname,count_test)) { + nbad += out[i].size(); // Skip if the parent does not have this + continue; + } + } if ( partype == MUSEG ) { // Record associated muons. jet.setAssociatedObjects(pli->label(i) , outms[i]); diff --git a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetPtAssociationTool.h b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetPtAssociationTool.h index e4931a5dc7adf0b2fecb84bfa99b09a2151b43b0..a3b75cafa488eb45013be15bd4f8e5d119cb1ada 100644 --- a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetPtAssociationTool.h +++ b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetPtAssociationTool.h @@ -41,6 +41,8 @@ public: /// for the jet with the highest such fraction. int modifyJet(xAOD::Jet& jet) const; +private: // data + /// Return the matched pT sum for each jet in a collection. /// The matching is done with match(). /// aps - input AP vector @@ -53,9 +55,8 @@ public: /// aps - input AP vector /// jet - Jet to be matched /// apvs - output vector of matched AP indices - int match(const APVector& aps, const xAOD::Jet& jet, APVector& apvs) const; - -private: // data + /// ptsum - sum of jet constituent pts + int match(const APVector& aps, const xAOD::Jet& jet, APVector& apvs, double& ptsum_constituents) const; /// Properties. std::string m_aname; diff --git a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexFractionTool.h b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexFractionTool.h index 4635365b4ef8f1c4b76dcd221106eeb3dc365f36..3d7244ada35bef500ea6ccd25ba43350b075b872 100644 --- a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexFractionTool.h +++ b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexFractionTool.h @@ -58,7 +58,12 @@ public: // methods // Inherited methods to modify a jet // Calls getJetVertexFraction and puts the result in the jet - virtual int modifyJet(xAOD::Jet& jet) const; + int modifyJet(xAOD::Jet& jet) const; + + // Inherited methods to modify a jet + // Computes JVF for all jets from track sum information + // Also adds JVF corrected to be insensitive to NPV + int modify(xAOD::JetContainer& jetCont) const; // Local method to calculate and return the JVF vector const std::vector<float> getJetVertexFraction(const xAOD::VertexContainer*, @@ -70,23 +75,49 @@ public: // methods const std::vector<const xAOD::TrackParticle*>&, const jet::TrackVertexAssociation*) const; + // Local method to calculate the JVF for a given vertex + float getCorrJetVertexFraction(const xAOD::Vertex*, + const std::vector<const xAOD::TrackParticle*>&, + const xAOD::TrackParticleContainer*&, + const jet::TrackVertexAssociation*) const; + // Local method to determine the highest JVF vertex and get an ElementLink to it ElementLink<xAOD::VertexContainer> getMaxJetVertexFraction(const xAOD::VertexContainer*, const std::vector<float>&) const; + private: // data // Configurable parameters std::string m_verticesName; std::string m_assocTracksName; std::string m_tvaName; + std::string m_tracksName; + std::string m_sumPtTrkName; ToolHandle<IJetTrackSelector> m_htsel; std::string m_jvfname; + float m_kcorrJVF; + float m_PUtrkptcut; private: // methods std::vector<float> getEmptyJetVertexFraction(const xAOD::VertexContainer*) const; + // Local method to count the number of pileup tracks in the event + int getPileupTrackCount(const xAOD::Vertex*, + const xAOD::TrackParticleContainer*&, + const jet::TrackVertexAssociation*) const; + + // Local method to return the HS vertex - that of type PriVtx + const xAOD::Vertex* findHSVertex(const xAOD::VertexContainer*&) const; + + // Local method to return the primary and pileup track pT sums + // this method also allows the standard jvf to be calculated + std::pair<float,float> + getJetVertexTrackSums(const xAOD::Vertex*, + const std::vector<const xAOD::TrackParticle*>&, + const jet::TrackVertexAssociation*) const; + }; diff --git a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexTaggerTool.h b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexTaggerTool.h index ad687c114f149f51759f6964126e077d542f667e..065c8e144db835d4b5febb469a6b721fd67d5b58 100644 --- a/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexTaggerTool.h +++ b/Reconstruction/Jet/JetMomentTools/JetMomentTools/JetVertexTaggerTool.h @@ -99,18 +99,6 @@ public: float updateJvt(const xAOD::Jet& jet, std::string sjvt = "Jvt", std::string scale ="JetPileupScaleMomentum") const; - // Local method to return the primary and pileup track pT sums - // this method also allows the standard jvf to be calculated - std::pair<float,float> - getJetVertexTrackSums(const xAOD::Vertex*, - const std::vector<const xAOD::TrackParticle*>&, - const jet::TrackVertexAssociation*) const; - - // Local method to count the number of pileup tracks in the event - int getPileupTrackCount(const xAOD::Vertex*, - const xAOD::TrackParticleContainer*&, - const jet::TrackVertexAssociation*) const; - // Local method to return the HS vertex - that of type PriVtx const xAOD::Vertex* findHSVertex(const xAOD::VertexContainer*&) const; @@ -121,6 +109,8 @@ private: // data std::string m_assocTracksName; std::string m_tvaName; std::string m_tracksName; + std::string m_jvfCorrName; + std::string m_sumPtTrkName; std::string m_jvtlikelihoodHistName; std::string m_jvtfileName; std::string m_jvtName; @@ -128,9 +118,6 @@ private: // data TString m_fn; TFile * m_jvtfile; TH2F * m_jvthisto; - float m_kcorrJVF; - float m_z0cut; - float m_PUtrkptcut; }; diff --git a/Reconstruction/Jet/JetMomentTools/Root/JetCaloEnergies.cxx b/Reconstruction/Jet/JetMomentTools/Root/JetCaloEnergies.cxx index 0087fcce4c1199d14a1b9ae4fa9a3010451b0586..54dba3759c7470b5c765b7ac1b30bc947d5be65a 100644 --- a/Reconstruction/Jet/JetMomentTools/Root/JetCaloEnergies.cxx +++ b/Reconstruction/Jet/JetMomentTools/Root/JetCaloEnergies.cxx @@ -76,7 +76,7 @@ void JetCaloEnergies::fillEperSamplingCluster(xAOD::Jet& jet, std::vector<float> #define FillESamplingPFO( LAYERNAME ) \ float E_##LAYERNAME = 0.0; \ - if (constit->attribute<float>(xAOD::PFODetails::eflowRec_LAYERENERGY_##LAYERNAME, E_##LAYERNAME)) { \ + if (constit->attribute(xAOD::PFODetails::eflowRec_LAYERENERGY_##LAYERNAME, E_##LAYERNAME)) { \ ePerSampling[CaloSampling::LAYERNAME] += E_##LAYERNAME; \ } diff --git a/Reconstruction/Jet/JetMomentTools/Root/JetPtAssociationTool.cxx b/Reconstruction/Jet/JetMomentTools/Root/JetPtAssociationTool.cxx index d16d52d7e2068040e4be48a4e746cc30a8b9a85a..06aa0fb7e133c42f20febdbf508499d95f10970a 100644 --- a/Reconstruction/Jet/JetMomentTools/Root/JetPtAssociationTool.cxx +++ b/Reconstruction/Jet/JetMomentTools/Root/JetPtAssociationTool.cxx @@ -79,26 +79,19 @@ int JetPtAssociationTool:: ptfrac(const APVector& apins, const xAOD::JetContainer& jets, FloatVector& ptfs) const { ptfs.clear(); ptfs.resize(jets.size(), 0.0); - double ptden = 0.0; - for ( const IParticle* ppar : apins ) { - if ( ppar == 0 ) return -1; - ptden += ppar->pt(); - } - if ( ptden < 0.0 ) return -2; - if ( ptden < 1.e-20 ) return 0; - const double inv_ptden = 1. / ptden; ATH_MSG_DEBUG("Match jet count: " << jets.size()); for ( unsigned int ijet=0; ijet<jets.size(); ++ijet ) { const Jet* pjet = jets[ijet]; if ( pjet == 0 ) return -3; APVector apouts; - match(apins, *pjet, apouts); + double ptsum_target = 0.; + match(apins, *pjet, apouts, ptsum_target); double ptsum = 0.0; for ( const IParticle* ppar : apouts ) { if ( ppar == 0 ) return -4; ptsum += ppar->pt(); } - ptfs[ijet] = ptsum*inv_ptden; + ptfs[ijet] = ptsum/ptsum_target; } return 0; } @@ -106,11 +99,13 @@ ptfrac(const APVector& apins, const xAOD::JetContainer& jets, FloatVector& ptfs) //********************************************************************** int JetPtAssociationTool:: -match(const APVector& aps, const xAOD::Jet& jet, APVector& apvs) const { +match(const APVector& aps, const xAOD::Jet& jet, APVector& apvs, double& ptsum_constituents) const { + ptsum_constituents = 0.; apvs.clear(); const JetConstituentVector cons = jet.getConstituents(); for ( const JetConstituent* pcon : cons ) { const IParticle* pparcon = pcon->rawConstituent(); + ptsum_constituents+=pparcon->pt(); for ( const IParticle* pparap : aps ) { if ( pparap == pparcon ) { apvs.push_back(pparcon); diff --git a/Reconstruction/Jet/JetMomentTools/Root/JetTrackMomentsTool.cxx b/Reconstruction/Jet/JetMomentTools/Root/JetTrackMomentsTool.cxx index b0c30be6bc3f03e52750e1c2e3caeeecfe24143e..706bbbd6a071e1000d272c58915b99c449afdee3 100644 --- a/Reconstruction/Jet/JetMomentTools/Root/JetTrackMomentsTool.cxx +++ b/Reconstruction/Jet/JetMomentTools/Root/JetTrackMomentsTool.cxx @@ -65,7 +65,7 @@ int JetTrackMomentsTool::modifyJet(xAOD::Jet& jet) const { bool havetracks = jet.getAssociatedObjects(m_assocTracksName, tracksAsParticles); if ( ! havetracks ) { - ATH_MSG_WARNING("Associted tracks not found"); + ATH_MSG_DEBUG("Associated tracks not found"); } // Do the dynamic_cast once for the particles instead of repeatedly diff --git a/Reconstruction/Jet/JetMomentTools/Root/JetTrackSumMomentsTool.cxx b/Reconstruction/Jet/JetMomentTools/Root/JetTrackSumMomentsTool.cxx index a2c7eb4f8cbebf9d8aa4e92e75c2c39bcfe46817..53908dbaceed0640ee80eef7a90e6b2116f7a557 100644 --- a/Reconstruction/Jet/JetMomentTools/Root/JetTrackSumMomentsTool.cxx +++ b/Reconstruction/Jet/JetMomentTools/Root/JetTrackSumMomentsTool.cxx @@ -69,7 +69,7 @@ int JetTrackSumMomentsTool::modifyJet(xAOD::Jet& jet) const { // Note that there may be no tracks - this is both normal and an error case std::vector<const xAOD::TrackParticle*> tracks; if ( ! jet.getAssociatedObjects(m_assocTracksName, tracks) ) { - ATH_MSG_WARNING("Associated tracks not found."); + ATH_MSG_DEBUG("Associated tracks not found."); } diff --git a/Reconstruction/Jet/JetMomentTools/Root/JetVertexFractionTool.cxx b/Reconstruction/Jet/JetMomentTools/Root/JetVertexFractionTool.cxx index 2336fb7cdd741796755994618d279132f77813f5..a749e0d6fef2031ad7fd4663572e93e278865422 100644 --- a/Reconstruction/Jet/JetMomentTools/Root/JetVertexFractionTool.cxx +++ b/Reconstruction/Jet/JetMomentTools/Root/JetVertexFractionTool.cxx @@ -10,15 +10,19 @@ JetVertexFractionTool::JetVertexFractionTool(const std::string& name) : JetModifierBase(name) -, m_verticesName("") , m_assocTracksName("") -, m_tvaName(""), - m_htsel("") { +, m_tvaName("") +, m_tracksName("") +, m_htsel("") { declareProperty("VertexContainer", m_verticesName); declareProperty("AssociatedTracks", m_assocTracksName); declareProperty("TrackVertexAssociation", m_tvaName); + declareProperty("TrackParticleContainer",m_tracksName); + declareProperty("SumPtTrkName",m_sumPtTrkName="SumPtTrkPt500"); declareProperty("TrackSelector", m_htsel); declareProperty("JVFName", m_jvfname ="JVF"); + declareProperty("K_JVFCorrScale",m_kcorrJVF = 0.01); + declareProperty("PUTrkPtCut",m_PUtrkptcut = 30000.); } //********************************************************************** @@ -34,10 +38,12 @@ StatusCode JetVertexFractionTool::initialize() { return StatusCode::SUCCESS; } +//********************************************************************** +// Legacy version that uses the direct computation of sums over tracks //********************************************************************** int JetVertexFractionTool::modifyJet(xAOD::Jet& jet) const { - + // Get the vertices container const xAOD::VertexContainer* vertices = NULL; if ( evtStore()->retrieve(vertices,m_verticesName).isFailure() ) { @@ -45,7 +51,7 @@ int JetVertexFractionTool::modifyJet(xAOD::Jet& jet) const { return 1; } ATH_MSG_DEBUG("Successfully retrieved VertexContainer from evtStore: " << m_verticesName); - + // Get the tracks associated to the jet // Note that there may be no tracks - this is both normal and an error case // In this case, just fill a vector with zero and don't set the highest vtx moment @@ -53,7 +59,7 @@ int JetVertexFractionTool::modifyJet(xAOD::Jet& jet) const { if ( ! jet.getAssociatedObjects(m_assocTracksName, tracks) ) { ATH_MSG_WARNING("Associated tracks not found."); } - + // Get the TVA object const jet::TrackVertexAssociation* tva = NULL; if (evtStore()->retrieve(tva,m_tvaName).isFailure()) { @@ -61,30 +67,208 @@ int JetVertexFractionTool::modifyJet(xAOD::Jet& jet) const { return 3; } ATH_MSG_DEBUG("Successfully retrieved TrackVertexAssociation from evtStore: " << m_tvaName); - + // Get and set the JVF vector const std::vector<float> jvf = getJetVertexFraction(vertices,tracks,tva); jet.setAttribute(m_jvfname, jvf); - + // Get and set the highest JVF vertex jet.setAttribute("Highest" + m_jvfname + "Vtx",getMaxJetVertexFraction(vertices,jvf)); - + // Done return 0; } //********************************************************************** +// Operate on the full jet container with fewer retrieves and +// add corrected JVF, which needs full-event information +//********************************************************************** +int JetVertexFractionTool::modify(xAOD::JetContainer& jetCont) const { -std::vector<float> -JetVertexFractionTool::getEmptyJetVertexFraction(const xAOD::VertexContainer* vertices) const { - std::vector<float> jvf; - jvf.resize(vertices->size()); - for (size_t iVertex = 0; iVertex < vertices->size(); ++iVertex) jvf.at(iVertex) = 0; - return jvf; + // Get the vertices container + const xAOD::VertexContainer* vertices = NULL; + if ( evtStore()->retrieve(vertices,m_verticesName).isFailure() ) { + ATH_MSG_ERROR("Could not retrieve the VertexContainer from evtStore: " << m_verticesName); + return 1; + } + ATH_MSG_DEBUG("Successfully retrieved VertexContainer from evtStore: " << m_verticesName); + + // Get the Tracks container + const xAOD::TrackParticleContainer* tracksCont = NULL; + if ( evtStore()->retrieve(tracksCont,m_tracksName).isFailure() ) { + ATH_MSG_ERROR("Could not retrieve the TrackParticleContainer from evtStore: " << m_tracksName); + return 2; + } + ATH_MSG_DEBUG("Successfully retrieved TrackParticleContainer from evtStore: " << m_tracksName); + + // Get the TVA object + const jet::TrackVertexAssociation* tva = NULL; + if (evtStore()->retrieve(tva,m_tvaName).isFailure()) { + ATH_MSG_ERROR("Could not retrieve the TrackVertexAssociation from evtStore: " << m_tvaName); + return 3; + } + ATH_MSG_DEBUG("Successfully retrieved TrackVertexAssociation from evtStore: " << m_tvaName); + + if (vertices->size() == 0 ) { + ATH_MSG_WARNING("There are no vertices in the container. Exiting"); + return 4; + } + + const xAOD::Vertex* HSvertex = findHSVertex(vertices); + + // Count pileup tracks - currently done for each collection + const int n_putracks = getPileupTrackCount(HSvertex, tracksCont, tva); + + for(xAOD::Jet * jet : jetCont) { + // Get the tracks associated to the jet + // Note that there may be no tracks - this is both normal and an error case + std::vector<const xAOD::TrackParticle*> tracks; + if ( ! jet->getAssociatedObjects(m_assocTracksName, tracks) ) { + ATH_MSG_DEBUG("Associated tracks not found."); + } + + // Get the track pT sums for all tracks in the jet (first key) and those associated to PU (second key) vertices. + const std::pair<float,float> tracksums = getJetVertexTrackSums(HSvertex, tracks, tva); + // Get the track pT sums for each individual vertex + std::vector<float> vsumpttrk = jet->getAttribute<std::vector<float> >(m_sumPtTrkName); + float sumpttrk_all = tracksums.first; + float sumpttrk_nonPV = tracksums.second; + float sumpttrk_PV = vsumpttrk[HSvertex->index()]; + + // Get and set the JVF vector + std::vector<float> jvf(vertices->size()); + for(size_t vtxi=0; vtxi<vertices->size(); ++vtxi) { + jvf[vtxi] = sumpttrk_all > 1e-9 ? vsumpttrk[vtxi] / sumpttrk_all : -1; + } + jet->setAttribute(m_jvfname, jvf); + + // Get and set the highest JVF vertex + jet->setAttribute("Highest" + m_jvfname + "Vtx",getMaxJetVertexFraction(vertices,jvf)); + + // Calculate RpT and JVFCorr + // Default JVFcorr to -1 when no tracks are associated. + float jvfcorr = -999.; + if(sumpttrk_PV + sumpttrk_nonPV > 0) { + jvfcorr = sumpttrk_PV / (sumpttrk_PV + ( sumpttrk_nonPV / (m_kcorrJVF * std::max(n_putracks, 1) ) ) ); + } else { + jvfcorr = -1; + } + jet->setAttribute(m_jvfname+"Corr",jvfcorr); + } + + return 0; } //********************************************************************** +ElementLink<xAOD::VertexContainer> JetVertexFractionTool:: +getMaxJetVertexFraction(const xAOD::VertexContainer* vertices, + const std::vector<float>& jvf) const { + size_t maxIndex = 0; + float maxVal = -100; + for ( size_t iVertex = 0; iVertex < jvf.size(); ++iVertex ) { + if ( jvf.at(iVertex) > maxVal ) { + maxIndex = iVertex; + maxVal = jvf.at(iVertex); + } + } + ElementLink<xAOD::VertexContainer> link = + ElementLink<xAOD::VertexContainer>(*vertices,vertices->at(maxIndex)->index()); + return link; +} + +//********************************************************************** + +std::pair<float,float> JetVertexFractionTool::getJetVertexTrackSums(const xAOD::Vertex* vertex, + const std::vector<const xAOD::TrackParticle*>& tracks, + const jet::TrackVertexAssociation* tva) const { + float sumTrackAll = 0; + float sumTracknotPV = 0; + bool notsel = m_htsel.empty(); + unsigned int nkeep = 0; + unsigned int nskip = 0; + for (size_t iTrack = 0; iTrack < tracks.size(); ++iTrack) { + const xAOD::TrackParticle* track = tracks.at(iTrack); + if ( notsel || m_htsel->keep(*track) ) { + sumTrackAll += track->pt(); + + const xAOD::Vertex* ptvtx = tva->associatedVertex(track); + if( ptvtx != nullptr ) { + // Track has vertex, assign to appropriate pT sum + if ( ptvtx->index() != vertex->index() ) {sumTracknotPV += track->pt(); } + } + ++nkeep; + } + else { ++nskip; } + } + ATH_MSG_VERBOSE("JetVertexTaggerTool " << name() + << ": nsel=" << nkeep + << ", nrej=" << nskip ); + + return std::make_pair(sumTrackAll,sumTracknotPV); + +} + + +//********************************************************************** + +int JetVertexFractionTool::getPileupTrackCount(const xAOD::Vertex* vertex, + const xAOD::TrackParticleContainer*& tracksCont, + const jet::TrackVertexAssociation* tva) const +{ + int n_pileuptrackcount = 0; + bool notsel = m_htsel.empty(); + unsigned int nkeep = 0; + unsigned int nskip = 0; + int tot_count = 0; + for(size_t iTrack = 0; iTrack < tracksCont->size(); ++iTrack) + { + const xAOD::TrackParticle * track = tracksCont->at(iTrack); + if ( notsel || m_htsel->keep(*track) ) { + const xAOD::Vertex* ptvtx = tva->associatedVertex(track); + // Count track as PU if associated with non-primary vertex and within pT cut. + // N.B. tracks with no vertex associated may be added to PV track sums, but not PU sums, nor the PU vertex counting. + if ( ptvtx != nullptr ) { + if ( (ptvtx->index() != vertex->index() ) && (track->pt() < m_PUtrkptcut) ) ++n_pileuptrackcount; + } + tot_count++; + ++nkeep; + } + else { ++nskip; } + } + const int n_pileuptracks = n_pileuptrackcount; + + ATH_MSG_VERBOSE("JetVertexFractionTool " << name() + << ": nsel=" << nkeep + << ", nrej=" << nskip + << ", total " << tracksCont->size() ); + ATH_MSG_VERBOSE("JetVertexFractionTool " << name() + << ": n_PUtracks=" << n_pileuptracks + << ", total=" << tot_count ); + + return n_pileuptracks; +} + +//********************************************************************** + +const xAOD::Vertex* JetVertexFractionTool::findHSVertex(const xAOD::VertexContainer*& vertices) const +{ + for ( size_t iVertex = 0; iVertex < vertices->size(); ++iVertex ) { + if(vertices->at(iVertex)->vertexType() == xAOD::VxType::PriVtx) { + + ATH_MSG_VERBOSE("JetVertexFractionTool " << name() << " Found HS vertex at index: "<< iVertex); + return vertices->at(iVertex); + } + } + ATH_MSG_VERBOSE("There is no vertex of type PriVx. Taking default vertex."); + return vertices->at(0); +} + +//********************************************************************** +// Legacy methods allowing direct computation of JVF +//********************************************************************** + + const std::vector<float> JetVertexFractionTool:: getJetVertexFraction(const xAOD::VertexContainer* vertices, const std::vector<const xAOD::TrackParticle*>& tracks, @@ -127,24 +311,3 @@ getJetVertexFraction(const xAOD::Vertex* vertex, << ", " << m_jvfname << "=" << jvf); return jvf; } - - -//********************************************************************** - -ElementLink<xAOD::VertexContainer> JetVertexFractionTool:: -getMaxJetVertexFraction(const xAOD::VertexContainer* vertices, - const std::vector<float>& jvf) const { - size_t maxIndex = 0; - float maxVal = -100; - for ( size_t iVertex = 0; iVertex < jvf.size(); ++iVertex ) { - if ( jvf.at(iVertex) > maxVal ) { - maxIndex = iVertex; - maxVal = jvf.at(iVertex); - } - } - ElementLink<xAOD::VertexContainer> link = - ElementLink<xAOD::VertexContainer>(*vertices,vertices->at(maxIndex)->index()); - return link; -} - -//********************************************************************** diff --git a/Reconstruction/Jet/JetMomentTools/Root/JetVertexTaggerTool.cxx b/Reconstruction/Jet/JetMomentTools/Root/JetVertexTaggerTool.cxx index 926e1d2a09d623668fd0db5007443d31c4ec2e20..8aec7bba28961c180b99569108aef6985a12be7b 100644 --- a/Reconstruction/Jet/JetMomentTools/Root/JetVertexTaggerTool.cxx +++ b/Reconstruction/Jet/JetMomentTools/Root/JetVertexTaggerTool.cxx @@ -19,26 +19,18 @@ using xAOD::JetFourMom_t; JetVertexTaggerTool::JetVertexTaggerTool(const std::string& name) : asg::AsgTool(name) -, m_verticesName("") -, m_assocTracksName("") -, m_tvaName("") -, m_tracksName("") , m_jvtlikelihoodHistName("") , m_jvtfileName("") , m_htsel("") { - declareProperty("VertexContainer",m_verticesName); - declareProperty("AssociatedTracks",m_assocTracksName); - declareProperty("TrackVertexAssociation",m_tvaName); - declareProperty("TrackParticleContainer",m_tracksName); + declareProperty("JVFCorrName", m_jvfCorrName="JVFCorr"); + declareProperty("SumPtTrkName", m_sumPtTrkName="SumPtTrkPt500"); + declareProperty("VertexContainer", m_verticesName="PrimaryVertices"); declareProperty("JVTFileName",m_jvtfileName = "JVTlikelihood_20140805.root"); declareProperty("JVTLikelihoodHistName",m_jvtlikelihoodHistName = "JVTRootCore_kNN100trim_pt20to50_Likelihood"); declareProperty("TrackSelector", m_htsel); declareProperty("JVTName", m_jvtName ="Jvt"); - declareProperty("K_JVFCorrScale",m_kcorrJVF = 0.01); - declareProperty("Z0Cut",m_z0cut = 3.); - declareProperty("PUTrkPtCut",m_PUtrkptcut = 30000.); } //********************************************************************** @@ -84,78 +76,30 @@ int JetVertexTaggerTool::modify(xAOD::JetContainer& jetCont) const { } ATH_MSG_DEBUG("Successfully retrieved VertexContainer from evtStore: " << m_verticesName); - // Get the Tracks container - const xAOD::TrackParticleContainer* tracksCont = NULL; - if ( evtStore()->retrieve(tracksCont,m_tracksName).isFailure() ) { - ATH_MSG_ERROR("Could not retrieve the TrackParticleContainer from evtStore: " << m_tracksName); - return 2; - } - ATH_MSG_DEBUG("Successfully retrieved TrackParticleContainer from evtStore: " << m_tracksName); - - // Get the TVA object - const jet::TrackVertexAssociation* tva = NULL; - if (evtStore()->retrieve(tva,m_tvaName).isFailure()) { - ATH_MSG_ERROR("Could not retrieve the TrackVertexAssociation from evtStore: " << m_tvaName); - return 3; - } - ATH_MSG_DEBUG("Successfully retrieved TrackVertexAssociation from evtStore: " << m_tvaName); if (vertices->size() == 0 ) { ATH_MSG_WARNING("There are no vertices in the container. Exiting"); - return 4; + return 2; } const xAOD::Vertex* HSvertex = findHSVertex(vertices); - // Count pileup tracks - currently done for each collection - const int n_putracks = getPileupTrackCount(HSvertex, tracksCont, tva); - for(xAOD::Jet * jet : jetCont) - { - - // Get the tracks associated to the jet - // Note that there may be no tracks - this is both normal and an error case - std::vector<const xAOD::TrackParticle*> tracks; - if ( ! jet->getAssociatedObjects(m_assocTracksName, tracks) ) { - ATH_MSG_WARNING("Associated tracks not found."); - } - - // Retrieve the Vertex associated to the jet. - - /* // For retrieving the origin from the jet - if( ! jet->getAssociatedObject<xAOD::Vertex>("OriginVertex", jetorigin) ) - { ATH_MSG_VERBOSE("Jet has no vertex associated. Using leading vertex" ); - jetorigin = vertices->at(0); - } - else - { - ATH_MSG_VERBOSE("Jet has associated vertex. Using this vertex, number: " << jetorigin->index() ); - } - */ - - // Get the track pTs sums associated to the primary (first key of pair) and PU (second key) vertices. - const std::pair<float,float> tracksums = getJetVertexTrackSums(HSvertex, tracks, tva); - + { // Calculate RpT and JVFCorr // Default JVFcorr to -1 when no tracks are associated. - float jvfcorr = -999.; - if(tracksums.first + tracksums.second > 0) { - jvfcorr = tracksums.first / (tracksums.first + ( tracksums.second / (m_kcorrJVF * std::max(n_putracks, 1) ) ) ); - } else { - jvfcorr = -1; - } - - const float rpt = tracksums.first/jet->pt(); + float jvfcorr = jet->getAttribute<float>(m_jvfCorrName); + std::vector<float> sumpttrkpt500 = jet->getAttribute<std::vector<float> >(m_sumPtTrkName); + const float rpt = sumpttrkpt500[HSvertex->index()]/jet->pt(); float jvt = evaluateJvt(rpt, jvfcorr); - - jet->setAttribute(m_jvtName+"Jvfcorr",jvfcorr); + jet->setAttribute(m_jvtName+"Rpt",rpt); jet->setAttribute(m_jvtName,jvt); - ATH_MSG_VERBOSE("JetVertexTaggerTool " << name() - << ": Primary trk pT=" << tracksums.first - << ", Pileup trk pT=" << tracksums.second - << ", Old JVF=" << tracksums.first/(tracksums.first+tracksums.second) ); + // ATH_MSG_VERBOSE("JetVertexTaggerTool " << name() + // << ": Primary trk pT=" << tracksums.first + // << ", Pileup trk pT=" << tracksums.second + // << ", Old JVF=" << tracksums.first/(tracksums.first+tracksums.second) ); ATH_MSG_VERBOSE("JetVertexTaggerTool " << name() << ": JVT=" << jvt @@ -188,7 +132,7 @@ float JetVertexTaggerTool::evaluateJvt(float rpt, float jvfcorr) const { //********************************************************************** float JetVertexTaggerTool::updateJvt(const xAOD::Jet& jet, std::string sjvt, std::string scale) const { - string sjvfcorr = sjvt + "Jvfcorr"; + string sjvfcorr = "JVFCorr"; string srpt = sjvt + "Rpt"; JetFourMom_t p4old = jet.jetP4(scale); float ptold = p4old.pt(); @@ -209,89 +153,6 @@ StatusCode JetVertexTaggerTool::finalize() { return StatusCode::SUCCESS; } -//********************************************************************** - -std::pair<float,float> JetVertexTaggerTool::getJetVertexTrackSums(const xAOD::Vertex* vertex, - const std::vector<const xAOD::TrackParticle*>& tracks, - const jet::TrackVertexAssociation* tva) const { - float sumTrackPV = 0; - float sumTracknotPV = 0; - bool notsel = m_htsel.empty(); - unsigned int nkeep = 0; - unsigned int nskip = 0; - for (size_t iTrack = 0; iTrack < tracks.size(); ++iTrack) { - const xAOD::TrackParticle* track = tracks.at(iTrack); - if ( notsel || m_htsel->keep(*track) ) { - const xAOD::Vertex* ptvtx = tva->associatedVertex(track); - - // Check track provenance - // if ( ptvtx == nullptr ) { - - // No track associated, check if z0 within cut. - // Now done upstream in TVA, comment inactive code. - // if( (fabs(track->z0()+track->vz()-vertex->z()) < m_z0cut) ) {sumTrackPV += track->pt(); } // if pass z0 cuts, assign track without vertex to PV track sum - // } - // else { - - // Previously tracks associated to no vertex were checked against z0 cuts, this is now done in the TVA tool - only consider tracks associated to a vertex. - if( ptvtx != nullptr ) { - // Track has vertex, assign to appropriate pT sum - if ( ptvtx->index() == vertex->index() ) { sumTrackPV += track->pt(); } - else {sumTracknotPV += track->pt(); } - } - ++nkeep; - } - else { ++nskip; } - } - ATH_MSG_VERBOSE("JetVertexTaggerTool " << name() - << ": nsel=" << nkeep - << ", nrej=" << nskip ); - - return std::make_pair(sumTrackPV,sumTracknotPV); - -} - -//********************************************************************** - -int JetVertexTaggerTool::getPileupTrackCount(const xAOD::Vertex* vertex, - const xAOD::TrackParticleContainer*& tracksCont, - const jet::TrackVertexAssociation* tva) const -{ - int n_pileuptrackcount = 0; - bool notsel = m_htsel.empty(); - unsigned int nkeep = 0; - unsigned int nskip = 0; - int tot_count = 0; - for(size_t iTrack = 0; iTrack < tracksCont->size(); ++iTrack) - { - const xAOD::TrackParticle * track = tracksCont->at(iTrack); - if ( notsel || m_htsel->keep(*track) ) { - const xAOD::Vertex* ptvtx = tva->associatedVertex(track); - // Count track as PU if associated with non-primary vertex and within pT cut. - // N.B. tracks with no vertex associated may be added to PV track sums, but not PU sums, nor the PU vertex counting. - if ( ptvtx != nullptr ) { - if ( (ptvtx->index() != vertex->index() ) && (track->pt() < m_PUtrkptcut) ) ++n_pileuptrackcount; - } - tot_count++; - ++nkeep; - } - else { ++nskip; } - } - const int n_pileuptracks = n_pileuptrackcount; - - ATH_MSG_VERBOSE("JetVertexTaggerTool " << name() - << ": nsel=" << nkeep - << ", nrej=" << nskip - << ", total " << tracksCont->size() ); - ATH_MSG_VERBOSE("JetVertexTaggerTool " << name() - << ": n_PUtracks=" << n_pileuptracks - << ", total=" << tot_count ); - - return n_pileuptracks; -} - -//********************************************************************** - const xAOD::Vertex* JetVertexTaggerTool::findHSVertex(const xAOD::VertexContainer*& vertices) const { for ( size_t iVertex = 0; iVertex < vertices->size(); ++iVertex ) { diff --git a/Reconstruction/Jet/JetMonitoring/Root/JetAttributeHisto.cxx b/Reconstruction/Jet/JetMonitoring/Root/JetAttributeHisto.cxx index 4806f95659d14779f127c8210887e27a09392bd5..dd814c949262e25b2f6cc92aec1d28ee12115271 100644 --- a/Reconstruction/Jet/JetMonitoring/Root/JetAttributeHisto.cxx +++ b/Reconstruction/Jet/JetMonitoring/Root/JetAttributeHisto.cxx @@ -121,13 +121,14 @@ namespace jet { Int=1, Float=2, VectFloat=3, + VectInt=4, Float_Float=22, Float_VectFloat=23, VectFloat_Float=32, }; static Supported fromString(const std::string &n){ - static std::map< std::string , Supported > m( { {"int",Int}, {"float",Float}, {"vector<float>",VectFloat} } ); + static std::map< std::string , Supported > m( { {"int",Int}, {"float",Float}, {"vector<float>",VectFloat}, {"vector<int>",VectInt}, } ); if ( m.find( n ) != m.end() ) return m[n]; return Unknown; } @@ -223,6 +224,17 @@ int JetAttributeHisto::buildHistos(){ ); } break; + case AttTypes::VectInt : + { + if(m_selectedIndex==-1) + m_histoFiller = new VecAttFiller<int>(m_attNames[0], + bookHisto( m_histoDef->buildTH1F() ), gev1 ); + else + m_histoFiller = new VecAttIndexFiller<int>(m_attNames[0], + bookHisto( m_histoDef->buildTH1F() ) , m_selectedIndex , gev1 + ); + } + break; default: { ATH_MSG_ERROR("Do not support attribute type "<< m_attTypes[0] << " "<< typ); diff --git a/Reconstruction/Jet/JetMonitoring/doc/mainpage.h b/Reconstruction/Jet/JetMonitoring/doc/mainpage.h deleted file mode 100644 index 0c8ae97e2353ba947c1170fb4f59c5f97b45d1e6..0000000000000000000000000000000000000000 --- a/Reconstruction/Jet/JetMonitoring/doc/mainpage.h +++ /dev/null @@ -1,21 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - -@mainpage JetMonitoring - -@author P.A. Delsart (delsart at lapp.in2p3 dot fr) - -@section Content - -JetMonitoring contains jet tools (deriving from JetAlgToolBase) c++ classes dedicated to jet monitoring. - -See also JetRec package - -@htmlinclude used_packages.html - -@include requirements - -*/ diff --git a/Reconstruction/Jet/JetMonitoring/python/JetHistoTools.py b/Reconstruction/Jet/JetMonitoring/python/JetHistoTools.py index af61ac177a44d870c62ec8b322909f1b5060b20b..c6cdfbd8e954678eb43d8ee81cd0400883a781b5 100644 --- a/Reconstruction/Jet/JetMonitoring/python/JetHistoTools.py +++ b/Reconstruction/Jet/JetMonitoring/python/JetHistoTools.py @@ -104,12 +104,20 @@ compactSpecification = { "LArQuality" : (("LAr quality;Energy;", 50, -0.4, 1.2), ("LArQuality", "float") ), "GhostTruthCount" : (("Number of associate truth part;Number;", 60,0,60) , ("GhostTruthCount", "int")), + "GhostTruthAssociationFraction" : (("Fraction of associated truth particles from a matched truth jet jet;GhostTruthAssociationFraction;", 50,0,1.) , ("GhostTruthAssociationFraction", "float")), "GhostTrackCount" : (("Number of associate tracks;Number;", 60,0,60), ("GhostTrackCount", "int") ), - "JVF" : (("Jet Vertex Fraction;JVF;", 60,0,1.), ("JVF", "vector<float>") ), - "JVF[0]" : (("Jet Vertex Fraction;JVF;", 60,0,1.), ("JVF[0]", "vector<float>") ), - "SumPtTrkPt1000" : (("Sum Pt of all tracks above 1GeV:SumPt;", 100,0,200), ("SumPtTrkPt1000", "vector<float>", "gev") ), - - "SumPtTrkPt1000[0]": (("Sum Pt of tracks from PV0 above 1GeV:SumPt;", 100,0,200), ("SumPtTrkPt1000[0]", "vector<float>", "gev") ), + "GhostMuonSegmentCount" : (("Number of associated muon segments;Number;", 60,0,60), ("GhostMuonSegmentCount", "int") ), + "JVF" : (("Jet Vertex Fraction;JVF;", 60,0,1.2), ("JVF", "vector<float>") ), + "JVF[0]" : (("Jet Vertex Fraction;JVF;", 60,0,1.2), ("JVF[0]", "vector<float>") ), + 'JVFCorr' : (("Jet JVT JVFCorr;;", 120, -1.2, 1.2) , ("JVFCorr","float" ) ), + 'Jvt' : (("Jet JVT;;", 70, -0.2, 1.2) , ("Jvt","float" ) ), + 'JvtRpt' : (("Jet JVT Rpt;;", 75, 0, 1.5) , ("JvtRpt","float" ) ), + + "SumPtTrkPt500" : (("Sum Pt of all tracks above 0.5 GeV:SumPt(p_{T}>0.5 GeV);", 100,0,200), ("SumPtTrkPt500", "vector<float>", "gev") ), + "SumPtTrkPt500[0]" : (("Sum Pt of tracks from PV0 above 0.5 GeV:SumPt(p_{T}>0.5 GeV);", 100,0,200), ("SumPtTrkPt500[0]", "vector<float>", "gev") ), + "NumTrkPt500[0]" : (("Number of tracks from PV0 above 0.5 GeV:N_{tracks}(p_{T}>0.5 GeV);", 100,0,100), ("NumTrkPt500[0]", "vector<int>") ), + "NumTrkPt1000[0]" : (("Number of all tracks above 1 GeV:N_{tracks}(p_{T}>1 GeV);", 100,0,100), ("NumTrkPt1000[0]", "vector<int>") ), + "TrackWidthPt1000[0]": (("Width from tracks from PV0 above 1 GeV:Track Width(p_{T}>1 GeV);", 75,0.,1.5), ("TrackWidthPt1000[0]", "vector<float>") ), "ActiveArea" : (("Active Area;Area;", 80, 0, 0.8), ("ActiveArea", "float") ), "ActiveArea15" : (("Active Area;Area;", 80, 0, 1.5), ("ActiveArea", "float") ), @@ -136,7 +144,8 @@ compactSpecification = { # binning optimisation from Emma Tolley #"LeadingClusterSecondR": (("LeadingClusterSecondR; LeadingClusterSecondR;",100,0.,1000.), ("LeadingClusterSecondR", "float") ), "LeadingClusterSecondR": (("LeadingClusterSecondR; LeadingClusterSecondR;",100,0.,100000.), ("LeadingClusterSecondR", "float") ), - "CHF": (("SumPtTrkPt1000/pT; SumPtTrkPt1000/pT;",50,-1.,1.2), ("chf", "vector<float>", "gev") ), + #"CHF": (("SumPtTrkPt500/pT; SumPtTrkPt500/pT;",50,-1.,1.2), ("chf", "vector<float>", "gev") ), + #"CHF[0]": (("SumPtTrkPt500/pT; SumPtTrkPt500/pT;",50,-1.,1.2), ("chf[0]", "vector<float>", "gev") ), #CBG # diff --git a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringHistos.py b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringHistos.py index aa6cdcded31b7b415a313c7b54af0516bf891e1d..73323a8781f1f6fb0c8edb7b5a378338f0e589b3 100644 --- a/Reconstruction/Jet/JetMonitoring/python/JetMonitoringHistos.py +++ b/Reconstruction/Jet/JetMonitoring/python/JetMonitoringHistos.py @@ -28,10 +28,10 @@ def commonMonitoringTool(container, refcontainer="", pathSuffix=''): # Draw a set of histo for a particular jet selection : selectionAndHistos( "leadingjet" , [ "basickinematics", ] ), selectionAndHistos( "subleadingjet" , [ "basickinematics"] ), - selectionAndHistos( "20000<pt<500000" , [ "allkinematics", "ptN", "Timing", "EMFrac", "HECFrac", "LArQuality", "AverageLArQF", "N90Constituents", "SumPtTrkPt1000[0]", "FracSamplingMax"], "highpt_20_500" ), - selectionAndHistos( "500000<pt<1000000" , [ "allkinematics", "ptN", "Timing", "EMFrac", "HECFrac", "LArQuality", "AverageLArQF", "N90Constituents", "SumPtTrkPt1000[0]", "FracSamplingMax"], "highpt_500_1000" ), - selectionAndHistos( "1000000<pt<2000000" , [ "allkinematics", "ptN", "Timing", "EMFrac", "HECFrac", "LArQuality", "AverageLArQF", "N90Constituents", "SumPtTrkPt1000[0]", "FracSamplingMax"], "highpt_1000_2000" ), - selectionAndHistos( "2000000<pt<8000000" , [ "allkinematics", "ptN", "Timing", "EMFrac", "HECFrac", "LArQuality", "AverageLArQF", "N90Constituents", "SumPtTrkPt1000[0]", "FracSamplingMax"], "highpt_2000_8000" ), + selectionAndHistos( "20000<pt<500000" , [ "allkinematics", "ptN", "Timing", "EMFrac", "HECFrac", "LArQuality", "AverageLArQF", "N90Constituents", "SumPtTrkPt500[0]", "FracSamplingMax"], "highpt_20_500" ), + selectionAndHistos( "500000<pt<1000000" , [ "allkinematics", "ptN", "Timing", "EMFrac", "HECFrac", "LArQuality", "AverageLArQF", "N90Constituents", "SumPtTrkPt500[0]", "FracSamplingMax"], "highpt_500_1000" ), + selectionAndHistos( "1000000<pt<2000000" , [ "allkinematics", "ptN", "Timing", "EMFrac", "HECFrac", "LArQuality", "AverageLArQF", "N90Constituents", "SumPtTrkPt500[0]", "FracSamplingMax"], "highpt_1000_2000" ), + selectionAndHistos( "2000000<pt<8000000" , [ "allkinematics", "ptN", "Timing", "EMFrac", "HECFrac", "LArQuality", "AverageLArQF", "N90Constituents", "SumPtTrkPt500[0]", "FracSamplingMax"], "highpt_2000_8000" ), selectionAndHistos( "LooseBadJets" , [ "ptN", "Timing", "EMFrac", "HECFrac", "LArQuality", JetKinematicHistos("kinematics",PlotOccupancy=True, PlotAveragePt=True, PlotAverageE=True, PlotNJet=True)]), selectionAndHistos( "1.0<eta<1.4" , [ "ptN", "Timing", "EMFrac", "HECFrac", "LArQuality", JetKinematicHistos("kinematicsTileGap",PlotOccupancy=True, PlotAveragePt=True, PlotAverageE=True, PlotNJet=True)], "eta_1_14" ), @@ -101,9 +101,12 @@ def commonMonitoringTool(container, refcontainer="", pathSuffix=''): filler.HistoTools += [ # track variables jhm.tool("JVF[0]"), - jhm.SumPtTrkPt1000, + jhm.SumPtTrkPt500, + jhm.tool("SumPtTrkPt500[0]"), + jhm.tool("NumTrkPt500[0]"), + jhm.tool("NumTrkPt1000[0]"), + jhm.tool("TrackWidthPt1000[0]"), jhm.GhostTrackCount, - jhm.CHF, ] diff --git a/Reconstruction/Jet/JetRec/Root/JetFromPseudojet.cxx b/Reconstruction/Jet/JetRec/Root/JetFromPseudojet.cxx index b6d062e623eb723db87ee55dbef5eb86f8456ae6..6e3d9036b9710590eeaa93eca7d5ffe464bc0a67 100644 --- a/Reconstruction/Jet/JetRec/Root/JetFromPseudojet.cxx +++ b/Reconstruction/Jet/JetRec/Root/JetFromPseudojet.cxx @@ -213,14 +213,14 @@ JetFromPseudojet::addjet(const PseudoJet& pj, xAOD::JetContainer& jets, const PseudoJetVector pjcons = pj.constituents(); ATH_MSG_VERBOSE(" Adding constituents: multiplicity is " << pjcons.size()); JetConstituentFiller confiller; - int nconskip = confiller.extractConstituents(*pjet, pghostlabs, &pj); - if ( nconskip < 0 ) { - ATH_MSG_WARNING(" Jet constituent filler returned error " << nconskip); - } - ATH_MSG_DEBUG(" Real/total/skipped constituents: " << pjet->numConstituents() - << "/" << pjcons.size() << "/" << nconskip); if ( pparent == 0 ) { ATH_MSG_VERBOSE(" No parent jet."); + int nconskip = confiller.extractConstituents(*pjet, pghostlabs, &pj); + if ( nconskip < 0 ) { + ATH_MSG_WARNING(" Jet constituent filler returned error " << nconskip); + } + ATH_MSG_DEBUG(" Real/total/skipped constituents: " << pjet->numConstituents() + << "/" << pjcons.size() << "/" << nconskip); } else { ATH_MSG_VERBOSE(" Adding parent jet properties"); const JetContainer* pcon = dynamic_cast<const JetContainer*>(pparent->container()); @@ -245,9 +245,15 @@ JetFromPseudojet::addjet(const PseudoJet& pj, xAOD::JetContainer& jets, ATH_MSG_VERBOSE(" Setting ghost area from parent."); pjet->setAttribute("JetGhostArea", pparent->getAttribute<float>("JetGhostArea")); + int nconskip = confiller.extractConstituents(*pjet, pghostlabs, &pj); + if ( nconskip < 0 ) { + ATH_MSG_WARNING(" Jet constituent filler returned error " << nconskip); + } + ATH_MSG_DEBUG(" Real/total/skipped constituents: " << pjet->numConstituents() + << "/" << pjcons.size() << "/" << nconskip); + ATH_MSG_VERBOSE(" Setting EM scale momentum."); - buildAndSetEMScaleMom(pjet, inputtype ); - + buildAndSetEMScaleMom(pjet, inputtype ); } ATH_MSG_VERBOSE("Done add with parent"); return pjet; diff --git a/Reconstruction/Jet/JetRec/Root/JetModifiedMassDrop.cxx b/Reconstruction/Jet/JetRec/Root/JetModifiedMassDrop.cxx index 3d24308fb49a7f643462d43a12879c699a9355a7..70408bb527b15ab5a8cffd577770592791ad3041 100644 --- a/Reconstruction/Jet/JetRec/Root/JetModifiedMassDrop.cxx +++ b/Reconstruction/Jet/JetRec/Root/JetModifiedMassDrop.cxx @@ -45,21 +45,23 @@ JetModifiedMassDrop::~JetModifiedMassDrop() { StatusCode JetModifiedMassDrop::initialize() { if ( m_zcut < 0.0 || m_zcut > 10.0 ) { - ATH_MSG_WARNING("Invalid value for ZCut " << m_zcut); + ATH_MSG_ERROR("Invalid value for ZCut " << m_zcut); + return StatusCode::FAILURE; } if ( m_mu < 0.0 ) { - ATH_MSG_WARNING("Invalid value for MassDrop " << m_mu); + ATH_MSG_ERROR("Invalid value for MassDrop " << m_mu); } if ( m_sym != y && m_sym != scalar_z && m_sym != vector_z ) { - ATH_MSG_WARNING("Invalid value for SymmetryMeasure " << m_sym); + ATH_MSG_ERROR("Invalid value for SymmetryMeasure " << m_sym); return StatusCode::FAILURE; } if ( m_recursion != larger_pt && m_recursion != larger_mt && m_recursion != larger_m ) { - ATH_MSG_WARNING("Invalid value for RecursionChoice " << m_recursion); + ATH_MSG_ERROR("Invalid value for RecursionChoice " << m_recursion); return StatusCode::FAILURE; } if ( m_bld.empty() ) { ATH_MSG_ERROR("Unable to retrieve jet builder."); + return StatusCode::FAILURE; } return StatusCode::SUCCESS; diff --git a/Reconstruction/Jet/JetRec/Root/JetPruner.cxx b/Reconstruction/Jet/JetRec/Root/JetPruner.cxx index 8807c46bd71b55f6f7c502982af3a43ed7758cb6..f28dc28470bfc4093355c80427fa39326065b4aa 100644 --- a/Reconstruction/Jet/JetRec/Root/JetPruner.cxx +++ b/Reconstruction/Jet/JetRec/Root/JetPruner.cxx @@ -43,13 +43,16 @@ StatusCode JetPruner::initialize() { return StatusCode::FAILURE; } if ( m_rcut < 0.0 || m_rcut > 10.0 ) { - ATH_MSG_WARNING("Invalid value for RCut " << m_rcut); + ATH_MSG_ERROR("Invalid value for RCut " << m_rcut); + return StatusCode::FAILURE; } if ( m_zcut < 0.0 || m_zcut > 1.0 ) { - ATH_MSG_WARNING("Invalid value for ZCut " << m_zcut); + ATH_MSG_ERROR("Invalid value for ZCut " << m_zcut); + return StatusCode::FAILURE; } if ( m_bld.empty() ) { ATH_MSG_ERROR("Unable to retrieve jet builder."); + return StatusCode::FAILURE; } return StatusCode::SUCCESS; } diff --git a/Reconstruction/Jet/JetRec/Root/JetSoftDrop.cxx b/Reconstruction/Jet/JetRec/Root/JetSoftDrop.cxx index 5e9d9648f41e4b3f6ae683a2e101b8a6f85788c2..cd0e4d15627471256f7beaa44ba6042b6ff0f569 100644 --- a/Reconstruction/Jet/JetRec/Root/JetSoftDrop.cxx +++ b/Reconstruction/Jet/JetRec/Root/JetSoftDrop.cxx @@ -37,13 +37,16 @@ JetSoftDrop::~JetSoftDrop() { StatusCode JetSoftDrop::initialize() { if ( m_zcut < 0.0 || m_zcut > 10.0 ) { - ATH_MSG_WARNING("Invalid value for ZCut " << m_zcut); + ATH_MSG_ERROR("Invalid value for ZCut " << m_zcut); + return StatusCode::FAILURE; } if ( m_beta < 0.0 || m_beta > 10.0 ) { - ATH_MSG_WARNING("Invalid value for Beta " << m_beta); + ATH_MSG_ERROR("Invalid value for Beta " << m_beta); + return StatusCode::FAILURE; } if ( m_bld.empty() ) { ATH_MSG_ERROR("Unable to retrieve jet builder."); + return StatusCode::FAILURE; } return StatusCode::SUCCESS; } diff --git a/Reconstruction/Jet/JetRec/Root/JetSplitter.cxx b/Reconstruction/Jet/JetRec/Root/JetSplitter.cxx index d94b10c21bf8de1b2f49a36464723b7db70c2162..6c50b06b6ec3dd6e7ce3c2880ffe0e9c885b7b51 100644 --- a/Reconstruction/Jet/JetRec/Root/JetSplitter.cxx +++ b/Reconstruction/Jet/JetRec/Root/JetSplitter.cxx @@ -48,13 +48,16 @@ JetSplitter::~JetSplitter() { StatusCode JetSplitter::initialize() { if ( m_mumax < 0.0 || m_mumax > 1.0 ) { - ATH_MSG_WARNING("Invalid value for MuMax: " << m_mumax); + ATH_MSG_ERROR("Invalid value for MuMax: " << m_mumax); + return StatusCode::FAILURE; } if ( m_mumax < 0.0 || m_mumax > 1.0 ) { - ATH_MSG_WARNING("Invalid value for YMin: " << m_ymin); + ATH_MSG_ERROR("Invalid value for YMin: " << m_ymin); + return StatusCode::FAILURE; } if ( m_bld.empty() ) { ATH_MSG_ERROR("Unable to retrieve jet builder."); + return StatusCode::FAILURE; } return StatusCode::SUCCESS; } diff --git a/Reconstruction/Jet/JetRec/Root/JetTrimmer.cxx b/Reconstruction/Jet/JetRec/Root/JetTrimmer.cxx index b80d8dd2ee98c3f449d39a434f50561bb581dc7b..8fe47168201ea841287f2f87a2b014a67f00f085 100644 --- a/Reconstruction/Jet/JetRec/Root/JetTrimmer.cxx +++ b/Reconstruction/Jet/JetRec/Root/JetTrimmer.cxx @@ -34,13 +34,16 @@ JetTrimmer::~JetTrimmer() { StatusCode JetTrimmer::initialize() { if ( m_rclus < 0.0 || m_rclus > 10.0 ) { - ATH_MSG_WARNING("Invalid value for RClus " << m_rclus); + ATH_MSG_ERROR("Invalid value for RClus " << m_rclus); + return StatusCode::FAILURE; } if ( m_ptfrac < 0.0 || m_ptfrac > 1.0 ) { - ATH_MSG_WARNING("Invalid value for PtFrac " << m_ptfrac); + ATH_MSG_ERROR("Invalid value for PtFrac " << m_ptfrac); + return StatusCode::FAILURE; } if ( m_bld.empty() ) { ATH_MSG_ERROR("Unable to retrieve jet builder."); + return StatusCode::FAILURE; } return StatusCode::SUCCESS; } diff --git a/Reconstruction/Jet/JetRec/doc/mainpage.h b/Reconstruction/Jet/JetRec/doc/mainpage.h deleted file mode 100644 index 44c70d1921ee21af72d8aea3eb1ceaec4bfab7be..0000000000000000000000000000000000000000 --- a/Reconstruction/Jet/JetRec/doc/mainpage.h +++ /dev/null @@ -1,29 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - -@mainpage JetRec - -@author D. Adams and P.A. Delsart - -@section Content - -Package JetRec (updated for run 2) contains the high-level tools used in jet reconstruction. -These are dual-use tools so that reconstruction can be run in either Athena or Root. -A top-level Athena algorithm is also provided. - -@section Main classes - - JetAlgorithm : This Athena algorithm runs a series of JetRec tools. - - JetRecTool : Each jet collection is produced by a dedicated JetRec tool (i.e. instance of JetRecTool). - - PseudoJetGetter : Inputs for jet finding, in the form of vectors of fastjet pseudojets, are accessed -and constructed with tools of this type. - - JetFromPseudojet: This tool constructs an ATLAS jet collection from a vector of fastjet pseudojets. - - JetFinder : This tool uses fastjet to find jets using an input list of pseudojets. - -@htmlinclude used_packages.html - -@include requirements - -*/ diff --git a/Reconstruction/Jet/JetRec/python/DefaultTools.py b/Reconstruction/Jet/JetRec/python/DefaultTools.py index 0466a050f1c6f4be388daedf8539ba5c01ed565d..b66bd49c020a2ba0b664bdaaec0809a0e1cdbeb6 100644 --- a/Reconstruction/Jet/JetRec/python/DefaultTools.py +++ b/Reconstruction/Jet/JetRec/python/DefaultTools.py @@ -27,7 +27,7 @@ def declareDefaultTools(): labs = [] if jetFlags.useTracks(): labs += ["Track"] - labs += ["AntiKt3TrackJet", "AntiKt3TrackJet"] + labs += ["AntiKt2TrackJet", "AntiKt2TrackJet"] if jetFlags.useMuonSegments(): labs += ["MuonSegment",] if jetFlags.useTruth(): diff --git a/Reconstruction/Jet/JetRec/python/JetRecCalibrationFinder.py b/Reconstruction/Jet/JetRec/python/JetRecCalibrationFinder.py index 8d6319173e42fb386030dd379848cd2ed6aeb23c..63c4893df030278465ac4c1d9086d6d294d2c13c 100644 --- a/Reconstruction/Jet/JetRec/python/JetRecCalibrationFinder.py +++ b/Reconstruction/Jet/JetRec/python/JetRecCalibrationFinder.py @@ -51,7 +51,7 @@ class JetRecCalibrationFinder: "triggerNoPileup" : "JES_Full2012dataset_Preliminary_Trigger_NoPileup.config", "trigger2016" : "JES_MC15cRecommendation_May2016_Trigger.config", "triggerTrim" : "JES_MC15recommendation_FatJet_June2015.config", - "pflow" : "JES_MC15cRecommendation_PFlow_Aug2016.config" + "pflow" : "JES_MC15cRecommendation_PFlow_Aug2016_rel21.config" } def find(self, alg, rad, inpin, seq, configkeyin, evsprefix): @@ -117,9 +117,7 @@ class JetRecCalibrationFinder: evskey = evsprefix + evssuf jetlog.info( myname + " Event shape key: " + evskey ) # ...create the tool. - setDetEtaPhi = (configkey != "reco") # Temporary setting to avoid clash with modifiers that set detector eta - jtm += JetCalibrationTool(tname, JetCollection=jetdefn, ConfigFile=configfile, CalibSequence=fullseq, RhoKey=evskey, - DoSetDetectorEta=setDetEtaPhi) + jtm += JetCalibrationTool(tname, JetCollection=jetdefn, ConfigFile=configfile, CalibSequence=fullseq, RhoKey=evskey) return jtm.tools[tname] diff --git a/Reconstruction/Jet/JetRec/python/JetRecFlags.py b/Reconstruction/Jet/JetRec/python/JetRecFlags.py index 00e00d5b8b643db47c75f5487a6ffd672cc57940..8b43fcea27d23d1e4364499820462088375df684 100644 --- a/Reconstruction/Jet/JetRec/python/JetRecFlags.py +++ b/Reconstruction/Jet/JetRec/python/JetRecFlags.py @@ -209,6 +209,26 @@ class useTrackVertexTool(JobProperty): allowedTypes = ['bool'] StoredValue = False +class JetContentDetail: + Reduced=1 + Full=2 + Validation=3 + +class detailLevel(JobProperty): + """ Toggles detail level for AOD jet reconstruction + 1. Reduced: This will disable the building of jet containers other than: + AntiKt4EMTopoJets, AntiKt4EMPFlowJets, AntiKt4LCTopoJets + 2. Full: This corresponds to the r21 default prior to AOD size reduction: + AntiKt10LCTopoJets, AntiKt2PV0TrackJets, AntiKt4PV0TrackJets, + AntiKt4TruthJets, AntiKt4TruthWZJets, AntiKt10TruthJets, AntiKt10TruthWZJets + 3. Validation: This adds to the Full content the building of jet containers: + AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets + with substructure moments included + """ + statusOn = True + allowedTypes = ['int'] + StoredValue = JetContentDetail.Full + jobproperties.add_Container(JetRecFlags) @@ -236,5 +256,6 @@ jobproperties.JetRecFlags.add_JobProperty(separateJetAlgs) jobproperties.JetRecFlags.add_JobProperty(timeJetToolRunner) jobproperties.JetRecFlags.add_JobProperty(timeJetRecTool) jobproperties.JetRecFlags.add_JobProperty(useTrackVertexTool) +jobproperties.JetRecFlags.add_JobProperty(detailLevel) jetFlags = jobproperties.JetRecFlags diff --git a/Reconstruction/Jet/JetRec/python/JetRecStandardToolManager.py b/Reconstruction/Jet/JetRec/python/JetRecStandardToolManager.py index aaf1ec63adc7b80f7f02f6c919c6df2096e9ccc5..9340fc456d1784d3c61e74839899dcaae6443968 100644 --- a/Reconstruction/Jet/JetRec/python/JetRecStandardToolManager.py +++ b/Reconstruction/Jet/JetRec/python/JetRecStandardToolManager.py @@ -25,7 +25,7 @@ jetlog.info( myname + "Defining standard tools" ) # Set and lock flags. ######################################################### -from JetRec.JetRecFlags import jetFlags +from JetRec.JetRecFlags import jetFlags, JetContentDetail # Set status on for flags that are initialized with status off. jetFlags.useTruth.set_On() @@ -83,6 +83,24 @@ if 0: raise Exception from traceback import print_stack print_stack() + +# Function to filter out skipped tools. +def filterout(skiptoolnames, tools): + outtools = [] + remtoolnames = [] + nrem = 0 + for tool in tools: + keep = True + for toolname in skiptoolnames: + skiptool = jtm[toolname] + same = tool == skiptool + if same: + keep = False + remtoolnames += [toolname] + if keep: + outtools += [tool] + jetlog.info( myname + "Removed tools: " + str(remtoolnames) ) + return outtools ######################################################### # Getters @@ -166,6 +184,11 @@ if jetFlags.useTruth(): jtm.gettersMap["truth"] = list(truthgetters) jtm.gettersMap["truthwz"] = list(truthwzgetters) +jtm.gettersMap["emtopo_reduced"] = filterout(["gakt2trackget","gakt4trackget"],emgetters) +jtm.gettersMap["lctopo_reduced"] = filterout(["gakt2trackget","gakt4trackget"],lcgetters) +jtm.gettersMap["empflow_reduced"] = filterout(["gakt2trackget","gakt4trackget"],empfgetters) + + ######################################################### # Modifiers ######################################################### @@ -201,10 +224,10 @@ ungroomed_modifiers += [jtm.ecpsfrac] if jetFlags.useCaloQualityTool(): ungroomed_modifiers += [jtm.caloqual_cluster] if jetFlags.useTracks(): - ungroomed_modifiers += [jtm.jvf] - ungroomed_modifiers += [jtm.jvt] ungroomed_modifiers += [jtm.trkmoms] ungroomed_modifiers += [jtm.trksummoms] + ungroomed_modifiers += [jtm.jvf] + ungroomed_modifiers += [jtm.jvt] ungroomed_modifiers += [jtm.charge] ungroomed_modifiers += ["trackassoc"] ungroomed_modifiers += [jtm.jetorigin_setpv] @@ -213,37 +236,27 @@ if jetFlags.useTruth(): if jtm.haveParticleJetTools: ungroomed_modifiers += [jtm.jetdrlabeler] +#if jetFlags.detailLevel>=JetContentDetail.Validation: +# ungroomed_modifiers += [jtm.jvt] + # Modifiers for groomed jets. -groomed_modifiers = [ jtm.jetsorter, - jtm.jetisol, - jtm.ktdr, - jtm.nsubjettiness, - jtm.ktsplitter, - jtm.angularity, - jtm.dipolarity, - jtm.planarflow, - jtm.ktmassdrop, - jtm.encorr, - jtm.comshapes - ] - -# Function to filter out skipped tools. -def filterout(skiptoolnames, tools): - outtools = [] - remtoolnames = [] - nrem = 0 - for tool in tools: - keep = True - for toolname in skiptoolnames: - skiptool = jtm[toolname] - same = tool == skiptool - if same: - keep = False - remtoolnames += [toolname] - if keep: - outtools += [tool] - jetlog.info( myname + "Removed tools: " + str(remtoolnames) ) - return outtools +groomed_modifiers = [ + jtm.jetsorter, + jtm.nsubjettiness, + jtm.ktdr, + jtm.ktsplitter, + jtm.encorr, + jtm.charge, + jtm.angularity, + jtm.comshapes, + jtm.ktmassdrop, + jtm.dipolarity, + jtm.pull, + jtm.planarflow, + jtm.width, + jtm.qw, + jtm.trksummoms + ] # Modifiers for pflow jets. # Same as topo jets. @@ -252,6 +265,10 @@ pflow_ungroomed_modifiers = [] pflow_ungroomed_modifiers += [jtm.constitfourmom_pflow] pflow_ungroomed_modifiers += filterout(["ecpsfrac"], ungroomed_modifiers) +pflow_groomed_modifiers = [] +pflow_groomed_modifiers += [jtm.constitfourmom_pflow] +pflow_groomed_modifiers += groomed_modifiers + # Here add tools to be run for topo jets and NOT for pflow. # Cluster moments. @@ -270,11 +287,29 @@ emtopo_ungroomed_modifiers = [] emtopo_ungroomed_modifiers += [jtm.constitfourmom_emtopo] emtopo_ungroomed_modifiers += ungroomed_modifiers +emtopo_groomed_modifiers = [] +emtopo_groomed_modifiers += [jtm.constitfourmom_emtopo] +emtopo_groomed_modifiers += groomed_modifiers + # LC-only modifiers here lctopo_ungroomed_modifiers = [] lctopo_ungroomed_modifiers += [jtm.constitfourmom_lctopo] lctopo_ungroomed_modifiers += ungroomed_modifiers +lctopo_groomed_modifiers = [] +lctopo_groomed_modifiers += [jtm.constitfourmom_lctopo] +lctopo_groomed_modifiers += groomed_modifiers + + + +### XAOD SIZE REDUCTION +# define a reduced set for AOD size reduction +pflow_reduced_modifiers = [jtm.constitfourmom_pflow, jtm.jetens, "calib", jtm.jetsorter] +emtopo_reduced_modifiers = [jtm.constitfourmom_emtopo, jtm.jetens, "calib", jtm.jetsorter] +lctopo_reduced_modifiers = [jtm.constitfourmom_lctopo, jtm.jetens, "calib", jtm.jetsorter] + + + # Filter out skipped tools. if len(jetFlags.skipTools()): jetlog.info( myname + "Tools to be skipped: " + str(jetFlags.skipTools()) ) @@ -286,19 +321,30 @@ if len(jetFlags.skipTools()): pflow_ungroomed_modifiers = filterout(jetFlags.skipTools(), pflow_ungroomed_modifiers) emtopo_ungroomed_modifiers = filterout(jetFlags.skipTools(), emtopo_ungroomed_modifiers) lctopo_ungroomed_modifiers = filterout(jetFlags.skipTools(), lctopo_ungroomed_modifiers) + pflow_groomed_modifiers = filterout(jetFlags.skipTools(), pflow_groomed_modifiers) + emtopo_groomed_modifiers = filterout(jetFlags.skipTools(), emtopo_groomed_modifiers) + lctopo_groomed_modifiers = filterout(jetFlags.skipTools(), lctopo_groomed_modifiers) # Add modifier lists to jtm indexed by modifier type name. jtm.modifiersMap["none"] = [] jtm.modifiersMap["ungroomed"] = list(ungroomed_modifiers) +jtm.modifiersMap["groomed"] = list(groomed_modifiers) jtm.modifiersMap["emtopo_ungroomed"] = list(emtopo_ungroomed_modifiers) jtm.modifiersMap["lctopo_ungroomed"] = list(lctopo_ungroomed_modifiers) jtm.modifiersMap["pflow_ungroomed"] = list(pflow_ungroomed_modifiers) +jtm.modifiersMap["emtopo_groomed"] = list(emtopo_groomed_modifiers) +jtm.modifiersMap["lctopo_groomed"] = list(lctopo_groomed_modifiers) +jtm.modifiersMap["pflow_groomed"] = list(pflow_groomed_modifiers) + +jtm.modifiersMap["emtopo_reduced"] = list(emtopo_reduced_modifiers) +jtm.modifiersMap["lctopo_reduced"] = list(lctopo_reduced_modifiers) +jtm.modifiersMap["pflow_reduced"] = list(pflow_reduced_modifiers) + if jetFlags.useTruth(): jtm.modifiersMap["truth_ungroomed"] = list(truth_ungroomed_modifiers) jtm.modifiersMap["track_ungroomed"] = list(track_ungroomed_modifiers) -jtm.modifiersMap["groomed"] = list(groomed_modifiers) # Also index modifier type names by input type name. # These are used when the modifier list is omitted. diff --git a/Reconstruction/Jet/JetRec/python/JetRecStandardTools.py b/Reconstruction/Jet/JetRec/python/JetRecStandardTools.py index 19075089be38daef64bc051a2745d3f53b3f67a6..ab62470c1fb496bd249b988f0d86b7419222b387 100644 --- a/Reconstruction/Jet/JetRec/python/JetRecStandardTools.py +++ b/Reconstruction/Jet/JetRec/python/JetRecStandardTools.py @@ -84,6 +84,7 @@ from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import EnergyCorr from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import CenterOfMassShapesTool from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import JetPullTool from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import JetChargeTool +from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import QwTool try: from JetSubStructureMomentTools.JetSubStructureMomentToolsConf import ShowerDeconstructionTool jtm.haveShowerDeconstructionTool = True @@ -114,7 +115,8 @@ ghostScaleFactor = 1e-40 #jtm += InDet__InDetDetailedTrackSelectionTool( jtm += InDet__InDetTrackSelectionTool( "trk_trackselloose", - CutLevel = "Loose" + CutLevel = "Loose", + minPt = 500 ) jtm += JetTrackSelectionTool( @@ -126,7 +128,8 @@ jtm += JetTrackSelectionTool( jtm += InDet__InDetTrackSelectionTool( "trk_trackselloose_trackjets", - CutLevel = "Loose" + CutLevel = "Loose", + minPt = 500 ) jtm += JetTrackSelectionTool( @@ -155,14 +158,17 @@ else: # Track-vertex association. #-------------------------------------------------------------- from TrackVertexAssociationTool.TrackVertexAssociationToolConf import CP__TightTrackVertexAssociationTool -jtm += CP__TightTrackVertexAssociationTool("jetTighTVAtool", dzSinTheta_cut=3, doPV=True) +jtm += CP__TightTrackVertexAssociationTool("jetTightTVAtool", dzSinTheta_cut=3, doPV=True) + +from TrackVertexAssociationTool.TrackVertexAssociationToolConf import CP__LooseTrackVertexAssociationTool +jtm += CP__LooseTrackVertexAssociationTool("jetLooseTVAtool") jtm += TrackVertexAssociationTool( "tvassoc", TrackParticleContainer = jtm.trackContainer, TrackVertexAssociation = "JetTrackVtxAssoc", VertexContainer = jtm.vertexContainer, - TrackVertexAssoTool = jtm.jetTighTVAtool, + TrackVertexAssoTool = jtm.jetTightTVAtool, ) jtm += TrackVertexAssociationTool( @@ -203,7 +209,7 @@ jtm += JetPseudojetRetriever("jpjretriever") labs = [] if jetFlags.useTracks(): labs += ["Track"] - labs += ["AntiKt3TrackJet", "AntiKt3TrackJet"] + labs += ["AntiKt2TrackJet", "AntiKt2TrackJet"] if jetFlags.useMuonSegments(): labs += ["MuonSegment",] if jetFlags.useTruth(): @@ -592,13 +598,13 @@ jtm += JetCaloEnergies("jetens") ## ) # Jet vertex fraction. -jtm += JetVertexFractionTool( - "jvfold", - VertexContainer = jtm.vertexContainer, - AssociatedTracks = "GhostTrack", - TrackVertexAssociation = jtm.tvassoc.TrackVertexAssociation, - JVFName = "JVFOld" -) +# jtm += JetVertexFractionTool( +# "jvfold", +# VertexContainer = jtm.vertexContainer, +# AssociatedTracks = "GhostTrack", +# TrackVertexAssociation = jtm.tvassoc.TrackVertexAssociation, +# JVFName = "JVFOld" +# ) # Jet vertex fraction with selection. jtm += JetVertexFractionTool( @@ -606,22 +612,22 @@ jtm += JetVertexFractionTool( VertexContainer = jtm.vertexContainer, AssociatedTracks = "GhostTrack", TrackVertexAssociation = jtm.tvassoc.TrackVertexAssociation, + TrackParticleContainer = jtm.trackContainer, TrackSelector = jtm.trackselloose, - JVFName = "JVF" + JVFName = "JVF", + K_JVFCorrScale = 0.01, + #Z0Cut = 3.0, + PUTrkPtCut = 30000.0 ) # Jet vertex tagger. jtm += JetVertexTaggerTool( "jvt", VertexContainer = jtm.vertexContainer, - TrackParticleContainer = jtm.trackContainer, - AssociatedTracks = "GhostTrack", - TrackVertexAssociation = jtm.tvassoc.TrackVertexAssociation, - TrackSelector = jtm.trackselloose, + # AssociatedTracks = "GhostTrack", + # TrackVertexAssociation = jtm.tvassoc.TrackVertexAssociation, + # TrackSelector = jtm.trackselloose, JVTName = "Jvt", - K_JVFCorrScale = 0.01, - Z0Cut = 3.0, - PUTrkPtCut = 30000.0 ) # Jet track info. @@ -793,6 +799,9 @@ jtm += JetChargeTool("charge", K=1.0) if jtm.haveShowerDeconstructionTool: jtm += ShowerDeconstructionTool("showerdec") +#Q jets +jtm += QwTool("qw") + # Remove constituents (useful for truth jets in evgen pile-up file) jtm += JetConstitRemover("removeconstit") diff --git a/Reconstruction/Jet/JetRec/python/JetRecUtils.py b/Reconstruction/Jet/JetRec/python/JetRecUtils.py index 827cefae6ae99b9dbe78cb5c86b72b8464ec6a4e..c70b2a1c357d13e66bce184d2ed6fdd69c6837a8 100644 --- a/Reconstruction/Jet/JetRec/python/JetRecUtils.py +++ b/Reconstruction/Jet/JetRec/python/JetRecUtils.py @@ -6,7 +6,7 @@ from AthenaCommon import Logging jetlog = Logging.logging.getLogger('JetRec_jobOptions') def retrieveAODList(): - from JetRec.JetRecFlags import jetFlags + from JetRec.JetRecFlags import jetFlags, JetContentDetail from RecExConfig.RecFlags import rec if rec.doESD(): @@ -15,11 +15,37 @@ def retrieveAODList(): # We can not simply copy what we have from input since some # jobs starts from empty files. See ATEAM-191. # We hard code the list here while waiting for a more robust solution + + exclusionStr = "" + # Build a list of branches to be excluded from writing + if jetFlags.detailLevel()==JetContentDetail.Reduced: + excludedMoments = [ + 'GhostBHadronsFinalCount', 'GhostBHadronsFinalPt', + 'GhostBHadronsInitialCount', 'GhostBHadronsInitialPt', + 'GhostBQuarksFinalCount', 'GhostBQuarksFinalPt', + 'GhostCHadronsFinalCount', 'GhostCHadronsFinalPt', + 'GhostCHadronsInitialCount', 'GhostCHadronsInitialPt', + 'GhostCQuarksFinalCount', 'GhostCQuarksFinalPt', + 'GhostHBosonsCount', 'GhostHBosonsPt', + 'GhostPartonsCount', 'GhostPartonsPt', + 'GhostTQuarksFinalCount', 'GhostTQuarksFinalPt', + 'GhostTausFinalCount', 'GhostTausFinalPt', + 'GhostTruthCount', 'GhostTruthPt', + 'GhostWBosonsCount', 'GhostWBosonsPt', + 'GhostZBosonsCount', 'GhostZBosonsPt', + 'GhostAntiKt4TrackJetCount', 'GhostAntiKt4TrackJetPt', + 'GhostTrackCount', 'GhostTrackPt', + 'GhostAntiKt2TrackJetCount', + ] + exclusionStr = ".".join(["-"+mom for mom in excludedMoments]) + l = [ # event shape objects 'xAOD::EventShape#Kt4EMPFlowEventShape', 'xAOD::EventShapeAuxInfo#Kt4EMPFlowEventShapeAux.', 'xAOD::EventShape#Kt4EMTopoOriginEventShape', 'xAOD::EventShapeAuxInfo#Kt4EMTopoOriginEventShapeAux.', 'xAOD::EventShape#Kt4LCTopoOriginEventShape', 'xAOD::EventShapeAuxInfo#Kt4LCTopoOriginEventShapeAux.', + 'xAOD::EventShape#Kt4EMTopoEventShape', 'xAOD::EventShapeAuxInfo#Kt4EMTopoEventShapeAux.', + 'xAOD::EventShape#Kt4LCTopoEventShape', 'xAOD::EventShapeAuxInfo#Kt4LCTopoEventShapeAux.', 'xAOD::EventShape#NeutralParticleFlowIsoCentralEventShape', 'xAOD::EventShapeAuxInfo#NeutralParticleFlowIsoCentralEventShapeAux.', 'xAOD::EventShape#NeutralParticleFlowIsoForwardEventShape', 'xAOD::EventShapeAuxInfo#NeutralParticleFlowIsoForwardEventShapeAux.', 'xAOD::EventShape#ParticleFlowIsoCentralEventShape', 'xAOD::EventShapeAuxInfo#ParticleFlowIsoCentralEventShapeAux.', @@ -27,27 +53,35 @@ def retrieveAODList(): 'xAOD::EventShape#TopoClusterIsoCentralEventShape', 'xAOD::EventShapeAuxInfo#TopoClusterIsoCentralEventShapeAux.', 'xAOD::EventShape#TopoClusterIsoForwardEventShape', 'xAOD::EventShapeAuxInfo#TopoClusterIsoForwardEventShapeAux.', - 'xAOD::JetContainer#AntiKt10LCTopoJets', 'xAOD::JetAuxContainer#AntiKt10LCTopoJetsAux.', - 'xAOD::JetContainer#AntiKt2PV0TrackJets', 'xAOD::JetAuxContainer#AntiKt2PV0TrackJetsAux.', - #'xAOD::JetContainer#AntiKt3PV0TrackJets', 'xAOD::JetAuxContainer#AntiKt3PV0TrackJetsAux.', - 'xAOD::JetContainer#AntiKt4EMPFlowJets', 'xAOD::JetAuxContainer#AntiKt4EMPFlowJetsAux.', - 'xAOD::JetContainer#AntiKt4EMTopoJets', 'xAOD::JetAuxContainer#AntiKt4EMTopoJetsAux.', - 'xAOD::JetContainer#AntiKt4LCTopoJets', 'xAOD::JetAuxContainer#AntiKt4LCTopoJetsAux.', - 'xAOD::JetContainer#AntiKt4PV0TrackJets', 'xAOD::JetAuxContainer#AntiKt4PV0TrackJetsAux.', - #'xAOD::JetContainer#CamKt12LCTopoJets', 'xAOD::JetAuxContainer#CamKt12LCTopoJetsAux.', - - 'xAOD::CaloClusterContainer#EMOriginTopoClusters', 'xAOD::ShallowAuxContainer#EMOriginTopoClustersAux.', - 'xAOD::CaloClusterContainer#LCOriginTopoClusters' , 'xAOD::ShallowAuxContainer#LCOriginTopoClustersAux.', + 'xAOD::JetContainer#AntiKt4EMPFlowJets', 'xAOD::JetAuxContainer#AntiKt4EMPFlowJetsAux.'+exclusionStr, + 'xAOD::JetContainer#AntiKt4EMTopoJets', 'xAOD::JetAuxContainer#AntiKt4EMTopoJetsAux.'+exclusionStr, + 'xAOD::JetContainer#AntiKt4LCTopoJets', 'xAOD::JetAuxContainer#AntiKt4LCTopoJetsAux.'+exclusionStr, ] - if rec.doTruth(): + if jetFlags.detailLevel()>=JetContentDetail.Full: l += [ - 'xAOD::JetContainer#AntiKt10TruthJets', 'xAOD::JetAuxContainer#AntiKt10TruthJetsAux.', - 'xAOD::JetContainer#AntiKt10TruthWZJets', 'xAOD::JetAuxContainer#AntiKt10TruthWZJetsAux.', - 'xAOD::JetContainer#AntiKt4TruthJets', 'xAOD::JetAuxContainer#AntiKt4TruthJetsAux.', - 'xAOD::JetContainer#AntiKt4TruthWZJets', 'xAOD::JetAuxContainer#AntiKt4TruthWZJetsAux.', - 'xAOD::JetContainer#CamKt12TruthJets', 'xAOD::JetAuxContainer#CamKt12TruthJetsAux.', - 'xAOD::JetContainer#CamKt12TruthWZJets', 'xAOD::JetAuxContainer#CamKt12TruthWZJetsAux.', + 'xAOD::JetContainer#AntiKt10LCTopoJets', 'xAOD::JetAuxContainer#AntiKt10LCTopoJetsAux.', + 'xAOD::JetContainer#AntiKt2PV0TrackJets', 'xAOD::JetAuxContainer#AntiKt2PV0TrackJetsAux.', + 'xAOD::JetContainer#AntiKt4PV0TrackJets', 'xAOD::JetAuxContainer#AntiKt4PV0TrackJetsAux.', + # + 'xAOD::CaloClusterContainer#EMOriginTopoClusters', 'xAOD::ShallowAuxContainer#EMOriginTopoClustersAux.', + 'xAOD::CaloClusterContainer#LCOriginTopoClusters' , 'xAOD::ShallowAuxContainer#LCOriginTopoClustersAux.', + ] + + if rec.doTruth(): + l += [ + 'xAOD::JetContainer#AntiKt10TruthJets', 'xAOD::JetAuxContainer#AntiKt10TruthJetsAux.', + 'xAOD::JetContainer#AntiKt10TruthWZJets', 'xAOD::JetAuxContainer#AntiKt10TruthWZJetsAux.', + 'xAOD::JetContainer#AntiKt4TruthJets', 'xAOD::JetAuxContainer#AntiKt4TruthJetsAux.', + 'xAOD::JetContainer#AntiKt4TruthWZJets', 'xAOD::JetAuxContainer#AntiKt4TruthWZJetsAux.', + 'xAOD::JetContainer#CamKt12TruthJets', 'xAOD::JetAuxContainer#CamKt12TruthJetsAux.', + 'xAOD::JetContainer#CamKt12TruthWZJets', 'xAOD::JetAuxContainer#CamKt12TruthWZJetsAux.', + ] + + if jetFlags.detailLevel()>=JetContentDetail.Validation: + l += [ + 'xAOD::JetContainer#AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets', + 'xAOD::JetAuxContainer#AntiKt10LCTopoTrimmedPtFrac5SmallR20JetsAux.', ] return l @@ -65,15 +99,33 @@ def retrieveAODList(): ## return esdjets +# define the convention that we write R truncating the decimal point +# if R>=1, then we write R*10 +def formatRvalue(parameter): + from AthenaCommon import Logging + jetlog = Logging.logging.getLogger('JetRecUtils') + # impose precision limits where there could be ambiguity + if int(10*parameter)>=1 and int(100*parameter % 10): + jetlog.warning('Radius parameter {0} exceeds allowable precision of 0.1'.format(parameter)) + if int(parameter)>=1: + return "{0:.0f}".format(10*parameter) + else: + return "{0:.1g}".format(10*parameter).replace('.','') + def buildJetAlgName(finder, mainParam, variableRMassScale=0, variableRMinRadius=0): # variableRMassScale (Rho) in MeV if ( variableRMassScale > 0 ): - return finder + "VR" + str(int(variableRMassScale/1000)) + "Rmax" + str(int(mainParam*10)) + "Rmin" +str(int(variableRMinRadius*10)) - return finder + str(int(mainParam*10)) + rmaxstr = formatRvalue(mainParam) + rminstr = formatRvalue(variableRMinRadius) + return finder + "VR" + str(int(variableRMassScale/1000)) + "Rmax" + rmaxstr + "Rmin" + rminstr + return finder + formatRvalue(mainParam) def buildJetContName(finder, mainParam, input, variableRMassScale=0, variableRMinRadius=0): return buildJetAlgName(finder, mainParam, variableRMassScale, variableRMinRadius) +input+"Jets" # could be more elaborated... def interpretJetName(jetcollName, finder = None,input=None, mainParam=None): + myname = "JetRecUtils: " + from AthenaCommon import Logging + jetlog = Logging.logging.getLogger('JetRecUtils') # first step : guess the finder, input , mainParam, if needed if finder is None: for a in [ 'AntiKt','CamKt','Kt', 'Cone','SISCone','CMSCone']: @@ -81,7 +133,7 @@ def interpretJetName(jetcollName, finder = None,input=None, mainParam=None): finder = a break if finder is None: - jetrec.info( "Error could not guess jet finder type in ",jetcollName ) + jetlog.warning( "Error could not guess jet finder type in ",jetcollName ) return if input is None: @@ -95,7 +147,7 @@ def interpretJetName(jetcollName, finder = None,input=None, mainParam=None): input = "TopoTower" break if input is None: - jetrec.info( "Error could not guess input type in ",jetcollName ) + jetlog.warning( "Error could not guess input type in ",jetcollName ) return if mainParam is None: @@ -105,7 +157,7 @@ def interpretJetName(jetcollName, finder = None,input=None, mainParam=None): try : mainParam = float(mp)/10. except ValueError : - jetrec.info( "Error could not guess main parameter in ",jetcollName ) + jetlog.warning( "Error could not guess main parameter in ",jetcollName ) return return finder, mainParam, input diff --git a/Reconstruction/Jet/JetRec/python/JetToolSupport.py b/Reconstruction/Jet/JetRec/python/JetToolSupport.py index 812fb324c3663f68f6edb4ea62f0eb2a96d03c62..bb6de8eac92d9f291a8924a3707e507aa914c189 100644 --- a/Reconstruction/Jet/JetRec/python/JetToolSupport.py +++ b/Reconstruction/Jet/JetRec/python/JetToolSupport.py @@ -123,9 +123,15 @@ class JetToolManager: # If the argument is a list, it is returned directly. def getModifiers(self, modifiersin, altname =None): if modifiersin == None: - return self.modifiersMap[altname] + if altname in ["lctopo","emtopo"]: + return self.modifiersMap[altname+"_ungroomed"] + elif "pflow" in altname: + return self.modifiersMap["pflow_ungroomed"] + else: + return self.modifiersMap[altname] if type(modifiersin) == str: - return self.modifiersMap[modifiersin] + return self.modifiersMap[modifiersin] + return modifiersin # Build the list of modifiers, replacing the string "calib:XXX:CALIB" with diff --git a/Reconstruction/Jet/JetRec/share/JetRec_jobOptions.py b/Reconstruction/Jet/JetRec/share/JetRec_jobOptions.py index 927bcfbaf6ffec92d39ec75562a7922bf90b418d..8dce182c7346e3b6e37cdd2fa4bf65dd2602880c 100644 --- a/Reconstruction/Jet/JetRec/share/JetRec_jobOptions.py +++ b/Reconstruction/Jet/JetRec/share/JetRec_jobOptions.py @@ -14,7 +14,7 @@ from JetRec.JetRecStandard import jtm,jetlog myname = "JetRec_jobOptions.py: " jetlog.info( myname + "Begin." ) -# from JetRec.JetRecFlags import jetFlags +from JetRec.JetRecFlags import jetFlags, JetContentDetail # jetFlags.separateJetAlgs.set_Value(True) # jetFlags.timeJetToolRunner.set_Value(2) @@ -26,29 +26,39 @@ jetlog.info( myname + "Begin." ) # Non-zero ghostArea enables calculation of active area. #-------------------------------------------------------------- -# Finders. -if jetFlags.useTruth(): - jtm.addJetFinder("AntiKt4TruthJets", "AntiKt", 0.4, "truth", ptmin= 5000) - jtm.addJetFinder("AntiKt4TruthWZJets", "AntiKt", 0.4, "truthwz", ptmin= 5000) - jtm.addJetFinder("AntiKt10TruthJets", "AntiKt", 1.0, "truth", ptmin=40000) - jtm.addJetFinder("AntiKt10TruthWZJets", "AntiKt", 1.0, "truthwz", ptmin=40000) -# jtm.addJetFinder("CamKt12TruthJets", "CamKt", 1.2, "truth", ptmin=40000) -# jtm.addJetFinder("CamKt12TruthWZJets", "CamKt", 1.2, "truthwz", ptmin=40000) -if jetFlags.useTracks(): - jtm.addJetFinder("AntiKt2PV0TrackJets", "AntiKt", 0.2, "pv0track", ptmin= 2000) -# jtm.addJetFinder("AntiKt3PV0TrackJets", "AntiKt", 0.3, "pv0track", ptmin= 2000) - jtm.addJetFinder("AntiKt4PV0TrackJets", "AntiKt", 0.4, "pv0track", ptmin= 2000) calibopt = "arj" if not jetFlags.useVertices(): calibopt = "aj" jetlog.info(myname + "No vertices -- switch calibopt to " + calibopt) -if jetFlags.useTopo(): - jtm.addJetFinder("AntiKt4EMTopoJets", "AntiKt", 0.4, "emtopo", "emtopo_ungroomed", ghostArea=0.01, ptmin= 5000, ptminFilter= 15000, calibOpt=calibopt) - jtm.addJetFinder("AntiKt4LCTopoJets", "AntiKt", 0.4, "lctopo", "lctopo_ungroomed", ghostArea=0.01, ptmin= 5000, ptminFilter= 15000, calibOpt=calibopt) - jtm.addJetFinder("AntiKt10LCTopoJets", "AntiKt", 1.0, "lctopo", "lctopo_ungroomed", ghostArea=0.01, ptmin= 40000, ptminFilter=50000, calibOpt="none") -# jtm.addJetFinder("CamKt12LCTopoJets", "CamKt", 1.2, "lctopo", "calib", ghostArea=0.01, ptmin= 5000, ptminFilter=50000, calibOpt="none") -if jetFlags.usePFlow(): - jtm.addJetFinder("AntiKt4EMPFlowJets", "AntiKt", 0.4, "empflow", "pflow_ungroomed", ghostArea=0.01, ptmin= 5000, ptminFilter= 10000, calibOpt=calibopt+":pflow") + +# Finders. +if jetFlags.detailLevel()==JetContentDetail.Reduced: + if jetFlags.useTopo(): + jtm.addJetFinder("AntiKt4EMTopoJets", "AntiKt", 0.4, "emtopo_reduced", "emtopo_ungroomed", ghostArea=0.01, ptmin= 5000, ptminFilter= 15000, calibOpt=calibopt) + jtm.addJetFinder("AntiKt4LCTopoJets", "AntiKt", 0.4, "lctopo_reduced", "lctopo_ungroomed", ghostArea=0.01, ptmin= 5000, ptminFilter= 15000, calibOpt=calibopt) + jtm.addJetFinder("AntiKt10LCTopoJets", "AntiKt", 1.0, "lctopo_reduced", "lctopo_ungroomed", ghostArea=0.01, ptmin= 40000, ptminFilter=50000, calibOpt="none") + if jetFlags.usePFlow(): + jtm.addJetFinder("AntiKt4EMPFlowJets", "AntiKt", 0.4, "empflow_reduced", "pflow_ungroomed", ghostArea=0.01, ptmin= 5000, ptminFilter= 10000, calibOpt=calibopt+":pflow") + # if jetFlags.useTruth(): + # jtm.addJetFinder("AntiKt4TruthJets", "AntiKt", 0.4, "truth", ptmin= 5000) +elif jetFlags.detailLevel()>=JetContentDetail.Full: + if jetFlags.useTruth(): + jtm.addJetFinder("AntiKt4TruthJets", "AntiKt", 0.4, "truth", ptmin= 5000) + jtm.addJetFinder("AntiKt4TruthWZJets", "AntiKt", 0.4, "truthwz", ptmin= 5000) + jtm.addJetFinder("AntiKt10TruthJets", "AntiKt", 1.0, "truth", ptmin=40000) + jtm.addJetFinder("AntiKt10TruthWZJets", "AntiKt", 1.0, "truthwz", ptmin=40000) + if jetFlags.useTracks(): + jtm.addJetFinder("AntiKt2PV0TrackJets", "AntiKt", 0.2, "pv0track", ptmin= 2000) + jtm.addJetFinder("AntiKt4PV0TrackJets", "AntiKt", 0.4, "pv0track", ptmin= 2000) + if jetFlags.useTopo(): + jtm.addJetFinder("AntiKt4EMTopoJets", "AntiKt", 0.4, "emtopo", "emtopo_ungroomed", ghostArea=0.01, ptmin= 5000, ptminFilter= 15000, calibOpt=calibopt) + jtm.addJetFinder("AntiKt4LCTopoJets", "AntiKt", 0.4, "lctopo", "lctopo_ungroomed", ghostArea=0.01, ptmin= 5000, ptminFilter= 15000, calibOpt=calibopt) + jtm.addJetFinder("AntiKt10LCTopoJets", "AntiKt", 1.0, "lctopo", "lctopo_ungroomed", ghostArea=0.01, ptmin= 40000, ptminFilter=50000, calibOpt="none") + if jetFlags.usePFlow(): + jtm.addJetFinder("AntiKt4EMPFlowJets", "AntiKt", 0.4, "empflow", "pflow_ungroomed", ghostArea=0.01, ptmin= 5000, ptminFilter= 10000, calibOpt=calibopt+":pflow") +if jetFlags.detailLevel()==JetContentDetail.Validation: + jtm.addJetTrimmer( "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets", + rclus=0.2, ptfrac=0.05, input="AntiKt10LCTopoJets", modifiersin="lctopo_groomed" ) #-------------------------------------------------------------- # Build output container list. diff --git a/Reconstruction/Jet/JetUtils/CMakeLists.txt b/Reconstruction/Jet/JetUtils/CMakeLists.txt index 152a39ccff96d575135d8832be25f703f70ca77c..8246106a9a9a084c617c3caf3f1979dff2e1a836 100644 --- a/Reconstruction/Jet/JetUtils/CMakeLists.txt +++ b/Reconstruction/Jet/JetUtils/CMakeLists.txt @@ -1,3 +1,4 @@ +# $Id: CMakeLists.txt 782306 2016-11-04 09:42:24Z krasznaa $ ################################################################################ # Package: JetUtils ################################################################################ @@ -6,35 +7,55 @@ atlas_subdir( JetUtils ) # Declare the package's dependencies: -atlas_depends_on_subdirs( PUBLIC - AtlasTest/TestTools - Calorimeter/CaloEvent - Event/xAOD/xAODCaloEvent - Event/xAOD/xAODJet - Event/xAOD/xAODTracking - PRIVATE - Calorimeter/CaloGeoHelpers - Control/AthLinks - Control/SGTools - Event/xAOD/xAODPFlow - TileCalorimeter/TileEvent ) +if( XAOD_STANDALONE OR XAOD_ANALYSIS ) + atlas_depends_on_subdirs( + PUBLIC + Event/xAOD/xAODCaloEvent + Event/xAOD/xAODJet + Event/xAOD/xAODTracking + PRIVATE + Calorimeter/CaloGeoHelpers + Event/xAOD/xAODPFlow + Control/AthLinks ) +else() + atlas_depends_on_subdirs( + PUBLIC + Calorimeter/CaloEvent + Event/xAOD/xAODCaloEvent + Event/xAOD/xAODJet + Event/xAOD/xAODTracking + PRIVATE + Calorimeter/CaloGeoHelpers + Control/AthLinks + Control/SGTools + Event/xAOD/xAODPFlow + TileCalorimeter/TileEvent ) +endif() # External dependencies: -find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread GenVector ) +find_package( ROOT COMPONENTS Core Tree RIO ) # Component(s) in the package: -atlas_add_library( JetUtils - src/*.cxx - Root/*.cxx - PUBLIC_HEADERS JetUtils - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CaloEvent xAODCaloEvent xAODJet xAODTracking - PRIVATE_LINK_LIBRARIES CaloGeoHelpers AthLinks SGTools xAODPFlow TileEvent ) +if( XAOD_STANDALONE OR XAOD_ANALYSIS ) + atlas_add_library( JetUtils + JetUtils/*.h JetUtils/*.icc Root/*.cxx + PUBLIC_HEADERS JetUtils + LINK_LIBRARIES xAODCaloEvent xAODJet xAODTracking + PRIVATE_LINK_LIBRARIES CaloGeoHelpers xAODPFlow ) +else() + atlas_add_library( JetUtils + JetUtils/*.h JetUtils/*.icc Root/*.cxx src/*.cxx + PUBLIC_HEADERS JetUtils + LINK_LIBRARIES CaloEvent xAODCaloEvent xAODJet xAODTracking + PRIVATE_LINK_LIBRARIES CaloGeoHelpers xAODPFlow TileEvent ) +endif() -atlas_add_test( JetUtils_CaloQual_test - SOURCES - test/JetUtils_CaloQual_test.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} TestTools CaloEvent xAODCaloEvent xAODJet xAODTracking CaloGeoHelpers AthLinks SGTools xAODPFlow TileEvent JetUtils - EXTRA_PATTERNS "no dictionary for class" ) +# Test(s) in the package: +if( NOT XAOD_STANDALONE ) + atlas_add_test( JetUtils_CaloQual_test + SOURCES test/JetUtils_CaloQual_test.cxx + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} xAODCaloEvent JetUtils AthLinks SGTools + EXTRA_PATTERNS "no dictionary for class" ) +endif() diff --git a/Reconstruction/Jet/JetUtils/JetUtils/JetCaloCalculations.h b/Reconstruction/Jet/JetUtils/JetUtils/JetCaloCalculations.h old mode 100755 new mode 100644 diff --git a/Reconstruction/Jet/JetUtils/JetUtils/JetCaloQualityUtils.h b/Reconstruction/Jet/JetUtils/JetUtils/JetCaloQualityUtils.h old mode 100755 new mode 100644 index fda7f481ac9c96ae4d31bdf4fd3518a3cdfeb0f0..e859567d49bcce80b479c6ae834d8efd5e8dfd9c --- a/Reconstruction/Jet/JetUtils/JetUtils/JetCaloQualityUtils.h +++ b/Reconstruction/Jet/JetUtils/JetUtils/JetCaloQualityUtils.h @@ -153,9 +153,8 @@ namespace jet { class JetCalcNegativeEnergy: virtual public JetCaloCalculator { protected: double m_totE; - double m_totSig ; // cluster level calculation - JETCALCFUNCDECL( JetCalcNegativeEnergy, JetAttribute::NegativeE, m_totE=0; m_totSig=0; ); + JETCALCFUNCDECL( JetCalcNegativeEnergy, JetAttribute::NegativeE, m_totE=0; ); }; /* @brief total negative energy in a jet*/ diff --git a/Reconstruction/Jet/JetUtils/JetUtils/JetCaloVariables.h b/Reconstruction/Jet/JetUtils/JetUtils/JetCaloVariables.h old mode 100755 new mode 100644 diff --git a/Reconstruction/Jet/JetUtils/JetUtils/JetCellAccessor.h b/Reconstruction/Jet/JetUtils/JetUtils/JetCellAccessor.h index 159ab7fbe4de2a72f070f739664a6f7fcf74e248..108c9dbc10d9517a6e1a99cc124f126fd2442c09 100644 --- a/Reconstruction/Jet/JetUtils/JetUtils/JetCellAccessor.h +++ b/Reconstruction/Jet/JetUtils/JetUtils/JetCellAccessor.h @@ -3,6 +3,8 @@ */ // emacs this is -*-C++-*- +#ifndef XAOD_ANALYSIS + #ifndef JETUTILS_JETCELLACCESSOR_H #define JETUTILS_JETCELLACCESSOR_H ////////////////////////////////////////////////////// @@ -85,3 +87,5 @@ namespace jet{ } #endif + +#endif diff --git a/Reconstruction/Jet/JetUtils/JetUtils/JetDistances.h b/Reconstruction/Jet/JetUtils/JetUtils/JetDistances.h old mode 100755 new mode 100644 diff --git a/Reconstruction/Jet/JetUtils/JetUtils/JetKinematics.h b/Reconstruction/Jet/JetUtils/JetUtils/JetKinematics.h old mode 100755 new mode 100644 diff --git a/Reconstruction/Jet/JetUtils/JetUtils/cyl_geom.h b/Reconstruction/Jet/JetUtils/JetUtils/cyl_geom.h old mode 100755 new mode 100644 diff --git a/Reconstruction/Jet/JetUtils/Root/JetCaloCalculations.cxx b/Reconstruction/Jet/JetUtils/Root/JetCaloCalculations.cxx old mode 100755 new mode 100644 diff --git a/Reconstruction/Jet/JetUtils/Root/JetCaloQualityUtils.cxx b/Reconstruction/Jet/JetUtils/Root/JetCaloQualityUtils.cxx old mode 100755 new mode 100644 index 0b739a0a78a0b55f6d4e160ee3c5e23b250af470..eb46a11fc195bc6bd12103d7e6be0cd48563db7c --- a/Reconstruction/Jet/JetUtils/Root/JetCaloQualityUtils.cxx +++ b/Reconstruction/Jet/JetUtils/Root/JetCaloQualityUtils.cxx @@ -311,16 +311,14 @@ namespace jet { // **************************************************************** bool JetCalcNegativeEnergy::setupJet(const Jet* ){ m_totE =0; - m_totSig = 0; return true; } double JetCalcNegativeEnergy::jetCalculation() const { - if( m_totSig != 0) return m_totE / m_totSig; + return m_totE; - return 0.; } bool JetCalcNegativeEnergy::processConstituent(xAOD::JetConstituentVector::iterator& iter){ @@ -328,11 +326,7 @@ namespace jet { double e = iter->e() ; // using iter since it is set at the expected scale by the JetCaloCalculations instance double epos= m_constitExtractor->moment(iter, xAOD::CaloCluster::ENG_POS); - double sig = m_constitExtractor->moment(iter, xAOD::CaloCluster::SIGNIFICANCE); - - - m_totE += (e - epos ) * fabs( sig ); - m_totSig += sig; + m_totE += (e - epos ); return true; } diff --git a/Reconstruction/Jet/JetUtils/Root/cyl_geom.cxx b/Reconstruction/Jet/JetUtils/Root/cyl_geom.cxx old mode 100755 new mode 100644 diff --git a/Reconstruction/Jet/JetUtils/cmt/requirements b/Reconstruction/Jet/JetUtils/cmt/requirements old mode 100755 new mode 100644 index 77d98d5f7ef51fc477bb46e43246551482b875e9..c346064bb716a59da7b141dbd7cc7157c7368104 --- a/Reconstruction/Jet/JetUtils/cmt/requirements +++ b/Reconstruction/Jet/JetUtils/cmt/requirements @@ -16,7 +16,9 @@ use AthLinks AthLinks-* Control #use PathResolver PathResolver-* Tools -use TileEvent TileEvent-* TileCalorimeter + +use_ifndef pplist="XAOD_ANALYSIS" pkg="TileCalorimeter/TileEvent" +#use TileEvent TileEvent-* TileCalorimeter use CaloGeoHelpers CaloGeoHelpers-* Calorimeter use xAODPFlow xAODPFlow-* Event/xAOD @@ -28,7 +30,8 @@ use xAODTracking xAODTracking-* Event/xAOD use AtlasPolicy AtlasPolicy-* use xAODJet xAODJet-* Event/xAOD -use CaloEvent CaloEvent-* Calorimeter +use_ifndef pplist="XAOD_ANALYSIS" pkg="Calorimeter/CaloEvent" +#use CaloEvent CaloEvent-* Calorimeter #use GaudiInterface GaudiInterface-* External diff --git a/Reconstruction/Jet/JetUtils/share/JetUtils_CaloQual_test.ref b/Reconstruction/Jet/JetUtils/share/JetUtils_CaloQual_test.ref index 0cd3deb158ba7e95def314ee497a93dfec34a2aa..22ab36d60d0295c7559c49ccaf08032837c258c9 100644 --- a/Reconstruction/Jet/JetUtils/share/JetUtils_CaloQual_test.ref +++ b/Reconstruction/Jet/JetUtils/share/JetUtils_CaloQual_test.ref @@ -1,135 +1,5 @@ -Warning in <TClass::TClass>: no dictionary for class DataHeader_p5 is available -Warning in <TClass::TClass>: no dictionary for class DataHeaderElement_p5 is available -Warning in <TClass::TClass>: no dictionary for class DataHeaderForm_p5 is available -Warning in <TClass::TClass>: no dictionary for class IOVMetaDataContainer_p1 is available -Warning in <TClass::TClass>: no dictionary for class IOVPayloadContainer_p1 is available -Warning in <TClass::TClass>: no dictionary for class IOVPayloadContainer_p1::CondAttrListCollection_p1 is available -Warning in <TClass::TClass>: no dictionary for class IOVPayloadContainer_p1::CondAttrListEntry_p1 is available -Warning in <TClass::TClass>: no dictionary for class IOVPayloadContainer_p1::IOVRange_p1 is available -Warning in <TClass::TClass>: no dictionary for class AttrListIndexes is available -Warning in <TClass::TClass>: no dictionary for class EventInfo_p4 is available -Warning in <TClass::TClass>: no dictionary for class EventID_p1 is available -Warning in <TClass::TClass>: no dictionary for class EventType_p3 is available -Warning in <TClass::TClass>: no dictionary for class TriggerInfo_p2 is available -Warning in <TClass::TClass>: no dictionary for class TPCnvTokenList_p1 is available -Warning in <TClass::TClass>: no dictionary for class TPObjRef is available -Warning in <TClass::TClass>: no dictionary for class TPObjRef::typeID_t is available -Warning in <TClass::TClass>: no dictionary for class SG::AuxVectorBase is available -Warning in <TClass::TClass>: no dictionary for class SG::AuxVectorData is available -Warning in <TClass::TClass>: no dictionary for class ILockable is available -Warning in <TClass::TClass>: no dictionary for class DataVector<CaloClusterCellLink> is available -Warning in <TClass::TClass>: no dictionary for class xAOD::Vertex_v1 is available -Warning in <TClass::TClass>: no dictionary for class SG::AuxElement is available -Warning in <TClass::TClass>: no dictionary for class SG::IAuxElement is available -Warning in <TClass::TClass>: no dictionary for class Trk::TrackCollection_tlp5 is available -Warning in <TClass::TClass>: no dictionary for class TPCnvToken_p1 is available -Warning in <TClass::TClass>: no dictionary for class Trk::TrackCollection_p1 is available -Warning in <TClass::TClass>: no dictionary for class Trk::Track_p4 is available -Warning in <TClass::TClass>: no dictionary for class Trk::TrackStateOnSurface_p3 is available -Warning in <TClass::TClass>: no dictionary for class Trk::TrackParameters_p2 is available -Warning in <TClass::TClass>: no dictionary for class Trk::HepSymMatrix_p1 is available -Warning in <TClass::TClass>: no dictionary for class Trk::LocalParameters_p1 is available -Warning in <TClass::TClass>: no dictionary for class InDet::Track_tlp2 is available -Warning in <TClass::TClass>: no dictionary for class InDet::PixelClusterOnTrack_p2 is available -Warning in <TClass::TClass>: no dictionary for class ElementLink_p1<unsigned int> is available -Warning in <TClass::TClass>: no dictionary for class InDet::SCT_ClusterOnTrack_p2 is available -Warning in <TClass::TClass>: no dictionary for class InDet::TRT_DriftCircleOnTrack_p2 is available -Warning in <TClass::TClass>: no dictionary for class CaloClusterCellLinkContainer is available -Warning in <TClass::TClass>: no dictionary for class CaloClusterCellLink is available -Warning in <TClass::TClass>: no dictionary for class DataLink<CaloCellContainer> is available -Warning in <TClass::TClass>: no dictionary for class DataLinkBase is available -Warning in <TClass::TClass>: no dictionary for class pair<unsigned int,double> is available -Warning in <TClass::TClass>: no dictionary for class xAOD::Photon_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::Egamma_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::IParticle is available -Warning in <TClass::TClass>: no dictionary for class xAOD::CaloCluster_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::Electron_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::TrackParticle_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::CaloClusterAuxContainer_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::AuxContainerBase is available -Warning in <TClass::TClass>: no dictionary for class SG::IAuxStore is available -Warning in <TClass::TClass>: no dictionary for class SG::IConstAuxStore is available -Warning in <TClass::TClass>: no dictionary for class SG::IAuxStoreIO is available -Warning in <TClass::TClass>: no dictionary for class SG::IAuxStoreHolder is available -Warning in <TClass::TClass>: no dictionary for class xAOD::EventInfo_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::EventAuxInfo_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::AuxInfoBase is available -Warning in <TClass::TClass>: no dictionary for class xAOD::TruthEvent_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::TruthEventAuxContainer_v1 is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<xAOD::TruthVertex_v1> > is available -Warning in <TClass::TClass>: no dictionary for class ElementLinkBase is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<xAOD::TruthParticle_v1> > is available -Warning in <TClass::TClass>: no dictionary for class xAOD::TruthParticle_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::TruthParticleAuxContainer_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::TruthVertex_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::TruthVertexAuxContainer_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::TrackParticleAuxContainer_v1 is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<xAOD::Vertex_v1> > is available -Warning in <TClass::TClass>: no dictionary for class xAOD::VertexAuxContainer_v1 is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<xAOD::TrackParticle_v1> > is available -Warning in <TClass::TClass>: no dictionary for class xAOD::MuonSegment_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::MuonSegmentAuxContainer_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::Jet_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::JetAuxContainer_v1 is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<xAOD::IParticle> > is available -Warning in <TClass::TClass>: no dictionary for class CaloCompactCellContainer is available -Warning in <TClass::TClass>: no dictionary for class TileCellVec is available -Warning in <TClass::TClass>: no dictionary for class TileMuContainer_p1 is available -Warning in <TClass::TClass>: no dictionary for class TileMu_p1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::MissingETComponent_v1 is available -Warning in <TClass::TClass>: no dictionary for class RecoTimingObj_p1 is available -Warning in <TClass::TClass>: no dictionary for class LArNoisyROSummary_p3 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::MissingETAuxComponentMap_v1 is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<xAOD::MissingETContainer_v1> is available -Warning in <TClass::TClass>: no dictionary for class xAOD::MissingET_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::ElectronAuxContainer_v2 is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<xAOD::CaloCluster_v1> > is available -Warning in <TClass::TClass>: no dictionary for class xAOD::MuonAuxContainer_v1 is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<xAOD::MuonSegment_v1> > is available -Warning in <TClass::TClass>: no dictionary for class xAOD::TauJet_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::PFO_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::Muon_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::PFOAuxContainer_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::MissingETAuxContainer_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::BTaggingAuxContainer_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::PhotonAuxContainer_v2 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::BTagging_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::TauJetAuxContainer_v1 is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<xAOD::Jet_v1> > is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<xAOD::PFO_v1> > is available -Warning in <TClass::TClass>: no dictionary for class CaloCalibrationHitContainer_p3 is available -Warning in <TClass::TClass>: no dictionary for class MuonCaloEnergyContainer_p1 is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<xAOD::BTagging_v1> > is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<xAOD::BTagVertex_v1> > is available -Warning in <TClass::TClass>: no dictionary for class xAOD::CaloClusterBadChannelData_v1 is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<Trk::Track> > is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<CaloClusterCellLinkContainer> is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<Trk::Segment> > is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<xAOD::Muon_v1> > is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<xAOD::Electron_v1> > is available -Warning in <TClass::TClass>: no dictionary for class ElementLink<DataVector<xAOD::Photon_v1> > is available -Warning in <TClass::TClass>: no dictionary for class Trk::PseudoMeasurementOnTrack_p2 is available -Warning in <TClass::TClass>: no dictionary for class Trk::Surface_p2 is available -Warning in <TClass::TClass>: no dictionary for class EventStreamInfo_p3 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::EventFormat_v1 is available -Warning in <TClass::TClass>: no dictionary for class EventBookkeeperCollection_p2 is available -Warning in <TClass::TClass>: no dictionary for class pair<unsigned int,string> is available -Warning in <TClass::TClass>: no dictionary for class DataVector<xAOD::Vertex_v1> is available -Warning in <TClass::TClass>: no dictionary for class DataVector<xAOD::Jet_v1> is available -Warning in <TClass::TClass>: no dictionary for class DataVector<xAOD::BTagging_v1> is available -Warning in <TClass::TClass>: no dictionary for class DataVector<xAOD::Electron_v1> is available -Warning in <TClass::TClass>: no dictionary for class DataVector<xAOD::Muon_v1> is available -Warning in <TClass::TClass>: no dictionary for class DataVector<xAOD::TauJet_v1> is available -Warning in <TClass::TClass>: no dictionary for class DataVector<xAOD::MuonSegment_v1> is available -Warning in <TClass::TClass>: no dictionary for class DataVector<xAOD::CaloCluster_v1> is available -Warning in <TClass::TClass>: no dictionary for class DataVector<xAOD::TruthEvent_v1> is available -Warning in <TClass::TClass>: no dictionary for class DataVector<xAOD::TruthVertex_v1> is available -Warning in <TClass::TClass>: no dictionary for class DataVector<xAOD::Photon_v1> is available -Warning in <TClass::TClass>: no dictionary for class DataVector<xAOD::PFO_v1> is available -Warning in <TClass::TClass>: no dictionary for class DataVector<xAOD::TrackParticle_v1> is available -Warning in <TClass::TClass>: no dictionary for class DataVector<xAOD::TruthParticle_v1> is available -Warning in <TClass::TClass>: no dictionary for class xAOD::MissingETComponentMap_v1 is available -Warning in <TClass::TClass>: no dictionary for class xAOD::MissingETContainer_v1 is available +/cvmfs/sft.cern.ch/lcg/contrib/gcc/4.9.3/x86_64-slc6/include/c++/4.9.3/bits/regex.h:1545:11: runtime error: load of value 144, which is not a valid value for type 'bool' +/cvmfs/sft.cern.ch/lcg/contrib/gcc/4.9.3/x86_64-slc6/include/c++/4.9.3/bits/regex.h:1545:11: runtime error: load of value 80, which is not a valid value for type 'bool' cluster e=26832.6 eta=-0.92739 sig=56.6167 cluster e=21128.1 eta=-0.974543 sig=47.631 cluster e=16134 eta=0.640434 sig=64.9049 @@ -146,29 +16,29 @@ nLeadCell = 7 ootFrac = 0 avgLArQF = 63.6055 hecQual = 0 -negE = -297.557 +negE = -3616.2 nLeadCell = 4 ootFrac = 0 avgLArQF = 53.7166 hecQual = 0 -negE = -561.101 +negE = -3395.96 nLeadCell = 9 ootFrac = 0.0929392 avgLArQF = 87.5256 hecQual = 0 -negE = -429.108 +negE = -5163.76 nLeadCell = 6 ootFrac = 0.00847961 avgLArQF = 523.398 hecQual = 0 -negE = -585.708 +negE = -6179.45 nLeadCell = 10 ootFrac = 0.0336657 avgLArQF = 8762.78 hecQual = 0 -negE = -465.821 +negE = -14333.7 nLeadCell = 2 ootFrac = 0 avgLArQF = 73.1208 hecQual = 0 -negE = -393.947 +negE = -727.051 diff --git a/Reconstruction/Jet/JetUtils/src/JetCaloCellQualityUtils.cxx b/Reconstruction/Jet/JetUtils/src/JetCaloCellQualityUtils.cxx index fbf9757f0051e32ced839e4d4104bf7cf0842917..16ed68576f10fb546aa4e2fd9d41246b868a3d2d 100644 --- a/Reconstruction/Jet/JetUtils/src/JetCaloCellQualityUtils.cxx +++ b/Reconstruction/Jet/JetUtils/src/JetCaloCellQualityUtils.cxx @@ -215,7 +215,6 @@ namespace jet { bool JetCalcNegativeEnergy_fromCells::processCell(const CaloCell *theCell, weight_t) { - m_totSig=1; if(theCell->e()<-2500) m_totE += theCell->e(); return true; diff --git a/Reconstruction/Jet/JetValidation/python/PhysicsValidationHistos.py b/Reconstruction/Jet/JetValidation/python/PhysicsValidationHistos.py index e095aad9ca80622809cdc539fcdaa60777e8abf0..f4b93e988d96134039d92cbd8d71e0c8d001cdb3 100644 --- a/Reconstruction/Jet/JetValidation/python/PhysicsValidationHistos.py +++ b/Reconstruction/Jet/JetValidation/python/PhysicsValidationHistos.py @@ -6,6 +6,7 @@ from AthenaCommon.AppMgr import ToolSvc from AthenaCommon.AppMgr import ServiceMgr as svcMgr from PyUtils import AthFile + af = AthFile.fopen(svcMgr.EventSelector.InputCollections[0]) #opens the first file from the InputCollections list af.fileinfos #this is a dict of dicts, take a look at what's available! Below are some examples: isMC = 'IS_SIMULATION' in af.fileinfos['evt_type'] @@ -13,19 +14,6 @@ beam_energy = af.fileinfos['beam_energy'] conditions_tag = af.fileinfos['conditions_tag'] #useful for figuring out which mc production this is print "PhysicsValidationHistos: isMC=",isMC, " beam=",beam_energy," conditions_tag=",conditions_tag - -## prepare a few additionnal histos builder for some new jet attributes -from JetMonitoring.JetAttributeHistoManager import attributeHistoManager -# format is name, ("title;labelx;labely", nbins, xlow, xup), ("attribute", "attribute type") -# attributeHistoManager.add1DHistoTool('Jvt', ("Jet JVT;;", 100, 0, 1) , ("Jvt","float" ) ) -# attributeHistoManager.add1DHistoTool('JvtJvfcorr', ("Jet JVT JVFCorr;;", 100, 0, 1) , ("JvtJvfcorr","float" ) ) -# attributeHistoManager.add1DHistoTool('JvtRpt', ("Jet JVT Rpt;;", 100, 0, 1) , ("JvtRpt","float" ) ) - -attributeHistoManager.add1DHistoTool('Jvt', ("Jet JVT;;", 120, -0.2, 1) , ("Jvt","float" ) ) -attributeHistoManager.add1DHistoTool('JvtJvfcorr', ("Jet JVT JVFCorr;;", 100, -1, 1) , ("JvtJvfcorr","float" ) ) -attributeHistoManager.add1DHistoTool('JvtRpt', ("Jet JVT Rpt;;", 75, 0, 1.5) , ("JvtRpt","float" ) ) - -# now jhm.Jvt is available... def commonPhysValTool(container, refcontainer="", onlyKinematics = False, globalSelection= ""): containerfiller = JetContainerHistoFiller(container+"HistoFiller",JetContainer = container) filler = containerfiller @@ -66,7 +54,7 @@ def commonPhysValTool(container, refcontainer="", onlyKinematics = False, global jhm.leadingjetrel, ] - if "Topo" in container: + if "Topo" in container or "PFlow" in container: filler.HistoTools += [ # jet states @@ -75,65 +63,18 @@ def commonPhysValTool(container, refcontainer="", onlyKinematics = False, global # track variables jhm.tool("JVF[0]"), - jhm.SumPtTrkPt1000, + jhm.SumPtTrkPt500, + jhm.tool("SumPtTrkPt500[0]"), + jhm.tool("NumTrkPt500[0]"), + jhm.tool("NumTrkPt1000[0]"), + jhm.tool("TrackWidthPt1000[0]"), jhm.GhostTrackCount, - - # jet moments - jhm.KtDR, - jhm.Tau1, - jhm.Tau2, - jhm.Tau3, - jhm.Tau1_wta, - jhm.Tau2_wta, - jhm.Tau3_wta, - jhm.Tau21, - jhm.Tau32, - jhm.Tau21_wta, - jhm.Tau32_wta, - jhm.Dip12, - jhm.Dip13, - jhm.Dip23, - jhm.DipExcl12, - jhm.Split12, - jhm.Split23, - jhm.Split34, - jhm.ZCut12, - jhm.ZCut23, - jhm.ZCut34, - jhm.Angularity, - jhm.PlanarFlow, - jhm.Mu12, - jhm.ECF1, - jhm.ECF2, - jhm.ECF3, - jhm.ECF1_Beta2, - jhm.ECF2_Beta2, - jhm.ECF3_Beta2, - jhm.C1, - jhm.C2, - jhm.D2, - jhm.C1_Beta2, - jhm.C2_Beta2, - jhm.D2_Beta2, - jhm.ThrustMin, - jhm.ThrustMaj, - jhm.FoxWolfram0, - jhm.FoxWolfram1, - jhm.FoxWolfram2, - jhm.FoxWolfram3, - jhm.FoxWolfram4, - jhm.Sphericity, - jhm.Aplanarity, - jhm.PullMag, - jhm.PullPhi, - jhm.Pull_C00, - jhm.Pull_C01, - jhm.Pull_C10, - jhm.Pull_C11, - jhm.Charge, - jhm.ShowerDeconstructionW, - jhm.ShowerDeconstructionTop, - jhm.Volatility, + jhm.GhostTruthAssociationFraction, + jhm.GhostMuonSegmentCount, + jhm.JVF, + jhm.JVFCorr, + jhm.Jvt, + jhm.JvtRpt, # calo variables jhm.NegativeE, @@ -142,8 +83,6 @@ def commonPhysValTool(container, refcontainer="", onlyKinematics = False, global jhm.Timing, jhm.LArQuality, - - jhm.EMB2, jhm.EMB3, jhm.EME2, @@ -157,14 +96,72 @@ def commonPhysValTool(container, refcontainer="", onlyKinematics = False, global jhm.TileExt0, jhm.TileExt1, - jhm.Jvt, ] if refcontainer: # efficiency - filler.HistoTools += [jhm.effresponse,] + filler.HistoTools += [jhm.effresponse,] filler.HistoTools['effresponse'].RefContainer = refcontainer + if "Trimmed" in container: + filler.HistoTools += [ + jhm.KtDR, + jhm.Tau1, + jhm.Tau2, + jhm.Tau3, + jhm.Tau1_wta, + jhm.Tau2_wta, + jhm.Tau3_wta, + jhm.Tau21, + jhm.Tau32, + jhm.Tau21_wta, + jhm.Tau32_wta, + jhm.Dip12, + jhm.Dip13, + jhm.Dip23, + jhm.DipExcl12, + jhm.Split12, + jhm.Split23, + jhm.Split34, + jhm.ZCut12, + jhm.ZCut23, + jhm.ZCut34, + jhm.Angularity, + jhm.PlanarFlow, + jhm.Mu12, + jhm.ECF1, + jhm.ECF2, + jhm.ECF3, + jhm.ECF1_Beta2, + jhm.ECF2_Beta2, + jhm.ECF3_Beta2, + jhm.C1, + jhm.C2, + jhm.D2, + jhm.C1_Beta2, + jhm.C2_Beta2, + jhm.D2_Beta2, + jhm.ThrustMin, + jhm.ThrustMaj, + jhm.FoxWolfram0, + jhm.FoxWolfram1, + jhm.FoxWolfram2, + jhm.FoxWolfram3, + jhm.FoxWolfram4, + jhm.Sphericity, + jhm.Aplanarity, + jhm.PullMag, + jhm.PullPhi, + jhm.Pull_C00, + jhm.Pull_C01, + jhm.Pull_C10, + jhm.Pull_C11, + jhm.Charge, + jhm.ShowerDeconstructionW, + jhm.ShowerDeconstructionTop, + jhm.Volatility, + ] + #filler.OutputLevel =2 return containerfiller @@ -179,9 +176,11 @@ athenaMonTool = JetMonitoringTool(HistoTools = [ commonPhysValTool( "AntiKt4LCTopoJets", akt4refContainer ,globalSelection = globalSelection), commonPhysValTool( "AntiKt4EMTopoJets", akt4refContainer ,globalSelection = globalSelection), commonPhysValTool( "AntiKt10LCTopoJets" ), - commonPhysValTool( "AntiKt3PV0TrackJets" ), + commonPhysValTool( "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets" ), + commonPhysValTool( "AntiKt2PV0TrackJets" ), commonPhysValTool( "AntiKt4EMPFlowJets" ), commonPhysValTool( "AntiKt4TruthJets" ), + commonPhysValTool( "AntiKt10TruthJets" ), ], IntervalType=8) # 8 == HistoGroupBase::all @@ -190,7 +189,8 @@ if (isMC==False): commonPhysValTool( "AntiKt4LCTopoJets", akt4refContainer ,globalSelection = globalSelection), commonPhysValTool( "AntiKt4EMTopoJets", akt4refContainer ,globalSelection = globalSelection), commonPhysValTool( "AntiKt10LCTopoJets" ), - commonPhysValTool( "AntiKt3PV0TrackJets" ), + commonPhysValTool( "AntiKt10LCTopoTrimmedPtFrac5SmallR20Jets" ), + commonPhysValTool( "AntiKt2PV0TrackJets" ), commonPhysValTool( "AntiKt4EMPFlowJets" ), ], IntervalType=8) # 8 == HistoGroupBase::all diff --git a/Reconstruction/Jet/JetValidation/share/JetPhysVal_jobOption.py b/Reconstruction/Jet/JetValidation/share/JetPhysVal_jobOption.py index 16d5223e29a9b78bf3aa2ae20e2e6f8a39894519..27c47f4c45207ab81a6ac86b55d5d33d6dd81639 100644 --- a/Reconstruction/Jet/JetValidation/share/JetPhysVal_jobOption.py +++ b/Reconstruction/Jet/JetValidation/share/JetPhysVal_jobOption.py @@ -1,11 +1,13 @@ # Inspired by PhysVal_jobOptions.py # Set up the reading of the input xAOD: -#FNAME = "AOD.pool.root" -FNAME = "/afs/cern.ch/atlas/groups/JetEtmiss/ReferenceFiles/RTT/MC/AOD/mc12_8TeV.117050.PowhegPythia_P2011C_ttbar.simul.AOD.e1728_s1581.20_0_0.039772.pool.root.1" +FNAME = "AOD.pool.root" +#FNAME = "/afs/cern.ch/atlas/groups/JetEtmiss/ReferenceFiles/RTT/MC/AOD/mc12_8TeV.117050.PowhegPythia_P2011C_ttbar.simul.AOD.e1728_s1581.20_0_0.039772.pool.root.1" include( "AthenaPython/iread_file.py" ) -#import AthenaPoolCnvSvc.ReadAthenaPool -#ServiceMgr.EventSelector.InputCollections = [ FNAME ] + +# only for testing... +# import AthenaPoolCnvSvc.ReadAthenaPool +# ServiceMgr.EventSelector.InputCollections = [ FNAME ] from JetValidation.PhysicsValidationHistos import athenaPhysValTool diff --git a/Reconstruction/MET/METReconstruction/METReconstruction/METAssociator.h b/Reconstruction/MET/METReconstruction/METReconstruction/METAssociator.h index f23250ace43befa41a38a178e1165a8816eb6936..4f7d8ec1001c1ce6451f723da792fd84786baa9a 100644 --- a/Reconstruction/MET/METReconstruction/METReconstruction/METAssociator.h +++ b/Reconstruction/MET/METReconstruction/METReconstruction/METAssociator.h @@ -85,7 +85,6 @@ namespace met { std::string m_pvcoll; std::string m_trkcoll; std::string m_clcoll; - std::string m_goodtracks_coll; bool m_pflow; bool m_useTracks; @@ -93,6 +92,7 @@ namespace met { bool m_useIsolationTools; bool m_useModifiedClus; bool m_weight_charged_pfo; + bool m_cleanChargedPFO; ToolHandle<CP::IRetrievePFOTool> m_pfotool; ToolHandle<CP::IWeightPFOTool> m_pfoweighttool; diff --git a/Reconstruction/MET/METReconstruction/METReconstruction/METCaloRegionsTool.h b/Reconstruction/MET/METReconstruction/METReconstruction/METCaloRegionsTool.h index fa7c6b48c359b1aba606bb884a55a45d87864d13..f765e0d0d59ef10488dd41849a8f403d2611a9c1 100644 --- a/Reconstruction/MET/METReconstruction/METReconstruction/METCaloRegionsTool.h +++ b/Reconstruction/MET/METReconstruction/METReconstruction/METCaloRegionsTool.h @@ -118,7 +118,8 @@ namespace met{ // Tool handle for CaloNoiseTool #if defined(XAOD_STANDALONE) || defined(XAOD_ANALYSIS) #else - ToolHandle<ICaloNoiseTool> m_caloNoiseTool; + // FIXME: mutable + mutable ToolHandle<ICaloNoiseTool> m_caloNoiseTool; #endif }; diff --git a/Reconstruction/MET/METReconstruction/METReconstruction/METSoftAssociator.h b/Reconstruction/MET/METReconstruction/METReconstruction/METSoftAssociator.h index f2bf51d0f030c5af651a50d12f9ddbc997ce3f04..ffdcfc94c6ff7cd28538efdf03b61864465caddd 100644 --- a/Reconstruction/MET/METReconstruction/METReconstruction/METSoftAssociator.h +++ b/Reconstruction/MET/METReconstruction/METReconstruction/METSoftAssociator.h @@ -75,6 +75,7 @@ namespace met{ bool m_decorateSoftTermConst; std::string m_lcmodclus_key; std::string m_emmodclus_key; + bool m_weight_soft_pfo; }; diff --git a/Reconstruction/MET/METReconstruction/Root/METAssociator.cxx b/Reconstruction/MET/METReconstruction/Root/METAssociator.cxx index 59b3410a2204c95343cc7ff5ba98cb852ce521b9..d2ce010b0c0b124877b787c3fd494c415fde890f 100644 --- a/Reconstruction/MET/METReconstruction/Root/METAssociator.cxx +++ b/Reconstruction/MET/METReconstruction/Root/METAssociator.cxx @@ -60,22 +60,22 @@ namespace met { declareProperty( "PrimVxColl", m_pvcoll = "PrimaryVertices" ); declareProperty( "TrkColl", m_trkcoll = "InDetTrackParticles" ); declareProperty( "ClusColl", m_clcoll = "CaloCalTopoClusters" ); - declareProperty( "UseModifiedClus", m_useModifiedClus = false ); + declareProperty( "UseModifiedClus", m_useModifiedClus = false ); declareProperty( "UseTracks", m_useTracks = true ); declareProperty( "PFlow", m_pflow = false ); - declareProperty( "WeightCPFO", m_weight_charged_pfo = true ); + declareProperty( "WeightCPFO", m_weight_charged_pfo = true ); declareProperty( "UseRapidity", m_useRapidity = false ); declareProperty( "PFOTool", m_pfotool ); - declareProperty( "PFOWeightTool", m_pfoweighttool ); + declareProperty( "PFOWeightTool", m_pfoweighttool ); declareProperty( "TrackSelectorTool", m_trkseltool ); declareProperty( "TrackIsolationTool", m_trkIsolationTool ); declareProperty( "CaloIsolationTool", m_caloIsolationTool ); - declareProperty( "GoodTracksColl", m_goodtracks_coll = "METRecoGoodTrackParticles" ); declareProperty( "IgnoreJetConst", m_skipconst = false ); - declareProperty( "ForwardColl", m_forcoll = "" ); + declareProperty( "ForwardColl", m_forcoll = "" ); declareProperty( "ForwardDef", m_foreta = 2.5 ); - declareProperty( "CentralTrackPtThr", m_cenTrackPtThr = 200e+3 ); - declareProperty( "ForwardTrackPtThr", m_forTrackPtThr = 120e+3 ); + declareProperty( "CentralTrackPtThr", m_cenTrackPtThr = 30e+3 ); + declareProperty( "ForwardTrackPtThr", m_forTrackPtThr = 30e+3 ); + declareProperty( "CleanCPFO", m_cleanChargedPFO = true ); } // Destructor @@ -325,7 +325,7 @@ namespace met { std::vector<Iso::IsolationType> caloIsoCones_coreCone; caloIsoCones_coreCone.push_back(xAOD::Iso::IsolationType::etcone20); xAOD::CaloCorrection caloIsoCorr_coreCone; - caloIsoCorr_coreCone.calobitset.set(xAOD::Iso::IsolationCaloCorrection::coreCone); + caloIsoCorr_coreCone.calobitset.set(xAOD::Iso::IsolationCaloCorrection::noneCaloCorrection); m_caloIsolationTool->caloTopoClusterIsolation(caloIsoResult_coreCone, *trk, caloIsoCones_coreCone, diff --git a/Reconstruction/MET/METReconstruction/Root/METEgammaAssociator.cxx b/Reconstruction/MET/METReconstruction/Root/METEgammaAssociator.cxx index 1ce604a194f775f120bed7da2af13ad3e53d9e57..a23bbd8c03c9408ff3b36a7db51e9104fd010b9a 100644 --- a/Reconstruction/MET/METReconstruction/Root/METEgammaAssociator.cxx +++ b/Reconstruction/MET/METReconstruction/Root/METEgammaAssociator.cxx @@ -162,7 +162,10 @@ namespace met { nearbyPFO.reserve(20); for(const auto& pfo : *constits.pfoCont) { if(P4Helpers::isInDeltaR(*pfo, *swclus, 0.4, m_useRapidity)) { - if(fabs(pfo->charge())<FLT_MIN || acceptChargedPFO(pfo->track(0),constits.pv)) { + if(fabs(pfo->charge())<FLT_MIN + || (acceptChargedPFO(pfo->track(0),constits.pv) + && ( !m_cleanChargedPFO || isGoodEoverP(pfo->track(0)) ) + )) { nearbyPFO.push_back(pfo); } // retain neutral PFOs and charged PFOs passing PV association } // DeltaR check diff --git a/Reconstruction/MET/METReconstruction/Root/METJetAssocTool.cxx b/Reconstruction/MET/METReconstruction/Root/METJetAssocTool.cxx index d3a56770fee297975d95d09dea98b75da22bb68f..284ae7a07161fe31e921095e78d7c9f74e2a2c85 100644 --- a/Reconstruction/MET/METReconstruction/Root/METJetAssocTool.cxx +++ b/Reconstruction/MET/METReconstruction/Root/METJetAssocTool.cxx @@ -103,7 +103,6 @@ namespace met { } // Create jet associations - MissingETBase::Types::constvec_t trkvec; for(const auto& jet : *jetCont) { std::vector<const IParticle*> selectedTracks; bool mismatchedPFlow = m_pflow && jet->rawConstituent(0)->type()!=xAOD::Type::ParticleFlow; @@ -113,9 +112,8 @@ namespace met { for (size_t consti = 0; consti < jet->numConstituents(); consti++) { const xAOD::PFO *pfo = static_cast<const xAOD::PFO*>(jet->rawConstituent(consti)); ATH_MSG_VERBOSE("Jet constituent PFO, pt " << pfo->pt()); - if (fabs(pfo->charge())>1e-9) { + if (fabs(pfo->charge())>1e-9 && isGoodEoverP(pfo->track(0))) { ATH_MSG_VERBOSE(" Accepted charged PFO, pt " << pfo->pt()); - trkvec += *pfo; selectedTracks.push_back(pfo); } } diff --git a/Reconstruction/MET/METReconstruction/Root/METMuonAssociator.cxx b/Reconstruction/MET/METReconstruction/Root/METMuonAssociator.cxx index 1cc01c2c6b27b157e6beaf0fe1bc185d34541bb3..5b2fe4f26d5c7f170135e979a8c549cfab3ee468 100644 --- a/Reconstruction/MET/METReconstruction/Root/METMuonAssociator.cxx +++ b/Reconstruction/MET/METReconstruction/Root/METMuonAssociator.cxx @@ -154,7 +154,9 @@ namespace met { for(const auto& pfo : *constits.pfoCont) { if(fabs(pfo->charge())>1e-9) { // get charged PFOs by matching the muon ID track - if(idtrack && acceptChargedPFO(idtrack,constits.pv) && pfo->track(0) == idtrack) { + if(idtrack && pfo->track(0) == idtrack && acceptChargedPFO(idtrack,constits.pv) && + ( !m_cleanChargedPFO || isGoodEoverP(pfo->track(0)) ) + ) { ATH_MSG_VERBOSE("Accept muon PFO " << pfo << " px, py = " << pfo->p4().Px() << ", " << pfo->p4().Py()); ATH_MSG_VERBOSE("Muon PFO index: " << pfo->index() << ", pt: " << pfo->pt() << ", eta: " << pfo->eta() << ", phi: " << pfo->phi() ); ATH_MSG_VERBOSE("Muon ID Track index: " << idtrack->index() << ", pt: " << idtrack->pt() << ", eta: " << idtrack->eta() << ", phi: " << idtrack->phi() ); diff --git a/Reconstruction/MET/METReconstruction/Root/METSoftAssociator.cxx b/Reconstruction/MET/METReconstruction/Root/METSoftAssociator.cxx index fe7e597c2ae53318969e26b724c8b21fba2e9a2f..116cd322739b7b12e55956d44654784481a54a32 100644 --- a/Reconstruction/MET/METReconstruction/Root/METSoftAssociator.cxx +++ b/Reconstruction/MET/METReconstruction/Root/METSoftAssociator.cxx @@ -17,6 +17,8 @@ #include "xAODCaloEvent/CaloClusterChangeSignalState.h" #include "xAODCaloEvent/CaloClusterContainer.h" +#include "PFlowUtils/IWeightPFOTool.h" + namespace met { using namespace xAOD; @@ -31,6 +33,7 @@ namespace met { declareProperty("DecorateSoftConst", m_decorateSoftTermConst=false); declareProperty("LCModClusterKey", m_lcmodclus_key = "LCOriginTopoClusters"); declareProperty("EMModClusterKey", m_emmodclus_key = "EMOriginTopoClusters"); + declareProperty("WeightSoftPFO", m_weight_soft_pfo = false); } // Destructor @@ -96,9 +99,15 @@ namespace met { for(const auto& sig : *uniquePFOs) { const PFO *pfo = static_cast<const PFO*>(sig); if (fabs(pfo->charge())>1e-9) { - if (acceptChargedPFO(pfo->track(0),constits.pv)) { + if (acceptChargedPFO(pfo->track(0),constits.pv) && + ( !m_cleanChargedPFO || isGoodEoverP(pfo->track(0)) ) + ) { *metCoreTrk += sig; - *metCoreCl += sig; + float weight = 1.0; + if(m_weight_charged_pfo && m_weight_soft_pfo) { + ATH_CHECK( m_pfoweighttool->fillWeight( *pfo, weight ) ); + } + metCoreCl->add(sig,weight); if(m_decorateSoftTermConst) { dec_softConst(*metCoreTrk).push_back(ElementLink<IParticleContainer>(*static_cast<const IParticleContainer*>(sig->container()),sig->index())); dec_softConst(*metCoreCl).push_back(ElementLink<IParticleContainer>(*static_cast<const IParticleContainer*>(sig->container()),sig->index())); diff --git a/Reconstruction/MET/METReconstruction/Root/METTauAssociator.cxx b/Reconstruction/MET/METReconstruction/Root/METTauAssociator.cxx index de558e9c623eca30bc7152eae38e4316fd338378..84793a007d7c5f44e55701da2b0250e62282200a 100644 --- a/Reconstruction/MET/METReconstruction/Root/METTauAssociator.cxx +++ b/Reconstruction/MET/METReconstruction/Root/METTauAssociator.cxx @@ -101,29 +101,6 @@ namespace met { const met::METAssociator::ConstitHolder& /*tcCont*/) const { const TauJet* tau = static_cast<const TauJet*>(obj); - /////////////////////////////////////////// TO-BE REMOVED!!! - /////////////////////////////////////////// TO-BE REMOVED!!! - ////// <<<===== OLD TAU EDM : ASM 19/4/2016 - //const Jet* seedjet = *tau->jetLink(); - //JetConstituentVector constit = seedjet->getConstituents(); - //ATH_MSG_VERBOSE("Current tau has " << constit.size() << " constituents."); - //// test for used topoclusters, and retrieve unused ones (ok until/unless we use PFlow taus) - //// only use clusters for computing the overlap removal relative to other objects - //for(const auto& cl : constit) { - // // TEMP: use jet seed axis - // // taus will provide an accessor - // if(!xAOD::P4Helpers::isInDeltaR(*seedjet,*cl->rawConstituent(),0.2,m_useRapidity)) continue; - // // skip cluster if dR>0.2 - // if(cl->rawConstituent()->type() == xAOD::Type::CaloCluster) { - // const CaloCluster* pClus = static_cast<const CaloCluster*>( cl->rawConstituent() ); - // tclist.push_back(pClus); - // } else { - // ATH_MSG_WARNING("Expected an object of type CaloCluster, received one of type " << cl->rawConstituent()->type()); - // } - //} // loop over jet constituents - ////// <<<===== OLD TAU EDM : ASM 19/4/2016 - /////////////////////////////////////////// TO-BE REMOVED!!! - /////////////////////////////////////////// TO-BE REMOVED!!! for( ElementLink< xAOD::IParticleContainer > cluster_link : tau->clusterLinks() ){ const xAOD::IParticle* ipart = *cluster_link; if(ipart->type() != xAOD::Type::CaloCluster) { @@ -145,32 +122,9 @@ namespace met { const met::METAssociator::ConstitHolder& constits) const { const TauJet* tau = static_cast<const TauJet*>(obj); - /////////////////////////////////////////// TO-BE REMOVED!!! - /////////////////////////////////////////// TO-BE REMOVED!!! - ////// <<<===== OLD TAU EDM : ASM 18/4/2016 - //const Jet* jet = *tau->jetLink(); - //for(size_t iTrk=0; iTrk<tau->nTracks(); ++iTrk) { - // const TrackParticle* tautrk = tau->track(iTrk); - // if(acceptTrack(tautrk,pv) && isGoodEoverP(tautrk,tcCont)) { - // // if(acceptTrack(tautrk,pv)) { - //ATH_MSG_VERBOSE("Accept tau track " << tautrk << " px, py = " << tautrk->p4().Px() << ", " << tautrk->p4().Py()); - //constlist.push_back(tautrk); - // } - //} - //for(size_t iTrk=0; iTrk<tau->nOtherTracks(); ++iTrk) { - // const TrackParticle* tautrk = tau->otherTrack(iTrk); - // if(xAOD::P4Helpers::isInDeltaR(*jet,*tautrk,0.2,m_useRapidity) && acceptTrack(tautrk,pv) && isGoodEoverP(tautrk,tcCont)) { - // // if(dR<0.2 && acceptTrack(tautrk,pv)) { - //ATH_MSG_VERBOSE("Accept track " << tautrk << " px, py = " << tautrk->p4().Px() << ", " << tautrk->p4().Py()); - //constlist.push_back(tautrk); - // } - //} - ////// <<<===== OLD TAU EDM : ASM 18/4/2016 - /////////////////////////////////////////// TO-BE REMOVED!!! - /////////////////////////////////////////// TO-BE REMOVED!!! for( const xAOD::TauTrack* tauTrk : tau->tracks(xAOD::TauJetParameters::coreTrack) ){//all tracks dR<0.2 regardless of quality const TrackParticle* trk = tauTrk->track(); - if(acceptTrack(trk,constits.pv) && isGoodEoverP(trk)){ + if(acceptTrack(trk,constits.pv) && ( !m_cleanChargedPFO || isGoodEoverP(trk) ) ){ ATH_MSG_VERBOSE("Accept tau track " << trk << " px, py = " << trk->p4().Px() << ", " << trk->p4().Py()); constlist.push_back(trk); } @@ -198,27 +152,11 @@ namespace met { } else { const TrackParticle* pfotrk = pfo->track(0); - /////////////////////////////////////////// TO-BE REMOVED!!! - /////////////////////////////////////////// TO-BE REMOVED!!! - ////// <<<===== OLD TAU EDM : ASM 18/4/2016 - //for(size_t iTrk=0; iTrk<tau->nTracks(); ++iTrk) { - // const TrackParticle* tautrk = tau->track(iTrk); - // if(tautrk==pfotrk) { - // if(acceptChargedPFO(tautrk,pv)) match = true; - // } - //} - //for(size_t iTrk=0; iTrk<tau->nOtherTracks(); ++iTrk) { - // const TrackParticle* tautrk = tau->otherTrack(iTrk); - // if(tautrk==pfotrk && xAOD::P4Helpers::isInDeltaR(*seedjet,*tautrk,0.2,m_useRapidity) && acceptChargedPFO(tautrk,pv)) match = true; - //} - ////// <<<===== OLD TAU EDM : ASM 18/4/2016 - /////////////////////////////////////////// TO-BE REMOVED!!! - /////////////////////////////////////////// TO-BE REMOVED!!! for( const xAOD::TauTrack* ttrk : tau->tracks(xAOD::TauJetParameters::coreTrack) ){//all tracks <0.2, no quality const TrackParticle* tautrk = ttrk->track(); if(tautrk==pfotrk) { ATH_MSG_VERBOSE("Found cPFO with dR " << seedjet->p4().DeltaR(ttrk->p4())); - if(acceptChargedPFO(tautrk,constits.pv)) match = true; + if(acceptChargedPFO(tautrk,constits.pv) && isGoodEoverP(pfotrk)) match = true; } } } diff --git a/Reconstruction/MET/METReconstruction/python/METAssocConfig.py b/Reconstruction/MET/METReconstruction/python/METAssocConfig.py index ce54120c386a487154d7895f214452a452935a74..181fb5bfd7ab4034b410171ae288a8e32e7ecd39 100644 --- a/Reconstruction/MET/METReconstruction/python/METAssocConfig.py +++ b/Reconstruction/MET/METReconstruction/python/METAssocConfig.py @@ -160,7 +160,8 @@ class METAssocConfig: self.trkseltool=CfgMgr.InDet__InDetTrackSelectionTool("IDTrkSel_METAssoc", CutLevel="TightPrimary", maxZ0SinTheta=3, - maxD0=2) + maxD0=2, + minPt=500) if not hasattr(ToolSvc,self.trkseltool.name()): ToolSvc += self.trkseltool @@ -169,7 +170,8 @@ class METAssocConfig: if not hasattr(ToolSvc,self.trkisotool.name()): ToolSvc += self.trkisotool - self.caloisotool = CfgMgr.xAOD__CaloIsolationTool("CaloIsolationTool_MET") + self.caloisotool = CfgMgr.xAOD__CaloIsolationTool("CaloIsolationTool_MET", + saveOnlyRequestedCorrections=True) if not hasattr(ToolSvc,self.caloisotool.name()): ToolSvc += self.caloisotool diff --git a/Reconstruction/MET/METReconstruction/python/METRecoConfig.py b/Reconstruction/MET/METReconstruction/python/METRecoConfig.py index f9636b107f100cc0884bc69db4207380eeb074b3..5218cfddd6b9abbcfc24c5e57aa6268278bdc1b0 100644 --- a/Reconstruction/MET/METReconstruction/python/METRecoConfig.py +++ b/Reconstruction/MET/METReconstruction/python/METRecoConfig.py @@ -268,11 +268,13 @@ class METConfig: self.trkseltool=CfgMgr.InDet__InDetTrackSelectionTool("IDTrkSel_MET", CutLevel="TightPrimary", maxZ0SinTheta=3, - maxD0=2) + maxD0=2, + minPt=500) if not hasattr(ToolSvc,self.trkseltool.name()): ToolSvc += self.trkseltool # - self.trkvxtool=CfgMgr.CP__TightTrackVertexAssociationTool("TightTrackVertexAssociationTool_MET", dzSinTheta_cut=1.5, doPV=False) + self.trkvxtool=CfgMgr.CP__LooseTrackVertexAssociationTool("LooseTrackVertexAssociationTool_MET") + #self.trkvxtool=CfgMgr.CP__TightTrackVertexAssociationTool("TightTrackVertexAssociationTool_MET", dzSinTheta_cut=3, doPV=False) if not hasattr(ToolSvc,self.trkvxtool.name()): ToolSvc += self.trkvxtool # @@ -281,7 +283,8 @@ class METConfig: if not hasattr(ToolSvc,self.trkisotool.name()): ToolSvc += self.trkisotool # - self.caloisotool = CfgMgr.xAOD__CaloIsolationTool("CaloIsolationTool_MET") + self.caloisotool = CfgMgr.xAOD__CaloIsolationTool("CaloIsolationTool_MET", + saveOnlyRequestedCorrections=True) if not hasattr(ToolSvc,self.caloisotool.name()): ToolSvc += self.caloisotool diff --git a/Reconstruction/MET/METReconstruction/share/METReconstructionOutputAODList_jobOptions.py b/Reconstruction/MET/METReconstruction/share/METReconstructionOutputAODList_jobOptions.py index eccdd0fc3ecce26eb61f31df6987bfc2d3d6a332..7474135f61e8513833182dd4c6b22a3e82eda97a 100644 --- a/Reconstruction/MET/METReconstruction/share/METReconstructionOutputAODList_jobOptions.py +++ b/Reconstruction/MET/METReconstruction/share/METReconstructionOutputAODList_jobOptions.py @@ -26,4 +26,4 @@ for config in assocoutput: MissingETAODList.append( 'xAOD::MissingETContainer#MET_Core_'+config ) MissingETAODList.append( 'xAOD::MissingETAuxContainer#MET_Core_'+config+'Aux.' ) MissingETAODList.append( 'xAOD::MissingETContainer#MET_Reference_'+config ) - MissingETAODList.append( 'xAOD::MissingETAuxContainer#MET_Reference_'+config+'Aux.-ConstitObjectLinks' ) + MissingETAODList.append( 'xAOD::MissingETAuxContainer#MET_Reference_'+config+'Aux.-ConstitObjectLinks.-ConstitObjectWeights' ) diff --git a/Reconstruction/MET/METReconstruction/share/METReconstructionOutputESDList_jobOptions.py b/Reconstruction/MET/METReconstruction/share/METReconstructionOutputESDList_jobOptions.py index 3194c3b8cc56e77a060f15e23054fca70a052e0f..32718a10d12e66542c69cd9a9050c3cefb86572a 100644 --- a/Reconstruction/MET/METReconstruction/share/METReconstructionOutputESDList_jobOptions.py +++ b/Reconstruction/MET/METReconstruction/share/METReconstructionOutputESDList_jobOptions.py @@ -26,4 +26,4 @@ for config in assocoutput: MissingETESDList.append( 'xAOD::MissingETContainer#MET_Core_'+config ) MissingETESDList.append( 'xAOD::MissingETAuxContainer#MET_Core_'+config+'Aux.' ) MissingETESDList.append( 'xAOD::MissingETContainer#MET_Reference_'+config ) - MissingETESDList.append( 'xAOD::MissingETAuxContainer#MET_Reference_'+config+'Aux.-ConstitObjectLinks' ) + MissingETESDList.append( 'xAOD::MissingETAuxContainer#MET_Reference_'+config+'Aux.-ConstitObjectLinks.-ConstitObjectWeights' ) diff --git a/Reconstruction/MET/METUtilities/CMakeLists.txt b/Reconstruction/MET/METUtilities/CMakeLists.txt index c9b55bf1541eef3557984cf0a5ad15c6e1382ee0..290b2e06aabdf8a6806879404c4a3de313bd7f79 100644 --- a/Reconstruction/MET/METUtilities/CMakeLists.txt +++ b/Reconstruction/MET/METUtilities/CMakeLists.txt @@ -1,4 +1,4 @@ -# $Id: CMakeLists.txt 786364 2016-11-24 18:23:50Z khoo $ +# $Id: CMakeLists.txt 788236 2016-12-06 14:03:54Z khoo $ ################################################################################ # Package: METUtilities ################################################################################ @@ -102,3 +102,4 @@ atlas_install_python_modules( python/*.py ) atlas_install_joboptions( share/*.py ) atlas_install_data( data/* ) + diff --git a/Reconstruction/MET/METUtilities/METUtilities/METHelpers.h b/Reconstruction/MET/METUtilities/METUtilities/METHelpers.h index 637a8d00684d37cfaba1082cc21b9978299bd509..2014223d3e31a673b768bc2d45ac0d7caf494af3 100644 --- a/Reconstruction/MET/METUtilities/METUtilities/METHelpers.h +++ b/Reconstruction/MET/METUtilities/METUtilities/METHelpers.h @@ -17,7 +17,8 @@ namespace met { void addGhostMuonsToJets(const xAOD::MuonContainer& muons, xAOD::JetContainer& jets); - + // void addGhostElecsToJets(const xAOD::ElectronContainer& elecs, xAOD::JetContainer& jets); + } #endif diff --git a/Reconstruction/MET/METUtilities/METUtilities/METMaker.h b/Reconstruction/MET/METUtilities/METUtilities/METMaker.h index 2a5c8f42ed8575f31fca5e994117e72903d38d4c..1362351f20a0d9f093ff6e04c2a5a09783b57a01 100644 --- a/Reconstruction/MET/METUtilities/METUtilities/METMaker.h +++ b/Reconstruction/MET/METUtilities/METUtilities/METMaker.h @@ -153,6 +153,7 @@ namespace met { double m_jetMinWeightedPt; std::string m_jetConstitScaleMom; std::string m_jetJvtMomentName; + std::string m_jetRejectionDec; double m_CenJetPtCut, m_FwdJetPtCut ; // jet pt cut for central/forward jets(eta<2.4) double m_JvtCut, m_JvtPtMax; // JVT cut and pt region of jets to apply a JVT selection @@ -161,12 +162,15 @@ namespace met { double m_customCenJetPtCut,m_customFwdJetPtCut; double m_customJvtCut,m_customJvtPtMax; + bool m_extraJetRejection; bool m_doPFlow; bool m_doSoftTruth; bool m_doConstJet; bool m_useGhostMuons; bool m_doRemoveMuonJets; + bool m_doRemoveElecTrks; + bool m_doRemoveElecTrksEM; bool m_doSetMuonJetEMScale; bool m_muEloss; diff --git a/Reconstruction/MET/METUtilities/Root/METHelpers.cxx b/Reconstruction/MET/METUtilities/Root/METHelpers.cxx index d7ad3414d84dcce716ec9973cee6324b4cf85b93..1bb53d63177866e2ed39171c0992ede05c3a93a6 100644 --- a/Reconstruction/MET/METUtilities/Root/METHelpers.cxx +++ b/Reconstruction/MET/METUtilities/Root/METHelpers.cxx @@ -15,6 +15,10 @@ // Muon EDM #include "xAODMuon/MuonContainer.h" +// Electron EDM +#include "xAODEgamma/ElectronContainer.h" +#include "xAODEgamma/EgammaxAODHelpers.h" + // Jet EDM #include "xAODJet/JetContainer.h" @@ -61,4 +65,41 @@ namespace met { } // end addGhostMuonsToJets(...) + // void addGhostElecsToJets(const xAOD::ElectronContainer& elecs, xAOD::JetContainer& jets) + // { + // std::vector<const xAOD::TrackParticle*> jet_tracks; + // for (const auto& jet: jets) { + // // Fill this with muons to be associated + // std::vector<const xAOD::Electron*> elecs_in_jet; + // // Get the tracks associated to the jet + // jet_tracks.clear(); + // if ( jet->getAssociatedObjects("GhostTrack", jet_tracks) ) { + + // for(const auto& elec : elecs) { + // bool eleMatch=false; + // for(size_t iTrk=0; iTrk<elec->nTrackParticles(); ++iTrk) { + // const xAOD::TrackParticle* idtrack = xAOD::EgammaHelpers::getOriginalTrackParticleFromGSF(elec->trackParticle(iTrk)); + // if(idtrack) { + // // check if this is ghost associated to a jet + // //make sure the jet is close first + // if(xAOD::P4Helpers::deltaR2(*jet,*elec)>0.3) continue; + // for(unsigned jtrk=0; jtrk<jet_tracks.size(); ++jtrk) { + // if(jet_tracks.at(jtrk)==idtrack) { + // //check if the track pointers match + // elecs_in_jet.push_back(elec); + // eleMatch=true; + // break; + // } + // } // loop over jet tracks + // } // if elec has ID track + // if(eleMatch) break; + // } + // } // loop over elecs + // } // jet has associated tracks + // //std::cout << "METHelpers::addGhostElecsToJets -- Jet has = " << elecs_in_jet.size() << " ghost electrons" << std::endl; + // jet->setAssociatedObjects( "GhostElec", elecs_in_jet) ; + // } // loop over jets + + // } // end addGhostElecsToJets(...) + } diff --git a/Reconstruction/MET/METUtilities/Root/METMaker.cxx b/Reconstruction/MET/METUtilities/Root/METMaker.cxx index 7c058e8c7835d07f7ca50b5b6306c727107f4a94..22c6ed576e9ca61255c315b9aa1e77d4d3155ec5 100644 --- a/Reconstruction/MET/METUtilities/Root/METMaker.cxx +++ b/Reconstruction/MET/METUtilities/Root/METMaker.cxx @@ -31,6 +31,10 @@ // Muon EDM #include "xAODMuon/MuonContainer.h" +// Electron EDM +#include "xAODEgamma/ElectronContainer.h" +#include "xAODEgamma/EgammaxAODHelpers.h" + namespace met { using std::vector; @@ -55,7 +59,8 @@ namespace met { typedef ElementLink<xAOD::IParticleContainer> iplink_t; static const SG::AuxElement::ConstAccessor< iplink_t > acc_originalObject("originalObjectLink"); static const SG::AuxElement::ConstAccessor< std::vector<iplink_t > > acc_ghostMuons("GhostMuon"); - + static const SG::AuxElement::ConstAccessor< std::vector<iplink_t > > acc_ghostElecs("GhostElec"); + static const SG::AuxElement::ConstAccessor< std::vector<int> > acc_trkN("NumTrkPt500"); static const SG::AuxElement::ConstAccessor< std::vector<float> > acc_trksumpt("SumPtTrkPt500"); static const SG::AuxElement::ConstAccessor< std::vector<float> > acc_sampleE("EnergyPerSampling"); @@ -64,7 +69,10 @@ namespace met { static const SG::AuxElement::ConstAccessor<float> acc_width("Width"); static const SG::AuxElement::ConstAccessor<float> acc_Eloss("EnergyLoss"); - static const SG::AuxElement::Decorator< std::vector<iplink_t > > dec_constitObjLinks("ConstitObjectLinks"); + static const SG::AuxElement::Decorator< std::vector<iplink_t> > dec_constitObjLinks("ConstitObjectLinks"); + static const SG::AuxElement::Decorator< std::vector<float> > dec_constitObjWeights("ConstitObjectWeights"); + // Implement dphi as well if we start correcting the jet phi. + // static const SG::AuxElement::Decorator< std::vector<float> > dec_constitObjDphis("ConstitObjectDphis"); const static MissingETBase::Types::bitmask_t invisSource = 0x100000; // doesn't overlap with any other @@ -76,6 +84,7 @@ namespace met { //////////////// METMaker::METMaker(const std::string& name) : AsgTool(name), + m_extraJetRejection(false), m_trkseltool("") { // @@ -85,6 +94,7 @@ namespace met { // declareProperty("VxColl", m_pvcoll = "PrimaryVertices" ); declareProperty("JetJvtMomentName", m_jetJvtMomentName = "Jvt" ); + declareProperty("JetRejectionDec", m_jetRejectionDec = "" ); declareProperty("JetMinEFrac", m_jetMinEfrac = 0.5 ); declareProperty("JetMinWeightedPt", m_jetMinWeightedPt = 0. ); //declareProperty("JetConstitScaleMom", m_jetConstitScaleMom = "JetLCScaleMomentum"); @@ -94,7 +104,7 @@ namespace met { declareProperty("DoSoftTruth", m_doSoftTruth = false ); declareProperty("DoJetTruth", m_doConstJet = false ); - declareProperty("JetSelection", m_jetSelection = "Default" );//Default, Tight or Expert + declareProperty("JetSelection", m_jetSelection = "Default" );//Default, Tight, PFlow or Expert declareProperty("CustomCentralJetPt", m_customCenJetPtCut = 20e3 ); declareProperty("CustomForwardJetPt", m_customFwdJetPtCut = 20e3 ); declareProperty("CustomJetJvtCut", m_customJvtCut = 0.59 ); @@ -102,10 +112,13 @@ namespace met { declareProperty("DoMuonEloss", m_muEloss = false ); declareProperty("ORCaloTaggedMuons", m_orCaloTaggedMuon = true ); - + declareProperty("UseGhostMuons", m_useGhostMuons = false ); - declareProperty("DoRemoveMuonJets", m_doRemoveMuonJets = false ); - declareProperty("DoSetMuonJetEMScale", m_doSetMuonJetEMScale = false ); + declareProperty("DoRemoveMuonJets", m_doRemoveMuonJets = true ); + declareProperty("DoSetMuonJetEMScale", m_doSetMuonJetEMScale = true ); + + declareProperty("DoRemoveElecTrks", m_doRemoveElecTrks = true ); + declareProperty("DoRemoveElecTrksEM", m_doRemoveElecTrksEM = false ); declareProperty("TrackSelectorTool", m_trkseltool ); } @@ -124,6 +137,7 @@ namespace met { //default jet selection i.e. pre-recommendation ATH_MSG_VERBOSE("Use jet selection criterion: " << m_jetSelection); if (m_jetSelection == "Default") { m_CenJetPtCut = 20e3; m_FwdJetPtCut = 20e3; m_JvtCut = 0.59; m_JvtPtMax = 60e3;} + else if (m_jetSelection == "PFlow") { m_CenJetPtCut = 20e3; m_FwdJetPtCut = 20e3; m_JvtCut = 0.2; m_JvtPtMax = 60e3;} else if (m_jetSelection == "Tight") { m_CenJetPtCut = 20e3; m_FwdJetPtCut = 30e3; m_JvtCut = 0.59; m_JvtPtMax = 60e3;} else if (m_jetSelection == "Tier0") { m_CenJetPtCut = 0; m_FwdJetPtCut = 0; m_JvtCut = -1; m_JvtPtMax = 0;} else if (m_jetSelection == "Expert") { @@ -133,10 +147,17 @@ namespace met { m_JvtCut = m_customJvtCut; m_JvtPtMax = m_customJvtPtMax; } - else { ATH_MSG_ERROR( "Error: No available jet selection found! Choose one: Default, Tight, Expert" ); return StatusCode::FAILURE; } + else { ATH_MSG_ERROR( "Error: No available jet selection found! Choose one: Default, Tight, PFlow, Expert" ); return StatusCode::FAILURE; } + + if (!m_jetRejectionDec.empty()) m_extraJetRejection = true; if (!m_trkseltool.empty()) ATH_CHECK( m_trkseltool.retrieve() ); + if(m_jetSelection=="PFlow" && !m_doPFlow) { + ATH_MSG_ERROR("\'PFlow\' jet selection needs DoPFlow=true."); + return StatusCode::FAILURE; + } + return StatusCode::SUCCESS; } @@ -243,8 +264,11 @@ namespace met { } ATH_MSG_VERBOSE("Building MET term " << met->name()); dec_constitObjLinks(*met) = vector<iplink_t>(0); + dec_constitObjWeights(*met) = vector<float>(0); std::vector<iplink_t>& uniqueLinks = dec_constitObjLinks(*met); - uniqueLinks.clear(); + std::vector<float>& uniqueWeights = dec_constitObjWeights(*met); + uniqueLinks.reserve(collection->size()); + uniqueWeights.reserve(collection->size()); if(!collection->empty()) { bool originalInputs = !acc_originalObject.isAvailable(*collection->front()); bool isShallowCopy = dynamic_cast<const xAOD::ShallowAuxContainer*>(collection->front()->container()->getConstStore()); @@ -280,12 +304,12 @@ namespace met { std::vector<size_t> ind = assocs[i]->overlapIndices(orig); std::vector<const xAOD::IParticle*> allObjects = assocs[i]->objects(); for (size_t indi = 0; indi < ind.size(); indi++) if (allObjects[ind[indi]]) { - if (allObjects[ind[indi]]->type()==xAOD::Type::Electron - && assocs[i]->objSelected(ind[indi])) { - selected = false; - break; + if (allObjects[ind[indi]]->type()==xAOD::Type::Electron + && assocs[i]->objSelected(ind[indi])) { + selected = false; + break; + } } - } } } // Don't overlap remove muons, but flag the non-overlapping muons to take out their tracks from jets @@ -303,6 +327,7 @@ namespace met { } if(selected) { uniqueLinks.emplace_back( iplink_t(*static_cast<const IParticleContainer*>(obj->container()),obj->index()) ); + uniqueWeights.emplace_back( 1. ); } } } @@ -517,9 +542,13 @@ namespace met { } dec_constitObjLinks(*metJet) = std::vector<iplink_t>(0); + dec_constitObjWeights(*metJet) = std::vector<float>(0); std::vector<iplink_t>& uniqueLinks = dec_constitObjLinks(*metJet); - uniqueLinks.clear(); + std::vector<float>& uniqueWeights = dec_constitObjWeights(*metJet); + uniqueLinks.reserve(jets->size()); + uniqueWeights.reserve(jets->size()); std::vector<iplink_t> softJetLinks; + std::vector<float> softJetWeights; bool originalInputs = jets->empty() ? false : !acc_originalObject.isAvailable(*jets->front()); for(const auto& jet : *jets) { @@ -532,7 +561,7 @@ namespace met { } if(assoc && !assoc->isMisc()) { ATH_MSG_VERBOSE( "Jet calib pt = " << jet->pt()); - bool selected = (fabs(jet->eta())<2.4 && jet->pt()>m_CenJetPtCut) || (fabs(jet->eta())>=2.4 && jet->pt()>m_FwdJetPtCut );//jjj + bool selected = (fabs(jet->eta())<2.4 && jet->pt()>m_CenJetPtCut) || (fabs(jet->eta())>=2.4 && jet->pt()>m_FwdJetPtCut );//jjj bool JVT_reject(false); bool isMuFSRJet(false); @@ -549,6 +578,7 @@ namespace met { } } } + if (m_extraJetRejection && jet->auxdata<char>(m_jetRejectionDec)==0) JVT_reject = true; bool hardJet(false); MissingETBase::Types::constvec_t calvec = assoc->overlapCalVec(); bool caloverlap = false; @@ -573,7 +603,7 @@ namespace met { double opy = jpy - calvec.cpy(); MissingET* met_muonEloss(0); - if(m_muEloss) { + if(m_muEloss || m_doSetMuonJetEMScale) { // Get a term to hold the Eloss corrections MissingETContainer* metCont = static_cast<MissingETContainer*>(metJet->container()); met_muonEloss = (*metCont)["MuonEloss"]; @@ -586,33 +616,73 @@ namespace met { float total_eloss(0); MissingETBase::Types::bitmask_t muons_selflags(0); std::vector<const xAOD::Muon*> muons_in_jet; + std::vector<const xAOD::Electron*> electrons_in_jet; + bool passJetForEl=false; if(m_useGhostMuons) { // for backwards-compatibility if(acc_ghostMuons.isAvailable(*jet)) { for(const auto& el : acc_ghostMuons(*jet)) { if(el.isValid()) { - muons_in_jet.push_back(static_cast<const xAOD::Muon*>(*el)); + muons_in_jet.push_back(static_cast<const xAOD::Muon*>(*el)); } else { - ATH_MSG_WARNING("Invalid element link to ghost muon! Quitting."); - return StatusCode::FAILURE; + ATH_MSG_WARNING("Invalid element link to ghost muon! Quitting."); + return StatusCode::FAILURE; } } } else { ATH_MSG_WARNING("Ghost muons requested but not found!"); return StatusCode::FAILURE; } - } else { // should all be associated in r21 - for(const auto& obj : assoc->objects()) if (obj) { - if(obj->type()==xAOD::Type::Muon) { - const xAOD::Muon* mu_test(static_cast<const xAOD::Muon*>(obj)); - ATH_MSG_VERBOSE("Muon " << mu_test->index() << " found in jet " << jet->index()); + } + for(const auto& obj : assoc->objects()) { + if (!obj) { continue; } + if(obj->type()==xAOD::Type::Muon && !m_useGhostMuons) { + const xAOD::Muon* mu_test(static_cast<const xAOD::Muon*>(obj)); + ATH_MSG_VERBOSE("Muon " << mu_test->index() << " found in jet " << jet->index()); + if((m_doRemoveMuonJets || m_doSetMuonJetEMScale) && acc_ghostMuons.isAvailable(*jet)) { if(acc_originalObject.isAvailable(*mu_test)) mu_test = static_cast<const xAOD::Muon*>(*acc_originalObject(*mu_test)); if(MissingETComposition::objSelected(map,mu_test)) { // - muons_in_jet.push_back(mu_test); - ATH_MSG_VERBOSE("Ghost muon is selected by MET."); + muons_in_jet.push_back(mu_test); + ATH_MSG_VERBOSE("Muon is selected by MET."); + } + } + } else if(obj->type()==xAOD::Type::Electron && m_doRemoveElecTrks) { + const xAOD::Electron* el_test(static_cast<const xAOD::Electron*>(obj)); + ATH_MSG_VERBOSE("Electron " << el_test->index() << " found in jet " << jet->index()); + if(acc_originalObject.isAvailable(*el_test)) el_test = static_cast<const xAOD::Electron*>(*acc_originalObject(*el_test)); + if(assoc->objSelected(el_test)){ + if(el_test->pt()>90.0e3) { // only worry about high-pt electrons? + electrons_in_jet.push_back(el_test); + ATH_MSG_VERBOSE("High-pt electron is selected by MET."); } } } } + if(m_doRemoveElecTrks) { + MissingETBase::Types::constvec_t initialTrkMom = assoc->jetTrkVec(); + float jet_ORtrk_sumpt = assoc->overlapTrkVec().sumpt(); + float jet_all_trk_pt = initialTrkMom.sumpt(); + float jet_unique_trk_pt = jet_all_trk_pt - jet_ORtrk_sumpt; + MissingETBase::Types::constvec_t el_calvec; + MissingETBase::Types::constvec_t el_trkvec; + for(const auto& elec : electrons_in_jet) { + el_calvec += assoc->calVec(elec); + el_trkvec += assoc->trkVec(elec); + } + float el_cal_pt = el_calvec.cpt(); + float el_trk_pt = el_trkvec.cpt(); + ATH_MSG_VERBOSE("Elec trk: " << el_trk_pt + << " jetalltrk: " << jet_all_trk_pt + << " jetORtrk: " << jet_ORtrk_sumpt + << " electrk-jetORtrk: " << (el_trk_pt-jet_ORtrk_sumpt) + << " elec cal: " << el_cal_pt + << " jetalltrk-electrk: " << (jet_all_trk_pt-el_trk_pt) + << " jetalltrk-jetORtrk: " << (jet_all_trk_pt-jet_ORtrk_sumpt) ); + // Want to use the jet calo measurement if we had at least one electron + // and the jet has a lot of residual track pt + // Is the cut appropriate? + if(el_trk_pt>1e-9 && jet_unique_trk_pt>10.0e3) passJetForEl=true; + } // end ele-track removal + for(const xAOD::Muon* mu_in_jet : muons_in_jet) { float mu_Eloss = acc_Eloss(*mu_in_jet); @@ -700,12 +770,12 @@ namespace met { ATH_MSG_VERBOSE("Jet " << jet->index() << " const pT after OR " << sqrt(opx*opx+opy*opy)); opx += mu_calovec.cpx(); opy += mu_calovec.cpy(); - double opt = sqrt( opx*opx+opy*opy ); + double opt = sqrt( opx*opx+opy*opy ); ATH_MSG_VERBOSE("Jet " << jet->index() << " const pT diff after OR readding muon clusters " << opt-jpt); - double uniquefrac = 1. - (calvec.ce() - mu_calovec.ce()) / constjet.E(); - ATH_MSG_VERBOSE( "Jet constscale px, py, pt, E = " << jpx << ", " << jpy << ", " << jpt << ", " << constjet.E() ); - ATH_MSG_VERBOSE( "Jet overlap E = " << calvec.ce() - mu_calovec.ce() ); - ATH_MSG_VERBOSE( "Jet OR px, py, pt, E = " << opx << ", " << opy << ", " << opt << ", " << constjet.E() - calvec.ce() ); + double uniquefrac = 1. - (calvec.ce() - mu_calovec.ce()) / constjet.E(); + ATH_MSG_VERBOSE( "Jet constscale px, py, pt, E = " << jpx << ", " << jpy << ", " << jpt << ", " << constjet.E() ); + ATH_MSG_VERBOSE( "Jet overlap E = " << calvec.ce() - mu_calovec.ce() ); + ATH_MSG_VERBOSE( "Jet OR px, py, pt, E = " << opx << ", " << opy << ", " << opt << ", " << constjet.E() - calvec.ce() ); if(isMuFSRJet) { if(met_muonEloss) { @@ -726,7 +796,7 @@ namespace met { } } else { // check unique fraction - if(uniquefrac>m_jetMinEfrac && opt>m_jetMinWeightedPt) { + if((uniquefrac>m_jetMinEfrac || passJetForEl) && opt>m_jetMinWeightedPt) { // add jet corrected for overlaps hardJet = true; if(!tracksForHardJets) { @@ -737,8 +807,17 @@ namespace met { metJet->add(opx*jesF,opy*jesF,opt*jesF); } } else { - if (m_doConstJet) metJet->add(uniquefrac*jpx,uniquefrac*jpy,uniquefrac*jpt); - else metJet->add(uniquefrac*jet->px(),uniquefrac*jet->py(),uniquefrac*jet->pt()); + if (m_doConstJet){ + metJet->add(uniquefrac*jpx,uniquefrac*jpy,uniquefrac*jpt); + } + else{ + if(passJetForEl){ + if(m_doRemoveElecTrksEM) metJet->add(opx,opy,opt); + else metJet->add(uniquefrac*jet->px(),uniquefrac*jet->py(),uniquefrac*jet->pt()); + }else{ + metJet->add(uniquefrac*jet->px(),uniquefrac*jet->py(),uniquefrac*jet->pt()); + } + } } } } @@ -748,12 +827,14 @@ namespace met { if(hardJet){ ATH_MSG_VERBOSE("Jet added at full scale"); uniqueLinks.emplace_back( iplink_t(*static_cast<const IParticleContainer*>(jet->container()),jet->index()) ); + uniqueWeights.emplace_back( uniquefrac ); } else { if(metSoftClus && !JVT_reject) { // add fractional contribution ATH_MSG_VERBOSE("Jet added at const scale"); if (fabs(jet->eta())<2.5 || !(coreSoftClus->source()&MissingETBase::Source::Central)) { softJetLinks.emplace_back( iplink_t(*static_cast<const xAOD::JetContainer*>(jet->container()),jet->index()) ); + softJetWeights.emplace_back( uniquefrac ); metSoftClus->add(opx,opy,opt); } @@ -794,7 +875,10 @@ namespace met { else if (fabs(jet->eta())<2.5 || !(coreSoftTrk->source()&MissingETBase::Source::Central)) { metSoftTrk->add(opx,opy,opt); // Don't need to add if already done for softclus. - if(!metSoftClus) softJetLinks.emplace_back( iplink_t(*static_cast<const xAOD::JetContainer*>(jet->container()),jet->index()) ); + if(!metSoftClus) { + softJetLinks.emplace_back( iplink_t(*static_cast<const xAOD::JetContainer*>(jet->container()),jet->index()) ); + softJetWeights.emplace_back( uniquefrac ); + } // Fill a vector with the soft constituents, if one was provided. // For now, only setting up to work with those corresponding to the jet constituents. @@ -838,12 +922,12 @@ namespace met { // these are recorded in the misc association const MissingETAssociation* assoc = map->getMiscAssociation(); if(assoc) { - MissingETBase::Types::constvec_t trkvec = assoc->overlapTrkVec(); - double opx = trkvec.cpx(); - double opy = trkvec.cpy(); - double osumpt = trkvec.sumpt();; - ATH_MSG_VERBOSE( "Misc track px, py, sumpt = " << opx << ", " << opy << ", " << osumpt ); - metSoftTrk->add(opx,opy,osumpt); + MissingETBase::Types::constvec_t trkvec = assoc->overlapTrkVec(); + double opx = trkvec.cpx(); + double opy = trkvec.cpy(); + double osumpt = trkvec.sumpt();; + ATH_MSG_VERBOSE( "Misc track px, py, sumpt = " << opx << ", " << opy << ", " << osumpt ); + metSoftTrk->add(opx,opy,osumpt); ATH_MSG_VERBOSE("Final soft track mpx " << metSoftTrk->mpx() << ", mpy " << metSoftTrk->mpy() << " sumet " << metSoftTrk->sumet()); @@ -857,11 +941,12 @@ namespace met { if(assoc) { float total_eloss(0.); MissingETBase::Types::bitmask_t muons_selflags(0); - MissingETBase::Types::constvec_t calvec = assoc->overlapCalVec(); - double opx = calvec.cpx(); - double opy = calvec.cpy(); - double osumpt = calvec.sumpt(); - for(const auto& obj : assoc->objects()) if (obj) { + MissingETBase::Types::constvec_t calvec = assoc->overlapCalVec(); + double opx = calvec.cpx(); + double opy = calvec.cpy(); + double osumpt = calvec.sumpt(); + for(const auto& obj : assoc->objects()) { + if (!obj) continue; if(obj->type()==xAOD::Type::Muon) { const xAOD::Muon* mu_test(static_cast<const xAOD::Muon*>(obj)); if(acc_originalObject.isAvailable(*mu_test)) mu_test = static_cast<const xAOD::Muon*>(*acc_originalObject(*mu_test)); @@ -892,7 +977,7 @@ namespace met { for(size_t iKey = 0; iKey < assoc->sizeCal(); iKey++) { bool selector = (muons_selflags & assoc->calkey()[iKey]); ATH_MSG_VERBOSE("This key: " << assoc->calkey()[iKey] << ", selector: " << selector - << " this calvec E: " << assoc->calVec(iKey).ce()); + << " this calvec E: " << assoc->calVec(iKey).ce()); if(selector) mu_calovec += assoc->calVec(iKey); } if(m_muEloss) mu_calovec *= std::max(0.,1-(total_eloss/mu_calovec.ce())); @@ -902,8 +987,8 @@ namespace met { ATH_MSG_VERBOSE("Mu cluster sumpt " << mu_calovec.sumpt()); - ATH_MSG_VERBOSE( "Misc cluster px, py, sumpt = " << opx << ", " << opy << ", " << osumpt ); - metSoftClus->add(opx,opy,osumpt); + ATH_MSG_VERBOSE( "Misc cluster px, py, sumpt = " << opx << ", " << opy << ", " << osumpt ); + metSoftClus->add(opx,opy,osumpt); ATH_MSG_VERBOSE("Final soft cluster mpx " << metSoftClus->mpx() << ", mpy " << metSoftClus->mpy() << " sumet " << metSoftClus->sumet()); diff --git a/Reconstruction/MET/METUtilities/Root/METSystematicsTool.cxx b/Reconstruction/MET/METUtilities/Root/METSystematicsTool.cxx index 7488549cd20c95395eb5c3d48a41e9789b684e2d..6b136cd5bc5dff9ddb3c4d3a0f56b0f473eae8ac 100644 --- a/Reconstruction/MET/METUtilities/Root/METSystematicsTool.cxx +++ b/Reconstruction/MET/METUtilities/Root/METSystematicsTool.cxx @@ -43,7 +43,7 @@ namespace met { { ATH_MSG_DEBUG (__PRETTY_FUNCTION__ ); - declareProperty( "ConfigPrefix", m_configPrefix = "METUtilities/data16_13TeV/rec_July16v1" ); + declareProperty( "ConfigPrefix", m_configPrefix = "METUtilities/data16_13TeV/rec_Dec16v1"); declareProperty( "ConfigSoftTrkFile", m_configSoftTrkFile = "TrackSoftTerms.config" ); // declareProperty( "ConfigSoftTrkFile", m_configSoftTrkFile = "TrackSoftTerms_afii.config" );//for ATLFAST declareProperty( "ConfigJetTrkFile", m_configJetTrkFile = "" ); diff --git a/Reconstruction/MET/METUtilities/cmt/requirements b/Reconstruction/MET/METUtilities/cmt/requirements index 8323b626618b99e41ba732c802ad90f5be330704..e1cfa91947771cb9ace4c7783e9e78d4c59165fe 100644 --- a/Reconstruction/MET/METUtilities/cmt/requirements +++ b/Reconstruction/MET/METUtilities/cmt/requirements @@ -72,9 +72,9 @@ application example_METMaker_METSystematicsTool ../util/example_METMaker_METSyst application example_METMaker_advanced ../util/example_METMaker_advanced.cxx application example_METMaker_rebuildTrackMET ../util/example_rebuildTrackMET.cxx -macro_append example_METMaker_METSystematicsTool METUtilitiesLib -macro_append example_METMaker_advanced METUtilitiesLib -macro_append example_METMaker_rebuildTrackMET METUtilitiesLib +macro_append example_METMaker_METSystematicsTool_dependencies " METUtilitiesLib " +macro_append example_METMaker_advanced_dependencies " METUtilitiesLib " +macro_append example_METMaker_rebuildTrackMET_dependencies " METUtilitiesLib " end_private diff --git a/Reconstruction/MET/METUtilities/util/example_METMaker_METSystematicsTool.cxx b/Reconstruction/MET/METUtilities/util/example_METMaker_METSystematicsTool.cxx index a3772ce22219bbf34895b5dd1db3b6c554324768..a3d6e5e0cf00de5db92d96e92acf2f4c00a68ae7 100644 --- a/Reconstruction/MET/METUtilities/util/example_METMaker_METSystematicsTool.cxx +++ b/Reconstruction/MET/METUtilities/util/example_METMaker_METSystematicsTool.cxx @@ -50,6 +50,7 @@ using namespace asg::msgUserCode; #include "METInterface/IMETSystematicsTool.h" #include "METInterface/IMETMaker.h" +#include "METUtilities/METHelpers.h" #include "PATInterfaces/SystematicRegistry.h" @@ -72,12 +73,17 @@ int main( int argc, char* argv[]) {std::cout << __PRETTY_FUNCTION__ << std::endl TString fileName = gSystem->Getenv("ASG_TEST_FILE_MC"); std::string jetType = "AntiKt4EMTopo"; bool debug = false; + bool calibjets = true; size_t evtmax = 100; for (int i=0; i<argc; ++i) { if (std::string(argv[i]) == "-filen" && i+1<argc) { fileName = argv[i+1]; } else if (std::string(argv[i]) == "-jetcoll" && i+1<argc) { jetType = argv[i+1]; + } else if (std::string(argv[i]) == "-nocalib") { // useful for checking smart slimming content + calibjets = false; + } else if (std::string(argv[i]) == "-evtmax" && i+1<argc) { + evtmax = atoi(argv[i+1]); } else if (std::string(argv[i]) == "-debug") { debug = true; } @@ -89,8 +95,8 @@ int main( int argc, char* argv[]) {std::cout << __PRETTY_FUNCTION__ << std::endl // Create a TEvent object to read from file and a transient store in which to place items #ifdef XAOD_STANDALONE - std::unique_ptr<xAOD::TEvent> event(new xAOD::TEvent( TEvent::kClassAccess ) ); - std::unique_ptr<xAOD::TStore store>(new xAOD::TStore()); + std::unique_ptr<xAOD::TEvent> event(new xAOD::TEvent( xAOD::TEvent::kClassAccess ) ); + std::unique_ptr<xAOD::TStore> store(new xAOD::TStore()); #else // Athena "Store" is the same StoreGate used by the TEvent std::unique_ptr<POOL::TEvent> event(new POOL::TEvent( POOL::TEvent::kClassAccess )); ServiceHandle<StoreGateSvc>& store = event->evtStore(); @@ -104,7 +110,7 @@ int main( int argc, char* argv[]) {std::cout << __PRETTY_FUNCTION__ << std::endl ANA_CHECK( ASG_MAKE_ANA_TOOL( jetCalibrationTool, JetCalibrationTool ) ); jetCalibrationTool.setName("jetCalibTool"); ANA_CHECK( jetCalibrationTool.setProperty("JetCollection", jetType) ); - ANA_CHECK( jetCalibrationTool.setProperty("ConfigFile", "JES_MC15cRecommendation_May2016.config") ); + ANA_CHECK( jetCalibrationTool.setProperty("ConfigFile", "JES_MC15cRecommendation_May2016_rel21.config") ); ANA_CHECK( jetCalibrationTool.setProperty("CalibSequence", "JetArea_Residual_EtaJES_GSC") ); ANA_CHECK( jetCalibrationTool.setProperty("IsData", false) ); ANA_CHECK( jetCalibrationTool.retrieve() ); @@ -117,6 +123,8 @@ int main( int argc, char* argv[]) {std::cout << __PRETTY_FUNCTION__ << std::endl asg::AnaToolHandle<IMETMaker> metMaker; metMaker.setTypeAndName("met::METMaker/metMaker"); ANA_CHECK( metMaker.setProperty("DoMuonEloss", true) ); + ANA_CHECK( metMaker.setProperty("DoRemoveMuonJets", true) ); + ANA_CHECK( metMaker.setProperty("DoSetMuonJetEMScale", true) ); ANA_CHECK( metMaker.retrieve() ); for(size_t ievent = 0; ievent < std::min(size_t(event->getEntries()), evtmax); ++ievent){ @@ -148,10 +156,13 @@ int main( int argc, char* argv[]) {std::cout << __PRETTY_FUNCTION__ << std::endl ANA_CHECK( event->retrieve(uncalibJets, jetType+"Jets"));//this retrieves and applies the correction std::pair< xAOD::JetContainer*, xAOD::ShallowAuxContainer* > calibJetsPair = xAOD::shallowCopyContainer( *uncalibJets );//make a shallow copy to calibrate xAOD::JetContainer *& calibJets = calibJetsPair.first;//create a reference to the first element of the pair (i.e. the JetContainer) - for ( const auto& jet : *calibJets ) { - //Shallow copy is needed (see links below) - if(!jetCalibrationTool->applyCalibration(*jet))//apply the calibration - return 1; + met::addGhostMuonsToJets(*muons, *calibJets); + if(calibjets) { + for ( const auto& jet : *calibJets ) { + //Shallow copy is needed (see links below) + if(!jetCalibrationTool->applyCalibration(*jet))//apply the calibration + return 1; + } } if(!xAOD::setOriginalObjectLink(*uncalibJets, *calibJets)){//tell calib container what old container it matches if(debug) std::cout << "Failed to set the original object links" << std::endl; @@ -274,12 +285,23 @@ int main( int argc, char* argv[]) {std::cout << __PRETTY_FUNCTION__ << std::endl //we record the container to the store, with a systematic indicated name ANA_CHECK( store->record( newMetContainer, "FinalMETContainer_" + iSysSet.name() )); ANA_CHECK( store->record( newMetAuxContainer, "FinalMETContainer_" + iSysSet.name() + "Aux.")); + + if(debug) { + xAOD::MissingET * jetMet = (*newMetContainer)["RefJet"]; + const std::vector<float>& jetweights = jetMet->auxdataConst<std::vector<float> >("ConstitObjectWeights"); + const std::vector<ElementLink<xAOD::IParticleContainer> >& constitjets = jetMet->auxdataConst<std::vector<ElementLink<xAOD::IParticleContainer> > >("ConstitObjectLinks"); + for(size_t iconstit=0; iconstit < jetweights.size(); ++iconstit) { + const xAOD::Jet* constjet = static_cast<const xAOD::Jet*>(*constitjets[iconstit]); + const float jetweight = jetweights[iconstit]; + std::cout << "RefJet jet " << constjet->index() << ", weight " << jetweight << ", pt: " << constjet->pt() << std::endl; + } + } } #ifdef XAOD_STANDALONE //fill the containers stored in the event //to the output file and clear the transient store - ANA_CHECK( event->fill()); + assert( event->fill()); store->clear(); #endif } diff --git a/Reconstruction/MET/METUtilities/util/example_METMaker_advanced.cxx b/Reconstruction/MET/METUtilities/util/example_METMaker_advanced.cxx index c63ec940a17f48a45b189e0fbc68fcee935bb458..639a9b64e45417835c37dca1b2c58c7d2db14f7c 100644 --- a/Reconstruction/MET/METUtilities/util/example_METMaker_advanced.cxx +++ b/Reconstruction/MET/METUtilities/util/example_METMaker_advanced.cxx @@ -85,7 +85,7 @@ int main( int argc, char* argv[] ){std::cout << __PRETTY_FUNCTION__ << std::endl ANA_CHECK( ASG_MAKE_ANA_TOOL( jetCalibrationTool, JetCalibrationTool ) ); jetCalibrationTool.setName("jetCalibTool"); ANA_CHECK( jetCalibrationTool.setProperty("JetCollection", jetType) ); - ANA_CHECK( jetCalibrationTool.setProperty("ConfigFile", "JES_MC15cRecommendation_May2016.config") ); + ANA_CHECK( jetCalibrationTool.setProperty("ConfigFile", "JES_MC15cRecommendation_May2016_rel21.config") ); ANA_CHECK( jetCalibrationTool.setProperty("CalibSequence", "JetArea_Residual_EtaJES_GSC") ); ANA_CHECK( jetCalibrationTool.setProperty("IsData", false) ); ANA_CHECK( jetCalibrationTool.retrieve() ); @@ -97,7 +97,7 @@ int main( int argc, char* argv[] ){std::cout << __PRETTY_FUNCTION__ << std::endl // Create a TEvent object to read from file and a transient store in which to place items #ifdef XAOD_STANDALONE std::unique_ptr<xAOD::TEvent> event(new xAOD::TEvent( xAOD::TEvent::kClassAccess ) ); - std::unique_ptr<xAOD::TStore store>(new xAOD::TStore()); + std::unique_ptr<xAOD::TStore> store(new xAOD::TStore()); #else // Athena "Store" is the same StoreGate used by the TEvent std::unique_ptr<POOL::TEvent> event(new POOL::TEvent( POOL::TEvent::kClassAccess )); ServiceHandle<StoreGateSvc>& store = event->evtStore(); @@ -107,6 +107,8 @@ int main( int argc, char* argv[] ){std::cout << __PRETTY_FUNCTION__ << std::endl asg::AnaToolHandle<IMETMaker> metMaker; metMaker.setTypeAndName("met::METMaker/metMaker"); ANA_CHECK( metMaker.setProperty("DoMuonEloss", true) ); + ANA_CHECK( metMaker.setProperty("DoRemoveMuonJets", true) ); + ANA_CHECK( metMaker.setProperty("DoSetMuonJetEMScale", true) ); ANA_CHECK( metMaker.retrieve() ); for(size_t ievent = 0; ievent < std::min(size_t(event->getEntries()), evtmax); ++ievent){ @@ -253,7 +255,7 @@ int main( int argc, char* argv[] ){std::cout << __PRETTY_FUNCTION__ << std::endl #ifdef XAOD_STANDALONE // POOL::TEvent should handle this when changing events //fill the containers stored in the event //to the output file and clear the transient store - ANA_CHECK(event->fill()); + assert(event->fill()); store->clear(); #endif } diff --git a/Reconstruction/MET/METUtilities/util/example_rebuildTrackMET.cxx b/Reconstruction/MET/METUtilities/util/example_rebuildTrackMET.cxx index fd560201f40294260e499043cce51e5ba2fe611d..ee852b48372c637c5fa192280852ec29763f2e02 100644 --- a/Reconstruction/MET/METUtilities/util/example_rebuildTrackMET.cxx +++ b/Reconstruction/MET/METUtilities/util/example_rebuildTrackMET.cxx @@ -15,7 +15,7 @@ int main() { #ifdef XAOD_STANDALONE #include "xAODRootAccess/Init.h" #include "xAODRootAccess/TEvent.h" -#include "xAODRootAccess/TStore->h" +#include "xAODRootAccess/TStore.h" #else #include "POOLRootAccess/TEvent.h" #include "StoreGate/StoreGateSvc.h" @@ -91,7 +91,7 @@ int main( int argc, char* argv[]) {std::cout << __PRETTY_FUNCTION__ << std::endl // Create a TEvent object to read from file and a transient store in which to place items #ifdef XAOD_STANDALONE std::unique_ptr<xAOD::TEvent> event(new xAOD::TEvent( xAOD::TEvent::kClassAccess ) ); - std::unique_ptr<xAOD::TStore store>(new xAOD::TStore()); + std::unique_ptr<xAOD::TStore> store (new xAOD::TStore()); #else // Athena "Store" is the same StoreGate used by the TEvent std::unique_ptr<POOL::TEvent> event(new POOL::TEvent( POOL::TEvent::kClassAccess )); ServiceHandle<StoreGateSvc>& store = event->evtStore(); @@ -105,7 +105,7 @@ int main( int argc, char* argv[]) {std::cout << __PRETTY_FUNCTION__ << std::endl ANA_CHECK( ASG_MAKE_ANA_TOOL( jetCalibrationTool, JetCalibrationTool ) ); jetCalibrationTool.setName("jetCalibTool"); ANA_CHECK( jetCalibrationTool.setProperty("JetCollection", jetType) ); - ANA_CHECK( jetCalibrationTool.setProperty("ConfigFile", "JES_MC15cRecommendation_May2016.config") ); + ANA_CHECK( jetCalibrationTool.setProperty("ConfigFile", "JES_MC15cRecommendation_May2016_rel21.config") ); ANA_CHECK( jetCalibrationTool.setProperty("CalibSequence", "JetArea_Residual_EtaJES_GSC") ); ANA_CHECK( jetCalibrationTool.setProperty("IsData", false) ); ANA_CHECK( jetCalibrationTool.retrieve() ); @@ -260,7 +260,7 @@ int main( int argc, char* argv[]) {std::cout << __PRETTY_FUNCTION__ << std::endl #ifdef XAOD_STANDALONE // POOL::TEvent should handle this when changing events //fill the containers stored in the event //to the output file and clear the transient store - ANA_CHECK(event->fill()); + assert(event->fill()); store->clear(); #endif } diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx index bfdd56c647c6fa4af1d756ce4c36e0edbd55d89a..5fd31cc3a5ebb06dc5ae391d2f135f88b06b8b70 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx +++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonCreatorTool.cxx @@ -308,11 +308,13 @@ namespace MuonCombined { //check for CSC unspoiled clusters: if none, and this is an endcap track that includes the CSC, reduce nGoodPrec by one //as we arbitrarily declare this to be a barrel track if there are equal numbers of good barrel and endcap chambers, we need not worry about that situation if(isEnd && (chamberQual.count(Muon::MuonStationIndex::CSS)>0 || chamberQual.count(Muon::MuonStationIndex::CSL)>0)){ - if(mu->auxdata<int>("nUnspoiledCscHits")==0){ + uint8_t unspoiledHits=0; + mu->summaryValue(unspoiledHits,xAOD::cscUnspoiledEtaHits); + if(unspoiledHits==0){ ATH_MSG_DEBUG("found no unspoiled csc hits, reduce # of good precision layers"); nGoodPrec--; } - else ATH_MSG_DEBUG("found "<<mu->auxdata<int>("nUnspoiledCscHits")<<" unspoiled csc hits, don't change nGoodPrecisionLayers"); + else ATH_MSG_DEBUG("found "<<(int)unspoiledHits<<" unspoiled csc hits, don't change nGoodPrecisionLayers"); } if(countHits){ //decide large-small by counting hits uint8_t sumval=0; @@ -554,8 +556,6 @@ namespace MuonCombined { // Etcore variables for muon collectCells(*muon,outputData.clusterContainer); - ATH_MSG_DEBUG("Done creating muon with "<<muon->auxdata<int>("nUnspoiledCscHits")<<" unspoiled csc hits"); - return muon; } @@ -1059,8 +1059,6 @@ namespace MuonCombined { float fieldInt=m_trackQuery->fieldIntegral(*updatedExtrapolatedTrack).betweenSpectrometerMeasurements(); muon.setParameter(fieldInt,xAOD::Muon::spectrometerFieldIntegral); //TrackSummary* tsum=updatedExtrapolatedTrack->trackSummary(); - int nunspoiled=updatedExtrapolatedTrack->trackSummary()->get(Trk::numberOfCscUnspoiltEtaHits); - muon.auxdata<int>("nUnspoiledCscHits")=nunspoiled; } } else{ //no refitted track, so add original un-refitted extrapolated track as ME track @@ -1074,8 +1072,6 @@ namespace MuonCombined { muon.setTrackParticleLink(xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle, link ); float fieldInt=m_trackQuery->fieldIntegral(*extrapolatedTrack).betweenSpectrometerMeasurements(); muon.setParameter(fieldInt,xAOD::Muon::spectrometerFieldIntegral); - int nunspoiled=extrapolatedTrack->trackSummary()->get(Trk::numberOfCscUnspoiltEtaHits); - muon.auxdata<int>("nUnspoiledCscHits")=nunspoiled; } } } @@ -1091,8 +1087,6 @@ namespace MuonCombined { muon.setTrackParticleLink(xAOD::Muon::ExtrapolatedMuonSpectrometerTrackParticle, link ); float fieldInt=m_trackQuery->fieldIntegral(*extrapolatedTrack).betweenSpectrometerMeasurements(); muon.setParameter(fieldInt,xAOD::Muon::spectrometerFieldIntegral); - int nunspoiled=extrapolatedTrack->trackSummary()->get(Trk::numberOfCscUnspoiltEtaHits); - muon.auxdata<int>("nUnspoiledCscHits")=nunspoiled; } else{ ATH_MSG_WARNING("failed to create ME track particle for SA muon"); @@ -1454,10 +1448,6 @@ namespace MuonCombined { addMSIDScatteringAngles(muon); - if(!muon.isAvailable<int>("nUnspoiledCscHits")){ - muon.auxdata<int>("nUnspoiledCscHits")=-999; - } - return true; } diff --git a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonDressingTool.cxx b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonDressingTool.cxx index f5eabbd88d559b7b4deb2d6d44b54dfc34e7bd88..c574ce58557dedb61ba3c13b52e5d6cfccef9163 100644 --- a/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonDressingTool.cxx +++ b/Reconstruction/MuonIdentification/MuonCombinedBaseTools/src/MuonDressingTool.cxx @@ -92,18 +92,22 @@ namespace MuonCombined { uint8_t phiLayer1RPCHits = 0; uint8_t phiLayer2RPCHits = 0; uint8_t phiLayer3RPCHits = 0; + uint8_t phiLayer4RPCHits = 0; uint8_t etaLayer1RPCHits = 0; uint8_t etaLayer2RPCHits = 0; uint8_t etaLayer3RPCHits = 0; + uint8_t etaLayer4RPCHits = 0; uint8_t phiLayer1RPCHoles = 0; uint8_t phiLayer2RPCHoles = 0; uint8_t phiLayer3RPCHoles = 0; + uint8_t phiLayer4RPCHoles = 0; uint8_t etaLayer1RPCHoles = 0; uint8_t etaLayer2RPCHoles = 0; uint8_t etaLayer3RPCHoles = 0; + uint8_t etaLayer4RPCHoles = 0; uint8_t phiLayer1TGCHits = 0; uint8_t phiLayer2TGCHits = 0; @@ -148,6 +152,9 @@ namespace MuonCombined { uint8_t isEndcap = 0; uint8_t isSmall = 0; + uint8_t cscEtaHits = 0; + uint8_t cscUnspoiledEtaHits = 0; + const Trk::TrackSummary* mstpTrackSummary=0; if( !trackSummary ){ @@ -297,6 +304,10 @@ namespace MuonCombined { } } } + if(isCsc){ + cscEtaHits+=chit->etaProjection().nhits; + cscUnspoiledEtaHits+=chit->etaProjection().ngoodHits; + } if( !isMdt && !isMM ){ uint8_t* phiHits = 0; @@ -348,6 +359,12 @@ namespace MuonCombined { phiLayer3RPCHoles += chit->phiProjection().nholes; etaLayer3RPCHoles += chit->etaProjection().nholes; } + else if (index == Muon::MuonStationIndex::BO2){ + phiLayer4RPCHits += chit->nphiHits(); + etaLayer4RPCHits += chit->netaHits(); + phiLayer4RPCHoles += chit->phiProjection().nholes; + etaLayer4RPCHoles += chit->etaProjection().nholes; + } else if (index == Muon::MuonStationIndex::T4){ phiLayer1TGCHits += chit->nphiHits(); etaLayer1TGCHits += chit->netaHits(); @@ -436,18 +453,22 @@ namespace MuonCombined { muon.setSummaryValue(phiLayer1RPCHits, xAOD::phiLayer1RPCHits); muon.setSummaryValue(phiLayer2RPCHits, xAOD::phiLayer2RPCHits); muon.setSummaryValue(phiLayer3RPCHits, xAOD::phiLayer3RPCHits); + muon.setSummaryValue(phiLayer4RPCHits, xAOD::phiLayer4RPCHits); muon.setSummaryValue(etaLayer1RPCHits, xAOD::etaLayer1RPCHits); muon.setSummaryValue(etaLayer2RPCHits, xAOD::etaLayer2RPCHits); muon.setSummaryValue(etaLayer3RPCHits, xAOD::etaLayer3RPCHits); + muon.setSummaryValue(etaLayer4RPCHits, xAOD::etaLayer4RPCHits); muon.setSummaryValue(phiLayer1RPCHoles, xAOD::phiLayer1RPCHoles); muon.setSummaryValue(phiLayer2RPCHoles, xAOD::phiLayer2RPCHoles); muon.setSummaryValue(phiLayer3RPCHoles, xAOD::phiLayer3RPCHoles); + muon.setSummaryValue(phiLayer4RPCHoles, xAOD::phiLayer4RPCHoles); muon.setSummaryValue(etaLayer1RPCHoles, xAOD::etaLayer1RPCHoles); muon.setSummaryValue(etaLayer2RPCHoles, xAOD::etaLayer2RPCHoles); muon.setSummaryValue(etaLayer3RPCHoles, xAOD::etaLayer3RPCHoles); + muon.setSummaryValue(etaLayer4RPCHoles, xAOD::etaLayer4RPCHoles); muon.setSummaryValue(phiLayer1TGCHits, xAOD::phiLayer1TGCHits); muon.setSummaryValue(phiLayer2TGCHits, xAOD::phiLayer2TGCHits); @@ -484,6 +505,9 @@ namespace MuonCombined { muon.setSummaryValue(isEndcap,xAOD::isEndcapGoodLayers); muon.setSummaryValue(isSmall,xAOD::isSmallGoodSectors); + muon.setSummaryValue(cscEtaHits,xAOD::cscEtaHits); + muon.setSummaryValue(cscUnspoiledEtaHits,xAOD::cscUnspoiledEtaHits); + } } // end of namespace diff --git a/Reconstruction/PanTau/PanTauAlgs/Root/Tool_FeatureExtractor.cxx b/Reconstruction/PanTau/PanTauAlgs/Root/Tool_FeatureExtractor.cxx index ef3499507eea3860a31a9d0802b4cb9e9617c306..9a9d73b2e91712a815dd0530a5ceffa6e466a9e3 100644 --- a/Reconstruction/PanTau/PanTauAlgs/Root/Tool_FeatureExtractor.cxx +++ b/Reconstruction/PanTau/PanTauAlgs/Root/Tool_FeatureExtractor.cxx @@ -556,16 +556,18 @@ StatusCode PanTau::Tool_FeatureExtractor::calculateFeatures(PanTau::PanTauSeed2* double etaCurConst = list_TypeConstituents_SortBDT[iTypeConst]->p4().Eta(); int etaBinIndex = m_HelperFunctions.getBinIndex(m_Config_CellBased_BinEdges_Eta, fabs(etaCurConst)); bool isOK; - int numTrack = inSeed->getConstituentsOfType(PanTau::TauConstituent2::t_Charged, isOK).size(); + //int numTrack = inSeed->getConstituentsOfType(PanTau::TauConstituent2::t_Charged, isOK).size(); + int numTrack = inSeed->getTauJet()->nTracks(); if(numTrack == 1) { mvaCorrection = m_Config_CellBased_EtaBinned_Pi0MVACut_1prong.at(etaBinIndex); } else { mvaCorrection = m_Config_CellBased_EtaBinned_Pi0MVACut_3prong.at(etaBinIndex); } + ATH_MSG_DEBUG("\t\tnumTrack = " << numTrack << " / value_BDT = " << value_BDT << " / mvaCorrection = " << mvaCorrection << " / etaCurConst = " << etaCurConst << " / etaBinIndex = " << etaBinIndex); value_BDT = value_BDT - mvaCorrection; } value_sumBDT_BDTSort += value_BDT; std::string iConst = m_HelperFunctions.convertNumberToString((double)(iTypeConst+1)); tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_BDTValues_BDTSort_" + iConst, value_BDT); - //ATH_MSG_DEBUG("\t\tAdded variable " << inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_nPhotons_BDTSort_" + iConstStr << " with value " << totalPhotonsInNeutral); + ATH_MSG_DEBUG("\t\tAdded variable " << inputAlgName << "_" << curTypeName << "_" << prefixVARType << "_BDTValues_BDTSort_" << iConst << " with value " << value_BDT); tauFeatureMap->addFeature(inputAlgName + "_" + curTypeName + "_" + prefixVARType + "_BDTValuesSum_BDTSort_" + iConst, value_sumBDT_BDTSort); } diff --git a/Reconstruction/PanTau/PanTauAlgs/Root/Tool_InformationStore.cxx b/Reconstruction/PanTau/PanTauAlgs/Root/Tool_InformationStore.cxx index 53244c1d3e5189f6419e0e805ea872721e45af30..eed146e2d518e466660b6ee0e79733b4c00751af 100644 --- a/Reconstruction/PanTau/PanTauAlgs/Root/Tool_InformationStore.cxx +++ b/Reconstruction/PanTau/PanTauAlgs/Root/Tool_InformationStore.cxx @@ -43,12 +43,12 @@ void PanTau::Tool_InformationStore::ABRDefaultInit(){ {"TauConstituents_PreselectionMinEnergy",500.}, {"TauConstituents_eflowRec_BDTThreshold_Pi0Neut",-0.04}, // PanTau BDT Cut values --- CellBased - {"DecayModeDeterminator_BDTCutValue_R10X_CellBased",0.57}, - {"DecayModeDeterminator_BDTCutValue_R11X_CellBased",-0.25}, - {"DecayModeDeterminator_BDTCutValue_R110_CellBased",0.53}, - {"DecayModeDeterminator_BDTCutValue_R1XX_CellBased",-0.06}, - {"DecayModeDeterminator_BDTCutValue_R30X_CellBased",-0.12}, - {"DecayModeDeterminator_BDTCutValue_R3XX_CellBased",-0.09}, + {"DecayModeDeterminator_BDTCutValue_R10X_CellBased",0.52}, + {"DecayModeDeterminator_BDTCutValue_R11X_CellBased",-0.33}, + {"DecayModeDeterminator_BDTCutValue_R110_CellBased",0.47}, + {"DecayModeDeterminator_BDTCutValue_R1XX_CellBased",-0.21}, + {"DecayModeDeterminator_BDTCutValue_R30X_CellBased",-0.13}, + {"DecayModeDeterminator_BDTCutValue_R3XX_CellBased",-0.08}, // PanTau BDT Cut values --- eflowRec {"DecayModeDeterminator_BDTCutValue_R10X_eflowRec",-0.15}, {"DecayModeDeterminator_BDTCutValue_R11X_eflowRec",-0.60}, diff --git a/Reconstruction/PanTau/PanTauAlgs/Root/Tool_InputConverter.cxx b/Reconstruction/PanTau/PanTauAlgs/Root/Tool_InputConverter.cxx index 2b1db97154800d83a3a392654c609d45ca61eb7d..b2c6764da73ee63310dfbb887c4dc1c7645f4457 100644 --- a/Reconstruction/PanTau/PanTauAlgs/Root/Tool_InputConverter.cxx +++ b/Reconstruction/PanTau/PanTauAlgs/Root/Tool_InputConverter.cxx @@ -124,7 +124,7 @@ StatusCode PanTau::Tool_InputConverter::ConvertToTauConstituent2(xAOD::PFO* pfo, } - ATH_MSG_DEBUG("About to create 4 vector of EFO. E / Eta / Phi / m: " << constituentEnergy << " / " << pfo->eta() << " / " << pfo->phi() << " / " << constituentMass); + //ATH_MSG_DEBUG("About to create 4 vector of EFO. E / Eta / Phi / m: " << constituentEnergy << " / " << pfo->eta() << " / " << pfo->phi() << " / " << constituentMass); TLorentzVector momentum; PanTau::SetP4EEtaPhiM( momentum, constituentEnergy, pfo->eta(), pfo->phi(), constituentMass); @@ -140,7 +140,8 @@ StatusCode PanTau::Tool_InputConverter::ConvertToTauConstituent2(xAOD::PFO* pfo, if(deltaR_toTauJet > m_Config_TauConstituents_Types_DeltaRCore) { if(pfoCharge != 0) { - itsTypeFlags.at((int)PanTau::TauConstituent2::t_OutChrg) = 1; + //itsTypeFlags.at((int)PanTau::TauConstituent2::t_OutChrg) = 1; + itsTypeFlags.at((int)PanTau::TauConstituent2::t_Charged) = 1; } if(pfoCharge == 0) { itsTypeFlags.at((int)PanTau::TauConstituent2::t_OutNeut) = 1; @@ -178,6 +179,7 @@ StatusCode PanTau::Tool_InputConverter::ConvertToTauConstituent2(xAOD::PFO* pfo, //! ================================================== //! create the tau constituent + ATH_MSG_DEBUG("About to create 4 vector of EFO. E / Eta / Phi / m / charge / mvaValue: " << constituentEnergy << " / " << pfo->eta() << " / " << pfo->phi() << " / " << constituentMass << " / " << pfoCharge << " / " << mvaValue); tauConstituent = new PanTau::TauConstituent2(momentum, pfoCharge, itsTypeFlags, mvaValue, pfo); tauConstituent->makePrivateStore(); ATH_MSG_DEBUG("Created new TauConstituent2 at: " << tauConstituent); diff --git a/Reconstruction/PanTau/PanTauAlgs/Root/Tool_TauConstituentSelector.cxx b/Reconstruction/PanTau/PanTauAlgs/Root/Tool_TauConstituentSelector.cxx index 85e2b76a3f5101a879bacca898314b8bc5326322..aa7d83c9e1e0f3ce872549529d18881df254075b 100644 --- a/Reconstruction/PanTau/PanTauAlgs/Root/Tool_TauConstituentSelector.cxx +++ b/Reconstruction/PanTau/PanTauAlgs/Root/Tool_TauConstituentSelector.cxx @@ -192,7 +192,13 @@ bool PanTau::Tool_TauConstituentSelector::passesSelection_Pi0NeutConstituent( bool PanTau::Tool_TauConstituentSelector::passesSelection_ChargedConstituent(PanTau::TauConstituent2* tauConstituent) const { - TLorentzVector tlv_Constituent = tauConstituent->p4(); + + TLorentzVector tlv_Constituent = tauConstituent->p4(); + + // we want to use all tracks + return true; + + /* double curEta = tlv_Constituent.Eta(); double cut_MinEt = getEtCut(fabs(curEta), PanTau::TauConstituent2::t_Charged); @@ -204,6 +210,9 @@ bool PanTau::Tool_TauConstituentSelector::passesSelection_ChargedConstituent( } return true; + + */ + } @@ -221,7 +230,13 @@ bool PanTau::Tool_TauConstituentSelector::passesSelection_OutNeutConstituent( bool PanTau::Tool_TauConstituentSelector::passesSelection_OutChrgConstituent(TauConstituent2* TauConstituent) const { - TLorentzVector tlv_Constituent = TauConstituent->p4(); + + TLorentzVector tlv_Constituent = TauConstituent->p4(); + + // we want to use all tracks + return true; + + /* double curEta = tlv_Constituent.Eta(); double cut_MinEt = getEtCut(fabs(curEta), PanTau::TauConstituent2::t_OutChrg); @@ -229,6 +244,8 @@ bool PanTau::Tool_TauConstituentSelector::passesSelection_OutChrgConstituent( if(curEt < cut_MinEt) return false; return true; + + */ } diff --git a/Reconstruction/PanTau/PanTauAlgs/python/Config_PanTau.py b/Reconstruction/PanTau/PanTauAlgs/python/Config_PanTau.py index 9452b2eea97737b8d24abad83fc0be8965c4716e..a0e41e0b4fb7cee3f62d5984a340c26607899f23 100644 --- a/Reconstruction/PanTau/PanTauAlgs/python/Config_PanTau.py +++ b/Reconstruction/PanTau/PanTauAlgs/python/Config_PanTau.py @@ -122,37 +122,37 @@ class DecayModeDeterminator_BDTCutValue_R10X_CellBased(JobProperty): """ """ statusOn = True allowedTypes = ['float'] - StoredValue = 0.57 + StoredValue = 0.52 class DecayModeDeterminator_BDTCutValue_R11X_CellBased(JobProperty): """ """ statusOn = True allowedTypes = ['float'] - StoredValue = -0.25 + StoredValue = -0.33 class DecayModeDeterminator_BDTCutValue_R110_CellBased(JobProperty): """ """ statusOn = True allowedTypes = ['float'] - StoredValue = 0.53 + StoredValue = 0.47 class DecayModeDeterminator_BDTCutValue_R1XX_CellBased(JobProperty): """ """ statusOn = True allowedTypes = ['float'] - StoredValue = -0.06 + StoredValue = -0.21 class DecayModeDeterminator_BDTCutValue_R30X_CellBased(JobProperty): """ """ statusOn = True allowedTypes = ['float'] - StoredValue = -0.12 + StoredValue = -0.13 class DecayModeDeterminator_BDTCutValue_R3XX_CellBased(JobProperty): """ """ statusOn = True allowedTypes = ['float'] - StoredValue = -0.09 + StoredValue = -0.08 # # PanTau BDT Cut values --- eflowRec diff --git a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py index 943d1274a8f7ed78df67c916080cd0342a451f33..c505b470ed35fef4552f354775ba058518c1543c 100755 --- a/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py +++ b/Reconstruction/RecExample/RecExCommon/share/RecExCommon_topOptions.py @@ -1033,7 +1033,8 @@ if globalflags.InputFormat()=='bytestream': # enable IOVDbSvc to read metadata svcMgr.MetaDataSvc.MetaDataContainer = "MetaDataHdr" - svcMgr.MetaDataSvc.MetaDataTools += [ "IOVDbMetaDataTool" ] + if not hasattr (svcMgr.ToolSvc, 'IOVDbMetaDataTool'): + svcMgr.MetaDataSvc.MetaDataTools += [ "IOVDbMetaDataTool" ] MetaDataStore=svcMgr.MetaDataStore @@ -1073,12 +1074,13 @@ if rec.doFileMetaData(): #force CutFlowSvc execution (necessary for file merging) theApp.CreateSvc+=['CutFlowSvc'] logRecExCommon_topOptions.debug("Added CutFlowSvc to theApp") - pass + pass try: # ByteStreamMetadata - from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamMetadataTool - svcMgr.MetaDataSvc.MetaDataTools += [ "ByteStreamMetadataTool" ] + from ByteStreamCnvSvc.ByteStreamCnvSvcConf import ByteStreamMetadataTool + if not hasattr (svcMgr.ToolSvc, 'ByteStreamMetadataTool'): + svcMgr.MetaDataSvc.MetaDataTools += [ "ByteStreamMetadataTool" ] except Exception: treatException("Could not load ByteStreamMetadataTool") @@ -1427,6 +1429,10 @@ if rec.doWriteAOD(): if AODFlags.ThinNegativeEnergyCaloClusters: from ThinningUtils.ThinNegativeEnergyCaloClusters import ThinNegativeEnergyCaloClusters ThinNegativeEnergyCaloClusters() + if AODFlags.ThinNegativeEnergyNeutralPFOs: + from ThinningUtils.ThinNegativeEnergyNeutralPFOs import ThinNegativeEnergyNeutralPFOs + ThinNegativeEnergyNeutralPFOs() + # Doens't exist in xAOD world: # if AODFlags.TrackParticleSlimmer or AODFlags.TrackParticleLastHitAndPerigeeSlimmer: diff --git a/Reconstruction/RecExample/RecJobTransformTests/test/RecJobTransformTests_TestConfiguration.xml b/Reconstruction/RecExample/RecJobTransformTests/test/RecJobTransformTests_TestConfiguration.xml index 507e04ea726d85e61eaf3da686f9f278a977180e..4b4c4f1c0574c033703acb4fe17f4d30763887bd 100755 --- a/Reconstruction/RecExample/RecJobTransformTests/test/RecJobTransformTests_TestConfiguration.xml +++ b/Reconstruction/RecExample/RecJobTransformTests/test/RecJobTransformTests_TestConfiguration.xml @@ -6,20 +6,6 @@ <!-- ++++++++++++++++++++++++++ Running on Simulated Data +++++++++++++++++++++++++++++++++++++++++++++ --> - <!-- DC14 type digitization and reconstruction of 13 TeV MC without pileup --> - <TEST name="RECOSHIFT_Reco_MC15_13TeV_nopileup" type="script" suite="reco_tf"> - <options_atn> - export TRF_ECHO=True; Reco_tf.py '--inputHITSFile=/afs/cern.ch/atlas/project/rig/referencefiles/mc15/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.simul.HITS.e4993_s2887_tid08170896_00/HITS.08170896._001944.pool.root.1' '--jobNumber=1' '--maxEvents=5' '--postInclude=RecJobTransforms/UseFrontier.py' '--preExec' 'rec.Commissioning.set_Value_and_Lock(True);from AthenaCommon.BeamFlags import jobproperties;jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0);from LArROD.LArRODFlags import larRODFlags;larRODFlags.nSamples.set_Value_and_Lock(4);larRODFlags.firstSample.set_Value_and_Lock(0);larRODFlags.useHighestGainAutoCorr.set_Value_and_Lock(True)' 'RAWtoESD:from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False' 'ESDtoAOD:TriggerFlags.AODEDMSet="AODFULL"' 'RAWtoESD:from InDetRecExample.InDetJobProperties import InDetFlags; InDetFlags.doSlimming.set_Value_and_Lock(False)' 'ESDtoAOD:from InDetRecExample.InDetJobProperties import InDetFlags; InDetFlags.doSlimming.set_Value_and_Lock(False)' 'RDOtoRDOTrigger:from TriggerJobOpts.TriggerFlags import TriggerFlags;TriggerFlags.triggerMenuSetup="MC_pp_v6_tight_mc_prescale"' '--skipEvents=0' '--autoConfiguration=everything' '--conditionsTag=OFLCOND-MC15c-SDR-09' '--geometryVersion=ATLAS-R2-2015-03-01-00' '--digiSeedOffset1=1' '--digiSeedOffset2=1' '--steering=doRDO_TRIG' '--numberOfCavernBkg=0' '--outputAODFile=AOD.pool.root' '--outputRDOFile=RDO.pool.root' '--outputESDFile=ESD.pool.root' - </options_atn> - <timelimit>60</timelimit> - <author>Xiaohu Sun, Carl Gwilliam and Marie-Helene Genest</author> - <prescript>rm -f $ATN_WORK_AREA/*</prescript> - <expectations> - <errorMessage>FAILURE </errorMessage> - <returnValue>0</returnValue> - </expectations> - </TEST> - <!-- MC15 type digitization and reconstruction of 13 TeV MC with pileup --> <TEST name="RECOSHIFT_Reco_MC15_13TeV" type="script" suite="reco_tf"> <options_atn> @@ -275,26 +261,6 @@ <queue>long</queue> </jobTransform> - <chain> - <chainName>PhysicsValidationDC14ChainJob</chainName> - <sequential> - <!-- Run Reco --> - <chainElement> - <jobTransform userJobId="Reco_DC14_8TeV_pileup"> - <doc>Reco_tf runs on mc1214 TeV with sampleA settings defined by Carl G, April 16 2014</doc> - <jobTransformJobName>Reco_DC14_trf</jobTransformJobName> - <jobTransformCmd> - export TRF_ECHO=True; Reco_tf.py --DBRelease="current" --autoConfiguration="everything" --conditionsTag="OFLCOND-RUN12-SDR-25" --digiSeedOffset1="1" --digiSeedOffset2="1" --geometryVersion="ATLAS-R1-2012-02-00-00" --jobNumber 1 --maxEvents 500 --numberOfHighPtMinBias="0.055936" --numberOfLowPtMinBias="39.9444" --postExec "CfgMgr.MessageSvc().setError+=[\"HepMcParticleLink\"]" "HITtoRDO:job.StandardPileUpToolsAlg.PileUpTools[\"MergeMcEventCollTool\"].OnlySaveSignalTruth=True" --postInclude="RecJobTransforms/UseFrontier.py" --preExec "rec.doTrigger.set_Value_and_Lock(False);rec.Commissioning.set_Value_and_Lock(True);jobproperties.Beam.numberOfCollisions.set_Value_and_Lock(20.0)" "HITtoRDO:from LArROD.LArRODFlags import larRODFlags;larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.NumberOfCollisions.set_Value_and_Lock(20);larRODFlags.UseDelta.set_Value_and_Lock(3)" "RAWtoESD:from LArROD.LArRODFlags import larRODFlags;larRODFlags.doOFCPileupOptimization.set_Value_and_Lock(True);larRODFlags.UseDelta.set_Value_and_Lock(3);from CaloRec.CaloCellFlags import jobproperties;jobproperties.CaloCellFlags.doLArCellEmMisCalib=False" "ESDtoAOD:TriggerFlags.AODEDMSet=\"AODFULL\"" --preInclude HITtoRDO:Digitization/ForceUseOfPileUpTools.py,SimulationJobOptions/preInclude.PileUpBunchTrains2011Config8_DigitConfig.py,RunDependentSimData/configLumi_mc14_2012_v1.py --skipEvents="0" --inputHITSFile="/afs/cern.ch/atlas/project/rig/referencefiles/RTTinputFiles/8TeV/valid1.105200.McAtNloJimmy_CT10_ttbar_LeptonFilter.simul.HITS.e1574_s2039_tid01566078_00/HITS.01566078._000483.pool.root.1" --inputLowPtMinbiasHitsFile="root://eosatlas//eos/atlas/atlascerngroupdisk/phys-val/mc14_8TeV.119995.Pythia8_A2MSTW2008LO_minbias_inelastic_low.merge.HITS.e1119_s1896_s1903_tid01415612_00/HITS.01415612._000005.pool.root.3,root://eosatlas//eos/atlas/atlascerngroupdisk/phys-val/mc14_8TeV.119995.Pythia8_A2MSTW2008LO_minbias_inelastic_low.merge.HITS.e1119_s1896_s1903_tid01415612_00/HITS.01415612._000006.pool.root.1,root://eosatlas//eos/atlas/atlascerngroupdisk/phys-val/mc14_8TeV.119995.Pythia8_A2MSTW2008LO_minbias_inelastic_low.merge.HITS.e1119_s1896_s1903_tid01415612_00/HITS.01415612._000007.pool.root.2,root://eosatlas//eos/atlas/atlascerngroupdisk/phys-val/mc14_8TeV.119995.Pythia8_A2MSTW2008LO_minbias_inelastic_low.merge.HITS.e1119_s1896_s1903_tid01415612_00/HITS.01415612._000008.pool.root.2" --inputHighPtMinbiasHitsFile="root://eosatlas//eos/atlas/atlascerngroupdisk/phys-val/mc14_8TeV.119996.Pythia8_A2MSTW2008LO_minbias_inelastic_high.merge.HITS.e1119_s1896_s1903_tid01415616_00/HITS.01415616._000005.pool.root.1,root://eosatlas//eos/atlas/atlascerngroupdisk/phys-val/mc14_8TeV.119996.Pythia8_A2MSTW2008LO_minbias_inelastic_high.merge.HITS.e1119_s1896_s1903_tid01415616_00/HITS.01415616._000006.pool.root.1,root://eosatlas//eos/atlas/atlascerngroupdisk/phys-val/mc14_8TeV.119996.Pythia8_A2MSTW2008LO_minbias_inelastic_high.merge.HITS.e1119_s1896_s1903_tid01415616_00/HITS.01415616._000007.pool.root.1,root://eosatlas//eos/atlas/atlascerngroupdisk/phys-val/mc14_8TeV.119996.Pythia8_A2MSTW2008LO_minbias_inelastic_high.merge.HITS.e1119_s1896_s1903_tid01415616_00/HITS.01415616._000008.pool.root.1" --outputAODFile="AOD_8TeV_PhysVal.pool.root" --outputESDFile="ESD.pool.root" --outputRDOFile="RDO.pool.root" - </jobTransformCmd> - <group>RecTrf</group> - <queue>long</queue> - <batchWallTime>300</batchWallTime> - </jobTransform> - <chainfileout>AOD_8TeV_PhysVal.pool.root</chainfileout> - </chainElement> - </sequential> - </chain> - <jobTransform userJobId="Reco_MC15_13TeV_nopileup"> <doc>Reco_tf runs physics validation as defined by Carl G/Marie-Helene G, July 28 2014</doc> <jobTransformJobName>Reco_MC15_tf</jobTransformJobName> @@ -336,7 +302,7 @@ <chaindatasetName>AOD_13TeV_PhysVal.pool.root</chaindatasetName> <dataset_info> <jobTransformData /> - <datasetName>/afs/cern.ch/atlas/project/rig/referencefiles/RTTinputFiles/MC15_13TeV/AOD_13TeV_PhysVal.pool.root</datasetName> + <datasetName>/afs/cern.ch/atlas/project/rig/referencefiles/RTTinputFiles/MC15_13TeV/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.recon.AOD.e4993_s2887_r9044/AOD.10538155._000209.pool.root.1</datasetName> </dataset_info> </chaindataset_info> <queue>long</queue> @@ -356,7 +322,7 @@ <chaindatasetName>AOD_13TeV_PhysVal.pool.root</chaindatasetName> <dataset_info> <jobTransformData /> - <datasetName>/afs/cern.ch/atlas/project/rig/referencefiles/RTTinputFiles/MC15_13TeV/AOD_13TeV_PhysVal.pool.root</datasetName> + <datasetName>/afs/cern.ch/atlas/project/rig/referencefiles/RTTinputFiles/MC15_13TeV/valid1.410000.PowhegPythiaEvtGen_P2012_ttbar_hdamp172p5_nonallhad.recon.AOD.e4993_s2887_r9044/AOD.10538155._000209.pool.root.1</datasetName> </dataset_info> </chaindataset_info> <queue>long</queue> diff --git a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IMuonCaloEnergyTool.h b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IMuonCaloEnergyTool.h index c7d8808962a8152a9fe972df29b61848bc4f1093..3a8fb4d209777383f4e948fff9fc70f35bf9f679 100644 --- a/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IMuonCaloEnergyTool.h +++ b/Reconstruction/RecoTools/RecoToolInterfaces/RecoToolInterfaces/IMuonCaloEnergyTool.h @@ -32,7 +32,8 @@ namespace Rec double deltaE, double meanIoni, double sigmaIoni, double& E, double& sigma, double& E_FSR, double& E_expected, double &E_em_meas, double &E_em_exp, double &E_tile_meas, double &E_tile_exp, - double &E_HEC_meas, double &E_HEC_exp, double &E_dead_exp ) const=0; + double &E_HEC_meas, double &E_HEC_exp, double &E_dead_exp, + std::vector<Identifier>* crossedCells = 0, std::vector<double>* sigmaNoise_cell = 0, std::vector<double>* E_exp_cell = 0) const=0; static const InterfaceID& interfaceID( ) ; }; diff --git a/Reconstruction/RecoTools/RecoToolInterfaces/doc/mainpage.h b/Reconstruction/RecoTools/RecoToolInterfaces/doc/mainpage.h deleted file mode 100755 index 51eb4a9942f0cf0b309d0ea846f4223813fca2eb..0000000000000000000000000000000000000000 --- a/Reconstruction/RecoTools/RecoToolInterfaces/doc/mainpage.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** -@mainpage RecoToolInterfaces Package - -This package contains abstract interfaces for common reconstruction tools. -Concrete implementations can be found in each leaf package. - -@author Reconstruction Software Group - -@section RecoToolInterfacesList List of Defined Interfaces - -Abstract interfaces for the following combined reconstruction tasks are defined: - -@htmlinclude annotated.html - - - IExtrapolateToCaloTool : Extrapolates Trk::Track, Trk::TrackParameters to the calorimeter samplings using the Trk::IExtrapolator. - - Rec::IMuonTrackThroughCalo : Extrapolates the parameters associated to muons across the calorimeter, - adding or subtracting energyloss from either parameterisation or measurement. - - Rec::ITrackThroughDetectorBoundaries : Makes an extrapolation of ID track parameters outwards, saving - the extrapolated parameters at each detector boundary and identification layer. - -This package is not built as any library, it is a simple include package. - -@section ExtrasRecoToolInterfaces Extra Pages - - - @ref UsedRecoToolInterfaces - - @ref requirementsRecoToolInterfaces -*/ - -/** -@page UsedRecoToolInterfaces Used Packages -@htmlinclude used_packages.html -*/ - -/** -@page requirementsRecoToolInterfaces Requirements -@include requirements -*/ - diff --git a/Reconstruction/RecoTools/TrackToCalo/src/CaloCellCollector.cxx b/Reconstruction/RecoTools/TrackToCalo/src/CaloCellCollector.cxx index c48634d9814256936463328a7f0ad6121bac3920..21fad6c083cdaf975bb42928290abce85eaec7c0 100644 --- a/Reconstruction/RecoTools/TrackToCalo/src/CaloCellCollector.cxx +++ b/Reconstruction/RecoTools/TrackToCalo/src/CaloCellCollector.cxx @@ -264,6 +264,12 @@ Rec::CaloCellCollector::collectEtCore( const xAOD::CaloCluster& clus, bool applyNoiseCut, float sigmaNoiseCut) const { + // FIXME: const_cast + ICaloNoiseTool* caloNoiseTool_nc = nullptr; + if (!caloNoiseTool.empty()) { + const ICaloNoiseTool* caloNoiseTool_c = &*caloNoiseTool; + caloNoiseTool_nc = const_cast<ICaloNoiseTool*> (caloNoiseTool_c); + } // Collect the cells in the core for a muon // Collect etCore for the different samples @@ -301,7 +307,7 @@ Rec::CaloCellCollector::collectEtCore( const xAOD::CaloCluster& clus, } // Check if cell passes the noise threshold of 3.4sigma if (m_doDebug && addCell) { - if( !caloNoiseTool.empty() ) std::cout << " cell E,3.4*noise: " << cell->energy() << "/" << 3.4*caloNoiseTool->getNoise(cell); + if( !caloNoiseTool.empty() ) std::cout << " cell E,3.4*noise: " << cell->energy() << "/" << 3.4*caloNoiseTool_nc->getNoise(cell); else std::cout << " cell E, NO CaloNoiseTool available: " << cell->energy() << "/ - "; } if (applyNoiseCut && caloNoiseTool.empty() ){ @@ -309,7 +315,7 @@ Rec::CaloCellCollector::collectEtCore( const xAOD::CaloCluster& clus, << "ERROR : Changing configuration to NOT apply calo noise cut!" << std::endl; applyNoiseCut = false; } - if (applyNoiseCut && addCell && cell->energy() < sigmaNoiseCut*caloNoiseTool->getNoise(cell)) { + if (applyNoiseCut && addCell && cell->energy() < sigmaNoiseCut*caloNoiseTool_nc->getNoise(cell)) { addCell = false; } // sum of et, defined by cell E, and muon track eta diff --git a/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.cxx b/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.cxx index 93af1922657b3ee272a7873cc022e686e4eec2bb..b46276b1fc292fb0db1fc4ea3156245e3fa8c855 100644 --- a/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.cxx +++ b/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.cxx @@ -88,8 +88,8 @@ namespace Rec { double deltaE, double meanIoni, double sigmaIoni, double& E, double& sigma, double& E_FSR , double& E_expected, double &E_em_meas, double &E_em_exp, double &E_tile_meas, double &E_tile_exp, - double &E_HEC_meas, double &E_HEC_exp, double &E_dead_exp ) const { - + double &E_HEC_meas, double &E_HEC_exp, double &E_dead_exp, + std::vector<Identifier>* crossedCells, std::vector<double>* sigmaNoise_cell, std::vector<double>* E_exp_cell) const { // // Input parameters trk: (muon) track pointer // deltaE: Mean Energy loss in Calorimeter @@ -114,6 +114,14 @@ namespace Rec { E_HEC_meas = 0.; E_HEC_exp = 0.; E_dead_exp = 0.; + + bool storeCells = false; + if(crossedCells!=0&&sigmaNoise_cell!=0&&E_exp_cell!=0) { + storeCells = true; + crossedCells->clear(); + sigmaNoise_cell->clear(); + E_exp_cell->clear(); + } // // For the expected Eloss in the dead or not instrumented material we will use the meanIonization loss // this meanIoni is stored on the extended Eloss object @@ -312,6 +320,7 @@ namespace Rec { int cellSampling = curr_cell->caloDDE()->getSampling(); bool badCell = curr_cell->badcell(); double cellEn = curr_cell->energy(); + Identifier id = curr_cell->ID(); double f_exp = (it.second)->pathLength(); double E_exp = (it.second)->expectedEnergyLoss(); @@ -344,7 +353,14 @@ namespace Rec { // sum measured, expected energies for crossed cells after noise cuts // if(cellSampling == CaloSampling::PreSamplerB || cellSampling == CaloSampling::PreSamplerE) { - if(f_exp>0&&cellEn>m_sigmasAboveNoise*sigma_Noise&&!badCell) E_em1 += cellEn; + if(f_exp>0&&cellEn>m_sigmasAboveNoise*sigma_Noise&&!badCell) { + E_em1 += cellEn; + if(storeCells) { + crossedCells->push_back(id); + sigmaNoise_cell->push_back(sigma_Noise); + E_exp_cell->push_back(scale_Ionization*f_exp*E_exp*scale_em_expected); // I don't want sum, but value for each cell + } + } } if(curr_cell->caloDDE()->getSubCalo() == CaloCell_ID::LAREM) { E_em_exptot += scale_Ionization*f_exp*E_exp*scale_em_expected; @@ -354,6 +370,11 @@ namespace Rec { E_em += cellEn; E_em_expected += scale_Ionization*f_exp*E_exp*scale_em_expected; ATH_MSG_VERBOSE( " EM cell " << cellEn << " sigma_Noise " << sigma_Noise << " f_exp " << f_exp << " E_exp " << E_exp); + if(storeCells) { + crossedCells->push_back(id); + sigmaNoise_cell->push_back(sigma_Noise); + E_exp_cell->push_back(scale_Ionization*f_exp*E_exp*scale_em_expected); + } } if(f_exp>0&&!badCell) nlay_em++; if(f_exp>0&&!badCell) sigma_Noise_em += sigma_Noise; @@ -365,6 +386,11 @@ namespace Rec { E_tile += cellEn; E_tile_expected += scale_Ionization*f_exp*E_exp*scale_tile_expected; ATH_MSG_VERBOSE( " Tile cell " << cellEn << " sigma_Noise " << sigma_Noise << " f_exp " << f_exp << " E_exp " << E_exp); + if(storeCells) { + crossedCells->push_back(id); + sigmaNoise_cell->push_back(sigma_Noise); + E_exp_cell->push_back(scale_Ionization*f_exp*E_exp*scale_tile_expected); + } } if(f_exp>0&&!badCell) nlay_tile++; if(f_exp>0&&!badCell) sigma_Noise_tile += sigma_Noise; @@ -377,6 +403,11 @@ namespace Rec { E_HEC += cellEn; E_HEC_expected += scale_Ionization*f_exp*E_exp*scale_HEC_expected; ATH_MSG_VERBOSE( " HEC cell " << cellEn << " sigma_Noise " << sigma_Noise << " f_exp " << f_exp << " E_exp " << E_exp); + if(storeCells) { + crossedCells->push_back(id); + sigmaNoise_cell->push_back(sigma_Noise); + E_exp_cell->push_back(scale_Ionization*f_exp*E_exp*scale_HEC_expected); + } } if(f_exp>0&&!badCell) nlay_HEC++; if(f_exp>0&&!badCell) sigma_Noise_HEC += sigma_Noise; diff --git a/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.h b/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.h index a995398099f4644cbbeda9ff123e409a08e09a59..63e55ee8564038ddd33140e47623737f5f6d474e 100644 --- a/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.h +++ b/Reconstruction/RecoTools/TrackToCalo/src/MuonCaloEnergyTool.h @@ -54,7 +54,9 @@ namespace Rec { double deltaE, double meanIoni, double sigmaIoni, double& E, double& sigma, double& E_FSR, double& E_expected, double &E_em_meas, double &E_em_exp, double &E_tile_meas, double &E_tile_exp, - double &E_HEC_meas, double &E_HEC_exp, double &E_dead_exp ) const; + double &E_HEC_meas, double &E_HEC_exp, double &E_dead_exp, + std::vector<Identifier>* crossedCells = 0, std::vector<double>* sigmaNoise_cell = 0, std::vector<double>* E_exp_cell = 0) const; + private: @@ -62,7 +64,8 @@ namespace Rec { ToolHandle <Rec::IParticleCaloCellAssociationTool> m_caloCellAssociationTool; //!< Tool to make the step-wise extrapolation ToolHandle< Trk::ITrackParticleCreatorTool > m_particleCreator; /**< The CB Particle Creator Tool */ - ToolHandle <ICaloNoiseTool> m_caloNoiseTool; //!< Tool to quantify electronic noise in calorimeter + // FIXME: mutable + mutable ToolHandle <ICaloNoiseTool> m_caloNoiseTool; //!< Tool to quantify electronic noise in calorimeter // DATA MEMBERS double m_sigmasAboveNoise; // 4. diff --git a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloClusterAssociationTool.h b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloClusterAssociationTool.h index ed3b22a595acda5dca8d0c6f7bb964cd5110e081..be5a3a91e465dbd07df55806445e97b3cd0a67ea 100644 --- a/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloClusterAssociationTool.h +++ b/Reconstruction/RecoTools/TrackToCalo/src/ParticleCaloClusterAssociationTool.h @@ -63,7 +63,8 @@ namespace Rec { ParticleClusterAssociation::Data& clusters ) const; ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool; - ToolHandle< xAOD::ICaloClustersInConeTool > m_clustersInConeTool; + // FIXME: mutable + mutable ToolHandle< xAOD::ICaloClustersInConeTool > m_clustersInConeTool; std::string m_containerName; double m_coneSize; diff --git a/Reconstruction/eflowRec/share/eflowRecAODList.py b/Reconstruction/eflowRec/share/eflowRecAODList.py index d113aa239637d47854b332b02163b09a04a5a568..f5cb146cdc2d6888e74046a5a8583c0a5a49d16d 100644 --- a/Reconstruction/eflowRec/share/eflowRecAODList.py +++ b/Reconstruction/eflowRec/share/eflowRecAODList.py @@ -9,13 +9,13 @@ if jobproperties.eflowRecFlags.eflowAlgType == "EOverP": eflowRecAODList += [ "xAOD::PFOContainer#EOverPNeutralParticleFlowObjects"] eflowRecAODList += [ "xAOD::PFOAuxContainer#EOverPChargedParticleFlowObjectsAux."] - eflowRecAODList += [ "xAOD::PFOAuxContainer#EOverPNeutralParticleFlowObjectsAux."]#+excludeList] + eflowRecAODList += [ "xAOD::PFOAuxContainer#EOverPNeutralParticleFlowObjectsAux."+excludeList] else: eflowRecAODList += [ "xAOD::PFOContainer#JetETMissChargedParticleFlowObjects"] eflowRecAODList += [ "xAOD::PFOContainer#JetETMissNeutralParticleFlowObjects"] eflowRecAODList += [ "xAOD::PFOAuxContainer#JetETMissChargedParticleFlowObjectsAux."] - eflowRecAODList += [ "xAOD::PFOAuxContainer#JetETMissNeutralParticleFlowObjectsAux."]#+excludeList] + eflowRecAODList += [ "xAOD::PFOAuxContainer#JetETMissNeutralParticleFlowObjectsAux."+excludeList] diff --git a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/ICaloCluster_OnTrackBuilder.h b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/ICaloCluster_OnTrackBuilder.h index f6c55d1f02c70b8ab874b188b94c163cadd28eb7..0f30bdf43fd66fee06d1e2230b6ef5adc8b086ad 100755 --- a/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/ICaloCluster_OnTrackBuilder.h +++ b/Reconstruction/egamma/egammaInterfaces/egammaInterfaces/ICaloCluster_OnTrackBuilder.h @@ -20,10 +20,10 @@ class ICaloCluster_OnTrackBuilder : virtual public IAlgTool public: static const InterfaceID& interfaceID() { return IID_caloCluster_OnTrackBuilder; }; - ~ICaloCluster_OnTrackBuilder() {}; + ~ICaloCluster_OnTrackBuilder() {}; - virtual Trk::CaloCluster_OnTrack* buildClusterOnTrack( const xAOD::Egamma* eg, int charge=0 ) const = 0 ; - virtual Trk::CaloCluster_OnTrack* buildClusterOnTrack( const xAOD::CaloCluster* cl, int charge=0 ) const = 0; + virtual Trk::CaloCluster_OnTrack* buildClusterOnTrack( const xAOD::Egamma* eg, int charge=0 ) = 0 ; + virtual Trk::CaloCluster_OnTrack* buildClusterOnTrack( const xAOD::CaloCluster* cl, int charge=0 ) = 0; }; diff --git a/Reconstruction/egamma/egammaRec/python/egammaGetter.py b/Reconstruction/egamma/egammaRec/python/egammaGetter.py index 19ca894a61bf21758e57e3a8c6284d87af5b2666..bbb25ca5df66eb4ce32b4eaf852921aba3764401 100755 --- a/Reconstruction/egamma/egammaRec/python/egammaGetter.py +++ b/Reconstruction/egamma/egammaRec/python/egammaGetter.py @@ -50,11 +50,7 @@ def getTopoSeededCollectionName(): return theCaloClusterTopoEMFixedSizeGetter.outputKey() else: return "" -def doTopoCaloSeeded(): - return egammaRecFlags.doTopoCaloSeeded() and not egammaRecFlags.doSuperclusters() and getTopoSeededCollectionName() -# -# #The tools used to add properties def egammaDecorationTools(): "Return a list with the tools that decorate both electrons and photons" diff --git a/Reconstruction/egamma/egammaRec/python/egammaRecFlags.py b/Reconstruction/egamma/egammaRec/python/egammaRecFlags.py index a8745c77581cf6b4a556da0f7a4e475d7a668be3..a432dc4d9b53d5811d37cb91465a5ce43c96d8ff 100755 --- a/Reconstruction/egamma/egammaRec/python/egammaRecFlags.py +++ b/Reconstruction/egamma/egammaRec/python/egammaRecFlags.py @@ -23,7 +23,7 @@ class Enabled(JobProperty): class egammaRecFlagsJobProperty(JobProperty): """ special flag . Subclass which has get_value depending on job properties.egammaRecFlags.Enabled - so properties inheriting from can be disabled in batch + so properties inheriting from this will be disables if egammaRec is not Enabled. """ def get_Value(self): return self.statusOn and self.StoredValue and jobproperties.egammaRecFlags.Enabled() @@ -43,7 +43,7 @@ class doEgammaForwardSeeded (egammaRecFlagsJobProperty): allowedTypes=['bool'] StoredValue=True -class doTopoCaloSeeded (egammaRecFlagsJobProperty): +class doTopoCaloSeeded (JobProperty): """ switch for SW TopoCalo algorithm """ statusOn=True @@ -51,7 +51,7 @@ class doTopoCaloSeeded (egammaRecFlagsJobProperty): StoredValue=True #Other options -class doEgammaTruthAssociation (egammaRecFlagsJobProperty): +class doEgammaTruthAssociation (JobProperty): """ switch for truth association alg """ statusOn=True @@ -80,7 +80,7 @@ class doSwitchTRTGas (JobProperty): StoredValue=True # Super cluster options -class doSuperclusters (egammaRecFlagsJobProperty): +class doSuperclusters (JobProperty): """ switch to enable/disable the supercluster based algorithm """ statusOn=True @@ -116,7 +116,7 @@ class calibMVAVersion (JobProperty): """ statusOn=True allowedTypes=['str', 'None'] - StoredValue="egammaMVACalib/offline/v5.0_rel21pre" + StoredValue="egammaMVACalib/offline/v6" # Defines a sub-container holding the jobProperties for egamma class egammaRecFlags(JobPropertyContainer): @@ -126,7 +126,9 @@ class egammaRecFlags(JobPropertyContainer): jobproperties.add_Container(egammaRecFlags) # I want always the following flags in the container -_list_Egamma=[Enabled,doEgammaCaloSeeded,doEgammaForwardSeeded,doConversions,doTopoCaloSeeded,cellContainerName,doSwitchTRTGas,doEgammaTruthAssociation,clusterCorrectionVersion,calibMVAVersion, doSuperclusters, inputTopoClusterCollection, egammaTopoClusterCollection] +_list_Egamma=[Enabled,doEgammaCaloSeeded,doEgammaForwardSeeded,doConversions,doTopoCaloSeeded,cellContainerName,doSwitchTRTGas, + doEgammaTruthAssociation,clusterCorrectionVersion,calibMVAVersion, doSuperclusters, inputTopoClusterCollection, + egammaTopoClusterCollection] for j in _list_Egamma: jobproperties.egammaRecFlags.add_JobProperty(j) diff --git a/Reconstruction/egamma/egammaRec/share/egammaRec_jobOptions.py b/Reconstruction/egamma/egammaRec/share/egammaRec_jobOptions.py index 594d349c79f06a8c42059299ec9776851a592ffa..1ada07b8a1c449cb47445c8d58688e83e2275706 100755 --- a/Reconstruction/egamma/egammaRec/share/egammaRec_jobOptions.py +++ b/Reconstruction/egamma/egammaRec/share/egammaRec_jobOptions.py @@ -11,9 +11,8 @@ from egammaRec.egammaKeys import egammaKeysDict from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() - ###############Print Egamma JobProperties############# -jobproperties.egammaRecFlags.print_JobProperties() +jobproperties.egammaRecFlags.print_JobProperties("full") ##################################################################### # Run calo-based (egamma) algorithm, includes topo-seeded # It requires either to read ESD diff --git a/Reconstruction/egamma/egammaTools/doc/mainpage.h b/Reconstruction/egamma/egammaTools/doc/mainpage.h deleted file mode 100644 index a6c9f3f021cde70573aed41eda22012f24428e05..0000000000000000000000000000000000000000 --- a/Reconstruction/egamma/egammaTools/doc/mainpage.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - -@mainpage egammaTools Package - -This package contains electron and photon reconstruction and identification tools. -These tools are called by main algorithms located in the egammaRec package. - -Following tools are used by egammaBuilder for the reconstruction of isolated high-pT electrons and photons : - -egammaSwTool : creation of the cluster - -EMClusterTool : define cluster size depending on type of object - -EMClusterErrorsTool : associate error on cluster quantities - -EMShowerBuilder : Calculation of the EM shower shapes. - -EMIsolationBuilder : It calls specialized tools located in egammaCaloTools package. When called from an analysis alg or tool it applies a special treatement to retrieve the original shower object to keep the "calorimetric isolation" variables which cannot be recalculated (due to lack of cells) - -EMTrackMatchBuilder : performs matching between cluster and a track - -EMPIDBuilder : performs identification of the object. It calls specialized tools located in egammaPID package - -EMConversionBuilder : retrieve and match conversion objects to an egamma one - -EMBremsstrahlungBuilder : retrieve bremsstrahlung. It calls specialized tools BremsstrahlungHit and BremsstrahlungHelix - -EMTrkRefitter : retrieve bremsstrahlung. It calls specialized tools like DNA and GSF. - -EMConversionRefitter : Refits the conversion tracks with dedicated e+- track fitters (like GSF and DNA) and refits the vertex (rebuilds the vertex from the first measurement in case of single-track conversions). Does not change the original tracks/vertices, but supplies the results in an egDetail. - -EMFourMomBuilder : build the 4-momentum of the candidates - -Following tools are called by softebuilder for the reconstruction of low-pT and non-isoalted electrons : - -EMClusterBuilderFromTrackSETool : take a track, extrapolate it to the EM and build a cluster - -egammaSelectClusterSETool : selection based on cluster - -egammaSelectSETool : pre and post-selection based on shower shape - -EMSofteCombinedTool :calculate variables which combine cluster and track - -Tools EMShowerBuilder, EMPIDBuilder, EMFourMomBuilder, EMConversionBuilder and EMBremsstrahlungBuilder are also called by softeBuilder. - - -@author H. Ma <hma@bnl.gov> -@author A. Poppleton <Alan.Poppleton@cern.ch> -@author S. Rajagopalan <srinir@bnl.gov> -@author M. Wielers <Monika.Wielers@cern.ch> -@author A. Khodinov <khodinov@bnl.gov> -@author F. Derue <derue@lpnhe.in2p3.fr> -@author T. Koffas <Thomas.Koffas@cern.ch> -*/ - diff --git a/Reconstruction/egamma/egammaTools/python/EMBremCollectionBuilder.py b/Reconstruction/egamma/egammaTools/python/EMBremCollectionBuilder.py index 1617b13d213129ad0d7c74c919f0c9e060b1aa4c..5b2da797bd1c5dd7eb5166a0b285c97c03dca328 100644 --- a/Reconstruction/egamma/egammaTools/python/EMBremCollectionBuilder.py +++ b/Reconstruction/egamma/egammaTools/python/EMBremCollectionBuilder.py @@ -138,15 +138,13 @@ class egammaBremCollectionBuilder ( egammaToolsConf.EMBremCollectionBuilder ) : TrackSummaryTool = GSFBuildInDetTrackSummaryTool, UseTrackSummaryTool = False, ForceTrackSummaryUpdate = False) - # Otherwise Tracks and CombinedInDetTracks will be different when slimming - ToolSvc += GSFBuildInDetParticleCreatorTool # # --- do track slimming # from TrkTrackSlimmingTool.TrkTrackSlimmingToolConf import Trk__TrackSlimmingTool as ConfigurableTrackSlimmingTool GSFBuildInDetTrkSlimmingTool = ConfigurableTrackSlimmingTool(name = "GSFBuildInDetTrackSlimmingTool", - KeepParameters = True, + KeepParameters = False, KeepOutliers = True ) ToolSvc += GSFBuildInDetTrkSlimmingTool diff --git a/Reconstruction/egamma/egammaTools/src/EMBremCollectionBuilder.cxx b/Reconstruction/egamma/egammaTools/src/EMBremCollectionBuilder.cxx index 284f512227e89f7b734c73cd917a2bf593863b90..36f1b45d77e8f5b89bffb193354af8e239505da8 100644 --- a/Reconstruction/egamma/egammaTools/src/EMBremCollectionBuilder.cxx +++ b/Reconstruction/egamma/egammaTools/src/EMBremCollectionBuilder.cxx @@ -51,6 +51,7 @@ UPDATE : #include <stdint.h> #include <algorithm> #include <cmath> +#include "CxxUtils/make_unique.h" #include "TrkMaterialOnTrack/EstimatedBremOnTrack.h" @@ -117,13 +118,11 @@ EMBremCollectionBuilder::EMBremCollectionBuilder(const std::string& type, const declareInterface<IEMBremCollectionBuilder>(this); } // =================================================================== -EMBremCollectionBuilder::~EMBremCollectionBuilder() -{ +EMBremCollectionBuilder::~EMBremCollectionBuilder() { } // ================================================================== -StatusCode EMBremCollectionBuilder::initialize() -{ +StatusCode EMBremCollectionBuilder::initialize() { // retrieve the track refitter tool: if(m_trkRefitTool.retrieve().isFailure()) { @@ -155,7 +154,6 @@ StatusCode EMBremCollectionBuilder::initialize() return StatusCode::FAILURE; } - //counters m_AllClusters=0; m_AllTracks=0; @@ -175,7 +173,6 @@ StatusCode EMBremCollectionBuilder::initialize() //************************************************************************* // Finalize StatusCode EMBremCollectionBuilder::EMBremCollectionBuilder::finalize(){ - ATH_MSG_INFO ("AllClusters " << m_AllClusters); ATH_MSG_INFO ("AllTracks " << m_AllTracks); @@ -285,8 +282,7 @@ StatusCode EMBremCollectionBuilder::contExecute() sc = refitTrack(*track_iter); if(sc.isFailure()) { ATH_MSG_WARNING("Problem in EMBreCollection Builder Refit"); - } - + } else { // Add Auxiliary decorations to the GSF Track Particle // Set Element link to original Track Particle @@ -374,47 +370,59 @@ StatusCode EMBremCollectionBuilder::refitTrack(const xAOD::TrackParticle* tmpTrk ATH_MSG_ERROR ("TrackParticle has not Track -- are you running on AOD?"); return StatusCode::FAILURE; } - - Trk::Track* trk_refit = 0; + std::unique_ptr<Trk::Track> trk_refit; // if( nSiliconHits_trk >= m_MinNoSiHits ) { StatusCode status = m_trkRefitTool->refitTrackParticle(tmpTrkPart); if (status == StatusCode::SUCCESS){ ATH_MSG_DEBUG("FIT SUCCESS "); m_RefittedTracks++; - trk_refit = m_trkRefitTool->refittedTrack(); //this is a Trk::Track + trk_refit.reset(m_trkRefitTool->refittedTrack()); //this is a Trk::Track m_summaryTool->updateTrack(*trk_refit); } else{ //We end up here due to a failed fit ATH_MSG_DEBUG("FIT FAILED "); m_FailedFitTracks++; - trk_refit = new Trk::Track(*tmpTrk); + trk_refit.reset(new Trk::Track(*tmpTrk)); } } else{ //We end up here if not enough silicons hits ATH_MSG_DEBUG("NO FIT ATTEMPTED"); m_FailedSiliconRequirFit++; - trk_refit = new Trk::Track(*tmpTrk); + trk_refit.reset(new Trk::Track(*tmpTrk)); } - - //Save perigee eta, phi for later usage in supercluster algorithm. - float perigeeExtrapEta(-999.), perigeeExtrapPhi(-999.); - if (trk_refit) { + // + //Refit Trk::Track created + // + //Get the vertex (may be pileup) that this track particle points to + const xAOD::Vertex* trkVtx(0); + if (tmpTrkPart->vertexLink().isValid()){ + trkVtx = tmpTrkPart->vertex(); + } + // + // Use the the refitted track and the original vertex to construct a new track particle + xAOD::TrackParticle* aParticle = m_particleCreatorTool->createParticle( *trk_refit, m_finalTrkPartContainer, trkVtx, xAOD::electron ); + // + //finalize things + if(aParticle!=0) { //store in container + //Additional info using the full Trk::Track + //Save extrapolated perigee to calo (eta,phi) for later usage in supercluster algorithm. + static const SG::AuxElement::Accessor<float> pgExtrapEta ("perigeeExtrapEta"); + static const SG::AuxElement::Accessor<float> pgExtrapPhi ("perigeeExtrapPhi"); + float perigeeExtrapEta(-999.), perigeeExtrapPhi(-999.); auto tsos = trk_refit->trackStateOnSurfaces()->begin(); for (;tsos != trk_refit->trackStateOnSurfaces()->end(); ++tsos) { if ((*tsos)->type(Trk::TrackStateOnSurface::Perigee) && (*tsos)->trackParameters()!=0) { - - float extrapEta(-999.), extrapPhi(-999.); - const Trk::TrackParameters *perigeeTrackParams(0); + float extrapEta(-999.), extrapPhi(-999.); + const Trk::TrackParameters *perigeeTrackParams(0); perigeeTrackParams = (*tsos)->trackParameters(); const Trk::PerigeeSurface pSurface (perigeeTrackParams->position()); std::unique_ptr<const Trk::TrackParameters> pTrkPar(pSurface.createTrackParameters( perigeeTrackParams->position(), perigeeTrackParams->momentum().unit()*1.e9, +1, 0)); - //Do the straight-line extrapolation. bool hitEM2 = m_extrapolationTool->getEtaPhiAtCalo(pTrkPar.get(), &extrapEta, &extrapPhi); if (hitEM2) { @@ -426,54 +434,38 @@ StatusCode EMBremCollectionBuilder::refitTrack(const xAOD::TrackParticle* tmpTrk break; } } - } - //Slim the tracks - Trk::Track* slimmed = m_slimTool->slim(*trk_refit); - if(!slimmed){ - ATH_MSG_ERROR ("TrackSlimming failed, this should never happen !"); - delete trk_refit; - return StatusCode::FAILURE; - } - m_finalTracks->push_back(slimmed); - - //Get the vertex (may be pileup) that this track particle points to - const xAOD::Vertex* trkVtx(0); - if (tmpTrkPart->vertexLink().isValid()){ - trkVtx = tmpTrkPart->vertex(); - } - - // Use the the refitted track and the original vertex to construct a new track particle - xAOD::TrackParticle* aParticle = m_particleCreatorTool->createParticle( *trk_refit, m_finalTrkPartContainer, trkVtx, xAOD::electron ); - delete trk_refit; - if(aParticle!=0) { //store in container - - //Set up the links - ElementLink<TrackCollection> trackLink( slimmed, *m_finalTracks); - aParticle->setTrackLink( trackLink ); - aParticle->setVertexLink(tmpTrkPart->vertexLink()); - - static const SG::AuxElement::Accessor<float> pgExtrapEta ("perigeeExtrapEta"); pgExtrapEta(*aParticle) = perigeeExtrapEta; - - static const SG::AuxElement::Accessor<float> pgExtrapPhi ("perigeeExtrapPhi"); pgExtrapPhi(*aParticle) = perigeeExtrapPhi; - + // //Add qoverP for the last measurement static const SG::AuxElement::Accessor<float > QoverPLM ("QoverPLM"); - auto tsos = slimmed->trackStateOnSurfaces()->rbegin(); - for (;tsos != slimmed->trackStateOnSurfaces()->rend(); ++tsos){ - - if ((*tsos)->type(Trk::TrackStateOnSurface::Measurement) - && (*tsos)->trackParameters()!=0 - &&(*tsos)->measurementOnTrack()!=0 - && !dynamic_cast<const Trk::PseudoMeasurementOnTrack*>((*tsos)->measurementOnTrack())) { - - QoverPLM(*aParticle) = (*tsos)->trackParameters()->parameters()[Trk::qOverP]; + float QoverPLast(0); + auto rtsos = trk_refit->trackStateOnSurfaces()->rbegin(); + for (;rtsos != trk_refit->trackStateOnSurfaces()->rend(); ++rtsos){ + if ((*rtsos)->type(Trk::TrackStateOnSurface::Measurement) + && (*rtsos)->trackParameters()!=0 + &&(*rtsos)->measurementOnTrack()!=0 + && !dynamic_cast<const Trk::PseudoMeasurementOnTrack*>((*rtsos)->measurementOnTrack())) { + QoverPLast = (*rtsos)->trackParameters()->parameters()[Trk::qOverP]; break; } } + QoverPLM(*aParticle) = QoverPLast; + // + //Now Slim the track for writing to disk + Trk::Track* slimmed = m_slimTool->slim(*trk_refit); + if(!slimmed){ + ATH_MSG_ERROR ("TrackSlimming failed, this should never happen !"); + return StatusCode::FAILURE; + } + m_finalTracks->push_back(slimmed); + // + ElementLink<TrackCollection> trackLink( slimmed, *m_finalTracks); + aParticle->setTrackLink( trackLink ); + aParticle->setVertexLink(tmpTrkPart->vertexLink()); return StatusCode::SUCCESS; - } else { + }else { + ATH_MSG_WARNING("Could not create TrackParticle, this should never happen !"); return StatusCode::FAILURE; } } diff --git a/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.cxx b/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.cxx index 0712910cf9a69c58a565c99bd09a2233978414af..af03e3d00bf90c92f86f833e7fea46cf9468c002 100644 --- a/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.cxx +++ b/Reconstruction/egamma/egammaTools/src/EMConversionBuilder.cxx @@ -145,6 +145,9 @@ StatusCode EMConversionBuilder::executeRec(egammaRec* egRec) { ATH_MSG_WARNING("Could not retrieve Conversion container! EMConversionBuilder will stop."); return StatusCode::SUCCESS; } + //reset the vertices + std::vector< ElementLink< xAOD::VertexContainer > > vertices; + egRec->setVertices(vertices); ATH_CHECK(vertexExecute(egRec,conversions)); return StatusCode::SUCCESS; } diff --git a/Reconstruction/egamma/egammaTools/src/egammaSuperClusterBuilder.cxx b/Reconstruction/egamma/egammaTools/src/egammaSuperClusterBuilder.cxx index 8b471e10c9c0807b37b670d6ffc53900bc70057b..b9471fa7b54e50184a9be522da85e901c3b11aec 100644 --- a/Reconstruction/egamma/egammaTools/src/egammaSuperClusterBuilder.cxx +++ b/Reconstruction/egamma/egammaTools/src/egammaSuperClusterBuilder.cxx @@ -146,8 +146,6 @@ egammaSuperClusterBuilder::egammaSuperClusterBuilder(const std::string& type, declareProperty("AddCellsWindowPhiCellsEndcap", m_addCellsWindowPhiCellsEndcap = 999 /*5 for SW*/, "Number of cells in phi of window around topocluster center to add cells"); - - declareProperty("SumRemainingCellsInWindow", m_sumRemainingCellsInWindow = false); declareProperty("RefineEta1", m_refineEta1 = true, "Whether to Refine Eta1 calculation"); @@ -198,14 +196,30 @@ StatusCode egammaSuperClusterBuilder::initialize() { bool egammaSuperClusterBuilder::MatchesInWindow(const xAOD::CaloCluster *ref, const xAOD::CaloCluster *clus) const { - //Get the differences in 2nd layer eta, phi of the - //satellite and seed for convenience. - float dEta(fabs(ref->eta()-clus->eta())); - float dPhi(fabs(P4Helpers::deltaPhi(ref->phi(), clus->phi()))); - - if (xAOD::EgammaHelpers::isBarrel(clus)) { + //First the case where we are both endcap and barrel, i.e in the crack + //Check around both measurements of the seed + if (ref->hasSampling(CaloSampling::EMB2) && ref->hasSampling(CaloSampling::EME2)) { + float dEta(fabs(ref->eta()-clus->eta())); + float dPhi(fabs(P4Helpers::deltaPhi(ref->phi(), clus->phi()))); + // + float dEtaBarrel (fabs(ref->etaSample(CaloSampling::EMB2)-clus->eta())); + float dPhiBarrel =(P4Helpers::deltaPhi(ref->phiSample(CaloSampling::EMB2),clus->phi())); + // + float dEtaEndcap (fabs(ref->etaSample(CaloSampling::EME2)-clus->eta())); + float dPhiEndcap =(P4Helpers::deltaPhi(ref->phiSample(CaloSampling::EME2),clus->phi())); + //Matches any in case of split + return ( (dEta < m_searchWindowEtaBarrel && dPhi < m_searchWindowPhiBarrel) || + (dEta < m_searchWindowEtaEndcap && dPhi < m_searchWindowPhiEndcap) || + (dEtaBarrel < m_searchWindowEtaBarrel && dPhiBarrel < m_searchWindowPhiBarrel) || + (dEtaEndcap < m_searchWindowEtaEndcap && dPhiEndcap < m_searchWindowPhiEndcap)); + } + else if (xAOD::EgammaHelpers::isBarrel(clus)) { + float dEta(fabs(ref->eta()-clus->eta())); + float dPhi(fabs(P4Helpers::deltaPhi(ref->phi(), clus->phi()))); return (dEta < m_searchWindowEtaBarrel && dPhi < m_searchWindowPhiBarrel); } else { + float dEta(fabs(ref->eta()-clus->eta())); + float dPhi(fabs(P4Helpers::deltaPhi(ref->phi(), clus->phi()))); return (dEta < m_searchWindowEtaEndcap && dPhi < m_searchWindowPhiEndcap); } } @@ -224,19 +238,15 @@ xAOD::CaloCluster* egammaSuperClusterBuilder::CreateNewCluster(const std::vector ATH_MSG_ERROR("CaloClusterStoreHelper::makeCluster failed."); return nullptr; } - newCluster->setClusterSize(xAOD::CaloCluster::SuperCluster); - //A vector to keep track of cells we have added (filled by AddEMCellsToCluster) - std::vector<const CaloCell*> cellsInWindow; - //Need a vector of element Links to the constituent Cluster std::vector< ElementLink< xAOD::CaloClusterContainer > > constituentLinks; static const SG::AuxElement::Accessor < ElementLink < xAOD::CaloClusterContainer > > sisterCluster("SisterCluster"); // //Start with the seed //Add the EM cells of the seed cluster - if (AddEMCellsToCluster(newCluster,clusters[0], cellsInWindow).isFailure()) { + if (AddEMCellsToCluster(newCluster,clusters[0]).isFailure()) { ATH_MSG_DEBUG("There was problem adding the cells to cluster with : " << newCluster->eta()); delete newCluster; return nullptr; @@ -247,6 +257,7 @@ xAOD::CaloCluster* egammaSuperClusterBuilder::CreateNewCluster(const std::vector } else{ ATH_MSG_WARNING("No sister Link available"); } + // calculate the seed cluster kinematics. CaloClusterKineHelper::calculateKine(newCluster, true, true); // @@ -256,12 +267,12 @@ xAOD::CaloCluster* egammaSuperClusterBuilder::CreateNewCluster(const std::vector ATH_MSG_DEBUG("========== Seed ==== "); ATH_MSG_DEBUG("Seed eta : "<<newCluster->eta0()); ATH_MSG_DEBUG("Seed phi : "<<newCluster->phi0()); - // + // // Now continue with the remaining clusters for (size_t i = 1; i < acSize; i++) { //Add te EM cells of the accumulated to the cluster - if (AddEMCellsToCluster(newCluster,clusters[i], cellsInWindow).isFailure()) { + if (AddEMCellsToCluster(newCluster,clusters[i]).isFailure()) { ATH_MSG_WARNING("There was problem adding the topocluster cells to the the cluster"); delete newCluster; return nullptr; @@ -279,20 +290,11 @@ xAOD::CaloCluster* egammaSuperClusterBuilder::CreateNewCluster(const std::vector static const SG::AuxElement::Accessor < std::vector< ElementLink< xAOD::CaloClusterContainer > > > caloClusterLinks("constituentClusterLinks"); caloClusterLinks(*newCluster) = constituentLinks; // - //Add all the remaining (not used) cells in a window (Around eta0,phi0) - if (m_sumRemainingCellsInWindow) { - if (AddRemainingCellsToCluster(newCluster,cellsInWindow).isFailure()) { - ATH_MSG_WARNING("There was problem adding the cells outside of the topoclusters"); - delete newCluster; - return nullptr; - } - } - // ///Calculate the kinematics of the new cluster, after all cells are added CaloClusterKineHelper::calculateKine(newCluster, true, true); // //Check to see if cluster doesn't have EMB2 OR EME2. If not, kill it. - if (!newCluster->hasSampling(CaloSampling::EMB2) && !newCluster->hasSampling(CaloSampling::EME2)) { + if (!newCluster->hasSampling(CaloSampling::EMB2) && !newCluster->hasSampling(CaloSampling::EME2)) { ATH_MSG_WARNING("Supercluster doesn't have energy in layer 2. Skipping..."); delete newCluster; return nullptr; @@ -304,6 +306,14 @@ xAOD::CaloCluster* egammaSuperClusterBuilder::CreateNewCluster(const std::vector delete newCluster; return nullptr; } + + // Apply SW-style summation of TileGap3 cells (if necessary). + if (AddTileGap3CellsinWindow(newCluster).isFailure()) { + ATH_MSG_ERROR("Problem with the input cluster when running AddTileGap3CellsinWindow?"); + return nullptr; + } + CaloClusterKineHelper::calculateKine(newCluster, true, true); + // Apply correction calibration if (CalibrateCluster(newCluster, egType).isFailure()) { ATH_MSG_WARNING("There was problem calibrating the object"); @@ -315,121 +325,77 @@ xAOD::CaloCluster* egammaSuperClusterBuilder::CreateNewCluster(const std::vector } StatusCode egammaSuperClusterBuilder::AddEMCellsToCluster(xAOD::CaloCluster *newCluster, - const xAOD::CaloCluster *ref, - std::vector<const CaloCell*>& cellsInWindow) const{ + const xAOD::CaloCluster *ref) const { if (!newCluster || !ref) { ATH_MSG_ERROR("Invalid input in AddEMCellsToCluster"); return StatusCode::FAILURE; } - const bool isBarrel(xAOD::EgammaHelpers::isBarrel(ref)); // xAOD::CaloCluster::const_cell_iterator cell_itr = ref->begin(); xAOD::CaloCluster::const_cell_iterator cell_end = ref->end(); - - //Need to check that the cell belongs to the EM calorimeter. + //Loop over cells for (; cell_itr != cell_end; ++cell_itr) { + + //sanity check on the cell const CaloCell* cell = *cell_itr; if (!cell){ continue; } - - //Add all LAR EM const CaloDetDescrElement *dde = cell->caloDDE(); if(!dde){ continue; } - - //Add TileGap3 (consider only E4 cell). - //Don't apply any eta/phi restrictions to TileGap3 cells, - //analogous to sliding window. + //First add all TileGap3 (consider only E4 cell). if (CaloCell_ID::TileGap3 == dde->getSampling()) { if( fabs(cell->eta()) >1.4 && fabs(cell->eta()) < 1.6 ) { newCluster->addCell(cell_itr.index(), cell_itr.weight()); - cellsInWindow.push_back(cell); } - } else { - if (isBarrel) { - if (fabs(ref->eta()-cell->eta()) > m_addCellsWindowEtaBarrel){ - continue; - } - if (fabs(P4Helpers::deltaPhi(ref->phi(),cell->phi())) > m_addCellsWindowPhiBarrel){ - continue; - } - } else { - if (fabs(ref->eta()-cell->eta()) > m_addCellsWindowEtaEndcap){ - continue; - } - if (fabs(P4Helpers::deltaPhi(ref->phi(),cell->phi())) > m_addCellsWindowPhiEndcap){ - continue; - } - } - - if (dde->getSubCalo() == CaloCell_ID::LAREM) { - //Avoid summing inner wheel Endcap cells - //for the Lar (i.e the ones with worse granularity) - if(! (dde->is_lar_em_endcap_inner()) ){ - newCluster->addCell(cell_itr.index(), cell_itr.weight()); - cellsInWindow.push_back(cell); - } + continue; + //If it is TileGap we are done here + //either added or not , next cell please + } + //First the case where we are both endcap and barrel, i.e in the crack + if (ref->hasSampling(CaloSampling::EMB2) && ref->hasSampling(CaloSampling::EME2)) { + //Here we want to allow them either because they around the barrel center + //or because they are around the endcap center , so skip only if it fails both + if ( (fabs(ref->etaSample(CaloSampling::EMB2)-cell->eta()) > m_addCellsWindowEtaBarrel)&& + (fabs(ref->etaSample(CaloSampling::EME2)-cell->eta()) > m_addCellsWindowEtaEndcap) ){ + continue; + } + if ((P4Helpers::deltaPhi(ref->phiSample(CaloSampling::EMB2),cell->phi()) > m_addCellsWindowPhiBarrel)&& + (P4Helpers::deltaPhi(ref->phiSample(CaloSampling::EME2),cell->phi()) > m_addCellsWindowPhiEndcap) ){ + continue; + } + } + else if (xAOD::EgammaHelpers::isBarrel(ref)) {//else if it is barrel + if (fabs(ref->eta()-cell->eta()) > m_addCellsWindowEtaBarrel){ + continue; + } + if (fabs(P4Helpers::deltaPhi(ref->phi(),cell->phi())) > m_addCellsWindowPhiBarrel){ + continue; + } + } else { //here must be endcap only + if (fabs(ref->eta()-cell->eta()) > m_addCellsWindowEtaEndcap){ + continue; + } + if (fabs(P4Helpers::deltaPhi(ref->phi(),cell->phi())) > m_addCellsWindowPhiEndcap){ + continue; + } + } + //For the cells we have not skipped either because TileGap or because out of bounds + if (dde->getSubCalo() == CaloCell_ID::LAREM) { + //Avoid summing inner wheel Endcap cells + if(! (dde->is_lar_em_endcap_inner()) ){ + newCluster->addCell(cell_itr.index(), cell_itr.weight()); } } }//Loop over cells - if (newCluster->size()==0){ return StatusCode::FAILURE; } return StatusCode::SUCCESS; } -StatusCode egammaSuperClusterBuilder::AddRemainingCellsToCluster(xAOD::CaloCluster *myCluster, - std::vector<const CaloCell*>& cellsInWindow) const{ - ATH_MSG_DEBUG("Add Remaining cells in window"); - if (!myCluster) { - ATH_MSG_ERROR("Invalid input in AddRemainingCellsToCluster"); - return StatusCode::FAILURE; - } - // determine window size, barrel or EC - auto searchWindowEta = m_searchWindowEtaEndcap; - auto searchWindowPhi = m_searchWindowPhiEndcap; - if (xAOD::EgammaHelpers::isBarrel(myCluster)) { - searchWindowEta = m_searchWindowEtaBarrel; - searchWindowPhi = m_searchWindowPhiBarrel; - } - std::vector<const CaloCell*> cells; - cells.reserve(100); - const CaloCellContainer* inputcells=myCluster->getCellLinks()->getCellContainer(); - CaloCellList myList(inputcells); - const std::vector<CaloSampling::CaloSample> samples = {CaloSampling::PreSamplerB, - CaloSampling::PreSamplerE, - CaloSampling::EMB1, - CaloSampling::EME1, - CaloSampling::EMB2, - CaloSampling::EME2, - CaloSampling::EMB3, - CaloSampling::EME3, - CaloSampling::TileGap3}; - - for ( auto samp : samples ) { - myList.select(myCluster->eta0(), myCluster->phi0(), searchWindowEta, searchWindowPhi,samp); - cells.insert(cells.end(), myList.begin(), myList.end()); - } - for ( auto cell : cells ) { - if( !cell || !cell->caloDDE() ) {continue;} - int index = inputcells->findIndex(cell->caloDDE()->calo_hash()); - if( index == -1 ) {continue;} - //Check if it's already used. - if (CaloCell_ID::TileGap3 == cell->caloDDE()->getSampling() && - (std::abs(cell->eta()) <= 1.4 || std::abs(cell->eta()) >= 1.6)) { - continue; // only take them in the gap - } - if (std::find(cellsInWindow.begin(),cellsInWindow.end(),cell) != cellsInWindow.end()) { - continue; - } - //Adding with weight '1' now -- don't a priori have weight of cell, - myCluster->addCell(index, 1.); - } - return StatusCode::SUCCESS; -} StatusCode egammaSuperClusterBuilder::CalibrateCluster(xAOD::CaloCluster* newCluster, const xAOD::EgammaParameters::EgammaType egType) { @@ -483,12 +449,10 @@ StatusCode egammaSuperClusterBuilder::CalibrateCluster(xAOD::CaloCluster* newClu } ATH_MSG_DEBUG("========== cluster only calibration ==== "); ATH_MSG_DEBUG("Cluster Energy after cluster only calibration: "<<newCluster->e()); - return StatusCode::SUCCESS; } // ========================================================================== -StatusCode egammaSuperClusterBuilder::fillPositionsInCalo(xAOD::CaloCluster* cluster) -{ +StatusCode egammaSuperClusterBuilder::fillPositionsInCalo(xAOD::CaloCluster* cluster){ const bool isBarrel = xAOD::EgammaHelpers::isBarrel(cluster); CaloCell_ID::CaloSample sample = isBarrel ? CaloCell_ID::EMB2 : CaloCell_ID::EME2; // eta and phi of the cluster in the calorimeter frame @@ -510,7 +474,7 @@ StatusCode egammaSuperClusterBuilder::fillPositionsInCalo(xAOD::CaloCluster* clu } StatusCode egammaSuperClusterBuilder::refineEta1Position(xAOD::CaloCluster* cluster) const { - + // This only makes sense if we have cells there if (!cluster->hasSampling(CaloSampling::EMB1) && !cluster->hasSampling(CaloSampling::EME1)) { ATH_MSG_DEBUG("No layer sampling - skipping refine eta "); @@ -585,14 +549,45 @@ StatusCode egammaSuperClusterBuilder::makeCorrection1(xAOD::CaloCluster* cluster return StatusCode::SUCCESS; } +StatusCode egammaSuperClusterBuilder::AddTileGap3CellsinWindow(xAOD::CaloCluster *myCluster) const{ + ATH_MSG_DEBUG("Add Remaining cells in window"); + if (!myCluster) { + ATH_MSG_ERROR("Invalid input in AddRemainingCellsToCluster"); + return StatusCode::FAILURE; + } -bool egammaSuperClusterBuilder::getTileGapCorrectedEMFrac(const xAOD::CaloCluster* cluster, double& emfrac ) const{ - emfrac=0; - static const SG::AuxElement::Accessor<float> acc("EMFraction"); - if(!acc.isAvailable(*cluster)) { - return false; - } - emfrac= acc(*cluster); - ATH_MSG_DEBUG("EM fraction from egamma decoration: " << emfrac); - return true; + //DO NOT RUN IF THERE ARE ALREADY ADDED + if (myCluster->hasSampling(CaloSampling::TileGap3)) { + return StatusCode::SUCCESS; + } + static const double searchWindowEta = 0.2; + static const double searchWindowPhi = 2*M_PI/64.0 + M_PI/64 ; // ~ 0.15 rad + std::vector<const CaloCell*> cells; + cells.reserve(16); + const CaloCellContainer* inputcells=myCluster->getCellLinks()->getCellContainer(); + + if (!inputcells) { + ATH_MSG_ERROR("No cell container in AddRemainingCellsToCluster?"); + return StatusCode::FAILURE; + } + + CaloCellList myList(inputcells); + + const std::vector<CaloSampling::CaloSample> samples = {CaloSampling::TileGap3}; + for ( auto samp : samples ) { + myList.select(myCluster->eta0(), myCluster->phi0(), searchWindowEta, searchWindowPhi,samp); + cells.insert(cells.end(), myList.begin(), myList.end()); + } + + for ( auto cell : cells ) { + if( !cell || !cell->caloDDE() ) { + continue; + } + if ( (CaloCell_ID::TileGap3 == cell->caloDDE()->getSampling()) && + (std::abs(cell->eta()) > 1.4 && std::abs(cell->eta()) < 1.6)) { + int index = inputcells->findIndex(cell->caloDDE()->calo_hash()); + myCluster->addCell(index, 1.); + } + } + return StatusCode::SUCCESS; } diff --git a/Reconstruction/egamma/egammaTools/src/egammaSuperClusterBuilder.h b/Reconstruction/egamma/egammaTools/src/egammaSuperClusterBuilder.h index 41d6b4e71702a11446c4f82295ca3bd82ecdcb00..bd57c65662e74ef47a32b1e88da958e6615d5256 100644 --- a/Reconstruction/egamma/egammaTools/src/egammaSuperClusterBuilder.h +++ b/Reconstruction/egamma/egammaTools/src/egammaSuperClusterBuilder.h @@ -44,8 +44,6 @@ protected: xAOD::CaloCluster* CreateNewCluster(const std::vector<const xAOD::CaloCluster*>& clusters, xAOD::EgammaParameters::EgammaType egType); - bool getTileGapCorrectedEMFrac(const xAOD::CaloCluster* cluster, double& emfrac ) const; - // some constants to use static constexpr float s_cellEtaSize = 0.025; static constexpr float s_cellPhiSize = M_PI/128.; @@ -63,13 +61,7 @@ private: /** Add the EM cells from reference cluster to self */ StatusCode AddEMCellsToCluster(xAOD::CaloCluster* newCluster, - const xAOD::CaloCluster* ref, - std::vector<const CaloCell*>& cellsInWindow) const; - - /** Add the cells in search window, not only those in topoclusters, to the new cluster */ - StatusCode AddRemainingCellsToCluster(xAOD::CaloCluster *myCluster, - std::vector<const CaloCell*>& cellsInWindow) const; - + const xAOD::CaloCluster* ref) const; /** function to calibrate the new clusters energy */ StatusCode CalibrateCluster(xAOD::CaloCluster* newCluster, @@ -81,12 +73,13 @@ private: StatusCode fillPositionsInCalo(xAOD::CaloCluster* cluster); // above can't be const because m_caloCellDetPos acceses are not const - //Calculate / refine posisiton in 1st sampling + /** functions to refine position in eta1*/ StatusCode refineEta1Position(xAOD::CaloCluster* cluster) const ; StatusCode makeCorrection1(xAOD::CaloCluster* cluster, const CaloSampling::CaloSample sample) const ; - + /** functions to add all tile Gap 3 cells in a window*/ + StatusCode AddTileGap3CellsinWindow(xAOD::CaloCluster *myCluster) const; // these are calculated window values for the windows in which cells of topoclusters are edded float m_addCellsWindowEtaBarrel; //!< half of addCells window size, converted to units of eta @@ -110,13 +103,9 @@ private: int m_addCellsWindowEtaCellsEndcap; /** @brief Size of windows et phi in which cells of topoclusters are edded for the endcap */ int m_addCellsWindowPhiCellsEndcap; - - bool m_sumRemainingCellsInWindow; //!< Whether to sum the cells outside of topoclusters in search window - bool m_refineEta1 ; //!< Whether to refine the eta1 calculation bool m_correctClusters; //!< Whether to run cluster correction bool m_calibrateClusters; //!< Whether to run cluster calibration - /** @breif Handle to the MVA calibration Tool **/ ToolHandle<IegammaMVATool> m_MVACalibTool; /** @brief Tool to handle cluster corrections */ diff --git a/Reconstruction/egamma/egammaTools/src/egammaTopoClusterCopier.cxx b/Reconstruction/egamma/egammaTools/src/egammaTopoClusterCopier.cxx index d8720342c11770c97992fc19fad1d3326416af35..db5df6d0eb8b3106a4f2f9e6c2aca2262da79bb5 100644 --- a/Reconstruction/egamma/egammaTools/src/egammaTopoClusterCopier.cxx +++ b/Reconstruction/egamma/egammaTools/src/egammaTopoClusterCopier.cxx @@ -7,15 +7,15 @@ #include "AthContainers/ConstDataVector.h" #include "CaloUtils/CaloClusterStoreHelper.h" #include "xAODCore/ShallowCopy.h" +#include "xAODCaloEvent/CaloClusterKineHelper.h" class greater{ public: bool operator()(xAOD::CaloCluster const *a, xAOD::CaloCluster const *b) const { - static const SG::AuxElement::Accessor<bool> acc("isE4TileGap3Recovered"); - - if(acc.isAvailable(*a) && acc.isAvailable(*b)) { //TieGap Recovered (true 1) should after (ascending) the no recovered (false 0) + static const SG::AuxElement::Accessor<bool> acc("isCrackRecovered"); + if(acc.isAvailable(*a) && acc.isAvailable(*b)) { if(acc(*a)!=acc(*b)){ return acc(*a) < acc(*b); } @@ -35,8 +35,7 @@ public: // ============================================================= egammaTopoClusterCopier::egammaTopoClusterCopier(const std::string& type, const std::string& name, const IInterface* parent) : - egammaBaseTool(type, name, parent) -{ + egammaBaseTool(type, name, parent){ declareProperty("InputTopoCollection", m_inputTopoCollection = "CaloTopoCluster"); declareProperty("OutputTopoCollection", m_outputTopoCollection = "egammaTopoCluster"); declareProperty("EtaCut", m_etaCut = 2.6); @@ -111,12 +110,14 @@ StatusCode egammaTopoClusterCopier::copyCaloTopo() const{ //Special condition for crack on EM fraction OR EM Et due to observed //fragmentation of showers. bool isCrack(fabs((*cciter)->eta()) > 1.37 && fabs((*cciter)->eta()) < 1.52); - if (isCrack) + if(isCrack){ passesCuts = (passesCuts || (emfrac*(*cciter)->et()) > m_EMCrackEtCut); - if (!passesCuts) + } + if (!passesCuts){ continue; - + } //Clone the cluster + CaloClusterKineHelper::calculateKine(*cciter,true,true); ATH_MSG_DEBUG("-->SELECTED Cluster at eta,phi,et " << (*cciter)->eta() << " , "<< (*cciter)->phi() << " , " << (*cciter)->et()); viewCopy->push_back((*cciter)); } @@ -139,10 +140,10 @@ StatusCode egammaTopoClusterCopier::checkEMFraction (const xAOD::CaloCluster *cl ATH_MSG_DEBUG("Initial emfrac: " <<emfrac); // double aeta= fabs(clus->eta()); - // if the cluster is in the crack or so, add the TileGap cells to its EM energy - if(aeta>1.35 && aeta<1.55 && clusterE>0){ + // Try to add the TileGap cells to its EM energy + // For crack clusters, also want to consider EME0, EMB0 + if(aeta>1.37 && aeta<1.63 && clusterE>0){ double EMEnergy= clusterE*emfrac; - xAOD::CaloCluster::const_cell_iterator cell_itr = clus->begin(); xAOD::CaloCluster::const_cell_iterator cell_end = clus->end(); @@ -162,6 +163,15 @@ StatusCode egammaTopoClusterCopier::checkEMFraction (const xAOD::CaloCluster *cl EMEnergy += cell->e()*cell_itr.weight(); } } + + //Add also cells from EMB0, EME0 for crack. + if (CaloCell_ID::PreSamplerE == dde->getSampling()) { + EMEnergy += cell->e()*cell_itr.weight(); + } + if (CaloCell_ID::PreSamplerB == dde->getSampling()) { + EMEnergy += cell->e()*cell_itr.weight(); + } + emfrac = EMEnergy/clusterE; } ATH_MSG_DEBUG("Corrected emfrac for E4 in TileGap3: " <<emfrac); @@ -169,14 +179,14 @@ StatusCode egammaTopoClusterCopier::checkEMFraction (const xAOD::CaloCluster *cl // static const SG::AuxElement::Decorator<float> acc("EMFraction"); acc(*clus)=emfrac; + //Did it pass after correction const bool pass_after_correction= ((emfrac>m_EMFracCut) && ( (clusterE*emfrac) > m_ECut)); - - static const SG::AuxElement::Decorator<bool> acc1("isE4TileGap3Recovered"); + static const SG::AuxElement::Decorator<bool> acc1("isCrackRecovered"); acc1(*clus)= (pass_no_correction!=pass_after_correction); ATH_MSG_DEBUG("Cluster need to be recovered " << (pass_no_correction!=pass_after_correction)); - + // emFrac = emfrac; - + //Could re return pass_after_correction ; } diff --git a/Reconstruction/egamma/egammaTrackTools/src/CaloCluster_OnTrackBuilder.cxx b/Reconstruction/egamma/egammaTrackTools/src/CaloCluster_OnTrackBuilder.cxx index 5eef00cc63b1c301fde6e6f76507bb1edfc1e621..1dfc4917e7282e8b0e4a60f4c52edb3d247f4aff 100755 --- a/Reconstruction/egamma/egammaTrackTools/src/CaloCluster_OnTrackBuilder.cxx +++ b/Reconstruction/egamma/egammaTrackTools/src/CaloCluster_OnTrackBuilder.cxx @@ -79,7 +79,7 @@ StatusCode CaloCluster_OnTrackBuilder::finalize(){ return StatusCode::SUCCESS; } //-------------------------------------------------------------------------------------------- - Trk::CaloCluster_OnTrack* CaloCluster_OnTrackBuilder::buildClusterOnTrack( const xAOD::Egamma* eg, int charge ) const + Trk::CaloCluster_OnTrack* CaloCluster_OnTrackBuilder::buildClusterOnTrack( const xAOD::Egamma* eg, int charge ) //-------------------------------------------------------------------------------------------- { return buildClusterOnTrack( eg->caloCluster(), charge ); @@ -88,7 +88,7 @@ StatusCode CaloCluster_OnTrackBuilder::finalize(){ return StatusCode::SUCCESS; } //-------------------------------------------------------------------------------------------- - Trk::CaloCluster_OnTrack* CaloCluster_OnTrackBuilder::buildClusterOnTrack( const xAOD::CaloCluster* cluster, int charge ) const + Trk::CaloCluster_OnTrack* CaloCluster_OnTrackBuilder::buildClusterOnTrack( const xAOD::CaloCluster* cluster, int charge ) //-------------------------------------------------------------------------------------------- { @@ -135,7 +135,7 @@ StatusCode CaloCluster_OnTrackBuilder::finalize(){ return StatusCode::SUCCESS; } //-------------------------------------------------------------------------------------------- -const Trk::Surface* CaloCluster_OnTrackBuilder::getCaloSurface( const xAOD::CaloCluster* cluster ) const +const Trk::Surface* CaloCluster_OnTrackBuilder::getCaloSurface( const xAOD::CaloCluster* cluster ) //-------------------------------------------------------------------------------------------- { diff --git a/Reconstruction/egamma/egammaTrackTools/src/CaloCluster_OnTrackBuilder.h b/Reconstruction/egamma/egammaTrackTools/src/CaloCluster_OnTrackBuilder.h index c4c8b556d5c607e47040c40643457cf13550ed37..36f947bee079340657acff08e0a1c344accd1176 100755 --- a/Reconstruction/egamma/egammaTrackTools/src/CaloCluster_OnTrackBuilder.h +++ b/Reconstruction/egamma/egammaTrackTools/src/CaloCluster_OnTrackBuilder.h @@ -38,13 +38,13 @@ class CaloCluster_OnTrackBuilder : public AthAlgTool, virtual public ICaloCluste virtual StatusCode initialize(); virtual StatusCode finalize(); - virtual Trk::CaloCluster_OnTrack* buildClusterOnTrack( const xAOD::Egamma* eg, int charge=0 ) const; - virtual Trk::CaloCluster_OnTrack* buildClusterOnTrack( const xAOD::CaloCluster* cl, int charge=0 ) const; + virtual Trk::CaloCluster_OnTrack* buildClusterOnTrack( const xAOD::Egamma* eg, int charge=0) ; + virtual Trk::CaloCluster_OnTrack* buildClusterOnTrack( const xAOD::CaloCluster* cl, int charge=0) ; private: - const Trk::Surface* getCaloSurface( const xAOD::CaloCluster* cluster ) const; + const Trk::Surface* getCaloSurface( const xAOD::CaloCluster* cluster ) ; const Trk::LocalParameters* getClusterLocalParameters( const xAOD::CaloCluster* cluster, const Trk::Surface* surf, int charge) const; diff --git a/Reconstruction/egamma/egammaTrackTools/src/EMExtrapolationTools.cxx b/Reconstruction/egamma/egammaTrackTools/src/EMExtrapolationTools.cxx index 7b54562be24ce52b7dd86f831b6772c603c06509..4a1fa9eb045de0fd49b53d1a7d3cc9a3ffec91a9 100644 --- a/Reconstruction/egamma/egammaTrackTools/src/EMExtrapolationTools.cxx +++ b/Reconstruction/egamma/egammaTrackTools/src/EMExtrapolationTools.cxx @@ -57,9 +57,6 @@ EMExtrapolationTools::EMExtrapolationTools(const std::string& type, declareProperty( "TRTendcapDeltaEta", m_TRTendcapDeltaEta = 0.2); declareProperty("useCaching", m_useCaching = true, "Use the cache for track Particle extrapolation"); - declareProperty("useTrkTrackForTRT", m_useTrkTrackForTRT = true, "Use Trk::Track instead of TrackParticle to determine TRT section"); - declareProperty("guessTRTsection", m_guessTRTsection = false, "Guess TRT section from eta, instead of using track parameters"); - declareInterface<IEMExtrapolationTools>(this); } @@ -144,18 +141,13 @@ EMExtrapolationTools::matchesAtCalo(const xAOD::CaloCluster* cluster, // Decide matching for TRT standalone // In case of standalone TRT tracks get an idea where the last measurement is - int isTRTB = 0; // barrel or endcap TRT + int isTRTB = 0 ; if(isTRT){ if (!m_trtId) { ATH_MSG_WARNING("Should have m_trtId defined for isTRT"); return false; } - // Get last measurement for TRT check - Trk::CurvilinearParameters temp = getLastMeasurement(trkPB); - const Trk::TrackParameters* trkParTRT = &temp; - const Trk::Surface& sf = trkParTRT->associatedSurface(); - const Identifier tid = sf.associatedDetectorElementIdentifier(); - isTRTB = m_trtId->barrel_ec(tid); + isTRTB = getTRTsection(trkPB); // First pass on TRT tracks, skip barrel tracks matching endcap clusters and vice-versa if((isTRTB==2 && (cluster->eta()<=0.6 || cluster->eta()>=2.4) ) || (isTRTB==-2 && (cluster->eta()>=-0.6 || cluster->eta()<=-2.4) ) || @@ -171,6 +163,7 @@ EMExtrapolationTools::matchesAtCalo(const xAOD::CaloCluster* cluster, ATH_MSG_WARNING("getMatchAtCalo failed"); return false; } + // Selection in the narrow eta/phi window if((isTRT && ((abs(isTRTB)==1 && deltaPhi[iSampling] < m_narrowDeltaPhiTRTbarrel && deltaPhi[iSampling] > -m_narrowDeltaPhiBremTRTbarrel) || @@ -578,7 +571,7 @@ Amg::Vector3D EMExtrapolationTools::getMomentumAtVertex(const xAOD::Vertex& vert } return momentum; } -// ================================================================= +// ============================================================================ // ======================= HELPERS============================================== const Trk::TrackParameters* @@ -609,45 +602,25 @@ EMExtrapolationTools::getRescaledPerigee(const xAOD::TrackParticle* trkPB, const return (result); } -// ================================================================= -Trk::CurvilinearParameters EMExtrapolationTools::getLastMeasurement(const xAOD::TrackParticle* trkPB) const{ - // Get last measurement for TRT check - //For TRT it is always the last - unsigned int index(0); - Trk::CurvilinearParameters temp; - if(trkPB->indexOfParameterAtPosition(index,xAOD::LastMeasurement)){ - temp= trkPB->curvilinearParameters(index); - } else { - ATH_MSG_WARNING("Track Particle does not contain Last Measurement track parameters"); - } - return temp; -} - // ================================================================= int EMExtrapolationTools::getTRTsection(const xAOD::TrackParticle* trkPB) const{ if (!trkPB){ ATH_MSG_DEBUG("Null pointer to TrackParticle"); return 0; - } - - if (!m_trtId || m_guessTRTsection){ - ATH_MSG_DEBUG("Guessing TRT section based on eta: " << trkPB->eta()); + } + if (!m_trtId){ + ATH_MSG_DEBUG("No trt ID guessing TRT section based on eta: " << trkPB->eta()); return (trkPB->eta() > 0 ? 1 : -1) * (fabs(trkPB->eta()) < 0.6 ? 1 : 2); } - const Trk::TrackParameters* trkPar =0; Trk::CurvilinearParameters temp; - if (!m_useTrkTrackForTRT){ - temp= getLastMeasurement(trkPB); - trkPar = &temp; - } - else if( trkPB->trackLink().isValid() && trkPB->track() != 0 ) { + if( trkPB->trackLink().isValid() && trkPB->track() != 0 ) { ATH_MSG_DEBUG("Will get TrackParameters from Trk::Track"); const DataVector<const Trk::TrackStateOnSurface> *trackStates = trkPB->track()->trackStateOnSurfaces(); if (!trackStates) { ATH_MSG_WARNING("NULL pointer to trackStateOnSurfaces"); return 0; - } + } //Loop over the TrkStateOnSurfaces // search last valid TSOS first for ( DataVector<const Trk::TrackStateOnSurface>::const_reverse_iterator rItTSoS = trackStates->rbegin(); rItTSoS != trackStates->rend(); ++rItTSoS) @@ -662,7 +635,9 @@ int EMExtrapolationTools::getTRTsection(const xAOD::TrackParticle* trkPB) const{ else { ATH_MSG_WARNING("Track particle without Trk::Track"); } - if (!trkPar) return 0; + if (!trkPar) { + return 0; + } const Trk::Surface& sf = trkPar->associatedSurface(); const Identifier tid = sf.associatedDetectorElementIdentifier(); return m_trtId->barrel_ec(tid); diff --git a/Reconstruction/egamma/egammaTrackTools/src/EMExtrapolationTools.h b/Reconstruction/egamma/egammaTrackTools/src/EMExtrapolationTools.h index d6afb4d7ebf66107f2fb62f9277a8c57a97c5a2a..7c92818e70edf029282c835880b3d0cbadf857c6 100644 --- a/Reconstruction/egamma/egammaTrackTools/src/EMExtrapolationTools.h +++ b/Reconstruction/egamma/egammaTrackTools/src/EMExtrapolationTools.h @@ -128,9 +128,6 @@ class EMExtrapolationTools : virtual public IEMExtrapolationTools, public AthAlg /** @Perform the Rescaling of the perigee parameters with the cluster energy **/ const Trk::TrackParameters* getRescaledPerigee(const xAOD::TrackParticle* trkPB, const xAOD::CaloCluster* cluster) const; - /** @Get Last measurement **/ - Trk::CurvilinearParameters getLastMeasurement(const xAOD::TrackParticle* trkPB) const; - /** @brief Return +/- 1 (2) if track is in positive/negative TRT barrel (endcap) **/ int getTRTsection(const xAOD::TrackParticle* trkPB) const; @@ -141,7 +138,6 @@ class EMExtrapolationTools : virtual public IEMExtrapolationTools, public AthAlg float *phiAtCalo, CaloExtensionHelpers::LayersToSelect& layersToSelect ) const; - ToolHandle<Trk::IParticleCaloExtensionTool> m_defaultParticleCaloExtensionTool; ToolHandle<Trk::IParticleCaloExtensionTool> m_perigeeParticleCaloExtensionTool; @@ -162,17 +158,10 @@ class EMExtrapolationTools : virtual public IEMExtrapolationTools, public AthAlg // ID TRT helper const TRT_ID* m_trtId; - //Use the a cache for track Particle extrapolation bool m_useCaching; - - // Use Trk::Track instead of TrackParticle to determine TRT section - // due to missing association with detector element - bool m_useTrkTrackForTRT; - // Guess TRT section from eta, instead of using track parameters - bool m_guessTRTsection; }; diff --git a/Reconstruction/tauRec/python/DeprecatedTauAlgorithmsHolder.py b/Reconstruction/tauRec/python/DeprecatedTauAlgorithmsHolder.py new file mode 100644 index 0000000000000000000000000000000000000000..c935e03d22a36080d67ebc45903065b7c52ad6c8 --- /dev/null +++ b/Reconstruction/tauRec/python/DeprecatedTauAlgorithmsHolder.py @@ -0,0 +1,273 @@ +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +######################################################################## +# calibrate tau at EM scale +def getEnergyCalibrationEM(): + _name = sPrefix + 'EnergyCalibrationEM' + + if _name in cached_instances: + return cached_instances[_name] + + from tauRecTools.tauRecToolsConf import TauCalibrateEM + TauCalibrateEM = TauCalibrateEM(name = _name, response_functions_file = "EMTES_Fits_Oct2010.root") + + cached_instances[_name] = TauCalibrateEM + return TauCalibrateEM + +######################################################################## +# lock tau containers +def getContainerLock(): + _name = sPrefix + 'TauContainerLock' + + if _name in cached_instances: + return cached_instances[_name] + + from tauRecTools.tauRecToolsConf import LockTauContainers + LockTauContainers = LockTauContainers(name = _name) + + cached_instances[_name] = LockTauContainers + return LockTauContainers + +######################################################################### +# Tau ID Variable Pileup Correction +# Not used +def getIDPileUpCorrection(): + _name = sPrefix + 'TauIDPileupCorrection' + + if _name in cached_instances: + return cached_instances[_name] + + from tauRecTools.tauRecToolsConf import TauIDPileupCorrection + IDPileUpCorrection = TauIDPileupCorrection(name = _name, + calibrationFile1Prong = "TF2pileupForOfflineID_1p.root", + calibrationFile3Prong = "TF2pileupForOfflineID_3p.root", + useMu = True) + + cached_instances[_name] = IDPileUpCorrection + return IDPileUpCorrection + +######################################################################## +#Old TauJetBDT from TauDiscriminant +def getTauJetBDT(): + _name = sPrefix + 'TauJetBDT' + from TauDiscriminant.TauDiscriminantConf import TauJetBDT + myTauJetBDT = TauJetBDT(name=_name, + jetBDT="uncorrBDTAODfix.bin",#update + jetSigTrans="", + jetSigBits="TauJetBDT2016FinalCuts_v1.txt") + cached_instances[_name] = myTauJetBDT + return myTauJetBDT + + +######################################################################## +#Old TauEleBDT from TauDiscriminant +def getTauEleBDT(_n='TauEleBDT', eBDT='ele.BDT.bin', only_decorate=False, eBits="", eBitsRoot="cuts.eBDT.root"): + _name = sPrefix + _n + from TauDiscriminant.TauDiscriminantConf import TauEleBDT + myTauEleBDT = TauEleBDT(name=_name, + eleBDT=eBDT, + eleBits=eBits, + eleBitsRoot=eBitsRoot, + onlyDecorateScore=only_decorate) + cached_instances[_name] = myTauEleBDT + return myTauEleBDT + +""" obsolete methods + +######################################################################## +# Tau Origin Cell Correction Tool +def getTauCellCorrection(): + _name = sPrefix + 'TauCellCorrection' + + from AthenaCommon.AppMgr import ToolSvc + + if _name in cached_instances: + return cached_instances[_name] + + from tauRecTools.tauRecToolsConf import TauOriginCorrectionTool + TauCellCorrectionTool = TauOriginCorrectionTool(name = _name, + UseJVA = False, #not using JetVertexAssociation, b/c JetRec doesn't use it too + UsePrimaryVertex = True, + UseBeamSpot = True, + VertexContainerKey = "PrimaryVertices") + + ToolSvc += TauCellCorrectionTool + cached_instances[_name] = TauCellCorrectionTool + return TauCellCorrectionTool + +######################################################################### +# CaloNoiseTool +def getCaloNoiseTool(): + _name = 'CaloNoiseTool' + + if _name in cached_instances: + return cached_instances[_name] + + from CaloTools.CaloNoiseToolDefault import CaloNoiseToolDefault + theCaloNoiseTool = CaloNoiseToolDefault() + + from AthenaCommon.AppMgr import ToolSvc + ToolSvc += theCaloNoiseTool + + cached_instances[_name] = theCaloNoiseTool + return theCaloNoiseTool + +######################################################################### +# tau1p3p track match cells +def getTauEflowTrackMatchCells(): + _name = sPrefix + 'EflowTrackMatchCells' + + if _name in cached_instances: + return cached_instances[_name] + + from tauRecTools.tauRecToolsConf import TauEflowTrackMatchCells + TauEflowTrackMatchCells = TauEflowTrackMatchCells(name = _name, + detRIsolCaloCut = 0.4, + useNoiseSigma = 1, + AbsNoiseSigma_cut = 2, + CaloNoiseTool = getCaloNoiseTool(), + selectConeSize = 0.45, #not used anymore + CellCorrection = True, + OriginCorrectionTool = getTauCellCorrection()) + + cached_instances[_name] = TauEflowTrackMatchCells + return TauEflowTrackMatchCells + +######################################################################### +# tau1p3p AddCaloInfo +def getTauEflowAddCaloInfo(): + _name = sPrefix + 'EflowAddCaloInfo' + + if _name in cached_instances: + return cached_instances[_name] + + from tauRecTools.tauRecToolsConf import TauEflowAddCaloInfo + TauEflowAddCaloInfo = TauEflowAddCaloInfo(name = _name, + detRCoreCaloCut = 0.2, + detRIsolCaloCut = 0.4, + ETCellMinCut = 0.1*GeV, + ETStripMinCut = 0.2*GeV, + detaStripCut = 0.2, + CellCorrection = True, + OriginCorrectionTool = getTauCellCorrection()) + + cached_instances[_name] = TauEflowAddCaloInfo + return TauEflowAddCaloInfo + +######################################################################### +# tau1p3p eflow info +def getTauEflowVariables(): + _name = sPrefix + 'EflowVariables' + + if _name in cached_instances: + return cached_instances[_name] + + from tauRecTools.tauRecToolsConf import TauEflowVariables + TauEflowVariables = TauEflowVariables(name = _name, + detRCoreCaloCut = 0.2, + dphiEMCLCut = 0.0375, + detaEMCLCut = 0.0375, + dphiEMCLFACCut = 2, + detaEMCLFACCut = 3, + dphiChrgEMCut = 0.0375, + detaChrgEMCut = 0.0375, + CaloClusterContainerName = "EMTopoForTaus", #TODO: rec.scoping<3 case?? + RecoTopoClusterETCut = 0.2*GeV, + RecoEtaCut = 2.5, + TrackTopoClusPhi2Cut = 0.0375, + TrackTopoClusEta1Cut = 0.01, + MVisEflowCut = 10.*GeV, + MTrk3PCut = 10.*GeV, + ETeflow_ETcaloCut = 10., + ETeflow_ETcaloCutMin = 0.1, + useEMTopoClusters = True, + CellCorrection = True, + OriginCorrectionTool = getTauCellCorrection()) + + cached_instances[_name] = TauEflowVariables + return TauEflowVariables + +##################### +# Pi0 Creator Chooser +def getPi0CreatorChooser(): + _name = sPrefix + 'Pi0CreatorChooser' + + if _name in cached_instances: + return cached_instances[_name] + + from AthenaCommon.AppMgr import ToolSvc + ToolSvc += getPi0ClusterCreator() + ToolSvc += getCrakowPi0ClusterCreator() + + from tauRecTools.tauRecToolsConf import TauPi0CreatorChooser + TauPi0CreatorChooser = TauPi0CreatorChooser(name = _name, + Tau1p3pCreatePi0ClusTool = getCrakowPi0ClusterCreator(), + TauCommonCreatePi0ClusTool = getPi0ClusterCreator()) + + cached_instances[_name] = TauPi0CreatorChooser + return TauPi0CreatorChooser + +######################################################################### +# Crakow Pi0/eflow algorithm +# Cluster/Cellfinder for Pi0/Eflow algos +def getPi0EflowCreateROI(): + _name = sPrefix + 'TauPi0EflowCreateROI' + + if _name in cached_instances: + return cached_instances[_name] + + from tauRecTools.tauRecToolsConf import TauPi0EflowCreateROI + TauPi0EflowCreateROI = TauPi0EflowCreateROI( name = _name, + detRIsolCaloCut = 0.4, + detRCoreCaloCut = 0.2, + useNoiseSigma = 0, + AbsNoiseSigma_cut = 2, + removeChrgEM01 = 1, + removeChrgEM2 = 1, + detRChrgEMCut = 0.0375, + # Added by SL + fillCellContainer = TRUE, + CellsOutputContainerName = "TauCells", + CaloNoiseTool = getCaloNoiseTool(), + CaloCellMakerToolNames = ["CaloCellContainerFinalizerTool/cellfinalizerForTaus","CaloCellContainerCheckerTool/cellcheckForTaus"], + CellCorrection = True, + OriginCorrectionTool = getTauCellCorrection()) + + cached_instances[_name] = TauPi0EflowCreateROI + return TauPi0EflowCreateROI + +################ +# Pi0 Clustering +def getCrakowPi0ClusterCreator(): + _name = sPrefix + 'CrakowPi0ClusterCreator' + + if _name in cached_instances: + return cached_instances[_name] + + from tauRecTools.tauRecToolsConf import TauPi0CrakowClusterCreator + TauPi0CrakowClusterCreator = TauPi0CrakowClusterCreator( name = _name, + detRCoreCaloCut = 0.2, + CaloClusterContainerName = "EMTopoForTaus", #TODO: rec.scoping<3 case?? + RecoTopoClusterETCut = 1.0*GeV, + RecoEtaCut = 2.5, + detTrkClusMin = 0.0375, + fracEM01verEM = 0.1) + + cached_instances[_name] = TauPi0CrakowClusterCreator + return TauPi0CrakowClusterCreator + +######################################################################## +# set track infos (charge + global track collection) +def getTauSetTracksAndCharge(): + _name = sPrefix + 'TauSetTracksAndCharge' + + if _name in cached_instances: + return cached_instances[_name] + + from tauRecTools.tauRecToolsConf import TauSetTracksAndCharge + TauSetTracksAndCharge = TauSetTracksAndCharge(name = _name, TrackContainer = "TrackParticleCandidate") + + cached_instances[_name] = TauSetTracksAndCharge + return TauSetTracksAndCharge + +""" diff --git a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py index 4488a06176dfa774c227c8cbfe4ee75f9eb62966..5c8055b8d66ffb661b7d87bb8699b3cf23fddb1d 100644 --- a/Reconstruction/tauRec/python/TauAlgorithmsHolder.py +++ b/Reconstruction/tauRec/python/TauAlgorithmsHolder.py @@ -97,9 +97,12 @@ def getEnergyCalibrationLC(correctEnergy=True, correctAxis=False, postfix=''): from tauRecTools.tauRecToolsConf import TauCalibrateLC TauCalibrateLC = TauCalibrateLC(name = _name, - calibrationFile = "TES_MC15.root", - doEnergyCorrection = correctEnergy, - doAxisCorrection = correctAxis) + calibrationFile = "TES_MC16a_prelim.root", + doEnergyCorrection = correctEnergy, + doAxisCorrection = correctAxis, + doPtResponse = True, + countOnlyPileupVertices = True, + ) cached_instances[_name] = TauCalibrateLC return TauCalibrateLC @@ -146,20 +149,6 @@ def getParticleCaloExtensionTool(): return tauParticleCaloExtensionTool -######################################################################## -# calibrate tau at EM scale -def getEnergyCalibrationEM(): - _name = sPrefix + 'EnergyCalibrationEM' - - if _name in cached_instances: - return cached_instances[_name] - - from tauRecTools.tauRecToolsConf import TauCalibrateEM - TauCalibrateEM = TauCalibrateEM(name = _name, response_functions_file = "EMTES_Fits_Oct2010.root") - - cached_instances[_name] = TauCalibrateEM - return TauCalibrateEM - ######################################################################## ######################################################################## # Tracking Tools @@ -262,20 +251,6 @@ def getTauTrackToVertexIPEstimator(): ToolSvc += TauTrackToVertexIPEstimator return TauTrackToVertexIPEstimator -######################################################################## -# lock tau containers -def getContainerLock(): - _name = sPrefix + 'TauContainerLock' - - if _name in cached_instances: - return cached_instances[_name] - - from tauRecTools.tauRecToolsConf import LockTauContainers - LockTauContainers = LockTauContainers(name = _name) - - cached_instances[_name] = LockTauContainers - return LockTauContainers - ######################################################################### # Tau Variables # TODO: rename + rearrange @@ -292,25 +267,6 @@ def getTauCommonCalcVars(): return TauCommonCalcVars -######################################################################### -# Tau ID Variable Pileup Correction -def getIDPileUpCorrection(): - _name = sPrefix + 'TauIDPileupCorrection' - - if _name in cached_instances: - return cached_instances[_name] - - from tauRecTools.tauRecToolsConf import TauIDPileupCorrection - IDPileUpCorrection = TauIDPileupCorrection(name = _name, - calibrationFile1Prong = "TF2pileupForOfflineID_1p.root", - calibrationFile3Prong = "TF2pileupForOfflineID_3p.root", - useMu = True) - - cached_instances[_name] = IDPileUpCorrection - return IDPileUpCorrection - - - ######################################################################### # Tau Test def getTauTestDump(): @@ -789,7 +745,7 @@ def getMvaTESEvaluator(): _name = sPrefix + 'MvaTESEvaluator' from tauRecTools.tauRecToolsConf import MvaTESEvaluator MvaTESEvaluator = MvaTESEvaluator(name = _name, - WeightFileName = 'MvaTES_20161015_pi0fix_BDTG.weights.root') + WeightFileName = 'MvaTES_20170207_v2_BDTG.weights.root') #update config? cached_instances[_name] = MvaTESEvaluator return MvaTESEvaluator @@ -799,7 +755,7 @@ def getCombinedP4FromRecoTaus(): _name = sPrefix + 'CombinedP4FromRecoTaus' from tauRecTools.tauRecToolsConf import CombinedP4FromRecoTaus CombinedP4FromRecoTaus = CombinedP4FromRecoTaus(name = _name, - WeightFileName = 'CalibLoopResult.root') + WeightFileName = 'CalibLoopResult_v04-04.root') #update config? cached_instances[_name] = CombinedP4FromRecoTaus return CombinedP4FromRecoTaus @@ -827,7 +783,8 @@ def getTauTrackClassifier(): Threshold = tauFlags.tauRecMVATrackClassificationConfig()[0][1], ExpectedFlag = ROOT.xAOD.TauJetParameters.unclassified, SignalType = ROOT.xAOD.TauJetParameters.classifiedCharged, - BackgroundType = ROOT.xAOD.TauJetParameters.classifiedIsolation + BackgroundType = ROOT.xAOD.TauJetParameters.classifiedIsolation, + calibFolder = tauFlags.tauRecToolsCVMFSPath(), ) ToolSvc += _BDT_TTCT_ITFT_0 cached_instances[_BDT_TTCT_ITFT_0.name] = _BDT_TTCT_ITFT_0 @@ -839,7 +796,8 @@ def getTauTrackClassifier(): Threshold = tauFlags.tauRecMVATrackClassificationConfig()[1][1], ExpectedFlag = ROOT.xAOD.TauJetParameters.classifiedCharged, SignalType = ROOT.xAOD.TauJetParameters.classifiedCharged, - BackgroundType = ROOT.xAOD.TauJetParameters.classifiedConversion + BackgroundType = ROOT.xAOD.TauJetParameters.classifiedConversion, + calibFolder = tauFlags.tauRecToolsCVMFSPath(), ) ToolSvc += _BDT_TTCT_ITFT_0_0 cached_instances[_BDT_TTCT_ITFT_0_0.name] = _BDT_TTCT_ITFT_0_0 @@ -851,7 +809,8 @@ def getTauTrackClassifier(): Threshold = tauFlags.tauRecMVATrackClassificationConfig()[2][1], ExpectedFlag = ROOT.xAOD.TauJetParameters.classifiedIsolation, SignalType = ROOT.xAOD.TauJetParameters.classifiedIsolation, - BackgroundType = ROOT.xAOD.TauJetParameters.classifiedFake + BackgroundType = ROOT.xAOD.TauJetParameters.classifiedFake, + calibFolder = tauFlags.tauRecToolsCVMFSPath(), ) ToolSvc += _BDT_TTCT_ITFT_0_1 cached_instances[_BDT_TTCT_ITFT_0_1.name] = _BDT_TTCT_ITFT_0_1 @@ -866,76 +825,81 @@ def getTauTrackClassifier(): ######################################################################## # -def getTauWPDecorator(): +def getTauWPDecoratorJetBDT(): + import PyUtils.RootUtils as ru + ROOT = ru.import_root() + import cppyy + cppyy.loadDictionary('xAODTau_cDict') + _name = sPrefix + 'TauWPDecorator' from tauRecTools.tauRecToolsConf import TauWPDecorator myTauWPDecorator = TauWPDecorator( name=_name, - flatteningFile1Prong = "flat1SmoothAODfix.root", - flatteningFile3Prong = "flat3SmoothAODfix.root", + flatteningFile1Prong = "FlatJetBDT1Pv2.root", #update + flatteningFile3Prong = "FlatJetBDT3Pv2.root", #update + CutEnumVals = + [ ROOT.xAOD.TauJetParameters.JetBDTSigVeryLoose, ROOT.xAOD.TauJetParameters.JetBDTSigLoose, + ROOT.xAOD.TauJetParameters.JetBDTSigMedium, ROOT.xAOD.TauJetParameters.JetBDTSigTight ], + SigEff1P = [0.95, 0.85, 0.75, 0.60], + SigEff3P = [0.95, 0.75, 0.60, 0.45], + ScoreName = "BDTJetScore", + NewScoreName = "BDTJetScoreSigTrans", DefineWPs = True, - SigEffWPVeryLoose1P = 0.95, - SigEffWPLoose1P = 0.85, - SigEffWPMedium1P = 0.75, - SigEffWPTight1P = 0.60, - SigEffWPVeryLoose3P = 0.95, - SigEffWPLoose3P = 0.75, - SigEffWPMedium3P = 0.60, - SigEffWPTight3P = 0.45) + ) cached_instances[_name] = myTauWPDecorator return myTauWPDecorator # def getTauWPDecoratorEleBDT(): + import PyUtils.RootUtils as ru + ROOT = ru.import_root() + import cppyy + cppyy.loadDictionary('xAODTau_cDict') + _name = sPrefix + 'TauWPDecoratorEleBDT' from tauRecTools.tauRecToolsConf import TauWPDecorator TauScoreFlatteningTool = TauWPDecorator( name=_name, - flatteningFile1Prong = "TauDiscriminant/02-00-09/tune_eVeto_BDT_1P.root", - flatteningFile3Prong = "TauDiscriminant/02-00-09/tune_eVeto_BDT_3P.root", - DefineWPs = False, - UseEleBDT = True ) + flatteningFile1Prong = "EleBDTFlat1P.root",#update + flatteningFile3Prong = "EleBDTFlat3P.root",#update + UseEleBDT = True , + ScoreName = "BDTEleScore", + NewScoreName = "BDTEleScoreSigTrans", #dynamic + DefineWPs = True, + CutEnumVals = + [ROOT.xAOD.TauJetParameters.EleBDTLoose, + ROOT.xAOD.TauJetParameters.EleBDTMedium, + ROOT.xAOD.TauJetParameters.EleBDTTight], + SigEff1P = [0.95, 0.85, 0.75], + SigEff3P = [0.95, 0.85, 0.75], + ) cached_instances[_name] = TauScoreFlatteningTool return TauScoreFlatteningTool -#end tauRecTools - -######################################################################## -#TauDiscriminant -######################################################################## +def getTauJetBDTEvaluator(_n, weightsFile="", minNTracks=0, maxNTracks=10000, outputVarName="BDTJetScore", GradiantBoost=True, minAbsTrackEta=-1, maxAbsTrackEta=-1): + _name = sPrefix + _n + from tauRecTools.tauRecToolsConf import TauJetBDTEvaluator + myTauJetBDTEvaluator = TauJetBDTEvaluator(name=_name, + weightsFile=weightsFile, #update config? + minNTracks=minNTracks, + maxNTracks=maxNTracks, + minAbsTrackEta=minAbsTrackEta, + maxAbsTrackEta=maxAbsTrackEta, + outputVarName=outputVarName, + GradiantBoost=GradiantBoost) + cached_instances[_name] = myTauJetBDTEvaluator + return myTauJetBDTEvaluator def getTauIDVarCalculator(): _name = sPrefix + 'TauIDVarCalculator' - from TauDiscriminant.TauDiscriminantConf import TauIDVarCalculator + from tauRecTools.tauRecToolsConf import TauIDVarCalculator myTauIDVarCalculator = TauIDVarCalculator(name=_name, ) cached_instances[_name] = myTauIDVarCalculator return myTauIDVarCalculator -def getTauJetBDT(): - _name = sPrefix + 'TauJetBDT' - from TauDiscriminant.TauDiscriminantConf import TauJetBDT - myTauJetBDT = TauJetBDT(name=_name, - jetBDT="uncorrBDTAODfix.bin", - jetSigTrans="", - jetSigBits="TauJetBDT2016FinalCuts_v1.txt") - cached_instances[_name] = myTauJetBDT - return myTauJetBDT - - -def getTauEleBDT(_n='TauEleBDT', eBDT='ele.BDT.bin', only_decorate=False, eBits="", eBitsRoot="cuts.eBDT.root"): - _name = sPrefix + _n - from TauDiscriminant.TauDiscriminantConf import TauEleBDT - myTauEleBDT = TauEleBDT(name=_name, - eleBDT=eBDT, - eleBits=eBits, - eleBitsRoot=eBitsRoot, - onlyDecorateScore=only_decorate) - cached_instances[_name] = myTauEleBDT - return myTauEleBDT - def getTauEleOLRDecorator(): _name = sPrefix + 'TauEleOLRDecorator' - from TauDiscriminant.TauDiscriminantConf import TauEleOLRDecorator + from tauRecTools.tauRecToolsConf import TauEleOLRDecorator myTauEleOLRDecorator = TauEleOLRDecorator(name=_name, ElectronContainerName="Electrons", EleOLRFile="eVetoAODfix.root") @@ -945,202 +909,3 @@ def getTauEleOLRDecorator(): -""" obsolete methods - -######################################################################## -# Tau Origin Cell Correction Tool -def getTauCellCorrection(): - _name = sPrefix + 'TauCellCorrection' - - from AthenaCommon.AppMgr import ToolSvc - - if _name in cached_instances: - return cached_instances[_name] - - from tauRecTools.tauRecToolsConf import TauOriginCorrectionTool - TauCellCorrectionTool = TauOriginCorrectionTool(name = _name, - UseJVA = False, #not using JetVertexAssociation, b/c JetRec doesn't use it too - UsePrimaryVertex = True, - UseBeamSpot = True, - VertexContainerKey = "PrimaryVertices") - - ToolSvc += TauCellCorrectionTool - cached_instances[_name] = TauCellCorrectionTool - return TauCellCorrectionTool - -######################################################################### -# CaloNoiseTool -def getCaloNoiseTool(): - _name = 'CaloNoiseTool' - - if _name in cached_instances: - return cached_instances[_name] - - from CaloTools.CaloNoiseToolDefault import CaloNoiseToolDefault - theCaloNoiseTool = CaloNoiseToolDefault() - - from AthenaCommon.AppMgr import ToolSvc - ToolSvc += theCaloNoiseTool - - cached_instances[_name] = theCaloNoiseTool - return theCaloNoiseTool - -######################################################################### -# tau1p3p track match cells -def getTauEflowTrackMatchCells(): - _name = sPrefix + 'EflowTrackMatchCells' - - if _name in cached_instances: - return cached_instances[_name] - - from tauRecTools.tauRecToolsConf import TauEflowTrackMatchCells - TauEflowTrackMatchCells = TauEflowTrackMatchCells(name = _name, - detRIsolCaloCut = 0.4, - useNoiseSigma = 1, - AbsNoiseSigma_cut = 2, - CaloNoiseTool = getCaloNoiseTool(), - selectConeSize = 0.45, #not used anymore - CellCorrection = True, - OriginCorrectionTool = getTauCellCorrection()) - - cached_instances[_name] = TauEflowTrackMatchCells - return TauEflowTrackMatchCells - -######################################################################### -# tau1p3p AddCaloInfo -def getTauEflowAddCaloInfo(): - _name = sPrefix + 'EflowAddCaloInfo' - - if _name in cached_instances: - return cached_instances[_name] - - from tauRecTools.tauRecToolsConf import TauEflowAddCaloInfo - TauEflowAddCaloInfo = TauEflowAddCaloInfo(name = _name, - detRCoreCaloCut = 0.2, - detRIsolCaloCut = 0.4, - ETCellMinCut = 0.1*GeV, - ETStripMinCut = 0.2*GeV, - detaStripCut = 0.2, - CellCorrection = True, - OriginCorrectionTool = getTauCellCorrection()) - - cached_instances[_name] = TauEflowAddCaloInfo - return TauEflowAddCaloInfo - -######################################################################### -# tau1p3p eflow info -def getTauEflowVariables(): - _name = sPrefix + 'EflowVariables' - - if _name in cached_instances: - return cached_instances[_name] - - from tauRecTools.tauRecToolsConf import TauEflowVariables - TauEflowVariables = TauEflowVariables(name = _name, - detRCoreCaloCut = 0.2, - dphiEMCLCut = 0.0375, - detaEMCLCut = 0.0375, - dphiEMCLFACCut = 2, - detaEMCLFACCut = 3, - dphiChrgEMCut = 0.0375, - detaChrgEMCut = 0.0375, - CaloClusterContainerName = "EMTopoForTaus", #TODO: rec.scoping<3 case?? - RecoTopoClusterETCut = 0.2*GeV, - RecoEtaCut = 2.5, - TrackTopoClusPhi2Cut = 0.0375, - TrackTopoClusEta1Cut = 0.01, - MVisEflowCut = 10.*GeV, - MTrk3PCut = 10.*GeV, - ETeflow_ETcaloCut = 10., - ETeflow_ETcaloCutMin = 0.1, - useEMTopoClusters = True, - CellCorrection = True, - OriginCorrectionTool = getTauCellCorrection()) - - cached_instances[_name] = TauEflowVariables - return TauEflowVariables - -##################### -# Pi0 Creator Chooser -def getPi0CreatorChooser(): - _name = sPrefix + 'Pi0CreatorChooser' - - if _name in cached_instances: - return cached_instances[_name] - - from AthenaCommon.AppMgr import ToolSvc - ToolSvc += getPi0ClusterCreator() - ToolSvc += getCrakowPi0ClusterCreator() - - from tauRecTools.tauRecToolsConf import TauPi0CreatorChooser - TauPi0CreatorChooser = TauPi0CreatorChooser(name = _name, - Tau1p3pCreatePi0ClusTool = getCrakowPi0ClusterCreator(), - TauCommonCreatePi0ClusTool = getPi0ClusterCreator()) - - cached_instances[_name] = TauPi0CreatorChooser - return TauPi0CreatorChooser - -######################################################################### -# Crakow Pi0/eflow algorithm -# Cluster/Cellfinder for Pi0/Eflow algos -def getPi0EflowCreateROI(): - _name = sPrefix + 'TauPi0EflowCreateROI' - - if _name in cached_instances: - return cached_instances[_name] - - from tauRecTools.tauRecToolsConf import TauPi0EflowCreateROI - TauPi0EflowCreateROI = TauPi0EflowCreateROI( name = _name, - detRIsolCaloCut = 0.4, - detRCoreCaloCut = 0.2, - useNoiseSigma = 0, - AbsNoiseSigma_cut = 2, - removeChrgEM01 = 1, - removeChrgEM2 = 1, - detRChrgEMCut = 0.0375, - # Added by SL - fillCellContainer = TRUE, - CellsOutputContainerName = "TauCells", - CaloNoiseTool = getCaloNoiseTool(), - CaloCellMakerToolNames = ["CaloCellContainerFinalizerTool/cellfinalizerForTaus","CaloCellContainerCheckerTool/cellcheckForTaus"], - CellCorrection = True, - OriginCorrectionTool = getTauCellCorrection()) - - cached_instances[_name] = TauPi0EflowCreateROI - return TauPi0EflowCreateROI - -################ -# Pi0 Clustering -def getCrakowPi0ClusterCreator(): - _name = sPrefix + 'CrakowPi0ClusterCreator' - - if _name in cached_instances: - return cached_instances[_name] - - from tauRecTools.tauRecToolsConf import TauPi0CrakowClusterCreator - TauPi0CrakowClusterCreator = TauPi0CrakowClusterCreator( name = _name, - detRCoreCaloCut = 0.2, - CaloClusterContainerName = "EMTopoForTaus", #TODO: rec.scoping<3 case?? - RecoTopoClusterETCut = 1.0*GeV, - RecoEtaCut = 2.5, - detTrkClusMin = 0.0375, - fracEM01verEM = 0.1) - - cached_instances[_name] = TauPi0CrakowClusterCreator - return TauPi0CrakowClusterCreator - -######################################################################## -# set track infos (charge + global track collection) -def getTauSetTracksAndCharge(): - _name = sPrefix + 'TauSetTracksAndCharge' - - if _name in cached_instances: - return cached_instances[_name] - - from tauRecTools.tauRecToolsConf import TauSetTracksAndCharge - TauSetTracksAndCharge = TauSetTracksAndCharge(name = _name, TrackContainer = "TrackParticleCandidate") - - cached_instances[_name] = TauSetTracksAndCharge - return TauSetTracksAndCharge - -""" diff --git a/Reconstruction/tauRec/python/TauRecBuilder.py b/Reconstruction/tauRec/python/TauRecBuilder.py index dfb254202051b6ddca4e007b2fd7ee8371a0f31a..255855a93c0a09e3c9763eaa8ac0267db22aafb6 100644 --- a/Reconstruction/tauRec/python/TauRecBuilder.py +++ b/Reconstruction/tauRec/python/TauRecBuilder.py @@ -277,7 +277,6 @@ class TauRecVariablesProcessor ( TauRecConfigured ) : # SWITCHED OFF SELECTOR< SINCE NO CHARGED PFOS AVAILABLE ATM tools.append(taualgs.getPi0Selector()) tools.append(taualgs.getEnergyCalibrationLC(correctEnergy=False, correctAxis=True, postfix='_onlyAxis')) - tools.append(taualgs.getIDPileUpCorrection()) # ## for testing purpose #tools.append(taualgs.getTauTestDump()) @@ -293,18 +292,27 @@ class TauRecVariablesProcessor ( TauRecConfigured ) : #these tools need pantau info + tools.append(taualgs.getCombinedP4FromRecoTaus()) tools.append(taualgs.getMvaTESVariableDecorator()) tools.append(taualgs.getMvaTESEvaluator()) - tools.append(taualgs.getCombinedP4FromRecoTaus()) if tauFlags.doRunTauDiscriminant(): tools.append(taualgs.getTauIDVarCalculator()) - tools.append(taualgs.getTauJetBDT()) - tools.append(taualgs.getTauEleBDT()) - tools.append(taualgs.getTauEleBDT(_n="TauEleBDT_run2", eBDT="TauDiscriminant/02-00-09/TauEleBDT_run2_test.bin", only_decorate=True, eBitsRoot="", eBits="")) - tools.append(taualgs.getTauEleOLRDecorator()) - tools.append(taualgs.getTauWPDecorator()) + tools.append(taualgs.getTauJetBDTEvaluator("TauJetBDT1P", weightsFile="vars2016_pt_gamma_1p_isofix.root", minNTracks=0, maxNTracks=1)) #update config? + tools.append(taualgs.getTauJetBDTEvaluator("TauJetBDT3P", weightsFile="vars2016_pt_gamma_3p_isofix.root", minNTracks=2, maxNTracks=1000)) #update config? + tools.append(taualgs.getTauWPDecoratorJetBDT()) + tools.append(taualgs.getTauJetBDTEvaluator("TauEleBDT_def", weightsFile="", outputVarName="BDTEleScore"))#just inits values + tools.append(taualgs.getTauJetBDTEvaluator("TauEleBDT_bar", + weightsFile="EleBDT1PBar.root", minNTracks=1, maxAbsTrackEta=1.37, + outputVarName="BDTEleScore")) #update config? + tools.append(taualgs.getTauJetBDTEvaluator("TauEleBDT_end1", + weightsFile="EleBDT1PEnd1.root", minNTracks=1, minAbsTrackEta=1.37, + maxAbsTrackEta=2.0, outputVarName="BDTEleScore")) #update config? + tools.append(taualgs.getTauJetBDTEvaluator("TauEleBDT_end23", + weightsFile="EleBDT1PEnd23.root", minNTracks=1, minAbsTrackEta=2.0, + maxAbsTrackEta=3.0, outputVarName="BDTEleScore")) #update config? tools.append(taualgs.getTauWPDecoratorEleBDT()) + tools.append(taualgs.getTauEleOLRDecorator()) pass tools+=tauFlags.tauRecToolsDevToolListProcessor() diff --git a/Reconstruction/tauRec/python/TauRecConfigured.py b/Reconstruction/tauRec/python/TauRecConfigured.py index c0f364a639fe6410e80cf95cddc1e45f3ec9704e..35f1efd4dbddfe708f8d1d8d92ba36fef937402b 100644 --- a/Reconstruction/tauRec/python/TauRecConfigured.py +++ b/Reconstruction/tauRec/python/TauRecConfigured.py @@ -50,10 +50,11 @@ class TauRecConfigured ( Configured ) : from AthenaCommon.AppMgr import ToolSvc from tauRec.tauRecFlags import tauFlags for tool in tools : - if tool.__slots__['calibFolder'].count('TauDiscriminant'): - tool.calibFolder = tauFlags.TauDiscriminantCVMFSPath() - else : - tool.calibFolder = tauFlags.tauRecToolsCVMFSPath() + # if tool.__slots__['calibFolder'].count('TauDiscriminant'): + # tool.calibFolder = tauFlags.TauDiscriminantCVMFSPath() + # else : + # tool.calibFolder = tauFlags.tauRecToolsCVMFSPath() + tool.calibFolder = tauFlags.tauRecToolsCVMFSPath() if tool not in ToolSvc : ToolSvc += tool pass diff --git a/Reconstruction/tauRec/python/tauRecFlags.py b/Reconstruction/tauRec/python/tauRecFlags.py index b4d440ccaf28c360928e2360f3c89013c8812596..9f6ad91583a39ae41cd0c5972585a69a9c06a5c8 100644 --- a/Reconstruction/tauRec/python/tauRecFlags.py +++ b/Reconstruction/tauRec/python/tauRecFlags.py @@ -36,7 +36,7 @@ class tauRecToolsCVMFSPath(JobProperty): """ statusOn=True allowedTypes=['string'] - StoredValue="tauRecTools/00-00-10/" + StoredValue="tauRecTools/00-02-00/" #deprecated class TauDiscriminantCVMFSPath(JobProperty): @@ -60,7 +60,7 @@ class tauRecMVATrackClassificationConfig(JobProperty): """ statusOn=True allowedTypes=[[[]]] - StoredValue=[ ["TMVAClassification_BDT.weights.root", -0.005], ["TMVAClassification_BDT_0.weights.root", -0.0074], ["TMVAClassification_BDT_1.weights.root", 0.0005] ] + StoredValue=[ ["TMVAClassification_BDT_l1.weights.root", 0.0002], ["TMVAClassification_BDT_l2.weights.root", -0.0080], ["TMVAClassification_BDT_l3.r207.weights.root", 0.0005] ] class tauRecSeedMaxEta(JobProperty): """ max allowed abs_eta of jet seed diff --git a/Reconstruction/tauRecTools/CMakeLists.txt b/Reconstruction/tauRecTools/CMakeLists.txt index 3e8271e36857f024e3cd7f05dd7fce702dd68f14..78ea36af8ad5be695ec5e914a37b256d708fc733 100644 --- a/Reconstruction/tauRecTools/CMakeLists.txt +++ b/Reconstruction/tauRecTools/CMakeLists.txt @@ -1,4 +1,4 @@ -# $Id: CMakeLists.txt 791623 2017-01-10 02:38:48Z griffith $ +# $Id: CMakeLists.txt 796274 2017-02-08 17:13:03Z griffith $ ################################################################################ # Package: tauRecTools ################################################################################ @@ -21,12 +21,14 @@ if( XAOD_STANDALONE OR XAOD_ANALYSIS ) Event/xAOD/xAODEventInfo Event/xAOD/xAODPFlow Event/xAOD/xAODTau + Event/xAOD/xAODEgamma Event/xAOD/xAODTracking Reconstruction/MVAUtils PRIVATE Event/FourMomUtils Event/xAOD/xAODJet Tools/PathResolver + PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools ${extra_deps} ) else() atlas_depends_on_subdirs( @@ -39,6 +41,7 @@ else() Event/xAOD/xAODEventInfo Event/xAOD/xAODPFlow Event/xAOD/xAODTau + Event/xAOD/xAODEgamma Event/xAOD/xAODTracking Reconstruction/Particle Reconstruction/MVAUtils @@ -55,6 +58,7 @@ else() Reconstruction/RecoTools/ITrackToVertex Reconstruction/RecoTools/RecoToolInterfaces Tools/PathResolver + PhysicsAnalysis/ElectronPhotonID/ElectronPhotonSelectorTools Tracking/TrkEvent/TrkLinks Tracking/TrkEvent/TrkParametersIdentificationHelpers Tracking/TrkEvent/TrkTrackSummary @@ -81,10 +85,10 @@ if( XAOD_STANDALONE OR XAOD_ANALYSIS ) ${FASTJET_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${FASTJETCONTRIB_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${FASTJET_LIBRARIES} ${Boost_LIBRARIES} - AthLinks AsgTools CxxUtils xAODCaloEvent xAODEventInfo xAODPFlow xAODTau + AthLinks AsgTools CxxUtils xAODCaloEvent xAODEventInfo xAODPFlow xAODEgamma xAODTau xAODTracking PRIVATE_LINK_LIBRARIES ${FASTJETCONTRIB_LIBRARIES} FourMomUtils xAODJet - PathResolver MVAUtils ) + PathResolver MVAUtils ElectronPhotonSelectorToolsLib ) else() atlas_add_library( tauRecToolsLib tauRecTools/*.h Root/*.cxx @@ -93,10 +97,10 @@ else() ${FASTJET_INCLUDE_DIRS} PRIVATE_INCLUDE_DIRS ${FASTJETCONTRIB_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${FASTJET_LIBRARIES} ${Boost_LIBRARIES} - AthLinks AsgTools CxxUtils xAODCaloEvent xAODEventInfo xAODPFlow xAODTau + AthLinks AsgTools CxxUtils xAODCaloEvent xAODEventInfo xAODPFlow xAODEgamma xAODTau xAODTracking CaloUtilsLib Particle PRIVATE_LINK_LIBRARIES ${FASTJETCONTRIB_LIBRARIES} FourMomUtils xAODJet - PathResolver MVAUtils ) + PathResolver MVAUtils ElectronPhotonSelectorToolsLib) endif() if( NOT XAOD_STANDALONE ) @@ -105,15 +109,15 @@ if( NOT XAOD_STANDALONE ) src/*.h src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} xAODTau - xAODTracking AthContainers FourMomUtils xAODCaloEvent xAODJet - xAODPFlow MVAUtils GaudiKernel tauRecToolsLib ) + xAODTracking xAODEgamma AthContainers FourMomUtils xAODCaloEvent xAODJet + xAODPFlow MVAUtils ElectronPhotonSelectorToolsLib GaudiKernel tauRecToolsLib ) else() atlas_add_component( tauRecTools src/*.h src/*.cxx src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} CaloUtilsLib - xAODTau xAODTracking AthContainers FourMomUtils NavFourMom - xAODCaloEvent xAODJet xAODPFlow MVAUtils GaudiKernel + xAODTau xAODTracking xAODEgamma AthContainers FourMomUtils NavFourMom + xAODCaloEvent xAODJet xAODPFlow MVAUtils ElectronPhotonSelectorToolsLib GaudiKernel InDetRecToolInterfaces JetEDM Particle ITrackToVertex RecoToolInterfaces TrkLinks TrkParametersIdentificationHelpers TrkTrackSummary VxVertex TrkToolInterfaces TrkVertexFitterInterfaces diff --git a/Reconstruction/tauRecTools/Root/CombinedP4FromRecoTaus.cxx b/Reconstruction/tauRecTools/Root/CombinedP4FromRecoTaus.cxx index 9363f0a8038f33e3cf421f12739948faf952357c..fdf33c6ef96a95837f52b2aee2989ab9288ad8e6 100644 --- a/Reconstruction/tauRecTools/Root/CombinedP4FromRecoTaus.cxx +++ b/Reconstruction/tauRecTools/Root/CombinedP4FromRecoTaus.cxx @@ -29,10 +29,14 @@ CombinedP4FromRecoTaus::CombinedP4FromRecoTaus(const std::string& name) : m_combined_res(-1111.), m_sigma_tauRec(-1111.), m_sigma_constituent(-1111.), - m_corrcoeff(-1111.) + m_corrcoeff(-1111.), + m_et_cb2PT_postcalib(0.), + m_et_postcalib(0.), + m_et_weighted(0.) { declareProperty( "WeightFileName", m_sWeightFileName = ""); declareProperty( "addCalibrationResultVariables", m_addCalibrationResultVariables=false); + declareProperty( "addUseCaloPtFlag", m_addUseCaloPtFlag=false); declareProperty( "tauRecEt_takenAs_combinedEt", m_tauRecEt_takenAs_combinedEt=false); } @@ -51,8 +55,7 @@ StatusCode CombinedP4FromRecoTaus::initialize() { m_correlationHists = std::vector<TH1F*>(0); - - std::string calibFilePath = find_file(m_sWeightFileName); + std::string calibFilePath = find_file(m_sWeightFileName); TFile * file = TFile::Open(calibFilePath.c_str(), "READ"); //m_Nsigma_compatibility=5; @@ -65,7 +68,6 @@ StatusCode CombinedP4FromRecoTaus::initialize() { TGraph* Graph(0); std::string Graphname=""; - //loop over decay modes for(int imode=0;imode < abs(m_modeNames.size());imode++){ @@ -176,6 +178,7 @@ StatusCode CombinedP4FromRecoTaus::initialize() { //_____________________________________________________________________________ StatusCode CombinedP4FromRecoTaus::execute(xAOD::TauJet& xTau) { xAOD::TauJet* Tau = &xTau; + static SG::AuxElement::Decorator<float> decPtCombined("pt_combined"); static SG::AuxElement::Decorator<float> decEtaCombined("eta_combined"); static SG::AuxElement::Decorator<float> decPhiCombined("phi_combined"); @@ -196,45 +199,27 @@ StatusCode CombinedP4FromRecoTaus::execute(xAOD::TauJet& xTau) { // move these to another file? : - m_weight = -1111.; + + /* m_weight = -1111.; m_combined_res = -1111.; m_sigma_tauRec = -1111.; m_sigma_constituent = -1111.; m_corrcoeff = -1111.; + */ - TLorentzVector substructureP4; + if (m_addUseCaloPtFlag){ + static SG::AuxElement::Decorator<char> decUseCaloPtFlag("UseCaloPtFlag"); + decUseCaloPtFlag(xTau) = GetUseCaloPtFlag(Tau); + } if (m_addCalibrationResultVariables){ - substructureP4 = getCalibratedConstituentP4(Tau); static SG::AuxElement::Decorator<float> decPtConstituent("pt_constituent"); - static SG::AuxElement::Decorator<float> decEtaConstituent("eta_constituent"); - static SG::AuxElement::Decorator<float> decPhiConstituent("phi_constituent"); - static SG::AuxElement::Decorator<float> decMConstituent("m_constituent"); - decPtConstituent(xTau) = substructureP4.Pt(); - decEtaConstituent(xTau) = substructureP4.Eta(); - decPhiConstituent(xTau) = substructureP4.Phi(); - decMConstituent(xTau) = substructureP4.M(); - - substructureP4 = getCalibratedTauRecP4(Tau); static SG::AuxElement::Decorator<float> decPtTauRecCalibrated("pt_tauRecCalibrated"); - static SG::AuxElement::Decorator<float> decEtaTauRecCalibrated("eta_tauRecCalibrated"); - static SG::AuxElement::Decorator<float> decPhiTauRecCalibrated("phi_tauRecCalibrated"); - static SG::AuxElement::Decorator<float> decMTauRecCalibrated("m_tauRecCalibrated"); - decPtTauRecCalibrated(xTau) = substructureP4.Pt(); - decEtaTauRecCalibrated(xTau) = substructureP4.Eta(); - decPhiTauRecCalibrated(xTau) = substructureP4.Phi(); - decMTauRecCalibrated(xTau) = substructureP4.M(); - - substructureP4 = getWeightedP4(Tau); static SG::AuxElement::Decorator<float> decPtWeighted("pt_weighted"); - static SG::AuxElement::Decorator<float> decEtaWeighted("eta_weighted"); - static SG::AuxElement::Decorator<float> decPhiWeighted("phi_weighted"); - static SG::AuxElement::Decorator<float> decMWeighted("m_weighted"); - decPtWeighted(xTau) = substructureP4.Pt(); - decEtaWeighted(xTau) = substructureP4.Eta(); - decPhiWeighted(xTau) = substructureP4.Phi(); - decMWeighted(xTau) = substructureP4.M(); + decPtConstituent(xTau) = m_et_cb2PT_postcalib; + decPtTauRecCalibrated(xTau) = m_et_postcalib; + decPtWeighted(xTau) = m_et_weighted; static SG::AuxElement::Decorator<float> decWeightWeighted("weight_weighted"); static SG::AuxElement::Decorator<float> decSigmaCombined("sigma_combined"); @@ -254,7 +239,6 @@ StatusCode CombinedP4FromRecoTaus::execute(xAOD::TauJet& xTau) { int CombinedP4FromRecoTaus::GetIndex_Eta(float eta){ - //std::cout << "Entering GetIndex_Eta(" << eta << ")" << std::endl; if( fabs(eta) < 0.3 ) { return 0; } @@ -267,12 +251,11 @@ int CombinedP4FromRecoTaus::GetIndex_Eta(float eta){ if( fabs(eta) < 1.6 ) { return 3; } - if( fabs(eta) < 2.5 ) { + if( fabs(eta) < 2.7 ) { return 4; } return 99; - } @@ -286,62 +269,9 @@ double CombinedP4FromRecoTaus::GetCorrelationCoefficient(int etaIndex, xAOD::Tau return m_correlationHists[mode]->GetBinContent(etaIndex); - /* - TString calibrationFile = "CalibLoopResult.root"; - TFile *file = TFile::Open(calibrationFile, "READ" ); - - TString histname=""; - TString decayMode=""; - - switch(mode){ - case xAOD::TauJetParameters::Mode_1p0n : decayMode = "1p0n"; - break; - case xAOD::TauJetParameters::Mode_1p1n : decayMode = "1p1n"; - break; - case xAOD::TauJetParameters::Mode_1pXn : decayMode = "1pXn"; - break; - case xAOD::TauJetParameters::Mode_3p0n : decayMode = "3p0n"; - break; - case xAOD::TauJetParameters::Mode_3pXn : decayMode = "3pXn"; - break; - default: decayMode = ""; - } - - histname="ConstituentEt/CorrelationCoeff_ConstituentEt_" + decayMode; - TH1F* histogram = (TH1F*) file->GetObjectChecked(histname,"TH1F"); - std::cout << "\tReturning Mean of Histogram: " << histname << " : " << histogram->GetMean() << std::endl; - - return histogram->GetMean(); - */ - - // from http://en.wikipedia.org/wiki/Standard_deviation#Identities_and_mathematical_properties - // values from my talk at Tau WG meeting March 10th 2015 - - /*if( mode == xAOD::TauJetParameters::DecayMode::Mode_1p0n ) return 0.13; - if( mode == xAOD::TauJetParameters::DecayMode::Mode_1p1n ) return 0.32; - if( mode == xAOD::TauJetParameters::DecayMode::Mode_1pXn ) return 0.48; - if( mode == xAOD::TauJetParameters::DecayMode::Mode_3p0n ) return 0.1; - if( mode == xAOD::TauJetParameters::DecayMode::Mode_3pXn ) return 0.25; - return 0.; - */ - } -/* -double CombinedP4FromRecoTaus::getCorrespondingBinContent(const TH1D* hist, double value) const { - if (not hist) { - return 0; - } - int bin = hist->FindFixBin(value); - if (bin > hist->GetNbinsX()) bin = hist->GetNbinsX(); - if (bin < 1) bin = 1; - return hist->GetBinContent(bin); - }*/ - - - - double CombinedP4FromRecoTaus::GetWeightedEt(double et_tauRec, double et_cb2PT, int etaIndex, @@ -350,11 +280,7 @@ double CombinedP4FromRecoTaus::GetWeightedEt(double et_tauRec, if( mode < xAOD::TauJetParameters::Mode_1p0n || mode > xAOD::TauJetParameters::Mode_3pXn ){ ATH_MSG_WARNING("Warning! decay mode not defined!"); - return 0.; - } - if( etaIndex < 0 || etaIndex > 4 ){ - ATH_MSG_WARNING( "Warning! etaIndex not defined!" ); - return 0.; + return et_tauRec; } float res_tauRec = GetResolution_taurec( et_tauRec, etaIndex, mode ); @@ -378,45 +304,26 @@ double CombinedP4FromRecoTaus::GetWeightedEt(double et_tauRec, float weight=( pow(res_substruct, 2) - GetCorrelationCoefficient(etaIndex, mode )*res_tauRec*res_substruct ) / ( pow(res_tauRec, 2) + pow(res_substruct, 2) - 2*GetCorrelationCoefficient(etaIndex, mode )*res_tauRec*res_substruct ); //float weighted_et = ( et_tauRec*invres_tauRec + GetCellbased2PantauEt( et_cb2PT, mode )*invres_substruct ) / ( invres_tauRec + invres_substruct ); - float weighted_et = weight*GetTauRecEt( et_tauRec, etaIndex, mode) + (1 - weight)*GetCellbased2PantauEt( et_cb2PT, etaIndex, mode ); + double weighted_et = weight*GetTauRecEt( et_tauRec, etaIndex, mode) + (1 - weight)*GetCellbased2PantauEt( et_cb2PT, etaIndex, mode ); m_weight = weight; + m_et_weighted = weighted_et; return weighted_et; } double CombinedP4FromRecoTaus::GetResolution_taurec( double et, int etaIndex, xAOD::TauJetParameters::DecayMode mode){ - ATH_MSG_DEBUG("Entering GetResolution_tauRec!"); if( mode < xAOD::TauJetParameters::Mode_1p0n || mode > xAOD::TauJetParameters::Mode_3pXn ){ ATH_MSG_WARNING("Warning! decay mode not defined!"); return 0.; } - if( etaIndex < 0 || etaIndex > 4 ){ - ATH_MSG_WARNING("Warning! etaIndex not defined!"); - return 0.; - } //Load file - - /*int bin_taurec = m_resHists_tauRec[etaIndex][mode]->FindBin( et ); - if( bin_taurec > m_resHists_tauRec[etaIndex][mode]->GetNbinsX() ) bin_taurec=m_resHists_tauRec[etaIndex][mode]->GetNbinsX(); - if( bin_taurec < 1 ) bin_taurec=1; - ATH_MSG_DEBUG("GetResolution_taurec: " << m_resHists_tauRec[etaIndex][mode]->GetBinContent( bin_taurec ) ); - return m_resHists_tauRec[etaIndex][mode]->GetBinContent( bin_taurec ) * et;*/ - - /*TGraph* m_resTGraph_tauRec; - m_resTGraph_tauRec = TGraph(m_resHists_tauRec[etaIndex][mode]); - double MaxEt = TMath::MaxElement(m_resTGraph_tauRec->GetN(),m_resTGraph_tauRec->GetX()); - if (et > MaxEt){ - return m_resTGraph_tauRec->Eval(MaxEt) * et;; - } - return m_resTGraph_tauRec->Eval(et) * et;*/ - double MaxEt = TMath::MaxElement(m_resTGraph_tauRec[etaIndex][mode]->GetN(),m_resTGraph_tauRec[etaIndex][mode]->GetX()); if (et > MaxEt){ - return m_resTGraph_tauRec[etaIndex][mode]->Eval(MaxEt) * et;; + return m_resTGraph_tauRec[etaIndex][mode]->Eval(MaxEt) * et; } return m_resTGraph_tauRec[etaIndex][mode]->Eval(et) * et; } @@ -428,23 +335,10 @@ double CombinedP4FromRecoTaus::GetResolution_CellBased2PanTau( double et, int et ATH_MSG_WARNING("Warning! decay mode not defined!"); return 0.; } - if( etaIndex < 0 || etaIndex > 4 ){ - ATH_MSG_WARNING( "Warning! etaIndex not defined!"); - return 0.; - } - - /*int bin_substruct = m_resHists_CellBased2PanTau[etaIndex][mode]->FindBin( et ); - if( bin_substruct > m_resHists_CellBased2PanTau[etaIndex][mode]->GetNbinsX() ) bin_substruct=m_resHists_CellBased2PanTau[etaIndex][mode]->GetNbinsX(); - if( bin_substruct < 1 ) { - bin_substruct=1; - ATH_MSG_DEBUG("bin_substruct < 1 . Set to 1!"); - } - ATH_MSG_DEBUG( "GetResolution_CellBased2PanTau: " << m_resHists_CellBased2PanTau[etaIndex][mode]->GetBinContent( bin_substruct )); - return m_resHists_CellBased2PanTau[etaIndex][mode]->GetBinContent( bin_substruct ) * et;*/ double MaxEt = TMath::MaxElement(m_resTGraph_CellBased2PanTau[etaIndex][mode]->GetN(),m_resTGraph_CellBased2PanTau[etaIndex][mode]->GetX()); if (et > MaxEt){ - return m_resTGraph_CellBased2PanTau[etaIndex][mode]->Eval(MaxEt) * et;; + return m_resTGraph_CellBased2PanTau[etaIndex][mode]->Eval(MaxEt) * et; } return m_resTGraph_CellBased2PanTau[etaIndex][mode]->Eval(et) * et; } @@ -456,16 +350,6 @@ double CombinedP4FromRecoTaus::GetMean_CellBased2PanTau( double et, int etaIndex ATH_MSG_WARNING( "Warning! decay mode not defined!" ); return 0.; } - if( etaIndex < 0 || etaIndex > 4 ){ - ATH_MSG_WARNING( "Warning! etaIndex not defined!" ); - return 0.; - } - - /*int bin_substruct = m_meanHists_CellBased2PanTau[etaIndex][mode]->FindBin( et ); - if( bin_substruct > m_meanHists_CellBased2PanTau[etaIndex][mode]->GetNbinsX() ) return 0.; // bin_substruct=m_meanHists_CellBased2PanTau[etaIndex][mode]->GetNbinsX(); - if( bin_substruct < 1 ) return 0.; //bin_substruct=1; - ATH_MSG_DEBUG( "MeanHists_CellBased2PanTau: " << m_meanHists_CellBased2PanTau[etaIndex][mode]->GetBinContent( bin_substruct )); - return m_meanHists_CellBased2PanTau[etaIndex][mode]->GetBinContent( bin_substruct ) * et;*/ double MaxEt = TMath::MaxElement(m_meanTGraph_CellBased2PanTau[etaIndex][mode]->GetN(),m_meanTGraph_CellBased2PanTau[etaIndex][mode]->GetX()); if (et > MaxEt){ @@ -481,17 +365,7 @@ double CombinedP4FromRecoTaus::GetMean_TauRec( double et, int etaIndex, xAOD::Ta ATH_MSG_WARNING( "Warning! decay mode not defined!" ); return 0.; } - if( etaIndex < 0 || etaIndex > 4 ){ - ATH_MSG_WARNING("Warning! etaIndex not defined!"); - return 0.; - } - /*int bin_tauRec = m_meanHists_tauRec[etaIndex][mode]->FindBin( et ); - if( bin_tauRec > m_meanHists_tauRec[etaIndex][mode]->GetNbinsX() ) return 0.; //bin_tauRec=m_meanHists_tauRec[etaIndex][mode]->GetNbinsX(); - if( bin_tauRec < 1 ) return 0.; //bin_tauRec=1; - ATH_MSG_DEBUG("MeanHists_tauRec: " << m_meanHists_tauRec[etaIndex][mode]->GetBinContent( bin_tauRec ) ); - return m_meanHists_tauRec[etaIndex][mode]->GetBinContent( bin_tauRec ) * et;*/ - double MaxEt = TMath::MaxElement(m_meanTGraph_tauRec[etaIndex][mode]->GetN(),m_meanTGraph_tauRec[etaIndex][mode]->GetX()); if (et > MaxEt){ return 0; @@ -506,10 +380,6 @@ double CombinedP4FromRecoTaus::GetCombinedResolution( double et_tauRec, double e ATH_MSG_WARNING( "Warning! decay mode not defined!" ); return 0.; } - if( etaIndex < 0 || etaIndex > 4 ){ - ATH_MSG_WARNING( "Warning! etaIndex not defined!" ); - return 0.; - } double sigma_tauRec = GetResolution_taurec( et_tauRec, etaIndex, mode ); double sigma_cb2PT = GetResolution_CellBased2PanTau( et_cb2PT, etaIndex, mode ); @@ -531,12 +401,9 @@ double CombinedP4FromRecoTaus::GetCellbased2PantauEt( double et_cb2PT, int etaIn if( mode < xAOD::TauJetParameters::Mode_1p0n || mode > xAOD::TauJetParameters::Mode_3pXn ){ return et_cb2PT; } - if( etaIndex < 0 || etaIndex > 4 ){ - ATH_MSG_WARNING( "Warning! etaIndex not defined!" ); - return et_cb2PT; - } - - return et_cb2PT - GetMean_CellBased2PanTau(et_cb2PT,etaIndex, mode); + + m_et_cb2PT_postcalib = et_cb2PT - GetMean_CellBased2PanTau(et_cb2PT,etaIndex, mode); + return m_et_cb2PT_postcalib; } @@ -545,12 +412,9 @@ double CombinedP4FromRecoTaus::GetTauRecEt( double et, int etaIndex, xAOD::TauJe if( mode < xAOD::TauJetParameters::Mode_1p0n || mode > xAOD::TauJetParameters::Mode_3pXn ){ return et; } - if( etaIndex < 0 || etaIndex > 4 ){ - ATH_MSG_WARNING( "Warning! etaIndex not defined!" ); - return et; - } - return et - GetMean_TauRec(et, etaIndex, mode); + m_et_postcalib = et - GetMean_TauRec(et, etaIndex, mode); + return m_et_postcalib; } @@ -562,10 +426,6 @@ double CombinedP4FromRecoTaus::getCombinedEt(double et_tauRec, int etaIndex = GetIndex_Eta(eta); ATH_MSG_DEBUG("Eta = " << eta << " , eta bin = " << etaIndex ); - if(etaIndex == 99){ - ATH_MSG_WARNING( "Eta = " << eta << " - outside limit! eta bin = " << etaIndex );//is this a warning? - return et_substructure; - } double et_reco = GetWeightedEt( et_tauRec, et_substructure, etaIndex, mode ); ATH_MSG_DEBUG( "GetWeightedEt: " << et_reco ); @@ -578,58 +438,31 @@ double CombinedP4FromRecoTaus::getCombinedEt(double et_tauRec, m_combined_res = combined_res; if( fabs( et_diff ) > GetNsigma_Compatibility(et_tauRec)*combined_res) { - /* - if( mode == RecoTypes::t_3p0n){ - // *fillOK = false; - // return -1; - et_reco = et_cb2PT; - - } else { - */ et_reco = et_tauRec; m_tauRecEt_takenAs_combinedEt = true; ATH_MSG_DEBUG( "(Boolean)m_tauRecEt_takenAs_combinedEt is set to:" << m_tauRecEt_takenAs_combinedEt ); - // } } return et_reco; } -/* -TLorentzVector CombinedP4FromRecoTaus::getConstituentsP4(const xAOD::TauJet* tau) { - TLorentzVector constituentsP4; - // add all charged 4-vectors - for (size_t i = 0; i < tau->nTracks(); i++) { - constituentsP4 += tau->track(i)->p4(); - } - // get all corrected Pi0s and add them - std::vector<TLorentzVector> correctedPi0P4s; - - // TauAnalysisTools::createPi0Vectors(tau, correctedPi0P4s); - // for (auto vPi0 : correctedPi0P4s) { - // constituentsP4 += vPi0; - // } - - size_t iNumPi0PFO = tau->nPi0PFOs(); - for (size_t iPFO = 0; iPFO < iNumPi0PFO; iPFO++){ - constituentsP4 += tau->pi0PFO(iPFO)->p4(); - } - return constituentsP4; -} -*/ - - TLorentzVector CombinedP4FromRecoTaus::getCombinedP4(const xAOD::TauJet* tau) { - ATH_MSG_DEBUG( "In CombinedP4FromRecoTaus::getCombinedP4..." ); m_tauRecEt_takenAs_combinedEt=false; ATH_MSG_DEBUG( "(Boolean)m_tauRecEt_takenAs_combinedEt is initialized to: " << m_tauRecEt_takenAs_combinedEt ); - //const TLorentzVector& tauRecP4 = tau->p4(); TLorentzVector tauRecP4; tauRecP4.SetPtEtaPhiM(tau->pt(), tau->eta(), tau->phi(), tau->m()); + TLorentzVector substructureP4; + if(tau->etaPanTauCellBased()<-111 || tau->phiPanTauCellBased()<-1111) + substructureP4.SetPtEtaPhiM(0,0,0,0); + else + substructureP4.SetPtEtaPhiM(tau->ptPanTauCellBased(), tau->etaPanTauCellBased(), tau->phiPanTauCellBased(), tau->mPanTauCellBased()); + + ATH_MSG_DEBUG( "TauRecET: " << tauRecP4.Et() ); + ATH_MSG_DEBUG( "ConstituentET: " << substructureP4.Et() ); xAOD::TauJetParameters::DecayMode decayMode = xAOD::TauJetParameters::DecayMode::Mode_Error; int tmpDecayMode; @@ -637,33 +470,21 @@ TLorentzVector CombinedP4FromRecoTaus::getCombinedP4(const xAOD::TauJet* tau) { decayMode = static_cast< xAOD::TauJetParameters::DecayMode>(tmpDecayMode); } - ATH_MSG_DEBUG( "Decaymode is: " << decayMode ); - int numTracks = tau->nTracks(); - ATH_MSG_DEBUG( "Number of tracks: " << numTracks ); - - - //Return tauRec P4 if tau is no pantau candidate + //Return tauRec P4 if tau is no pantau candidate or pantau decay mode is unequal 1P or 3P int isPanTauCandidate; - tau->panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_isPanTauCandidate, isPanTauCandidate); - ATH_MSG_DEBUG( "is tau PanTau candidate = " << isPanTauCandidate ); - if (isPanTauCandidate == 0) { - return tauRecP4; - } - - //Return tauRec P4 if pantau decay mode is unequal 1P or 3P + tau->panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_isPanTauCandidate, isPanTauCandidate); int DecayMode; tau->panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_DecayMode, DecayMode); - if(DecayMode>xAOD::TauJetParameters::Mode_3pXn){ + + ATH_MSG_DEBUG( "tau IsPanTauCandidate = " << isPanTauCandidate ); + + if (isPanTauCandidate == 0 || DecayMode>xAOD::TauJetParameters::Mode_3pXn || fabs(tauRecP4.Eta()) > 2.5) { + m_et_cb2PT_postcalib = substructureP4.Et(); + m_et_postcalib = tauRecP4.Et(); + m_et_weighted = tauRecP4.Et(); return tauRecP4; } - // TLorentzVector substructureP4 = getConstituentsP4(tau); - TLorentzVector substructureP4; - substructureP4.SetPtEtaPhiM(tau->ptPanTauCellBased(), tau->etaPanTauCellBased(), tau->phiPanTauCellBased(), tau->mPanTauCellBased()); - ATH_MSG_DEBUG( "ConstituentET: " << substructureP4.Et() ); - ATH_MSG_DEBUG( "TauRecET: " << tauRecP4.Et() ); - - //double combinedEt = getCombinedEt(tauRecP4.Et(), substructureP4.Et(), tau->Eta(), decayMode); double combinedEt = getCombinedEt(tauRecP4.Et(), substructureP4.Et(), tauRecP4.Eta(), decayMode); ATH_MSG_DEBUG( "combinedET: " << combinedEt ); @@ -682,177 +503,91 @@ TLorentzVector CombinedP4FromRecoTaus::getCombinedP4(const xAOD::TauJet* tau) { ATH_MSG_DEBUG( "combinedPt: " << combinedPt ); combinedP4.SetPtEtaPhiM(combinedPt, substructureP4.Eta(), substructureP4.Phi(), combinedM); - if (combinedPt < 15){ - std::cout << "ERROR pt is zero" << std::endl; - } return combinedP4; } -TLorentzVector CombinedP4FromRecoTaus::getCalibratedConstituentP4(const xAOD::TauJet* tau) { - - ATH_MSG_DEBUG( "In CombinedP4FromRecoTaus::getCalibratedConstituentP4..." ); - TLorentzVector tauRecP4; - tauRecP4.SetPtEtaPhiM(tau->pt(), tau->eta(), tau->phi(), tau->m()); - - TLorentzVector substructureP4; - substructureP4.SetPtEtaPhiM(tau->ptPanTauCellBased(), tau->etaPanTauCellBased(), tau->phiPanTauCellBased(), tau->mPanTauCellBased()); - - ATH_MSG_DEBUG( "ConstituentET: " << substructureP4.Et() ); +//_____________________________________________________________________________ +float CombinedP4FromRecoTaus::GetNsigma_Compatibility(float et_TauRec){ - xAOD::TauJetParameters::DecayMode decayMode = xAOD::TauJetParameters::DecayMode::Mode_Error; - int tmpDecayMode; - if (tau->panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_DecayMode, tmpDecayMode)) { - decayMode = static_cast< xAOD::TauJetParameters::DecayMode>(tmpDecayMode); - } - ATH_MSG_DEBUG( "Decaymode is: " << decayMode ); - int numTracks = tau->nTracks(); - ATH_MSG_DEBUG( "Number of tracks: " << numTracks ); + float nsigma=m_Nsigma_compatibility.Eval(et_TauRec); - int DecayMode; - int isPanTauCandidate; - tau->panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_isPanTauCandidate, isPanTauCandidate); - ATH_MSG_DEBUG( "is tau PanTau candidate = " << isPanTauCandidate ); - if (isPanTauCandidate == 0) { - return substructureP4; - } - tau->panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_DecayMode, DecayMode); - if(DecayMode>xAOD::TauJetParameters::Mode_3pXn){ - return substructureP4; - } + if(nsigma<0) return 0.; + return nsigma; - float eta = tauRecP4.Eta(); - int etaIndex = GetIndex_Eta(eta); - ATH_MSG_DEBUG( "Eta = " << eta << " , eta bin = " << etaIndex ); - if(etaIndex == 99){ - ATH_MSG_WARNING( "Eta = " << eta << " - outside limit! eta bin = " << etaIndex );//warning? - return substructureP4; } - double et = GetCellbased2PantauEt( substructureP4.Et(), etaIndex, decayMode ); - ATH_MSG_DEBUG( "et: " << et ); - ATH_MSG_DEBUG( "SubstructureP4.M(): " << substructureP4.M() ); - - TLorentzVector p4; - double pt = sqrt(pow(et,2) - substructureP4.M2()); - ATH_MSG_DEBUG( "pt: " << pt ); - - p4.SetPtEtaPhiM(pt, substructureP4.Eta(), substructureP4.Phi(), substructureP4.M()); - - return p4; -} - -TLorentzVector CombinedP4FromRecoTaus::getCalibratedTauRecP4(const xAOD::TauJet* tau) { - ATH_MSG_DEBUG( "In CombinedP4FromRecoTaus::getCalibratedTauRecP4..." ); +//_____________________________________________________________________________ +double CombinedP4FromRecoTaus::GetCaloResolution(const xAOD::TauJet* tau){ + ATH_MSG_DEBUG("Entering GetCaloResolution!"); TLorentzVector tauRecP4; tauRecP4.SetPtEtaPhiM(tau->pt(), tau->eta(), tau->phi(), tau->m()); - // TLorentzVector substructureP4 = getConstituentsP4(tau); + double et = tauRecP4.Et(); + float eta = tauRecP4.Eta(); + int etaIndex = GetIndex_Eta(eta); + + xAOD::TauJetParameters::DecayMode mode = xAOD::TauJetParameters::DecayMode::Mode_Error; - ATH_MSG_DEBUG( "TauRecET: " << tauRecP4.Et() ); - xAOD::TauJetParameters::DecayMode decayMode = xAOD::TauJetParameters::DecayMode::Mode_Error; int tmpDecayMode; if (tau->panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_DecayMode, tmpDecayMode)) { - decayMode = static_cast< xAOD::TauJetParameters::DecayMode>(tmpDecayMode); + mode = static_cast< xAOD::TauJetParameters::DecayMode>(tmpDecayMode); } - ATH_MSG_DEBUG( "Decaymode is: " << decayMode ); - int numTracks = tau->nTracks(); - ATH_MSG_DEBUG( "Number of tracks: " << numTracks ); - int DecayMode; - int isPanTauCandidate; - tau->panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_isPanTauCandidate, isPanTauCandidate); - ATH_MSG_DEBUG( "is tau PanTau candidate = " << isPanTauCandidate ); - if (isPanTauCandidate == 0) { - return tauRecP4; + if( mode < xAOD::TauJetParameters::Mode_1p0n || mode > xAOD::TauJetParameters::Mode_3pXn ){ + ATH_MSG_DEBUG("PanTau decay mode > 3PXN! Return false"); + return false; } - tau->panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_DecayMode, DecayMode); - if(DecayMode>xAOD::TauJetParameters::Mode_3pXn){ - return tauRecP4; + if( etaIndex < 0 || etaIndex > 4 ){ + ATH_MSG_DEBUG("eta > 2.7. Return false"); + return false; } - float eta = tauRecP4.Eta(); - int etaIndex = GetIndex_Eta(eta); - ATH_MSG_DEBUG( "Eta = " << eta << " , eta bin = " << etaIndex ); - - if(etaIndex == 99){ - ATH_MSG_WARNING( "Eta = " << eta << " - outside limit! eta bin = " << etaIndex ); - return tauRecP4; + double MaxEt = TMath::MaxElement(m_resTGraph_tauRec[etaIndex][mode]->GetN(),m_resTGraph_tauRec[etaIndex][mode]->GetX()); + if (et > MaxEt){ + return m_resTGraph_tauRec[etaIndex][mode]->Eval(MaxEt) * et; } - - double et = GetTauRecEt( tauRecP4.Et(), etaIndex, decayMode); - ATH_MSG_DEBUG( "et: " << et ); - ATH_MSG_DEBUG( "tauRecP4.M(): " << tauRecP4.M2() ); - - TLorentzVector p4; - double pt = sqrt(pow(et,2) - tauRecP4.M2()); - p4.SetPtEtaPhiM(pt, tauRecP4.Eta(), tauRecP4.Phi(), tauRecP4.M()); - - return p4; + return m_resTGraph_tauRec[etaIndex][mode]->Eval(et) * et; } -TLorentzVector CombinedP4FromRecoTaus::getWeightedP4(const xAOD::TauJet* tau) { - - ATH_MSG_DEBUG( "In CombinedP4FromRecoTaus::WeightedP4..." ); - - //const TLorentzVector& tauRecP4 = tau->p4(); +//_____________________________________________________________________________ +bool CombinedP4FromRecoTaus::GetUseCaloPtFlag(const xAOD::TauJet* tau){ + ATH_MSG_DEBUG("Entering GetUseCaloPtFlag!"); + TLorentzVector tauRecP4; + TLorentzVector tauMVATESP4; tauRecP4.SetPtEtaPhiM(tau->pt(), tau->eta(), tau->phi(), tau->m()); - // TLorentzVector substructureP4 = getConstituentsP4(tau); - TLorentzVector substructureP4; - substructureP4.SetPtEtaPhiM(tau->ptPanTauCellBased(), tau->etaPanTauCellBased(), tau->phiPanTauCellBased(), tau->mPanTauCellBased()); - ATH_MSG_DEBUG( "ConstituentET: " << substructureP4.Et() ); - ATH_MSG_DEBUG( "TauRecET: " << tauRecP4.Et() ); - xAOD::TauJetParameters::DecayMode decayMode = xAOD::TauJetParameters::DecayMode::Mode_Error; + tauMVATESP4.SetPtEtaPhiM(tau->ptFinalCalib(), tau->etaFinalCalib(), tau->phiFinalCalib(), tau->mFinalCalib()); + double et_tauRec = tauRecP4.Et(); + double et_MVATES = tauMVATESP4.Et(); + + float eta = tauRecP4.Eta(); + int etaIndex = GetIndex_Eta(eta); + + xAOD::TauJetParameters::DecayMode mode = xAOD::TauJetParameters::DecayMode::Mode_Error; int tmpDecayMode; if (tau->panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_DecayMode, tmpDecayMode)) { - decayMode = static_cast< xAOD::TauJetParameters::DecayMode>(tmpDecayMode); + mode = static_cast< xAOD::TauJetParameters::DecayMode>(tmpDecayMode); } - ATH_MSG_DEBUG( "Decaymode is: " << decayMode ); - int numTracks = tau->nTracks(); - ATH_MSG_DEBUG( "Number of tracks: " << numTracks ); - int DecayMode; - int isPanTauCandidate; - tau->panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_isPanTauCandidate, isPanTauCandidate); - ATH_MSG_DEBUG( "is tau PanTau candidate = " << isPanTauCandidate ); - if (isPanTauCandidate == 0) { - return tauRecP4; + if( mode < xAOD::TauJetParameters::Mode_1p0n || mode > xAOD::TauJetParameters::Mode_3pXn ){ + ATH_MSG_DEBUG("PanTau decay mode > 3PXN! Return false"); + return false; } - tau->panTauDetail(xAOD::TauJetParameters::PanTauDetails::PanTau_DecayMode, DecayMode); - if(DecayMode>xAOD::TauJetParameters::Mode_3pXn){ - return tauRecP4; + if( etaIndex < 0 || etaIndex > 4 ){ + ATH_MSG_DEBUG("eta > 2.7. Return false"); + return false; } - - - float eta = tauRecP4.Eta(); - int etaIndex = GetIndex_Eta(eta); - ATH_MSG_DEBUG( "Eta = " << eta << " , eta bin = " << etaIndex ); - - if(etaIndex == 99){ - ATH_MSG_WARNING( "Eta = " << eta << " - outside limit! eta bin = " << etaIndex ); - return substructureP4; + + double tauRec_res = GetCaloResolution(tau); + double et_diff = et_MVATES - et_tauRec; + + bool UseCaloPt = false; + if( et_diff > 5*tauRec_res) { + UseCaloPt = true; } - - double et = GetWeightedEt( tauRecP4.Et(), substructureP4.Et(), etaIndex, decayMode ); - ATH_MSG_DEBUG( "et: " << et ); - - TLorentzVector p4; - double pt = sqrt(pow(et,2) - substructureP4.M2()); - p4.SetPtEtaPhiM(pt, substructureP4.Eta(), substructureP4.Phi(), substructureP4.M()); - - return p4; + + return UseCaloPt; } - - -//_____________________________________________________________________________ -float CombinedP4FromRecoTaus::GetNsigma_Compatibility(float et_TauRec){ - - float nsigma=m_Nsigma_compatibility.Eval(et_TauRec); - - if(nsigma<0) return 0.; - return nsigma; - - } diff --git a/Reconstruction/tauRecTools/Root/HelperFunctions.cxx b/Reconstruction/tauRecTools/Root/HelperFunctions.cxx index c29a68155c90e5f3267e03201527b543dff5f479..297bb8a3d20c890d2706ba4ab5b5e6d3a8043a5f 100644 --- a/Reconstruction/tauRecTools/Root/HelperFunctions.cxx +++ b/Reconstruction/tauRecTools/Root/HelperFunctions.cxx @@ -179,3 +179,92 @@ MVAUtils::BDT* tauRecTools::configureMVABDT( std::map<TString, float*> &availabl return reader; } + +//________________________________________________________________________________ +tauRecTools::TRTBDT::TRTBDT(const char* weightFile){ + this->bdt = 0; + init(weightFile); +} + +//________________________________________________________________________________ +bool tauRecTools::TRTBDT::init(const char* weightFile){ + TFile* fBDT = TFile::Open( weightFile ); + if(!fBDT){ + std::cerr << "ERROR Cannot find tau input BDT file: " << weightFile << std::endl; + return 0; + } + TTree* tBDT = dynamic_cast<TTree*> (fBDT->Get("BDT")); + if(!tBDT){ + delete fBDT; + std::cerr << "ERROR Cannot find tau input BDT tree" << std::endl; + return 0; + } + + std::cout << "tauRecTools::configureMVABDT opened file: " << weightFile << std::endl; + // tBDT->Print(); + // std::cout << "CHECK 123" << std::endl; + + std::vector<float*> vars; + + TNamed* n_varList = dynamic_cast<TNamed*> (fBDT->Get("varList")); + if(!n_varList) { + std::cerr << "ERROR no Variable List in file : " << weightFile << std::endl; + delete fBDT; + return 0; + } + + std::vector<TString> varList_ar = tauRecTools::parseStringMVAUtilsBDT(n_varList->GetTitle()); + for(TString str : varList_ar){ + if(str.Length()==0) continue; + + if(str.Index(".")>=0){ + str = str(str.Last('.')+1, str.Length()-str.Last('.')-1); + } + + float* fval = new float(0); + DummyAccessor* facc = new DummyAccessor(str);//second argument if int + + m_data.insert(std::make_pair(fval, facc)); + vars.push_back(fval); + } + + this->bdt = new MVAUtils::BDT(tBDT); + this->bdt->SetPointers( vars ); + + delete n_varList; + delete fBDT; + return true; +} + +//________________________________________________________________________________ +tauRecTools::TRTBDT::~TRTBDT(){ + for( std::pair<float*, DummyAccessor*> p : m_data ){ + delete p.first; + delete p.second; + } + m_data.clear(); +} + +//________________________________________________________________________________ +bool tauRecTools::TRTBDT::updateVariables(const xAOD::TauJet& tau){ + for( std::pair<float*, DummyAccessor*> p : m_data ){ + //check availability first and return false if not avail + *(p.first) = (*p.second)(tau); + } + return true; +} + +//________________________________________________________________________________ +float tauRecTools::TRTBDT::GetGradBoostMVA(){ + return this->bdt->GetGradBoostMVA(this->bdt->GetPointers()); +} + +//________________________________________________________________________________ +float tauRecTools::TRTBDT::GetClassification(){ + return this->bdt->GetClassification(); +} + +//________________________________________________________________________________ +float tauRecTools::TRTBDT::GetResponse(){ + return this->bdt->GetResponse(); +} diff --git a/Reconstruction/tauRecTools/Root/LinkDef.h b/Reconstruction/tauRecTools/Root/LinkDef.h index e0fcf738f4273a194195ce302f25fd0bb18fdf73..469569b7b05f25695ba29cf5a409ff60d54c5918 100644 --- a/Reconstruction/tauRecTools/Root/LinkDef.h +++ b/Reconstruction/tauRecTools/Root/LinkDef.h @@ -16,6 +16,9 @@ #include "tauRecTools/CombinedP4FromRecoTaus.h" #include "tauRecTools/TauChargedPFOCreator.h" #include "tauRecTools/TauWPDecorator.h" +#include "tauRecTools/TauJetBDTEvaluator.h" +#include "tauRecTools/TauIDVarCalculator.h" +#include "tauRecTools/TauEleOLRDecorator.h" #ifdef __CINT__ @@ -44,5 +47,8 @@ #pragma link C++ class CombinedP4FromRecoTaus+; #pragma link C++ class TauChargedPFOCreator+; #pragma link C++ class TauWPDecorator+; +#pragma link C++ class TauJetBDTEvaluator+; +#pragma link C++ class TauIDVarCalculator+; +#pragma link C++ class TauEleOLRDecorator+; #endif diff --git a/Reconstruction/tauRecTools/Root/MvaTESEvaluator.cxx b/Reconstruction/tauRecTools/Root/MvaTESEvaluator.cxx index 7a7f85e3596300675a8f14e0e386992a55d8c679..6ef5d303eff8eb68fb6986664588316f1ae3874f 100644 --- a/Reconstruction/tauRecTools/Root/MvaTESEvaluator.cxx +++ b/Reconstruction/tauRecTools/Root/MvaTESEvaluator.cxx @@ -26,20 +26,24 @@ MvaTESEvaluator::MvaTESEvaluator(const std::string& name) , second_lambda(0) , presampler_frac(0) , em_probability(0) - , interpolPt(0) - , LC_D_interpolPt(0) - , pantau_D_interpolPt(0) - , etaPanTauCellBased(0) + , ptCombined(0) + , ptLC_D_ptCombined(0) + , ptConstituent_D_ptCombined(0) + , etaConstituent(0) + , PanTauBDT_1p0n_vs_1p1n(0) + , PanTauBDT_1p1n_vs_1pXn(0) + , PanTauBDT_3p0n_vs_3pXn(0) , nTracks(0) - , nPi0s(0) , PFOEngRelDiff(0) - , nMuSeg(0) , truthPtVis(0) - , ptTauEtaCalib(0) + , pt(0) , ptPanTauCellBased(0) + , ptDetectorAxis(0) + , truthDecayMode(0) + , PanTau_DecayMode(0) { - declareProperty( "WeightFileName", m_sWeightFileName = "MvaTES_20161015_pi0fix_BDTG.weights.root" ); - //Old one: "LC.pantau.interpolPt250GeV_mediumTaus_BDTG.weights.root" + declareProperty( "WeightFileName", m_sWeightFileName = "MvaTES_20170207_v2_BDTG.weights.root" ); + //R20.7 pi0-fix version: "MvaTES_20161015_pi0fix_BDTG.weights.root" } //_____________________________________________________________________________ @@ -60,19 +64,24 @@ StatusCode MvaTESEvaluator::initialize(){ m_availableVars.insert( std::make_pair("TauJetsAuxDyn.ClustersMeanPresamplerFrac", &presampler_frac) ); m_availableVars.insert( std::make_pair("TauJetsAuxDyn.ClustersMeanEMProbability", &em_probability) ); - m_availableVars.insert( std::make_pair("TauJetsAuxDyn.LC_pantau_interpolPt", &interpolPt) ); - m_availableVars.insert( std::make_pair("TauJetsAuxDyn.LC_TES_precalib/TauJetsAuxDyn.LC_pantau_interpolPt", &LC_D_interpolPt) ); - m_availableVars.insert( std::make_pair("TauJetsAux.ptPanTauCellBased/TauJetsAuxDyn.LC_pantau_interpolPt", &pantau_D_interpolPt) ); - m_availableVars.insert( std::make_pair("TauJetsAux.etaPanTauCellBased", &etaPanTauCellBased) ); + m_availableVars.insert( std::make_pair("TauJetsAuxDyn.pt_combined", &ptCombined) ); + m_availableVars.insert( std::make_pair("TauJetsAuxDyn.ptDetectorAxis/TauJetsAuxDyn.pt_combined", &ptLC_D_ptCombined) ); + m_availableVars.insert( std::make_pair("TauJetsAuxDyn.ptPanTauCellBased/TauJetsAuxDyn.pt_combined", &ptConstituent_D_ptCombined) ); + m_availableVars.insert( std::make_pair("TauJetsAuxDyn.etaPanTauCellBased", &etaConstituent) ); - m_availableVars.insert( std::make_pair("TauJetsAuxDyn.nPi0s", &nPi0s) ); - m_availableVars.insert( std::make_pair("TauJetsAuxDyn.PFOEngRelDiff", &PFOEngRelDiff) ); + m_availableVars.insert( std::make_pair("TauJetsAuxDyn.PanTau_BDTValue_1p0n_vs_1p1n", &PanTauBDT_1p0n_vs_1p1n) ); + m_availableVars.insert( std::make_pair("TauJetsAuxDyn.PanTau_BDTValue_1p1n_vs_1pXn", &PanTauBDT_1p1n_vs_1pXn) ); + m_availableVars.insert( std::make_pair("TauJetsAuxDyn.PanTau_BDTValue_3p0n_vs_3pXn", &PanTauBDT_3p0n_vs_3pXn) ); m_availableVars.insert( std::make_pair("TauJetsAuxDyn.nTracks", &nTracks) ); + m_availableVars.insert( std::make_pair("TauJetsAuxDyn.PFOEngRelDiff", &PFOEngRelDiff) ); // Spectator variables declared in the training have to be added to the reader, too m_availableVars.insert( std::make_pair("TauJetsAuxDyn.truthPtVis", &truthPtVis) ); - m_availableVars.insert( std::make_pair("TauJetsAux.ptTauEtaCalib", &ptTauEtaCalib) ); - m_availableVars.insert( std::make_pair("TauJetsAux.ptPanTauCellBased", &ptPanTauCellBased) ); + m_availableVars.insert( std::make_pair("TauJetsAuxDyn.pt", &pt) ); + m_availableVars.insert( std::make_pair("TauJetsAuxDyn.ptPanTauCellBased", &ptPanTauCellBased) ); + m_availableVars.insert( std::make_pair("TauJetsAuxDyn.ptDetectorAxis", &ptDetectorAxis) ); + m_availableVars.insert( std::make_pair("TauJetsAuxDyn.truthDecayMode", &truthDecayMode) ); + m_availableVars.insert( std::make_pair("TauJetsAuxDyn.PanTau_DecayMode", &PanTau_DecayMode) ); std::string weightFile = find_file(m_sWeightFileName); @@ -86,6 +95,25 @@ StatusCode MvaTESEvaluator::initialize(){ } +//_____________________________________________________________________________ +StatusCode MvaTESEvaluator::eventInitialize() +{ + // HACK HACK HACK: Get nVtxPU, AuxElement::ConstAccessor doesn't work + nVtxPU = 0; + if(evtStore()->contains<xAOD::VertexContainer>("PrimaryVertices")){ + ATH_CHECK(evtStore()->retrieve(m_xVertexContainer, "PrimaryVertices")); + for (auto xVertex : *m_xVertexContainer) + if (xVertex->vertexType() == xAOD::VxType::PileUp) + nVtxPU++; + } + else { + ATH_MSG_WARNING("No xAOD::VertexContainer, setting nVtxPU to 0"); + nVtxPU=0; + } + + return StatusCode::SUCCESS; +} + //_____________________________________________________________________________ StatusCode MvaTESEvaluator::execute(xAOD::TauJet& xTau){ @@ -93,9 +121,9 @@ StatusCode MvaTESEvaluator::execute(xAOD::TauJet& xTau){ // Retrieve event info static SG::AuxElement::ConstAccessor<double> acc_mu("mu"); - static SG::AuxElement::ConstAccessor<int> acc_nVtxPU("nVtxPU"); + //static SG::AuxElement::ConstAccessor<int> acc_nVtxPU("nVtxPU"); mu = acc_mu(xTau); - nVtxPU = acc_nVtxPU(xTau); + //nVtxPU = acc_nVtxPU(xTau); // Retrieve seed jet info xTau.detail(xAOD::TauJetParameters::ClustersMeanCenterLambda, center_lambda); @@ -103,26 +131,29 @@ StatusCode MvaTESEvaluator::execute(xAOD::TauJet& xTau){ xTau.detail(xAOD::TauJetParameters::ClustersMeanEMProbability,em_probability); xTau.detail(xAOD::TauJetParameters::ClustersMeanSecondLambda, second_lambda); xTau.detail(xAOD::TauJetParameters::ClustersMeanPresamplerFrac, presampler_frac); - int nMuSeg_i=0; - xTau.detail(xAOD::TauJetParameters::GhostMuonSegmentCount, nMuSeg_i); - nMuSeg=nMuSeg_i; // Retrieve pantau and LC-precalib TES - etaPanTauCellBased = xTau.etaPanTauCellBased(); - float pT_LC = xTau.ptDetectorAxis(); - float pT_pantau = xTau.ptPanTauCellBased(); - xTau.detail(xAOD::TauJetParameters::LC_pantau_interpolPt, interpolPt); - LC_D_interpolPt = pT_LC / interpolPt; - pantau_D_interpolPt = pT_pantau / interpolPt; + etaConstituent = xTau.etaPanTauCellBased(); + float ptLC = xTau.ptDetectorAxis(); + float ptConstituent = xTau.ptPanTauCellBased(); + static SG::AuxElement::ConstAccessor<float> acc_pt_combined("pt_combined"); + ptCombined = acc_pt_combined(xTau); + ptLC_D_ptCombined = ptLC / ptCombined; + ptConstituent_D_ptCombined = ptConstituent / ptCombined; // Retrieve substructures info + static SG::AuxElement::ConstAccessor<float> acc_PanTauBDT_1p0n_vs_1p1n("PanTau_BDTValue_1p0n_vs_1p1n"); + static SG::AuxElement::ConstAccessor<float> acc_PanTauBDT_1p1n_vs_1pXn("PanTau_BDTValue_1p1n_vs_1pXn"); + static SG::AuxElement::ConstAccessor<float> acc_PanTauBDT_3p0n_vs_3pXn("PanTau_BDTValue_3p0n_vs_3pXn"); + PanTauBDT_1p0n_vs_1p1n = acc_PanTauBDT_1p0n_vs_1p1n(xTau); + PanTauBDT_1p1n_vs_1pXn = acc_PanTauBDT_1p1n_vs_1pXn(xTau); + PanTauBDT_3p0n_vs_3pXn = acc_PanTauBDT_3p0n_vs_3pXn(xTau); nTracks = (float)xTau.nTracks(); - nPi0s = (float) xTau.nPi0PFOs(); xTau.detail(xAOD::TauJetParameters::PFOEngRelDiff, PFOEngRelDiff); - float ptMVA = float( interpolPt * reader->GetResponse() ); + float ptMVA = float( ptCombined * reader->GetResponse() ); if(ptMVA<1) ptMVA=1; - xTau.setP4(xAOD::TauJetParameters::FinalCalib, ptMVA, xTau.etaPanTauCellBased(), xTau.phiPanTauCellBased(), 0); + xTau.setP4(xAOD::TauJetParameters::FinalCalib, ptMVA, etaConstituent, xTau.phiPanTauCellBased(), 0); return StatusCode::SUCCESS; diff --git a/Reconstruction/tauRecTools/Root/TauCalibrateLC.cxx b/Reconstruction/tauRecTools/Root/TauCalibrateLC.cxx index 03b79666c7d23a39285bba87b5a8ed5d85848ae6..3197277c7c2f3ba57626d119f2894ad718761cd0 100644 --- a/Reconstruction/tauRecTools/Root/TauCalibrateLC.cxx +++ b/Reconstruction/tauRecTools/Root/TauCalibrateLC.cxx @@ -28,7 +28,9 @@ using CLHEP::GeV; TauCalibrateLC::TauCalibrateLC(const std::string& name) : TauRecToolBase(name), m_doEnergyCorr(false), + m_doPtResponse(false), m_doAxisCorr(false), + m_usePantauAxis(false), m_printMissingContainerINFO(true), m_isCaloOnly(false), m_clusterCone(0.2) //not used @@ -38,9 +40,12 @@ TauCalibrateLC::TauCalibrateLC(const std::string& name) : declareProperty("calibrationFile", calibrationFile = "EnergyCalibrationLC2012.root"); declareProperty("vertexContainerKey", vertexContainerKey = "PrimaryVertices"); declareProperty("doEnergyCorrection", m_doEnergyCorr); - declareProperty("doAxisCorrection", m_doAxisCorr); + declareProperty("doPtResponse", m_doPtResponse); + declareProperty("countOnlyPileupVertices", m_countOnlyPileupVertices=false); + declareProperty("doAxisCorrection", m_doAxisCorr); + declareProperty("usePantauAxis", m_usePantauAxis); declareProperty("ClusterCone", m_clusterCone); //not used - declareProperty("isCaloOnly", m_isCaloOnly); + declareProperty("isCaloOnly", m_isCaloOnly); } /********************************************************************/ @@ -183,7 +188,11 @@ StatusCode TauCalibrateLC::execute(xAOD::TauJet& pTau) xAOD::VertexContainer::const_iterator vx_end = vxContainer->end(); for (; vx_iter != vx_end; ++vx_iter) { - if ((*vx_iter)->nTrackParticles() >= m_minNTrackAtVertex) + if(m_countOnlyPileupVertices && + (*vx_iter)->vertexType() == xAOD::VxType::PileUp) + ++nVertex; + else if(!m_countOnlyPileupVertices && + (*vx_iter)->nTrackParticles() >= m_minNTrackAtVertex) ++nVertex; } @@ -206,10 +215,21 @@ StatusCode TauCalibrateLC::execute(xAOD::TauJet& pTau) } - // get detector axis energy - // was saved by TauAxisSetter + + + double calibConst = 1.0; + + double slopeNPV = slopeNPVHist[prongBin]->GetBinContent(etaBin + 1); + double offset = slopeNPV * (nVertex - m_averageNPV); + + // FF: March,2014 + // no offset correction for trigger + //if (inTrigger) offset = 0.; + + // energy response parameterized as a function of pileup-corrected E_LC double energyLC = pTau.p4(xAOD::TauJetParameters::DetectorAxis).E() / GeV; //was sumClusterVector.e() / GeV; - + if(m_doPtResponse) energyLC = pTau.ptDetectorAxis() / GeV; + if (energyLC <= 0) { ATH_MSG_DEBUG("tau energy at LC scale is " << energyLC << "--> set energy=0.001"); //TODO: we can not set tau energy to 0 due to bug in P4Helpers during deltaR calculation @@ -218,26 +238,21 @@ StatusCode TauCalibrateLC::execute(xAOD::TauJet& pTau) return StatusCode::SUCCESS; } - double slopeNPV = slopeNPVHist[prongBin]->GetBinContent(etaBin + 1); - double offset = slopeNPV * (nVertex - m_averageNPV); - - // FF: March,2014 - // no offset correction for trigger - //if (inTrigger) offset = 0.; - + // get detector axis energy + // was saved by TauAxisSetter + if (energyLC - offset <= 0) { ATH_MSG_DEBUG("after pile-up correction energy would be = " << energyLC - offset << " --> setting offset=0 now!"); offset = 0; } - + // apply offset correction double energyPileupCorr = energyLC - offset; - - double calibConst = 1.0; + if (energyPileupCorr > 0 and energyPileupCorr < 10000) // from 0 to 10 TeV { calibConst = calibFunc[prongBin][etaBin]->Eval(energyPileupCorr); - + if (calibConst <= 0) { ATH_MSG_DEBUG("calibration constant = " << calibConst); ATH_MSG_DEBUG("prongBin = " << prongBin); @@ -247,36 +262,51 @@ StatusCode TauCalibrateLC::execute(xAOD::TauJet& pTau) calibConst = 1.0; } } - + double energyFinal = energyPileupCorr / calibConst; + + if (not m_doPtResponse) energyFinal /= cosh(pTau.eta()) ; + pTau.setP4( energyFinal * GeV, pTau.eta(), pTau.phi(), pTau.m()); - pTau.setP4(energyFinal * GeV / cosh( pTau.eta() ), pTau.eta(), pTau.phi(), pTau.m()); + ATH_MSG_DEBUG("Energy at LC scale = " << energyLC << " pile-up offset " << offset << " calib. const. = " << calibConst << " final energy = " << energyFinal); - pTau.setP4(xAOD::TauJetParameters::TauEnergyScale, pTau.pt(), pTau.eta(), pTau.phi(), pTau.m()); - + pTau.setP4(xAOD::TauJetParameters::TauEnergyScale, pTau.pt(), pTau.eta(), pTau.phi(), pTau.m()); pTau.setDetail(xAOD::TauJetParameters::TESCalibConstant, static_cast<float>( calibConst ) ); - pTau.setDetail(xAOD::TauJetParameters::TESOffset, static_cast<float>( offset * GeV ) ); - - ATH_MSG_DEBUG("Energy at LC scale = " << energyLC << " pile-up offset " << offset << " calib. const. = " << calibConst << " final energy = " << energyFinal); + pTau.setDetail(xAOD::TauJetParameters::TESOffset, static_cast<float>( offset * GeV ) ); + } // final tau axis if (m_doAxisCorr) { // get tau intermediate axis values - double eta = pTau.eta(); + + double eta = pTau.etaIntermediateAxis(); double absEta = std::abs(eta); double etaCorr = eta; + + // WARNING !!! THIS IS NEW - MAKE SURE WE WANT THIS + double phi = pTau.phiIntermediateAxis(); + double phiCorr = phi; - if (absEta) - etaCorr = (eta / absEta)*(absEta - etaCorrectionHist->GetBinContent(etaCorrectionHist->GetXaxis()->FindBin(absEta))); + // TauCalibrateLC should then only be called after Pantau !! + // + if(m_usePantauAxis && fabs(pTau.etaPanTauCellBased()) < 111) { + etaCorr = pTau.etaPanTauCellBased(); + phiCorr = pTau.phiPanTauCellBased(); - ATH_MSG_DEBUG("eta " << eta << "; corrected eta = " << etaCorr); + } + else if (absEta) { + + etaCorr = (eta / absEta)*(absEta - etaCorrectionHist->GetBinContent(etaCorrectionHist->GetXaxis()->FindBin(absEta))); - pTau.setP4( pTau.e() / cosh( etaCorr ), etaCorr, pTau.phi(), pTau.m()); + } + ATH_MSG_DEBUG("eta " << eta << "; corrected eta = " << etaCorr << " ; phi " << phi << "; corrected phi " << phiCorr ); + + pTau.setP4( pTau.e() / cosh( etaCorr ), etaCorr, phiCorr, pTau.m()); + pTau.setP4(xAOD::TauJetParameters::TauEtaCalib, pTau.pt(), pTau.eta(), pTau.phi(), pTau.m()); - } if (m_isCaloOnly == true && tauEventData()->inTrigger() == true){ diff --git a/Reconstruction/tauRecTools/Root/TauCommonCalcVars.cxx b/Reconstruction/tauRecTools/Root/TauCommonCalcVars.cxx index a8617e7f773ba4122a0643727dc5b3d71fa77c55..925f70aede4dff4e3b335e3440a0cad62aa4b3ed 100644 --- a/Reconstruction/tauRecTools/Root/TauCommonCalcVars.cxx +++ b/Reconstruction/tauRecTools/Root/TauCommonCalcVars.cxx @@ -31,6 +31,8 @@ TauCommonCalcVars::TauCommonCalcVars(const std::string &name) : TauRecToolBase(name) { declareProperty("ConfigPath", m_configPath); + //if TauTrackClassifier is not run, wide&passTrkSelector==classifiedIsolation==modifiedIsolationTrack + declareProperty("isolationTrackType", m_isolationTrackType=xAOD::TauJetParameters::modifiedIsolationTrack); } //----------------------------------------------------------------------------- @@ -68,6 +70,9 @@ StatusCode TauCommonCalcVars::execute(xAOD::TauJet& pTau) { // Calculate variables that are always valid //////////////////////////////////////////////// + //init some vars + pTau.setDetail( xAOD::TauJetParameters::SumPtTrkFrac, static_cast<float>( 0 ) ); + // Leading track pT and et/pt(lead track) if (pTau.nTracks() > 0) { pTau.setDetail( xAOD::TauJetParameters::leadTrkPt, static_cast<float>( pTau.track(0)->pt() ) ); @@ -107,7 +112,7 @@ StatusCode TauCommonCalcVars::execute(xAOD::TauJet& pTau) { // invariant mass of track system std::vector<const xAOD::TauTrack*> tauTracks = pTau.tracks(xAOD::TauJetParameters::TauTrackFlag::classifiedCharged); - for( const xAOD::TauTrack* trk : pTau.tracks(xAOD::TauJetParameters::TauTrackFlag::classifiedIsolation) ) tauTracks.push_back(trk); + for( const xAOD::TauTrack* trk : pTau.tracks((xAOD::TauJetParameters::TauTrackFlag) m_isolationTrackType) ) tauTracks.push_back(trk); // if ((pTau.nTracks() + pTau.nWideTracks()) > 0) { if (tauTracks.size()> 0) { @@ -170,7 +175,7 @@ StatusCode TauCommonCalcVars::execute(xAOD::TauJet& pTau) { for (const xAOD::TauTrack* tauTrk : tauTracks){ - double deltaR = Tau1P3PKineUtils::deltaR(pTau.eta(), pTau.phi(), tauTrk->eta(), tauTrk->phi() ); + double deltaR = Tau1P3PKineUtils::deltaR( (inTrigger() ? pTau.eta() : pTau.etaIntermediateAxis()), pTau.phi(), tauTrk->eta(), tauTrk->phi() ); ptSum += tauTrk->pt(); sumWeightedDR += deltaR * (tauTrk->pt()); diff --git a/PhysicsAnalysis/TauID/TauDiscriminant/Root/TauEleOLRDecorator.cxx b/Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx similarity index 99% rename from PhysicsAnalysis/TauID/TauDiscriminant/Root/TauEleOLRDecorator.cxx rename to Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx index c80d25e1b33d3e6703d1b29d38a0ac0fd249ef42..98893c28b62e6e04beb584c364e7542583537816 100644 --- a/PhysicsAnalysis/TauID/TauDiscriminant/Root/TauEleOLRDecorator.cxx +++ b/Reconstruction/tauRecTools/Root/TauEleOLRDecorator.cxx @@ -9,7 +9,7 @@ * Modified: Lorenz Hauswald */ -#include "TauDiscriminant/TauEleOLRDecorator.h" +#include "tauRecTools/TauEleOLRDecorator.h" #include "ElectronPhotonSelectorTools/AsgElectronLikelihoodTool.h" #include "CxxUtils/make_unique.h" #include "TFile.h" diff --git a/PhysicsAnalysis/TauID/TauDiscriminant/Root/TauIDVarCalculator.cxx b/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx similarity index 55% rename from PhysicsAnalysis/TauID/TauDiscriminant/Root/TauIDVarCalculator.cxx rename to Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx index 94d17bfb70883a63028e1fabeb7fc5447ed7bf2a..2721926cab481d4f9b2633aae9b1fc724852dd13 100644 --- a/PhysicsAnalysis/TauID/TauDiscriminant/Root/TauIDVarCalculator.cxx +++ b/Reconstruction/tauRecTools/Root/TauIDVarCalculator.cxx @@ -8,10 +8,12 @@ * Author: Lorenz Hauswald */ -#include "TauDiscriminant/TauIDVarCalculator.h" +#include "tauRecTools/TauIDVarCalculator.h" #include "xAODTracking/VertexContainer.h" #include "xAODEventInfo/EventInfo.h" - +#include "CaloGeoHelpers/CaloSampling.h" +#include "FourMomUtils/xAODP4Helpers.h" +#include "TLorentzVector.h" const float TauIDVarCalculator::LOW_NUMBER = -1111.; @@ -76,11 +78,18 @@ StatusCode TauIDVarCalculator::execute(xAOD::TauJet& tau) //for old trigger BDT: static SG::AuxElement::Accessor<int> acc_numWideTrk("NUMWIDETRACK"); #ifdef XAODTAU_VERSIONS_TAUJET_V3_H - acc_numWideTrk(tau) = tau.nTracks(xAOD::TauJetParameters::classifiedIsolation); + acc_numWideTrk(tau) = tau.nTracks(xAOD::TauJetParameters::classifiedIsolation);//the ID should train on nIsolatedTracks which is static! #else acc_numWideTrk(tau) = tau.nWideTracks(); #endif } + + + static SG::AuxElement::Accessor<float> acc_absipSigLeadTrk("absipSigLeadTrk"); + float ipSigLeadTrk=0; + if(!tau.detail(xAOD::TauJetParameters::ipSigLeadTrk, ipSigLeadTrk)) + return StatusCode::FAILURE; + acc_absipSigLeadTrk(tau) = fabs(ipSigLeadTrk); //don't calculate EleBDT variables if run from TrigTauDiscriminant: if(inTrigger()) return StatusCode::SUCCESS; @@ -104,7 +113,65 @@ StatusCode TauIDVarCalculator::execute(xAOD::TauJet& tau) static SG::AuxElement::Accessor<float> acc_newhadLeakEt("HADLEAKET"); static SG::AuxElement::Accessor<float> acc_trtNhtOverNlt("TAU_TRT_NHT_OVER_NLT"); static SG::AuxElement::Accessor<float> acc_centFracCorrected("CORRCENTFRAC"); - + + // Will: Fixed variables for R21 + static SG::AuxElement::Accessor<float> acc_EMFracFixed("EMFracFixed"); + static SG::AuxElement::Accessor<float> acc_hadLeakFracFixed("hadLeakFracFixed"); + static SG::AuxElement::Accessor<float> acc_etHotShotDR1("etHotShotDR1"); // replace secMaxStripEt + static SG::AuxElement::Accessor<float> acc_etHotShotWin("etHotShotWin"); // replace secMaxStripEt + static SG::AuxElement::Accessor<float> acc_etHotShotDR1OverPtLeadTrk("etHotShotDR1OverPtLeadTrk"); // replace TAU_SEEDTRK_SECMAXSTRIPETOVERPT + static SG::AuxElement::Accessor<float> acc_etHotShotWinOverPtLeadTrk("etHotShotWinOverPtLeadTrk"); // replace TAU_SEEDTRK_SECMAXSTRIPETOVERPT + + + // EMFracFixed and eHad1AtEMScaleFixed (for acc_hadLeakFracFixed) + // -------------------------------------------------------------- + // ECAL Layers: 0, 1, 2. Don't include 3 because it is mismodelled! + std::vector<CaloSampling::CaloSample> EMSamps = { + CaloSampling::PreSamplerB, CaloSampling::PreSamplerE, + CaloSampling::EMB1, CaloSampling::EME1, + CaloSampling::EMB2, CaloSampling::EME2 }; + // All HCAL Layers + std::vector<CaloSampling::CaloSample> HadSamps = { + CaloSampling::HEC0, CaloSampling::HEC1, CaloSampling::HEC2, CaloSampling::HEC3, + CaloSampling::TileBar0, CaloSampling::TileBar1, CaloSampling::TileBar2, + CaloSampling::TileGap1, CaloSampling::TileGap2, CaloSampling::TileGap3, + CaloSampling::TileExt0, CaloSampling::TileExt1, CaloSampling::TileExt2}; + // First HCal Layer + std::vector<CaloSampling::CaloSample> Had1Samps = { + CaloSampling::HEC0, CaloSampling::TileBar0, CaloSampling::TileGap1, CaloSampling::TileExt0}; + + // Get Clusters via Jet Seed + auto p4IntAxis = tau.p4(xAOD::TauJetParameters::IntermediateAxis); + const xAOD::Jet *jetSeed = (*tau.jetLink()); + float eEMAtEMScaleFixed = 0; + float eHadAtEMScaleFixed = 0; + float eHad1AtEMScaleFixed = 0; + if (jetSeed) { + for( auto it : jetSeed->getConstituents() ){ + auto *cl = dynamic_cast<const xAOD::CaloCluster *>((*it)->rawConstituent()); + if (!cl){ + ATH_MSG_WARNING("Found invalid cluster link from seed jet"); + continue; + } + // Only take clusters with dR<0.2 w.r.t IntermediateAxis + if( p4IntAxis.DeltaR(cl->p4(xAOD::CaloCluster::UNCALIBRATED)) > 0.2 ) continue; + + for( auto samp : EMSamps ) + eEMAtEMScaleFixed += cl->eSample(samp); + for( auto samp : HadSamps ) + eHadAtEMScaleFixed += cl->eSample(samp); + for( auto samp : Had1Samps ) + eHad1AtEMScaleFixed += cl->eSample(samp); + } + acc_EMFracFixed(tau) = ( eEMAtEMScaleFixed + eHadAtEMScaleFixed ) != 0 ? + eEMAtEMScaleFixed / ( eEMAtEMScaleFixed + eHadAtEMScaleFixed ) : LOW_NUMBER; + } + else{ + ATH_MSG_WARNING("Tau got invalid xAOD::Jet link"); + acc_EMFracFixed(tau) = LOW_NUMBER; + } + + if(tau.nTracks() > 0){ const xAOD::TrackParticle* track = 0; #ifdef XAODTAU_VERSIONS_TAUJET_V3_H @@ -142,6 +209,47 @@ StatusCode TauIDVarCalculator::execute(xAOD::TauJet& tau) float fTracksEProbabilityHT; track->summaryValue( fTracksEProbabilityHT, xAOD::eProbabilityHT); acc_leadTrackProbHT(tau) = fTracksEProbabilityHT; + + // hadLeakFracFixed + acc_hadLeakFracFixed(tau) = (track->p4().P() != 0) ? eHad1AtEMScaleFixed / track->p4().P() : LOW_NUMBER; + + // HOT SHOTS!!!!! + // -------------- + // Get track position extrapolated to EM1 + const xAOD::TauTrack* tauTrack = tau.track(0); + float etaCalo = -10.0; + float phiCalo = -10.0; + if( not tauTrack->detail(xAOD::TauJetParameters::CaloSamplingEtaEM, etaCalo)) + ATH_MSG_WARNING("Failed to retrieve extrapolated chargedPFO eta"); + if( not tauTrack->detail(xAOD::TauJetParameters::CaloSamplingPhiEM, phiCalo)) + ATH_MSG_WARNING("Failed to retrieve extrapolated chargedPFO phi"); + ATH_MSG_DEBUG("track EM " << ", eta: " << etaCalo << ", phi: " << phiCalo ); + + // Get hottest shot in dR<0.1 and in 0.05 x 0.1 window + float etHotShotDR1 = 0; + float etHotShotWin = 0; + for( auto shotLink : tau.shotPFOLinks() ){ + if( not shotLink.isValid() ){ + ATH_MSG_WARNING("Invalid shotLink"); + continue; + } + const xAOD::PFO* shot = (*shotLink); + float etShot = 0; + shot->attribute(xAOD::PFODetails::tauShots_pt3, etShot); + + // In dR < 0.1 + if(xAOD::P4Helpers::deltaR(*shot, etaCalo, phiCalo, false) and etShot > etHotShotDR1){ + etHotShotDR1 = etShot; + } + // In 0.012 x 0.1 window + if(abs(shot->eta() - etaCalo) > 0.012 ) continue; + if(abs(xAOD::P4Helpers::deltaPhi(shot->phi(), phiCalo)) > 0.1 ) continue; + if(etShot > etHotShotWin) etHotShotWin = etShot; + } + acc_etHotShotDR1(tau) = etHotShotDR1; + acc_etHotShotWin(tau) = etHotShotWin; + acc_etHotShotDR1OverPtLeadTrk(tau) = (track->pt() != 0) ? etHotShotDR1 / track->pt() : LOW_NUMBER; + acc_etHotShotWinOverPtLeadTrk(tau) = (track->pt() != 0) ? etHotShotWin / track->pt() : LOW_NUMBER; }else{ acc_absEtaLead(tau) = LOW_NUMBER; @@ -151,6 +259,11 @@ StatusCode TauIDVarCalculator::execute(xAOD::TauJet& tau) acc_EMFractionAtEMScaleMOVEE3(tau) = LOW_NUMBER; acc_seedTrkSecMaxStripEtOverPt(tau) = LOW_NUMBER; acc_trtNhtOverNlt(tau) = LOW_NUMBER; + acc_hadLeakFracFixed(tau) = LOW_NUMBER; + acc_etHotShotDR1(tau) = LOW_NUMBER; + acc_etHotShotWin(tau) = LOW_NUMBER; + acc_etHotShotDR1OverPtLeadTrk(tau) = LOW_NUMBER; + acc_etHotShotWinOverPtLeadTrk(tau) = LOW_NUMBER; } //CORRFTRK float correction = m_nVtx != int(LOW_NUMBER) ? 0.003 * m_nVtx : 0.; @@ -159,7 +272,7 @@ StatusCode TauIDVarCalculator::execute(xAOD::TauJet& tau) acc_corrftrk(tau) = ptLeadTrkOverEt != -1111. ? ptLeadTrkOverEt + correction : ptLeadTrkOverEt; acc_centFracCorrected(tau) = tau.pt() < 80*1000. ? acc_centFrac(tau) + correction : acc_centFrac(tau); - + return StatusCode::SUCCESS; } diff --git a/Reconstruction/tauRecTools/Root/TauJetBDTEvaluator.cxx b/Reconstruction/tauRecTools/Root/TauJetBDTEvaluator.cxx new file mode 100644 index 0000000000000000000000000000000000000000..296ea9024356e23cb9f9bc40fd133d1ebf69296b --- /dev/null +++ b/Reconstruction/tauRecTools/Root/TauJetBDTEvaluator.cxx @@ -0,0 +1,73 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "tauRecTools/TauJetBDTEvaluator.h" + +TauJetBDTEvaluator::TauJetBDTEvaluator(const std::string& name) + : TauRecToolBase(name) + , m_outputVar(0) + , m_myBdt(0) +{ + declareProperty("weightsFile", m_weightsFile=""); + declareProperty("minNTracks", m_minNTracks=0); + declareProperty("maxNTracks", m_maxNTracks=999); + declareProperty("minAbsTrackEta", m_minAbsTrackEta=-1); + declareProperty("maxAbsTrackEta", m_maxAbsTrackEta=-1); + declareProperty("outputVarName", m_outputVarName="BDTJetScore"); + declareProperty("GradiantBoost", m_isGrad=true, "Gradiant if true, else AdaBoost Classification"); + declareProperty("defaultValue", m_dummyValue=-1111, "if no weightsFile, then set all taus to this value nTrack/eta ignored"); +} + +//________________________________________ +StatusCode TauJetBDTEvaluator::initialize(){ + //init output variable accessor + m_outputVar = new SG::AuxElement::Accessor<float>(m_outputVarName); + + //check if weightsFile is empty, if so, assume we apply dummyValue to all taus + if(m_weightsFile.length()==0){ + ATH_MSG_INFO("No weights file set, will set all " << m_outputVarName << " to " << m_dummyValue ); + return StatusCode::SUCCESS; + } + + //configure m_myBdt object if weights exists + std::string full_path=find_file(m_weightsFile); + m_myBdt = new tauRecTools::TRTBDT(full_path.c_str()); + if(m_myBdt->bdt==0) { + ATH_MSG_FATAL("Couldn't configure BDT"); + return StatusCode::FAILURE; + } + return StatusCode::SUCCESS; +} + +SG::AuxElement::ConstAccessor<float> acc_absTrackEta("ABS_ETA_LEAD_TRACK"); + +//________________________________________ +StatusCode TauJetBDTEvaluator::execute(xAOD::TauJet& xTau){ + if(m_myBdt==0) { + (*m_outputVar)(xTau) = m_dummyValue; + return StatusCode::SUCCESS; + } + + int nTracks = 0; + xTau.detail(xAOD::TauJetParameters::nChargedTracks, nTracks); + if(nTracks<m_minNTracks) return StatusCode::SUCCESS; + if(nTracks>m_maxNTracks) return StatusCode::SUCCESS; + float absTrackEta = acc_absTrackEta(xTau); + if(m_minAbsTrackEta>=0. && absTrackEta < m_minAbsTrackEta) + return StatusCode::SUCCESS; + if(m_maxAbsTrackEta>=0. && absTrackEta >= m_maxAbsTrackEta) + return StatusCode::SUCCESS; + + m_myBdt->updateVariables(xTau); + float response = (m_isGrad ? m_myBdt->GetGradBoostMVA() : m_myBdt->GetClassification() ); + (*m_outputVar)(xTau) = response; + return StatusCode::SUCCESS; +} + +//________________________________________ +StatusCode TauJetBDTEvaluator::finalize(){ + if(m_myBdt) delete m_myBdt; + if(m_outputVar) delete m_outputVar; + return StatusCode::SUCCESS; +} diff --git a/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx b/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx index 8469c257f5b8bc59e8e9db57cece0ed3e98ac944..382283fbb29297831d04c51ab65bab964983d5fb 100644 --- a/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx +++ b/Reconstruction/tauRecTools/Root/TauTrackClassifier.cxx @@ -94,7 +94,16 @@ StatusCode TauTrackClassifier::execute(xAOD::TauJet& xTau) xTau.setCharge(charge); xTau.setDetail(xAOD::TauJetParameters::nChargedTracks, (int) xTau.nTracks()); xTau.setDetail(xAOD::TauJetParameters::nIsolatedTracks, (int) xTau.nTracks(xAOD::TauJetParameters::classifiedIsolation)); - + + //set modifiedIsolationTrack + for (xAOD::TauTrack* xTrack : vTracks) { + if( not xTrack->flag(xAOD::TauJetParameters::classifiedCharged) and + xTrack->flag(xAOD::TauJetParameters::passTrkSelector) ) xTrack->setFlag(xAOD::TauJetParameters::modifiedIsolationTrack, true); + else xTrack->setFlag(xAOD::TauJetParameters::modifiedIsolationTrack, false); + } + xTau.setDetail(xAOD::TauJetParameters::nModifiedIsolationTracks, (int) xTau.nTracks(xAOD::TauJetParameters::modifiedIsolationTrack)); + + return StatusCode::SUCCESS; } diff --git a/Reconstruction/tauRecTools/Root/TauWPDecorator.cxx b/Reconstruction/tauRecTools/Root/TauWPDecorator.cxx index 24a372d38f1181c73fbf1381a95885397340eb0a..3cab3b1d2550d5a0caeec1fc2fc1e70e91e87fef 100644 --- a/Reconstruction/tauRecTools/Root/TauWPDecorator.cxx +++ b/Reconstruction/tauRecTools/Root/TauWPDecorator.cxx @@ -31,18 +31,19 @@ TauWPDecorator::TauWPDecorator(const std::string& name) : declareProperty("flatteningFile1Prong", m_file1P = "fitted.pileup_1prong_hlt.root"); declareProperty("flatteningFile3Prong", m_file3P = "fitted.pileup_multiprongs_hlt.root"); + declareProperty("ScoreName", m_scoreName = "BDTJetScore"); + declareProperty("NewScoreName", m_newScoreName = "BDTJetScoreSigTrans"); + declareProperty("DefineWPs", m_defineWP); declareProperty("UseEleBDT", m_electronMode=false); - declareProperty("SigEffWPVeryLoose1P", m_effVeryLoose1P); - declareProperty("SigEffWPLoose1P", m_effLoose1P); - declareProperty("SigEffWPMedium1P", m_effMedium1P); - declareProperty("SigEffWPTight1P", m_effTight1P); + declareProperty("CutEnumVals", m_cut_bits); + declareProperty("SigEff1P", m_cut_effs_1p); + declareProperty("SigEff3P", m_cut_effs_3p); - declareProperty("SigEffWPVeryLoose3P", m_effVeryLoose3P); - declareProperty("SigEffWPLoose3P", m_effLoose3P); - declareProperty("SigEffWPMedium3P", m_effMedium3P); - declareProperty("SigEffWPTight3P", m_effTight3P); + declareProperty("DecorWPNames", m_decoration_names); + declareProperty("DecorWPCutEffs1P", m_cut_effs_decoration_1p); + declareProperty("DecorWPCutEffs3P", m_cut_effs_decoration_3p); } @@ -133,13 +134,8 @@ StatusCode TauWPDecorator::initialize() { ATH_CHECK( storeLimits(1) ); ATH_CHECK( storeLimits(3) ); - - std::string scoreName = "BDTJetScore"; - std::string newScoreName = "BDTJetScoreSigTrans"; - if(m_electronMode) { - scoreName = "BDTEleScore_run2"; - newScoreName = "BDTEleScoreTrans_run2"; - } + std::string scoreName = m_scoreName; + std::string newScoreName = m_newScoreName; acc_score = new SG::AuxElement::ConstAccessor<float>(scoreName); acc_newScore = new SG::AuxElement::Accessor<float>(newScoreName); @@ -236,33 +232,45 @@ StatusCode TauWPDecorator::execute(xAOD::TauJet& pTau) // Upper & Lower Boundaries if(!gotHigh) { - cuts[1] = 1.0; + cuts[1] = 1.01; effs[1] = 0.0; } if(!gotLow) { - cuts[0] = 0.0; + cuts[0] = -1.01; effs[0] = 1.0; } - + // Evaluate and decorate new score - double newscore = transformScore(score, cuts[0], effs[0], cuts[1], effs[1]); + double newscore = -1111.; + // Score higher than default upper boundary (rare) + if( score > cuts[1] ) newscore = cuts[0]; + // Score lower than default lower boundary (rare) + else if( score < cuts[0] ) newscore = cuts[1]; + // Score inside boundaries + else { + newscore = transformScore(score, cuts[0], effs[0], cuts[1], effs[1]); + } (*acc_newScore)(pTau) = newscore; - // Define working points if(m_defineWP) { - if(acc_numTrack(pTau) == 1) { - pTau.setIsTau(xAOD::TauJetParameters::JetBDTSigLoose, newscore > (1-m_effLoose1P)); - pTau.setIsTau(xAOD::TauJetParameters::JetBDTSigMedium, newscore > (1-m_effMedium1P)); - pTau.setIsTau(xAOD::TauJetParameters::JetBDTSigTight, newscore > (1-m_effTight1P)); - pTau.auxdecor<char>("IsVeryLoose") = newscore > (1-m_effVeryLoose1P); - } else { - pTau.setIsTau(xAOD::TauJetParameters::JetBDTSigLoose, newscore > (1-m_effLoose3P)); - pTau.setIsTau(xAOD::TauJetParameters::JetBDTSigMedium, newscore > (1-m_effMedium3P)); - pTau.setIsTau(xAOD::TauJetParameters::JetBDTSigTight, newscore > (1-m_effTight3P)); - pTau.auxdecor<char>("IsVeryLoose") = newscore > (1-m_effVeryLoose3P); + for (u_int Nwp=0; Nwp < m_cut_bits.size(); Nwp++){ + if(acc_numTrack(pTau) == 1) { + pTau.setIsTau((xAOD::TauJetParameters::IsTauFlag) m_cut_bits[Nwp], newscore > (1-m_cut_effs_1p[Nwp])); + } + else{ + pTau.setIsTau((xAOD::TauJetParameters::IsTauFlag) m_cut_bits[Nwp], newscore > (1-m_cut_effs_3p[Nwp])); + } + } + // Decorate other WPs + for (u_int Nwp=0; Nwp < m_decoration_names.size(); Nwp++){ + if(acc_numTrack(pTau) == 1) { + pTau.auxdecor<char>(m_decoration_names[Nwp]) = newscore > (1-m_cut_effs_decoration_1p[Nwp]); + } + else { + pTau.auxdecor<char>(m_decoration_names[Nwp]) = newscore > (1-m_cut_effs_decoration_3p[Nwp]); + } } } - return StatusCode::SUCCESS; } diff --git a/Reconstruction/tauRecTools/cmt/requirements b/Reconstruction/tauRecTools/cmt/requirements index 2f32856d3bdd73168c8c12d5a8a379abf350a821..67d3eee71c913b1b978eb18ee53e76b2a6bb35b3 100644 --- a/Reconstruction/tauRecTools/cmt/requirements +++ b/Reconstruction/tauRecTools/cmt/requirements @@ -7,6 +7,7 @@ public use AtlasPolicy AtlasPolicy-* use AsgTools AsgTools-* Control/AthToolSupport use xAODTau xAODTau-* Event/xAOD +use xAODEgamma xAODEgamma-* Event/xAOD use AtlasBoost AtlasBoost-* External use AtlasROOT AtlasROOT-* External use xAODTracking xAODTracking-* Event/xAOD diff --git a/Reconstruction/tauRecTools/src/TauTrackFinder.cxx b/Reconstruction/tauRecTools/src/TauTrackFinder.cxx index 2675d3203fc369f47af5fdfe2e5a8d8b9eacaa99..d9346425b14cb0911dbb4a07a794a353112c63f0 100644 --- a/Reconstruction/tauRecTools/src/TauTrackFinder.cxx +++ b/Reconstruction/tauRecTools/src/TauTrackFinder.cxx @@ -218,6 +218,7 @@ StatusCode TauTrackFinder::execute(xAOD::TauJet& pTau) { track->setFlag(xAOD::TauJetParameters::TauTrackFlag::passTrkSelector, true); // in case TrackClassifier is not run, still get sensible results track->setFlag(xAOD::TauJetParameters::TauTrackFlag::classifiedIsolation, true); // for sake of trigger, reset in TauTrackClassifier + track->setFlag(xAOD::TauJetParameters::TauTrackFlag::modifiedIsolationTrack, true); // for sake of trigger, reset in TauTrackClassifier track->setFlag(xAOD::TauJetParameters::TauTrackFlag::unclassified, true); //track->setFlag(xAOD::TauJetParameters::TauTrackFlag::passTrkSelectionTight, m_trackSelectorTool_tau_xAOD->accept(trackParticle)); ElementLink<xAOD::TauTrackContainer> linkToTauTrack; diff --git a/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx b/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx index f135eda46d7c95baa8972e483e64ad02817ce423..331be2dc3eae518080294ef83ffaa04592332be5 100644 --- a/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx +++ b/Reconstruction/tauRecTools/src/components/tauRecTools_entries.cxx @@ -36,6 +36,9 @@ #include "tauRecTools/TauWPDecorator.h" #include "tauRecTools/DiTauDiscriminantTool.h" #include "tauRecTools/DiTauIDVarCalculator.h" +#include "tauRecTools/TauJetBDTEvaluator.h" +#include "tauRecTools/TauEleOLRDecorator.h" +#include "tauRecTools/TauIDVarCalculator.h" #include "GaudiKernel/DeclareFactoryEntries.h" @@ -79,3 +82,6 @@ DECLARE_TOOL_FACTORY( TauPi0Selector ) DECLARE_TOOL_FACTORY( TauWPDecorator ) DECLARE_NAMESPACE_TOOL_FACTORY( tauRecTools, DiTauDiscriminantTool ) DECLARE_NAMESPACE_TOOL_FACTORY( tauRecTools, DiTauIDVarCalculator ) +DECLARE_TOOL_FACTORY( TauJetBDTEvaluator ) +DECLARE_TOOL_FACTORY( TauEleOLRDecorator ) +DECLARE_TOOL_FACTORY( TauIDVarCalculator ) diff --git a/Reconstruction/tauRecTools/tauRecTools/CombinedP4FromRecoTaus.h b/Reconstruction/tauRecTools/tauRecTools/CombinedP4FromRecoTaus.h index d956bc222e9e229928dc839d578a1e3bc518f531..e7d7a9335fd869531f3b126caa08ea0481336301 100644 --- a/Reconstruction/tauRecTools/tauRecTools/CombinedP4FromRecoTaus.h +++ b/Reconstruction/tauRecTools/tauRecTools/CombinedP4FromRecoTaus.h @@ -62,15 +62,15 @@ class CombinedP4FromRecoTaus //Calculates the optimal tau 4-vector TLorentzVector getCombinedP4(const xAOD::TauJet* tau); - // move these to another file? : - TLorentzVector getCalibratedTauRecP4(const xAOD::TauJet* tau); - TLorentzVector getCalibratedConstituentP4(const xAOD::TauJet* tau); - TLorentzVector getWeightedP4(const xAOD::TauJet* tau); // Get the enum-value for eta corresponding to the eta value int GetIndex_Eta(float eta); float GetNsigma_Compatibility(float et_TauRec); + //high pt flag + double GetCaloResolution(const xAOD::TauJet* tau); + bool GetUseCaloPtFlag(const xAOD::TauJet* tau); + StatusCode execute(xAOD::TauJet& xTau); private: @@ -91,9 +91,11 @@ class CombinedP4FromRecoTaus std::string m_calibFilePath; bool m_addCalibrationResultVariables; + bool m_addUseCaloPtFlag; bool m_tauRecEt_takenAs_combinedEt; double m_weight, m_combined_res, m_sigma_tauRec, m_sigma_constituent, m_corrcoeff; - + double m_et_cb2PT_postcalib, m_et_postcalib, m_et_weighted; + std::string m_sWeightFileName; TF1 m_Nsigma_compatibility; }; diff --git a/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h b/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h index 9f1fe466eaf100f59754e513e1f2d71ac7e7517d..afe3d2264515f1891b2020aaeb8ee28323dfd0ba 100644 --- a/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h +++ b/Reconstruction/tauRecTools/tauRecTools/HelperFunctions.h @@ -8,6 +8,7 @@ #include "MVAUtils/BDT.h" #include <vector> +#include <map> // ROOT include(s) #include "TLorentzVector.h" @@ -32,6 +33,42 @@ namespace tauRecTools xAOD::TauTrack::TrackFlagType isolateClassifiedBits(xAOD::TauTrack::TrackFlagType flag); bool sortTracks(const ElementLink<xAOD::TauTrackContainer> &l1, const ElementLink<xAOD::TauTrackContainer> &l2); + //keep track of whether input var is float or int + struct DummyAccessor { + SG::AuxElement::ConstAccessor<int>* iacc = 0; + SG::AuxElement::ConstAccessor<float>* facc = 0; + float operator()(const xAOD::TauJet& tau) { + if(facc) return (*facc)(tau); + else return (int) (*iacc)(tau); + } + ~DummyAccessor(){ + if(iacc) delete iacc; + else delete facc; + } + DummyAccessor(const char* name, bool isfloat=true){ + if(isfloat) facc = new SG::AuxElement::ConstAccessor<float>(name); + else iacc = new SG::AuxElement::ConstAccessor<int>(name); + } + private: + //discourage use of this as an object + //must implement this properly if you want + //DummyAccessor as an object + DummyAccessor(const DummyAccessor&){ + } + }; + + struct TRTBDT { + float GetGradBoostMVA();//GradBost + float GetClassification();//AdaBoost + float GetResponse();//regression + MVAUtils::BDT* bdt=0; + std::map< float*, DummyAccessor* > m_data; + TRTBDT( const char* weightFile); + bool init(const char* weightFile); + ~TRTBDT(); + bool updateVariables(const xAOD::TauJet& tau); + }; + MVAUtils::BDT* configureMVABDT( std::map<TString, float*> &availableVars, const TString& weightFile); std::vector<TString> parseString(const TString& str, const TString& delim=","); diff --git a/Reconstruction/tauRecTools/tauRecTools/MvaTESEvaluator.h b/Reconstruction/tauRecTools/tauRecTools/MvaTESEvaluator.h index 91049bc2876e85a7bd5a36e9707c767645edc27b..fabab358e6ad4ba6b1c0c0e3f5b9e0cea6bc9150 100644 --- a/Reconstruction/tauRecTools/tauRecTools/MvaTESEvaluator.h +++ b/Reconstruction/tauRecTools/tauRecTools/MvaTESEvaluator.h @@ -22,6 +22,7 @@ class MvaTESEvaluator virtual ~MvaTESEvaluator(); StatusCode initialize(); + StatusCode eventInitialize(); StatusCode execute(xAOD::TauJet& xTau); StatusCode finalize() { delete reader; return StatusCode::SUCCESS;} @@ -33,32 +34,38 @@ class MvaTESEvaluator MVAUtils::BDT *reader; //! std::map<TString, float*> m_availableVars; //!< addresses of the floats below - + + // HACK HACK HACK: Use to get nVtxPU, AuxElement::ConstAccessor doesn't work + const xAOD::VertexContainer* m_xVertexContainer; //! + // MVA input variables (provide all variables in float) float mu; //! float nVtxPU; //! - + float center_lambda; //! float first_eng_dens; //! float second_lambda; //! float presampler_frac; //! float em_probability; //! - - float interpolPt; //! - float LC_D_interpolPt; //! - float pantau_D_interpolPt;//! - float etaPanTauCellBased; //! - + + float ptCombined; //! + float ptLC_D_ptCombined; //! + float ptConstituent_D_ptCombined;//! + float etaConstituent; //! + + float PanTauBDT_1p0n_vs_1p1n; //! + float PanTauBDT_1p1n_vs_1pXn; //! + float PanTauBDT_3p0n_vs_3pXn; //! float nTracks; //! - float nPi0s; //! float PFOEngRelDiff; //! - - float nMuSeg; //! - + // Spectators float truthPtVis; //! - float ptTauEtaCalib; //! + float pt; //! float ptPanTauCellBased; //! + float ptDetectorAxis; //! + float truthDecayMode; //! + float PanTau_DecayMode; //! }; #endif // TAURECTOOLSDEV_MVATESEVALUATOR_H diff --git a/Reconstruction/tauRecTools/tauRecTools/TauCalibrateLC.h b/Reconstruction/tauRecTools/tauRecTools/TauCalibrateLC.h index 0695c46be9005cc0e952bbfe4cedc9771f112876..4b2e3ea8bfd984199084c861921701bc1d69ba4f 100644 --- a/Reconstruction/tauRecTools/tauRecTools/TauCalibrateLC.h +++ b/Reconstruction/tauRecTools/tauRecTools/TauCalibrateLC.h @@ -55,7 +55,10 @@ private: double m_averageNPV=0; bool m_doEnergyCorr; //!< switch for energy correction + bool m_doPtResponse; //!< switch for pt response vs pt, if false, use E response vs E + bool m_countOnlyPileupVertices; //!< switch for counting vertices by nTracks or VxType::PileUp bool m_doAxisCorr; //!< switch for eta correction + bool m_usePantauAxis; //!< switch for overwriting calo (eta,phi) with Pantau (eta,phi) bool m_printMissingContainerINFO; bool m_isCaloOnly; //!< switch for CaloOnly corrections diff --git a/Reconstruction/tauRecTools/tauRecTools/TauCommonCalcVars.h b/Reconstruction/tauRecTools/tauRecTools/TauCommonCalcVars.h index c3fe5feac2cd46bb0d2994d6fe0f622d102facc5..57d3a6fc13a1f2d56a6df59c843f9f478f5aab2e 100644 --- a/Reconstruction/tauRecTools/tauRecTools/TauCommonCalcVars.h +++ b/Reconstruction/tauRecTools/tauRecTools/TauCommonCalcVars.h @@ -38,6 +38,9 @@ public: private: std::string m_configPath; + int m_isolationTrackType; + + }; #endif // TAUREC_TAUCOMMONCALCVARS_H diff --git a/PhysicsAnalysis/TauID/TauDiscriminant/TauDiscriminant/TauEleOLRDecorator.h b/Reconstruction/tauRecTools/tauRecTools/TauEleOLRDecorator.h similarity index 100% rename from PhysicsAnalysis/TauID/TauDiscriminant/TauDiscriminant/TauEleOLRDecorator.h rename to Reconstruction/tauRecTools/tauRecTools/TauEleOLRDecorator.h diff --git a/PhysicsAnalysis/TauID/TauDiscriminant/TauDiscriminant/TauIDVarCalculator.h b/Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h similarity index 93% rename from PhysicsAnalysis/TauID/TauDiscriminant/TauDiscriminant/TauIDVarCalculator.h rename to Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h index d9a7277e7dc1d2c7b06a58dc8e7cf3d34ebd4ac4..e19d0cb6dd56c3244cb37f7a85ebbe432447a0fa 100644 --- a/PhysicsAnalysis/TauID/TauDiscriminant/TauDiscriminant/TauIDVarCalculator.h +++ b/Reconstruction/tauRecTools/tauRecTools/TauIDVarCalculator.h @@ -16,7 +16,7 @@ #include "xAODTau/TauJet.h" #include <string> -class TauIDVarCalculator: virtual public TauRecToolBase +class TauIDVarCalculator: public TauRecToolBase { ASG_TOOL_CLASS2(TauIDVarCalculator, TauRecToolBase, ITauToolBase) diff --git a/Reconstruction/tauRecTools/tauRecTools/TauJetBDTEvaluator.h b/Reconstruction/tauRecTools/tauRecTools/TauJetBDTEvaluator.h new file mode 100644 index 0000000000000000000000000000000000000000..2d500e11fd36028f4ca63fcdc49fca94956960d0 --- /dev/null +++ b/Reconstruction/tauRecTools/tauRecTools/TauJetBDTEvaluator.h @@ -0,0 +1,49 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TAURECTOOLS_TAUJETBDTEVALUATOR_H +#define TAURECTOOLS_TAUJETBDTEVALUATOR_H + +// tauRecTools include(s) +#include "tauRecTools/TauRecToolBase.h" +#include "tauRecTools/HelperFunctions.h" + +/** + * @brief Implementation of a generic BDT for tau ID + * @brief Can support dynamic loading of floats attached + * @brief to the tau object, wih a few modifications to + * @brief HelperFunctions TRTBDT, should handle ints too + * @author Justin Griffiths + * + */ + +class TauJetBDTEvaluator +: public TauRecToolBase +{ + public: + ASG_TOOL_CLASS2(TauJetBDTEvaluator, TauRecToolBase, ITauToolBase) + + TauJetBDTEvaluator(const std::string& name="TauJetBDTEvaluator"); + virtual ~TauJetBDTEvaluator() { } + + StatusCode initialize(); + StatusCode execute(xAOD::TauJet& xTau); + StatusCode finalize();// { delete myBdt; delete m_outputVar; return StatusCode::SUCCESS;} + + private: + + std::string m_weightsFile; + std::string m_outputVarName; + SG::AuxElement::Accessor<float>* m_outputVar=0; + + tauRecTools::TRTBDT* m_myBdt=0; + int m_minNTracks; + int m_maxNTracks; + float m_minAbsTrackEta; + float m_maxAbsTrackEta; + float m_dummyValue;// in case no configs are set, set a dummy value. + + bool m_isGrad; +}; +#endif diff --git a/Reconstruction/tauRecTools/tauRecTools/TauWPDecorator.h b/Reconstruction/tauRecTools/tauRecTools/TauWPDecorator.h index a675d85b93cbf66e95059c01b901c1c073521741..a2a612ae249a98645cb528914e7f52b95d5c7231 100644 --- a/Reconstruction/tauRecTools/tauRecTools/TauWPDecorator.h +++ b/Reconstruction/tauRecTools/tauRecTools/TauWPDecorator.h @@ -62,19 +62,31 @@ private: std::map<int, double> m_ymax; // Ugly, but makes configuration easier to read - double m_effVeryLoose1P; - double m_effLoose1P; - double m_effMedium1P; - double m_effTight1P; + //double m_effVeryLoose1P; + //double m_effLoose1P; + //double m_effMedium1P; + //double m_effTight1P; + + //double m_effVeryLoose3P; + //double m_effLoose3P; + //double m_effMedium3P; + //double m_effTight3P; - double m_effVeryLoose3P; - double m_effLoose3P; - double m_effMedium3P; - double m_effTight3P; bool m_defineWP; bool m_electronMode; + std::vector<int> m_cut_bits; + std::vector<float> m_cut_effs_1p; + std::vector<float> m_cut_effs_3p; + + std::vector<std::string> m_decoration_names; + std::vector<float> m_cut_effs_decoration_1p; + std::vector<float> m_cut_effs_decoration_3p; + + std::string m_scoreName; + std::string m_newScoreName; + SG::AuxElement::ConstAccessor<float>* acc_score; SG::AuxElement::Accessor<float>* acc_newScore; diff --git a/Reconstruction/tauRecTools/tauRecTools/ToolsDef.h b/Reconstruction/tauRecTools/tauRecTools/ToolsDef.h index 28c3a2f0a70bed56b69791f7ce725bb22687ab7e..8bfacb614297dca7f3366e64b28e4fb8fa0224e8 100644 --- a/Reconstruction/tauRecTools/tauRecTools/ToolsDef.h +++ b/Reconstruction/tauRecTools/tauRecTools/ToolsDef.h @@ -15,6 +15,9 @@ #include "tauRecTools/TauTrackClassifier.h" #include "tauRecTools/TauChargedPFOCreator.h" #include "tauRecTools/TauWPDecorator.h" +#include "tauRecTools/TauJetBDTEvaluator.h" +#include "tauRecTools/TauIDVarCalculator.h" +#include "tauRecTools/TauEleOLRDecorator.h" REGISTER_TOOL(TauCalibrateLC) REGISTER_TOOL(TauCommonCalcVars) @@ -29,3 +32,6 @@ REGISTER_TOOL(tauRecTools::TauTrackClassifier) REGISTER_TOOL(tauRecTools::TrackMVABDT) REGISTER_TOOL(TauChargedPFOCreator) REGISTER_TOOL(TauWPDecorator) +REGISTER_TOOL(TauJetBDTEvaluator) +REGISTER_TOOL(TauEleOLRDecorator) +REGISTER_TOOL(TauIDVarCalculator) diff --git a/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_muRange.py b/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_muRange.py index 30d76c5bd58a55e441175f8703d2d5652590f357..2e803d470f82f6c464ba5175f8289d91ae8e7324 100644 --- a/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_muRange.py +++ b/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_muRange.py @@ -16,7 +16,11 @@ try: except: digilog.error("Set userRunLumiOverride=\'{\"run\":1234,...}\' in preExec to use configLumi_user.py!") raise RuntimeError("No valid userRunLumiOverride provided.") - +keys=['run','startmu','endmu','stepmu','startlb','timestamp'] +for key in userRunLumiOverride.keys(): + if key not in keys: + raise RuntimeError("Invalid userRunLumiOverride provided, key: %s. Valid keys are: %s"%(key,keys)) + #We need to be able to adjust for different dataset sizes. if not 'ScaleTaskLength' in dir(): ScaleTaskLength = 1 diff --git a/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_run284500_v2.py b/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_run284500_v2.py index 3d33e94896bf56223bf30e1e89ed1c3df6007509..a095ccd1309f5d73af26d9b24a5b6e78d9fdd671 100644 --- a/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_run284500_v2.py +++ b/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_run284500_v2.py @@ -5,14 +5,11 @@ #################### #Run-dependent digi job configuration file. #RunDependentSimData/OverrideRunLBLumiDigitConfig.py - -# WARNING timestamps are derived ad hoc to put them outside run-1 or run-2 periods! +# WARNING timestamps are derived ad hoc to put them outside run-1 or run-2 periods! # This is based on assumptions for beta*=60cm collisions. - #We need to be able to adjust for different dataset sizes. if not 'ScaleTaskLength' in dir(): ScaleTaskLength = 1 _evts = lambda x: int(ScaleTaskLength * x) - if not 'logging' in dir(): import logging digilog = logging.getLogger('Digi_trf') digilog.info('doing RunLumiOverride configuration from file.') @@ -59,9 +56,7 @@ JobMaker=[ {'run':284500, 'lb':40, 'starttstamp':1446541525, 'dt':0.000, 'evts':_evts(13), 'mu':39.5, 'force_new':False}, #--> end hiding ] - include('RunDependentSimData/configCommon.py') - #cleanup python memory if not "RunDMC_testing_configuration" in dir(): del JobMaker diff --git a/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_run284500_v5.py b/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_run284500_v5.py new file mode 100644 index 0000000000000000000000000000000000000000..cd7c4e605c493db0f3080159b4e0c3bd414ccea6 --- /dev/null +++ b/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_run284500_v5.py @@ -0,0 +1,72 @@ +#################### +## File configLumi_run219114.py: autogenerated configuration file from command +##/cvmfs/atlas-nightlies.cern.ch/repo/sw/nightlies/x86_64-slc6-gcc47-opt/devval/rel_1/AtlasSimulation/rel_1/InstallArea/share/bin/RunDepTaskMaker.py --externalDict={0.0:24.0,1.0:31.0, 2.0:38.0,3.0:45.0, 4.0:52.0,5.0:59.0, 6.0:65.0, 7.0:72.0, 8.0:79.0, 9.0:86.0, 10.0:93.0, 11.0:99.0, 12.0:105.0, 13.0:112.0, 14.0:119.0, 15.0:126.0, 16.0:133.0, 17.0:141.0, 18.0:147.0, 19.0:154.0, 20.0:161.0, 21.0:161.0, 22.0:161.0, 23.0:161.0, 24.0:161.0, 25.0:161.0, 26.0:161.0, 27.0:161.0, 28.0:161.0, 29.0:161.0, 30.0:161.0, 31.0:161.0, 32.0:161.0, 33.0:161.0, 34.0:161.0, 35.0:161.0, 36.0:161.0, 37.0:161.0, 38.0:161.0, 39.0:161.0} --lumimethod=EXTERNAL --nMC=1 --trigger=L1_MBTS_2 --outfile=configLumi_run219114.py run219114.xml +## Created on Tue May 20 18:26:16 2014 +#################### +#Run-dependent digi job configuration file. +#RunDependentSimData/OverrideRunLBLumiDigitConfig.py + +# WARNING timestamps are derived ad hoc to put them outside run-1 or run-2 periods! +# This is based on assumptions for beta*=60cm collisions. + +#We need to be able to adjust for different dataset sizes. +if not 'ScaleTaskLength' in dir(): ScaleTaskLength = 1 +_evts = lambda x: int(ScaleTaskLength * x) + +if not 'logging' in dir(): import logging +digilog = logging.getLogger('Digi_trf') +digilog.info('doing RunLumiOverride configuration from file.') +JobMaker=[ + {'run':284500, 'lb':1, 'starttstamp':1446539185, 'dt':0.000, 'evts':_evts(0), 'mu':0.5, 'force_new':False}, + {'run':284500, 'lb':2, 'starttstamp':1446539245, 'dt':0.000, 'evts':_evts(0), 'mu':1.5, 'force_new':False}, + {'run':284500, 'lb':3, 'starttstamp':1446539305, 'dt':0.000, 'evts':_evts(0), 'mu':2.5, 'force_new':False}, + {'run':284500, 'lb':4, 'starttstamp':1446539365, 'dt':0.000, 'evts':_evts(0), 'mu':3.5, 'force_new':False}, + {'run':284500, 'lb':5, 'starttstamp':1446539425, 'dt':0.000, 'evts':_evts(0), 'mu':4.5, 'force_new':False}, + {'run':284500, 'lb':6, 'starttstamp':1446539485, 'dt':0.000, 'evts':_evts(0), 'mu':5.5, 'force_new':False}, + {'run':284500, 'lb':7, 'starttstamp':1446539545, 'dt':0.000, 'evts':_evts(0), 'mu':6.5, 'force_new':False}, + {'run':284500, 'lb':8, 'starttstamp':1446539605, 'dt':0.000, 'evts':_evts(0), 'mu':7.5, 'force_new':False}, + {'run':284500, 'lb':9, 'starttstamp':1446539665, 'dt':0.000, 'evts':_evts(0), 'mu':8.5, 'force_new':False}, + {'run':284500, 'lb':10, 'starttstamp':1446539725, 'dt':0.000, 'evts':_evts(1), 'mu':9.5, 'force_new':False}, + {'run':284500, 'lb':11, 'starttstamp':1446539785, 'dt':0.000, 'evts':_evts(2), 'mu':10.5, 'force_new':False}, + {'run':284500, 'lb':12, 'starttstamp':1446539845, 'dt':0.000, 'evts':_evts(11), 'mu':11.5, 'force_new':False}, + {'run':284500, 'lb':13, 'starttstamp':1446539905, 'dt':0.000, 'evts':_evts(17), 'mu':12.5, 'force_new':False}, + {'run':284500, 'lb':14, 'starttstamp':1446539965, 'dt':0.000, 'evts':_evts(25), 'mu':13.5, 'force_new':False}, + {'run':284500, 'lb':15, 'starttstamp':1446540025, 'dt':0.000, 'evts':_evts(30), 'mu':14.5, 'force_new':False}, + {'run':284500, 'lb':16, 'starttstamp':1446540085, 'dt':0.000, 'evts':_evts(34), 'mu':15.5, 'force_new':False}, + {'run':284500, 'lb':17, 'starttstamp':1446540145, 'dt':0.000, 'evts':_evts(36), 'mu':16.5, 'force_new':False}, + {'run':284500, 'lb':18, 'starttstamp':1446540205, 'dt':0.000, 'evts':_evts(36), 'mu':17.5, 'force_new':False}, + {'run':284500, 'lb':19, 'starttstamp':1446540265, 'dt':0.000, 'evts':_evts(40), 'mu':18.5, 'force_new':False}, + {'run':284500, 'lb':20, 'starttstamp':1446540325, 'dt':0.000, 'evts':_evts(46), 'mu':19.5, 'force_new':False}, + {'run':284500, 'lb':21, 'starttstamp':1446540385, 'dt':0.000, 'evts':_evts(48), 'mu':20.5, 'force_new':False}, + {'run':284500, 'lb':22, 'starttstamp':1446540445, 'dt':0.000, 'evts':_evts(49), 'mu':21.5, 'force_new':False}, + {'run':284500, 'lb':23, 'starttstamp':1446540505, 'dt':0.000, 'evts':_evts(49), 'mu':22.5, 'force_new':False}, + {'run':284500, 'lb':24, 'starttstamp':1446540565, 'dt':0.000, 'evts':_evts(46), 'mu':23.5, 'force_new':False}, + {'run':284500, 'lb':25, 'starttstamp':1446540625, 'dt':0.000, 'evts':_evts(49), 'mu':24.5, 'force_new':False}, + {'run':284500, 'lb':26, 'starttstamp':1446540685, 'dt':0.000, 'evts':_evts(49), 'mu':25.5, 'force_new':False}, + {'run':284500, 'lb':27, 'starttstamp':1446540745, 'dt':0.000, 'evts':_evts(56), 'mu':26.5, 'force_new':False}, + {'run':284500, 'lb':28, 'starttstamp':1446540805, 'dt':0.000, 'evts':_evts(45), 'mu':27.5, 'force_new':False}, + {'run':284500, 'lb':29, 'starttstamp':1446540865, 'dt':0.000, 'evts':_evts(45), 'mu':28.5, 'force_new':False}, + {'run':284500, 'lb':30, 'starttstamp':1446540925, 'dt':0.000, 'evts':_evts(45), 'mu':29.5, 'force_new':False}, + {'run':284500, 'lb':31, 'starttstamp':1446540985, 'dt':0.000, 'evts':_evts(40), 'mu':30.5, 'force_new':False}, + {'run':284500, 'lb':32, 'starttstamp':1446541045, 'dt':0.000, 'evts':_evts(38), 'mu':31.5, 'force_new':False}, + {'run':284500, 'lb':33, 'starttstamp':1446541105, 'dt':0.000, 'evts':_evts(34), 'mu':32.5, 'force_new':False}, + {'run':284500, 'lb':34, 'starttstamp':1446541165, 'dt':0.000, 'evts':_evts(31), 'mu':33.5, 'force_new':False}, + {'run':284500, 'lb':35, 'starttstamp':1446541225, 'dt':0.000, 'evts':_evts(27), 'mu':34.5, 'force_new':False}, + {'run':284500, 'lb':36, 'starttstamp':1446541285, 'dt':0.000, 'evts':_evts(20), 'mu':35.5, 'force_new':False}, + {'run':284500, 'lb':37, 'starttstamp':1446541345, 'dt':0.000, 'evts':_evts(13), 'mu':36.5, 'force_new':False}, + {'run':284500, 'lb':38, 'starttstamp':1446541405, 'dt':0.000, 'evts':_evts(11), 'mu':37.5, 'force_new':False}, + {'run':284500, 'lb':39, 'starttstamp':1446541465, 'dt':0.000, 'evts':_evts(8), 'mu':38.5, 'force_new':False}, + {'run':284500, 'lb':40, 'starttstamp':1446541525, 'dt':0.000, 'evts':_evts(7), 'mu':39.5, 'force_new':False}, + {'run':284500, 'lb':41, 'starttstamp':1446541585, 'dt':0.000, 'evts':_evts(6), 'mu':40.5, 'force_new':False}, + {'run':284500, 'lb':42, 'starttstamp':1446541645, 'dt':0.000, 'evts':_evts(4), 'mu':41.5, 'force_new':False}, + {'run':284500, 'lb':43, 'starttstamp':1446541705, 'dt':0.000, 'evts':_evts(2), 'mu':42.5, 'force_new':False}, + {'run':284500, 'lb':44, 'starttstamp':1446541765, 'dt':0.000, 'evts':_evts(0), 'mu':43.5, 'force_new':False}, + {'run':284500, 'lb':45, 'starttstamp':1446541825, 'dt':0.000, 'evts':_evts(0), 'mu':44.5, 'force_new':False}, + #--> end hiding +] + +include('RunDependentSimData/configCommon.py') + +#cleanup python memory +if not "RunDMC_testing_configuration" in dir(): + del JobMaker diff --git a/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_user.py b/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_user.py index ece92eec353a558809735d0ece803af0035ee430..ca35d9ab9798c3aa82372e53f4e776a841ca12ad 100644 --- a/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_user.py +++ b/Simulation/RunDependentSim/RunDependentSimData/share/configLumi_user.py @@ -15,6 +15,10 @@ try: except: digilog.error("Set userRunLumiOverride=\'{\"run\":1234,...}\' in preExec to use configLumi_user.py!") raise RuntimeError("No valid userRunLumiOverride provided.") +keys=['run','startmu','endmu','stepmu','startlb','timestamp'] +for key in userRunLumiOverride.keys(): + if key not in keys: + raise RuntimeError("Invalid userRunLumiOverride provided, key: %s. Valid keys are: %s"%(key,keys)) #We need to be able to adjust for different dataset sizes. if not 'ScaleTaskLength' in dir(): ScaleTaskLength = 1 diff --git a/Simulation/SimulationJobOptions/share/cavern/preInclude.G4WriteCavern.py b/Simulation/SimulationJobOptions/share/cavern/preInclude.G4WriteCavern.py index 3c80c607b2565cac1baa7fdbd9938b76bce2a454..f8695261086cdb4a04b7a7576249f6c90503493e 100644 --- a/Simulation/SimulationJobOptions/share/cavern/preInclude.G4WriteCavern.py +++ b/Simulation/SimulationJobOptions/share/cavern/preInclude.G4WriteCavern.py @@ -6,8 +6,8 @@ simFlags.NeutronTimeCut = int(2**31 - 1) #probably not required. simFlags.NeutronTimeCut.set_Off() simFlags.CavernBG = 'Write' if 'runArgs' in dir(): - if hasattr(runArgs,'outputEVNT_CAVERNTRFile'): - simFlags.WriteTR = runArgs.outputEVNT_CAVERNTRFile + if hasattr(runArgs,'outputEVNT_TRFile'): + simFlags.WriteTR = runArgs.outputEVNT_TRFile elif hasattr(runArgs,'outputTrackRecordFile'): simFlags.WriteTR = runArgs.outputTrackRecordFile elif hasattr(runArgs,'outputEvgenFile'): diff --git a/Simulation/SimulationJobOptions/share/cavern/preInclude.G4WriteWorld.py b/Simulation/SimulationJobOptions/share/cavern/preInclude.G4WriteWorld.py index fe19e36599af2f9d3412e6c026bf2fdc8b68e5d6..1f5af72f314d06066d1619e3ef12efb20cfb8453 100644 --- a/Simulation/SimulationJobOptions/share/cavern/preInclude.G4WriteWorld.py +++ b/Simulation/SimulationJobOptions/share/cavern/preInclude.G4WriteWorld.py @@ -5,8 +5,8 @@ simFlags.NeutronTimeCut = int(2**31 - 1) #probably not required. simFlags.NeutronTimeCut.set_Off() simFlags.CavernBG = 'WriteWorld' if 'runArgs' in dir(): - if hasattr(runArgs,'outputEVNT_CAVERNTRFile'): - simFlags.WriteTR = runArgs.outputEVNT_CAVERNTRFile + if hasattr(runArgs,'outputEVNT_TRFile'): + simFlags.WriteTR = runArgs.outputEVNT_TRFile elif hasattr(runArgs,'outputTrackRecordFile'): simFlags.WriteTR = runArgs.outputTrackRecordFile elif hasattr(runArgs,'outputEvgenFile'): diff --git a/Simulation/SimulationJobOptions/share/g4/preInclude.G4FluxRecording.py b/Simulation/SimulationJobOptions/share/g4/preInclude.G4FluxRecording.py index 08dc0a85eba67a90ad6804be79000a48a8663468..a0e84d56e97b3431e789e366f6ad1fbbafd8c117 100644 --- a/Simulation/SimulationJobOptions/share/g4/preInclude.G4FluxRecording.py +++ b/Simulation/SimulationJobOptions/share/g4/preInclude.G4FluxRecording.py @@ -7,8 +7,8 @@ simFlags.NeutronTimeCut = int(2**31 - 1) #probably not required. simFlags.NeutronTimeCut.set_Off() simFlags.CavernBG = 'Write' if 'runArgs' in dir(): - if hasattr(runArgs,'outputEVNT_CAVERNTRFile'): - simFlags.WriteTR = runArgs.outputEVNT_CAVERNTRFile + if hasattr(runArgs,'outputEVNT_TRFile'): + simFlags.WriteTR = runArgs.outputEVNT_TRFile elif hasattr(runArgs,'outputTrackRecordFile'): simFlags.WriteTR = runArgs.outputTrackRecordFile elif hasattr(runArgs,'outputEvgenFile'): diff --git a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.GMSB.py b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.GMSB.py index 2c462a3ec9b32c631bdc2b38b1b40f558b3e91fa..dee4b888a4cd52a154d75eabb81b329ebb6a3249 100644 --- a/Simulation/SimulationJobOptions/share/specialConfig/preInclude.GMSB.py +++ b/Simulation/SimulationJobOptions/share/specialConfig/preInclude.GMSB.py @@ -1,9 +1,9 @@ ################################################################# -# preInclude.GMSB.py - Chiara Debenedetti, 3 Jun 2011 # +# preInclude.GMSB.py - Sascha Mehlhase, 6 Jul 2016 # ################################################################# def get_and_fix_PDGTABLE(replace): - import os, shutil + import os, shutil, re # Download generic PDGTABLE (overwrite existing one if it exists) os.system('get_files -remove -data PDGTABLE.MeV') @@ -12,56 +12,97 @@ def get_and_fix_PDGTABLE(replace): # an example line to illustrate the fixed format, see PDGTABLE.MeV for more details # M 1000022 0.E+00 +0.0E+00 -0.0E+00 ~chi(0,1) 0 - update = open('PDGTABLE.MeV', 'w') - for l in open('PDGTABLE.MeV.org'): - - for r in replace: - if l.find(r[1]) > -1: - ll = l.split() - - if ll[0] == r[0] and ll[1] == r[1]: - l = l[0:35] + ('%11.5E' % r[2]).strip().ljust(14) + l[49:] - continue + lines = open('PDGTABLE.MeV.org').readlines() + for pdgid,mass,name,charge in replace: + if not re.search(r'[MW]\s+'+str(pdgid)+'\s+\S+', ''.join(lines)): + lines.append('M' + str(pdgid).rjust(8) +''.ljust(26) + + ('%11.5E' % mass).ljust(15) + + '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) + + name.strip() + ''.ljust(6) + charge.strip() + '\n') + lines.append('W' + str(pdgid).rjust(8) +''.ljust(26) + + '0.E+00'.ljust(15) + '+0.0E+00'.ljust(9) + '-0.0E+00'.ljust(9) + + name.strip() + ''.ljust(6) + charge.strip() + '\n') + else: + for i in xrange(len(lines)): + if re.search(r'M\s+'+str(pdgid)+'\s+\S+', lines[i]): + l = lines[i] + lines[i] = l[0:35] + ('%11.5E' % mass).ljust(14) + l[49:] - update.write(l) + update = open('PDGTABLE.MeV', 'w') + update.write(''.join(lines)) update.close() + + print 'modfied PDGTABLE\n%s\n' % ''.join(lines) def load_files_for_GMSB_scenario(simdict): GMSBIndex = int(simdict["GMSBIndex"]) - + if GMSBIndex == 1: - get_and_fix_PDGTABLE([('M', '1000022', eval(simdict["GMSBNeutralino"])), ('M', '1000039', eval(simdict.get("GMSBGravitino",'0')))]) + # get_and_fix_PDGTABLE([('M', '1000022', eval(simdict["GMSBNeutralino"])), ('M', '1000039', eval(simdict.get("GMSBGravitino",'0')))]) + get_and_fix_PDGTABLE([ + (1000022, eval(simdict["GMSBNeutralino"]), '~chi(0,1)', '0'), + (1000039, eval(simdict.get("GMSBGravitino",'0')), '~G', '0') + ]) elif GMSBIndex == 2: m_stau = eval(simdict["GMSBStau"]) m_slepton = eval(simdict["GMSBSlepton"]) - get_and_fix_PDGTABLE([('M', '1000015', m_stau), ('M', '2000011', m_slepton), ('M', '2000013', m_slepton)]) + # get_and_fix_PDGTABLE([('M', '1000015', m_stau), ('M', '2000011', m_slepton), ('M', '2000013', m_slepton)]) + get_and_fix_PDGTABLE([ + (1000015, m_stau, '~tau(L)', '-'), + (2000011, m_slepton, '~e(R)', '-'), + (2000013, m_slepton, '~mu(R)', '-') + ]) elif GMSBIndex == 3: - m_stau = eval(simdict["GMSBStau"]) + m_stau = eval(simdict["GMSBStau"]) m_slepton = eval(simdict["GMSBSlepton"]) - m_squark = eval(simdict["SQUARKMASS"]) - m_neutralino = eval(simdict["NEUTRALINOMASS"]) - m_gluino = eval(simdict["GLUINOMASS"]) - get_and_fix_PDGTABLE([('M', '1000001', m_squark), ('M', '2000001', m_squark), ('M', '1000002', m_squark), \ - ('M', '2000002', m_squark), ('M', '1000022', m_neutralino), ('M', '1000021', m_gluino), \ - ('M', '1000003', 1.00E+04 ), ('M', '2000003', 1.00E+04 ), ('M', '1000004', 1.00E+04 ), \ - ('M', '2000004', 1.00E+04 ), ('M', '1000005', 1.00E+04 ), ('M', '2000005', 1.00E+04 ), \ - ('M', '1000006', 1.00E+04 ), ('M', '2000006', 1.00E+04 ), ('M', '1000011', 2.50E+02 ), \ - ('M', '1000012', 1.00E+04 ), ('M', '1000013', 2.50E+02 ), ('M', '1000014', 1.00E+04 ), \ - ('M', '1000015', m_stau ), ('M', '1000016', 1.00E+04 ), ('M', '2000011', m_slepton ), \ - ('M', '2000013', m_slepton ), ('M', '2000015', 2.50E+02 ), ('M', '1000023', 1.00E+04 ), \ - ('M', '1000024', 1.00E+04 ), ('M', '1000025', -1.0E+04 ), ('M', '1000035', 1.00E+04 ), \ - ('M', '1000037', 1.00E+04 ) ]) - + m_squark = eval(simdict["SQUARKMASS"]) + m_neutralino = eval(simdict["NEUTRALINOMASS"]) + m_gluino = eval(simdict["GLUINOMASS"]) + # get_and_fix_PDGTABLE([('M', '1000001', m_squark), ('M', '2000001', m_squark), ('M', '1000002', m_squark), \ + # ('M', '2000002', m_squark), ('M', '1000022', m_neutralino), ('M', '1000021', m_gluino), \ + # ('M', '1000003', 1.00E+04 ), ('M', '2000003', 1.00E+04 ), ('M', '1000004', 1.00E+04 ), \ + # ('M', '2000004', 1.00E+04 ), ('M', '1000005', 1.00E+04 ), ('M', '2000005', 1.00E+04 ), \ + # ('M', '1000006', 1.00E+04 ), ('M', '2000006', 1.00E+04 ), ('M', '1000011', 2.50E+02 ), \ + # ('M', '1000012', 1.00E+04 ), ('M', '1000013', 2.50E+02 ), ('M', '1000014', 1.00E+04 ), \ + # ('M', '1000015', m_stau ), ('M', '1000016', 1.00E+04 ), ('M', '2000011', m_slepton ), \ + # ('M', '2000013', m_slepton ), ('M', '2000015', 2.50E+02 ), ('M', '1000023', 1.00E+04 ), \ + # ('M', '1000024', 1.00E+04 ), ('M', '1000025', -1.0E+04 ), ('M', '1000035', 1.00E+04 ), \ + # ('M', '1000037', 1.00E+04 ) ]) + get_and_fix_PDGTABLE([ + (1000001, m_squark, '~d(L)', '-1/3'), (2000001, m_squark, '~d(R)', '-1/3'), + (1000002, m_squark, '~u(L)', '+2/3'), (2000002, m_squark, '~u(R)', '+2/3'), + (1000003, 1.00E+04, '~s(L)', '-1/3'), (2000003, 1.00E+04, '~s(R)', '-1/3'), + (1000004, 1.00E+04, '~c(L)', '+2/3'), (2000004, 1.00E+04, '~c(R)', '+2/3'), + (1000005, 1.00E+04, '~b(1)', '-1/3'), (2000005, 1.00E+04, '~b(2)', '-1/3'), + (1000006, 1.00E+04, '~t(1)', '+2/3'), (2000006, 1.00E+04, '~t(2)', '+2/3'), + (1000011, 2.50E+02, '~e(L)', '-'), (2000011, m_slepton, '~e(R)', '-'), + (1000012, 1.00E+04, '~nu(e,L)', '0'), + (1000013, 2.50E+02, '~mu(L)', '-'), (2000013, m_slepton, '~mu(R)', '-'), + (1000014, 1.00E+04, '~nu(e,L)', '0'), + (1000015, m_stau, '~tau(L)', '-'), (2000015, 2.50E+02, '~tau(R)', '-'), + (1000016, 1.00E+04, '~nu(tau,L)', '0'), + (1000021, m_gluino, '~g', '0'), + (1000022, m_neutralino, '~chi(0,1)', '0'), + (1000023, 1.00E+04, '~chi(0,2)', '0'), + (1000024, 1.00E+04, '~chi(+,1)', '+'), + (1000025, -1.00E+04, '~chi(0,3)', '0'), + (1000035, 1.00E+04, '~chi(0,4)', '0'), + (1000037, 1.00E+04, '~chi(+,2)', '+') + ]) + elif GMSBIndex == 4: - get_and_fix_PDGTABLE([('M', '1000015', eval(simdict["GMSBStau"]))]) + # get_and_fix_PDGTABLE([('M', '1000015', eval(simdict["GMSBStau"]))]) + get_and_fix_PDGTABLE([ + (1000015, m_stau, '~tau(L)', '-') + ]) else: print 'GMSBIndex %i not supported' % GMSBIndex raise - + doG4SimConfig = True from AthenaCommon.AthenaCommonFlags import athenaCommonFlags import PyUtils.AthFile as af @@ -73,11 +114,11 @@ try: simdict = digitizationFlags.specialConfiguration.get_Value() doG4SimConfig = False else: - from G4AtlasApps.SimFlags import simFlags - simdict = simFlags.specialConfiguration.get_Value() + from G4AtlasApps import AtlasG4Eng + simdict = AtlasG4Eng.G4Eng.Dict_SpecialConfiguration except: - from G4AtlasApps.SimFlags import simFlags - simdict = simFlags.specialConfiguration.get_Value() + from G4AtlasApps import AtlasG4Eng + simdict = AtlasG4Eng.G4Eng.Dict_SpecialConfiguration assert "GMSBIndex" in simdict #if 2525 == simdict["GMSBIndex"]: @@ -89,7 +130,7 @@ if doG4SimConfig: def gmsb_processlist(): from G4AtlasApps import AtlasG4Eng AtlasG4Eng.G4Eng.gbl.G4Commands().process.list() - + simFlags.InitFunctions.add_function("postInit", gmsb_processlist) def gmsb_setparams(): @@ -98,14 +139,57 @@ if doG4SimConfig: ## Assuming that GMSBIndex is an int here... GMSBIndex = int(AtlasG4Eng.G4Eng.Dict_SpecialConfiguration["GMSBIndex"]) + + def modify_slepton_mass(name, mass): + slepton = AtlasG4Eng.G4Eng.gbl.ParticleDataModifier(name) + slepton.SetParticleMass(mass) + if GMSBIndex == 1: # generic neutralino to photon scenario - from G4AtlasApps.SimFlags import simFlags - simFlags.PhysicsOptions += ["GauginosPhysicsTool"] + GMSBNeutralino = eval(AtlasG4Eng.G4Eng.Dict_SpecialConfiguration["GMSBNeutralino"]) + GMSBTime = eval(AtlasG4Eng.G4Eng.Dict_SpecialConfiguration["GMSBLifeTime"]) + AtlasG4Eng.G4Eng.log.info("Generic GMSB neutralino to photon scenario (mass=%s MeV/time=%s ns)" % (GMSBNeutralino, GMSBTime)) + + AtlasG4Eng.G4Eng._ctrl.load("Gauginos") + NLsp=AtlasG4Eng.G4Eng.gbl.ParticleDataModifier("s_chi_0_1") + NLsp.SetParticleMass(GMSBNeutralino) + NLsp.SetParticleLifeTime(GMSBTime) + NLsp.Stable(False) + NLsp.AddDecayChannel("s_chi_0_1",1.,"s_G=gamma") + + if AtlasG4Eng.G4Eng.Dict_SpecialConfiguration.has_key("GMSBGravitino"): + GMSBGravitino = eval(AtlasG4Eng.G4Eng.Dict_SpecialConfiguration["GMSBGravitino"]) + AtlasG4Eng.G4Eng.log.info("Adding gravitino mass (gravitino mass=%s keV)" % (GMSBGravitino*1E3)) + + Lsp=AtlasG4Eng.G4Eng.gbl.ParticleDataModifier("s_G") + Lsp.SetParticleMass(GMSBGravitino) + + del GMSBGravitino + + del GMSBNeutralino, GMSBTime + elif GMSBIndex == 2 or GMSBIndex == 3 or GMSBIndex == 4: # generic stau scenario - from G4AtlasApps.SimFlags import simFlags - simFlags.PhysicsOptions += ["SleptonsPhysicsTool"] + + GMSBStau = eval(AtlasG4Eng.G4Eng.Dict_SpecialConfiguration["GMSBStau"]) + AtlasG4Eng.G4Eng.log.info("Generic GMSB stau scenario (stau=%s MeV)" % GMSBStau) + + AtlasG4Eng.G4Eng._ctrl.load("Sleptons") + modify_slepton_mass("s_tau_plus_1", GMSBStau) + modify_slepton_mass("s_tau_minus_1", GMSBStau) + + if AtlasG4Eng.G4Eng.Dict_SpecialConfiguration.has_key("GMSBSlepton"): + GMSBSlepton = eval(AtlasG4Eng.G4Eng.Dict_SpecialConfiguration.get("GMSBSlepton", None)) + AtlasG4Eng.G4Eng.log.info("Adding slepton mass to GMSB stau scenario (slepton=%s MeV)" % GMSBSlepton) + + modify_slepton_mass("s_mu_plus_R", GMSBSlepton) + modify_slepton_mass("s_mu_minus_R", GMSBSlepton) + modify_slepton_mass("s_e_plus_R", GMSBSlepton) + modify_slepton_mass("s_e_minus_R", GMSBSlepton) + + del GMSBSlepton + + del GMSBStau del GMSBIndex @@ -121,3 +205,4 @@ if doG4SimConfig: simFlags.InitFunctions.add_function("postInit", gmsb_applycalomctruthstrategy) del doG4SimConfig, simdict + diff --git a/Simulation/Tools/HitAnalysis/CMakeLists.txt b/Simulation/Tools/HitAnalysis/CMakeLists.txt index 4c38d7c1c047a4da322fb7613859b2236ffb0bed..adacc0f9cafdb7c0670c24fe00fff63b5e8cddae 100644 --- a/Simulation/Tools/HitAnalysis/CMakeLists.txt +++ b/Simulation/Tools/HitAnalysis/CMakeLists.txt @@ -7,20 +7,29 @@ atlas_subdir( HitAnalysis ) # Declare the package's dependencies: atlas_depends_on_subdirs( PUBLIC - Control/AthenaBaseComps - Control/StoreGate GaudiKernel PRIVATE Calorimeter/CaloDetDescr Calorimeter/CaloIdentifier + Calorimeter/CaloSimEvent + Control/AthenaBaseComps DetectorDescription/GeoModel/GeoAdaptors Event/EventInfo + ForwardDetectors/AFP/AFP_SimEv + ForwardDetectors/ALFA/ALFA_SimEv + ForwardDetectors/LUCID/LUCID_SimUtils/LUCID_SimEvent + ForwardDetectors/ZDC/ZDC_SimEvent + Generators/GeneratorObjects + InnerDetector/InDetSimEvent LArCalorimeter/LArSimEvent + MuonSpectrometer/MuonSimEvent + Simulation/G4Sim/TrackRecord TileCalorimeter/TileDetDescr TileCalorimeter/TileSimEvent ) # External dependencies: find_package( CLHEP ) +find_package( HepMC ) find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread Table MathMore Minuit Minuit2 Matrix Physics HistPainter Rint Graf Graf3d Gpad Html Postscript Gui GX11TTF GX11 ) # tag ROOTBasicLibs was not recognized in automatic conversion in cmt2cmake @@ -31,8 +40,8 @@ find_package( ROOT COMPONENTS Core Tree MathCore Hist RIO pthread Table MathMore atlas_add_component( HitAnalysis src/*.cxx src/components/*.cxx - INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps StoreGateLib SGtests GaudiKernel CaloDetDescrLib CaloIdentifier GeoAdaptors EventInfo LArSimEvent TileDetDescr TileSimEvent ) + INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} ${HEPMC_INCLUDE_DIRS} + LINK_LIBRARIES ${ROOT_LIBRARIES} ${CLHEP_LIBRARIES} ${HEPMC_LIBRARIES} GaudiKernel CaloDetDescrLib CaloIdentifier CaloSimEvent AthenaBaseComps GeoAdaptors EventInfo AFP_SimEv ALFA_SimEv LUCID_SimEvent ZDC_SimEvent GeneratorObjects InDetSimEvent LArSimEvent MuonSimEvent TileDetDescr TileSimEvent ) # Install files from the package: atlas_install_headers( HitAnalysis ) diff --git a/Simulation/Tools/HitAnalysis/HitAnalysis/CaloHitAnalysis.h b/Simulation/Tools/HitAnalysis/HitAnalysis/CaloHitAnalysis.h deleted file mode 100755 index 946093b3948c937c81a75bc65850f4257723027b..0000000000000000000000000000000000000000 --- a/Simulation/Tools/HitAnalysis/HitAnalysis/CaloHitAnalysis.h +++ /dev/null @@ -1,59 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -#ifndef CALO_HIT_ANALYSIS_H -#define CALO_HIT_ANALYSIS_H - -#include "GaudiKernel/ToolHandle.h" -#include "GaudiKernel/Algorithm.h" -#include "GaudiKernel/ObjectVector.h" -#include "CLHEP/Units/SystemOfUnits.h" -#include "StoreGate/StoreGateSvc.h" - -#include "AthenaBaseComps/AthAlgorithm.h" - -#include <string> - -#include "TH1.h" - -class TileID; -class TileDetDescrManager; -class TTree; -class ITHistSvc; - -class CaloHitAnalysis : public AthAlgorithm { - - public: - - CaloHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator); - ~CaloHitAnalysis(); - - virtual StatusCode initialize(); - virtual StatusCode finalize(); - virtual StatusCode execute(); - - private: - - /** a handle on Store Gate for access to the Event Store */ - StoreGateSvc* m_storeGate; - - /** Simple variables by Ketevi */ - std::vector<float>* m_cell_eta; - std::vector<float>* m_cell_phi; - std::vector<float>* m_cell_e; - std::vector<float>* m_cell_radius; - - TTree * m_tree; - std::string m_ntupleFileName; - std::string m_ntupleDirName; - std::string m_ntupleTreeName; - - ITHistSvc * m_thistSvc; - - const TileID * m_tileID; - const TileDetDescrManager * m_tileMgr; -}; - -#endif // CALO_HIT_ANALYSIS_H - diff --git a/Simulation/Tools/HitAnalysis/cmt/requirements b/Simulation/Tools/HitAnalysis/cmt/requirements index df7ce418dc34978a5164af242a057dbd6cdb8a03..1d8154fcff756ad12a02f8090a24ad1f80259391 100755 --- a/Simulation/Tools/HitAnalysis/cmt/requirements +++ b/Simulation/Tools/HitAnalysis/cmt/requirements @@ -7,21 +7,29 @@ use AtlasPolicy AtlasPolicy-* branches run use GaudiInterface GaudiInterface-* External -use AtlasCLHEP AtlasCLHEP-* External use AtlasROOT AtlasROOT-* External -use StoreGate StoreGate-* Control - -use AthenaBaseComps AthenaBaseComps-* Control - private -use TileSimEvent TileSimEvent-* TileCalorimeter -use TileDetDescr TileDetDescr-* TileCalorimeter -use LArSimEvent LArSimEvent-* LArCalorimeter -use GeoAdaptors GeoAdaptors-* DetectorDescription/GeoModel -use CaloIdentifier CaloIdentifier-* Calorimeter -use CaloDetDescr CaloDetDescr-* Calorimeter -use EventInfo EventInfo-* Event +use AthenaBaseComps AthenaBaseComps-* Control +use InDetSimEvent InDetSimEvent-* InnerDetector +use TileSimEvent TileSimEvent-* TileCalorimeter +use TileDetDescr TileDetDescr-* TileCalorimeter +use LArSimEvent LArSimEvent-* LArCalorimeter +use GeoAdaptors GeoAdaptors-* DetectorDescription/GeoModel +use CaloIdentifier CaloIdentifier-* Calorimeter +use CaloDetDescr CaloDetDescr-* Calorimeter +use CaloSimEvent CaloSimEvent-* Calorimeter +use InDetSimEvent InDetSimEvent-* InnerDetector +use MuonSimEvent MuonSimEvent-* MuonSpectrometer +use AtlasCLHEP AtlasCLHEP-* External +use EventInfo EventInfo-* Event +use AtlasHepMC AtlasHepMC-* External +use GeneratorObjects GeneratorObjects-* Generators +use TrackRecord TrackRecord-* Simulation/G4Sim +use ALFA_SimEv ALFA_SimEv-* ForwardDetectors/ALFA +use LUCID_SimEvent LUCID_SimEvent-* ForwardDetectors/LUCID/LUCID_SimUtils +use ZDC_SimEvent ZDC_SimEvent-* ForwardDetectors/ZDC +use AFP_SimEv AFP_SimEv-* ForwardDetectors/AFP end_private use AtlasSimulationRunTime AtlasSimulationRunTime-* diff --git a/Simulation/Tools/HitAnalysis/share/AFPHitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/AFPHitAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..2afbcca4cdb77defa0e2bd4de9df3fd27e423b30 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/AFPHitAnalysis_topOptions.py @@ -0,0 +1,44 @@ +#from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +import AthenaPoolCnvSvc.ReadAthenaPool + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"HITS*root*" ) +ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # This is stupid and redundant, but necessary + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from HitAnalysis.HitAnalysisConf import AFPHitAnalysis +topSequence += AFPHitAnalysis() +AFPHitAnalysis = AFPHitAnalysis() +AFPHitAnalysis.NtupleFileName = '/AFPHitAnalysis/ntuples/' +AFPHitAnalysis.HistPath = '/AFPHitAnalysis/histos/' + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +ServiceMgr.THistSvc.Output += [ "AFPHitAnalysis DATAFILE='AFPHitAnalysis.root' OPT='RECREATE'" ] + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = FALSE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include("TrkDetDescrSvc/AtlasTrackingGeometrySvc.py") # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/share/ALFAHitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/ALFAHitAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..05ece5efe46658e466076b68e58401a4c7622553 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/ALFAHitAnalysis_topOptions.py @@ -0,0 +1,43 @@ +#from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +import AthenaPoolCnvSvc.ReadAthenaPool + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"HITS*root*" ) +ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # This is stupid and redundant, but necessary + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from HitAnalysis.HitAnalysisConf import ALFAHitAnalysis +topSequence += ALFAHitAnalysis() +ALFAHitAnalysis = ALFAHitAnalysis() +ALFAHitAnalysis.HistPath = '/ALFAHitAnalysis/' + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +ServiceMgr.THistSvc.Output += [ "ALFAHitAnalysis DATAFILE='ALFAHitAnalysis.root' OPT='RECREATE'" ] + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = FALSE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include("TrkDetDescrSvc/AtlasTrackingGeometrySvc.py") # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/share/AllHitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/AllHitAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..54b3b85785444b952715d591f944b1a53fb96924 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/AllHitAnalysis_topOptions.py @@ -0,0 +1,104 @@ +#from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +import AthenaPoolCnvSvc.ReadAthenaPool + + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = glob( "/afs/cern.ch/work/a/ancuetog/HitsAreas/20.3.X.Y-VAL-r3/atlasG4_10ttbar_20.3.X.Y-VAL-r3-modtime.NoFrozenShower.DeadLAr.hits.pool.root" ) +#athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"HITS*root*" ) +ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() +from HitAnalysis.HitAnalysisConf import * + +topSequence += SiHitAnalysis('PixelHitAnalysis') +topSequence.PixelHitAnalysis.CollectionName='PixelHits' +topSequence += SiHitAnalysis('SCTHitAnalysis') +topSequence.SCTHitAnalysis.CollectionName='SCT_Hits' +topSequence += SiHitAnalysis('BCMHitAnalysis') +topSequence.BCMHitAnalysis.CollectionName='BCMHits' +topSequence += SiHitAnalysis('BLMHitAnalysis') +topSequence.BLMHitAnalysis.CollectionName='BLMHits' +topSequence += TRTHitAnalysis('TRTHitAnalysis') +topSequence += RPCHitAnalysis('RPCHitAnalysis') +topSequence += MDTHitAnalysis('MDTHitAnalysis') +topSequence += CSCHitAnalysis('CSCHitAnalysis') +topSequence += TGCHitAnalysis('TGCHitAnalysis') +#topSequence += ALFAHitAnalysis('ALFAHitAnalysis') +#topSequence += LucidHitAnalysis('LucidHitAnalysis') +#topSequence += ZDCHitAnalysis('ZDCHitAnalysis') +topSequence += TrackRecordAnalysis('TrackRecordAnalysis') +topSequence += TruthHitAnalysis('TruthHitAnalysis') +topSequence += CaloHitAnalysis('CaloHitAnalysis') + + + +topSequence.PixelHitAnalysis.HistPath='/HitAnalysis/Pixel/histos/' +topSequence.SCTHitAnalysis.HistPath='/HitAnalysis/SCT/histos/' +topSequence.BCMHitAnalysis.HistPath='/HitAnalysis/BCM/histos/' +topSequence.BLMHitAnalysis.HistPath='/HitAnalysis/BLM/histos/' +topSequence.TRTHitAnalysis.HistPath='/HitAnalysis/TRT/histos/' +topSequence.RPCHitAnalysis.HistPath='/HitAnalysis/RPC/histos/' +topSequence.MDTHitAnalysis.HistPath='/HitAnalysis/MDT/histos/' +topSequence.CSCHitAnalysis.HistPath='/HitAnalysis/CSC/histos/' +topSequence.TGCHitAnalysis.HistPath='/HitAnalysis/TGC/histos/' +#topSequence.ALFAHitAnalysis.HistPath='/HitAnalysis/' +#topSequence.LucidHitAnalysis.HistPath='/HitAnalysis/' +#topSequence.ZDCHitAnalysis.HistPath='/HitAnalysis/' +topSequence.TrackRecordAnalysis.HistPath='/HitAnalysis/Track/histos/' +topSequence.TruthHitAnalysis.HistPath = '/HitAnalysis/Truth/histos/' +topSequence.CaloHitAnalysis.HistPath = '/HitAnalysis/Calo/histos/' +topSequence.PixelHitAnalysis.NtupleFileName='/HitAnalysis/Pixel/ntuple/' +topSequence.SCTHitAnalysis.NtupleFileName='/HitAnalysis/SCT/ntuple/' +topSequence.BCMHitAnalysis.NtupleFileName='/HitAnalysis/BCM/ntuple/' +topSequence.BLMHitAnalysis.NtupleFileName='/HitAnalysis/BLM/ntuple/' +topSequence.TRTHitAnalysis.NtupleFileName='/HitAnalysis/TRT/ntuple/' +topSequence.RPCHitAnalysis.NtupleFileName='/HitAnalysis/RPC/ntuple/' +topSequence.MDTHitAnalysis.NtupleFileName='/HitAnalysis/MDT/ntuple/' +topSequence.CSCHitAnalysis.NtupleFileName='/HitAnalysis/CSC/ntuple/' +topSequence.TGCHitAnalysis.NtupleFileName='/HitAnalysis/TGC/ntuple/' +#topSequence.ALFAHitAnalysis.NtupleFileName='/HitAnalysis/' +#topSequence.LucidHitAnalysis.NtupleFileName='/HitAnalysis/' +#topSequence.ZDCHitAnalysis.NtupleFileName='/HitAnalysis/' +topSequence.TrackRecordAnalysis.NtupleFileName='/HitAnalysis/Track/ntuple/' +topSequence.TruthHitAnalysis.NtupleFileName = '/HitAnalysis/Truth/ntuple/' +topSequence.CaloHitAnalysis.NtupleFileName = '/HitAnalysis/Calo/ntuple/' +#Add some more TH2 histograms + + +topSequence.PixelHitAnalysis.ExpertMode= "off" +topSequence.SCTHitAnalysis.ExpertMode= "off" +topSequence.BCMHitAnalysis.ExpertMode= "off" +topSequence.BLMHitAnalysis.ExpertMode= "off" +topSequence.CaloHitAnalysis.ExpertMode = "off" +topSequence.CaloHitAnalysis.CalibHits = "off" + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +ServiceMgr.THistSvc.Output += ["HitAnalysis DATAFILE='AllHitAnalysis.root' OPT='RECREATE'" ] + + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = TRUE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include( "TrkDetDescrSvc/AtlasTrackingGeometrySvc.py" ) # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/share/CSCHitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/CSCHitAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..3cc733d76a21145f721bd06370c054a5b4ca8ce1 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/CSCHitAnalysis_topOptions.py @@ -0,0 +1,43 @@ +q#from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +import AthenaPoolCnvSvc.ReadAthenaPool + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"HITS*root*" ) +ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # This is stupid and redundant, but necessary + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from HitAnalysis.HitAnalysisConf import CSCHitAnalysis +topSequence += CSCHitAnalysis() +CSCHitAnalysis = CSCHitAnalysis() +CSCHitAnalysis.HistPath = '/CSCHitAnalysis/' + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +ServiceMgr.THistSvc.Output += [ "CSCHitAnalysis DATAFILE='CSCHitAnalysis.root' OPT='RECREATE'" ] + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = FALSE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include("TrkDetDescrSvc/AtlasTrackingGeometrySvc.py") # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/share/CaloHitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/CaloHitAnalysis_topOptions.py index 6c11ce957d6c01658de90a88560e7a02729dbb5a..95306b508b4560a8e68ed3738c9a6459dc8a4ba3 100755 --- a/Simulation/Tools/HitAnalysis/share/CaloHitAnalysis_topOptions.py +++ b/Simulation/Tools/HitAnalysis/share/CaloHitAnalysis_topOptions.py @@ -5,7 +5,7 @@ import AthenaPoolCnvSvc.ReadAthenaPool from PartPropSvc.PartPropSvcConf import PartPropSvc include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") -include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) +#include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) import os from glob import glob @@ -17,13 +17,19 @@ from AthenaCommon.AlgSequence import AlgSequence topSequence = AlgSequence() from HitAnalysis.HitAnalysisConf import CaloHitAnalysis -topSequence += CaloHitAnalysis() CaloHitAnalysis = CaloHitAnalysis() -CaloHitAnalysis.NtupleFileName = 'CaloHitAnalysis' +topSequence += CaloHitAnalysis +CaloHitAnalysis.HistPath = '/CaloHitAnalysis/histos/' +CaloHitAnalysis.NtupleFileName = '/CaloHitAnalysis/ntuple/' +#ExpertMode adds more histograms to the output. Default mode is off +CaloHitAnalysis.ExpertMode = "off" +#CalibHits adds Calibrated hits histograms to the output. Default mode is off +CaloHitAnalysis.CalibHits = "off" from GaudiSvc.GaudiSvcConf import THistSvc ServiceMgr += THistSvc() -ServiceMgr.THistSvc.Output += [ "CaloHitAnalysis DATAFILE='CaloHitAnalysis.root' OPT='RECREATE'" ] +ServiceMgr.THistSvc.Output += ["CaloHitAnalysis DATAFILE='CaloHitAnalysis.root' OPT='RECREATE'" ] + ServiceMgr.MessageSvc.OutputLevel = INFO ServiceMgr.MessageSvc.defaultLimit = 9999999 diff --git a/Simulation/Tools/HitAnalysis/share/HitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/HitAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..2719aae9383ac07bcffb4fe2bfe496fb8db01a3a --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/HitAnalysis_topOptions.py @@ -0,0 +1,83 @@ +#from AthenaCommon.AppMgr import ToolSvc +#from AthenaCommon.AppMgr import ServiceMgr +#import AthenaPoolCnvSvc.ReadAthenaPool + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() +from HitAnalysis.HitAnalysisConf import * + +topSequence += SiHitAnalysis('PixelHitAnalysis') +topSequence.PixelHitAnalysis.CollectionName='PixelHits' +topSequence += SiHitAnalysis('SCTHitAnalysis') +topSequence.SCTHitAnalysis.CollectionName='SCT_Hits' +topSequence += SiHitAnalysis('BCMHitAnalysis') +topSequence.BCMHitAnalysis.CollectionName='BCMHits' +topSequence += SiHitAnalysis('BLMHitAnalysis') +topSequence.BLMHitAnalysis.CollectionName='BLMHits' +topSequence += TRTHitAnalysis('TRTHitAnalysis') +topSequence += RPCHitAnalysis('RPCHitAnalysis') +topSequence += MDTHitAnalysis('MDTHitAnalysis') +topSequence += CSCHitAnalysis('CSCHitAnalysis') +topSequence += TGCHitAnalysis('TGCHitAnalysis') +#topSequence += ALFAHitAnalysis('ALFAHitAnalysis') +#topSequence += LucidHitAnalysis('LucidHitAnalysis') +#topSequence += ZDCHitAnalysis('ZDCHitAnalysis') +topSequence += TrackRecordAnalysis('TrackRecordAnalysis') +topSequence += TruthHitAnalysis('TruthHitAnalysis') +topSequence += CaloHitAnalysis('CaloHitAnalysis') + + + +topSequence.PixelHitAnalysis.HistPath='/HitAnalysis/' +topSequence.SCTHitAnalysis.HistPath='/HitAnalysis/' +topSequence.BCMHitAnalysis.HistPath='/HitAnalysis/' +topSequence.BLMHitAnalysis.HistPath='/HitAnalysis/' +topSequence.TRTHitAnalysis.HistPath='/HitAnalysis/' +topSequence.RPCHitAnalysis.HistPath='/HitAnalysis/' +topSequence.MDTHitAnalysis.HistPath='/HitAnalysis/' +topSequence.CSCHitAnalysis.HistPath='/HitAnalysis/' +topSequence.TGCHitAnalysis.HistPath='/HitAnalysis/' +#topSequence.ALFAHitAnalysis.HistPath='/HitAnalysis/' +#topSequence.LucidHitAnalysis.HistPath='/HitAnalysis/' +#topSequence.ZDCHitAnalysis.HistPath='/HitAnalysis/' +topSequence.TrackRecordAnalysis.HistPath='/HitAnalysis/' +topSequence.TruthHitAnalysis.HistPath = '/HitAnalysis/' +topSequence.CaloHitAnalysis.HistPath = '/HitAnalysis/' +#Add some more TH2 histograms + + +topSequence.PixelHitAnalysis.ExpertMode= "off" +topSequence.SCTHitAnalysis.ExpertMode= "off" +topSequence.BCMHitAnalysis.ExpertMode= "off" +topSequence.BLMHitAnalysis.ExpertMode= "off" +topSequence.CaloHitAnalysis.ExpertMode = "off" +topSequence.CaloHitAnalysis.CalibHits = "off" + +#from GaudiSvc.GaudiSvcConf import THistSvc +#ServiceMgr += THistSvc() +#ServiceMgr.THistSvc.Output += ["CaloHitAnalysis DATAFILE='CaloHitAnalysis_v2.root' OPT='RECREATE'" ] + + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +#ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = TRUE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include( "TrkDetDescrSvc/AtlasTrackingGeometrySvc.py" ) # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/share/LucidHitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/LucidHitAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..b4404d517df75c2370517461d5c8b9b189b22fb9 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/LucidHitAnalysis_topOptions.py @@ -0,0 +1,43 @@ +#from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +import AthenaPoolCnvSvc.ReadAthenaPool + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"HITS*root*" ) +ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # This is stupid and redundant, but necessary + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from HitAnalysis.HitAnalysisConf import LucidHitAnalysis +topSequence += LucidHitAnalysis() +LucidHitAnalysis = LucidHitAnalysis() +LucidHitAnalysis.HistPath = '/LucidHitAnalysis/' + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +ServiceMgr.THistSvc.Output += [ "LucidHitAnalysis DATAFILE='LucidHitAnalysis.root' OPT='RECREATE'" ] + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = FALSE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include("TrkDetDescrSvc/AtlasTrackingGeometrySvc.py") # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/share/MDTHitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/MDTHitAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..8cac6fc0153a0037b429515aef9e68ce77ff7977 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/MDTHitAnalysis_topOptions.py @@ -0,0 +1,43 @@ +#from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +import AthenaPoolCnvSvc.ReadAthenaPool + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"HITS*root*" ) +ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # This is stupid and redundant, but necessary + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from HitAnalysis.HitAnalysisConf import MDTHitAnalysis +topSequence += MDTHitAnalysis() +MDTHitAnalysis = MDTHitAnalysis() +MDTHitAnalysis.NtupleFileName = 'MDTHitAnalysis' + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +ServiceMgr.THistSvc.Output += [ "MDTHitAnalysis DATAFILE='MDTHitAnalysis.root' OPT='RECREATE'" ] + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = FALSE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include("TrkDetDescrSvc/AtlasTrackingGeometrySvc.py") # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/share/MuonHitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/MuonHitAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..1d887bb4d46208b112e8ac80ab6265457a4b1bb5 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/MuonHitAnalysis_topOptions.py @@ -0,0 +1,51 @@ +#from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +import AthenaPoolCnvSvc.ReadAthenaPool + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"HITS*root*" ) +ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # This is stupid and redundant, but necessary + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from HitAnalysis.HitAnalysisConf import RPCHitAnalysis +topSequence += RPCHitAnalysis('RPCHitAnalysis') +topSequence.RPCHitAnalysis.HistPath = '/MuonHitAnalysis/' +from HitAnalysis.HitAnalysisConf import MDTHitAnalysis +topSequence += MDTHitAnalysis('MDTHitAnalysis') +topSequence.MDTHitAnalysis.HistPath = '/MuonHitAnalysis/' +from HitAnalysis.HitAnalysisConf import CSCHitAnalysis +topSequence += CSCHitAnalysis('CSCHitAnalysis') +topSequence.CSCHitAnalysis.HistPath = '/MuonHitAnalysis/' +from HitAnalysis.HitAnalysisConf import TGCHitAnalysis +topSequence += TGCHitAnalysis('TGCHitAnalysis') +topSequence.TGCHitAnalysis.HistPath = '/MuonHitAnalysis/' + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +ServiceMgr.THistSvc.Output += [ "MuonHitAnalysis DATAFILE='MuonHitAnalysis.root' OPT='RECREATE'" ] + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = FALSE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include("TrkDetDescrSvc/AtlasTrackingGeometrySvc.py") # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/share/RPCHitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/RPCHitAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..17160c375da896c878b09f565799b6ccea8f3ac1 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/RPCHitAnalysis_topOptions.py @@ -0,0 +1,43 @@ +#from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +import AthenaPoolCnvSvc.ReadAthenaPool + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"HITS*root*" ) +ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # This is stupid and redundant, but necessary + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from HitAnalysis.HitAnalysisConf import RPCHitAnalysis +topSequence += RPCHitAnalysis() +RPCHitAnalysis = RPCHitAnalysis() +RPCHitAnalysis.NtupleFileName = 'RPCHitAnalysis' + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +ServiceMgr.THistSvc.Output += [ "RPCHitAnalysis DATAFILE='RPCHitAnalysis.root' OPT='RECREATE'" ] + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = FALSE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include("TrkDetDescrSvc/AtlasTrackingGeometrySvc.py") # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/share/SiHitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/SiHitAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..e274b8fb193a21712ce067a50f7577251a529a34 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/SiHitAnalysis_topOptions.py @@ -0,0 +1,65 @@ +#from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +import AthenaPoolCnvSvc.ReadAthenaPool + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"HITS*root*" ) +ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # This is stupid and redundant, but necessary + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from HitAnalysis.HitAnalysisConf import SiHitAnalysis +topSequence += SiHitAnalysis('PixelHitAnalysis') +topSequence.PixelHitAnalysis.CollectionName='PixelHits' +topSequence += SiHitAnalysis('SCTHitAnalysis') +topSequence.SCTHitAnalysis.CollectionName='SCT_Hits' +topSequence += SiHitAnalysis('BCMHitAnalysis') +topSequence.BCMHitAnalysis.CollectionName='BCMHits' +topSequence += SiHitAnalysis('BLMHitAnalysis') +topSequence.BLMHitAnalysis.CollectionName='BLMHits' + +topSequence.PixelHitAnalysis.HistPath='/SiHitAnalysis/histos/' +topSequence.SCTHitAnalysis.HistPath='/SiHitAnalysis/histos/' +topSequence.BCMHitAnalysis.HistPath='/SiHitAnalysis/histos/' +topSequence.BLMHitAnalysis.HistPath='/SiHitAnalysis/histos/' + +topSequence.PixelHitAnalysis.NtupleFileName='/SiHitAnalysis/ntuples/' +topSequence.SCTHitAnalysis.NtupleFileName='/SiHitAnalysis/ntuples/' +topSequence.BCMHitAnalysis.NtupleFileName='/SiHitAnalysis/ntuples/' +topSequence.BLMHitAnalysis.NtupleFileName='/SiHitAnalysis/ntuples/' + + +#Add some more TH2 histograms +topSequence.PixelHitAnalysis.ExpertMode= "off" +topSequence.SCTHitAnalysis.ExpertMode= "off" +topSequence.BCMHitAnalysis.ExpertMode= "off" +topSequence.BLMHitAnalysis.ExpertMode= "off" + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +ServiceMgr.THistSvc.Output += [ "SiHitAnalysis DATAFILE='SiHitAnalysis.root' OPT='RECREATE'" ] + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = TRUE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include( "TrkDetDescrSvc/AtlasTrackingGeometrySvc.py" ) # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/share/TGCHitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/TGCHitAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..ec86239c82d51d66d7391370a48fd040bb55f902 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/TGCHitAnalysis_topOptions.py @@ -0,0 +1,43 @@ +#from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +import AthenaPoolCnvSvc.ReadAthenaPool + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"HITS*root*" ) +ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # This is stupid and redundant, but necessary + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from HitAnalysis.HitAnalysisConf import TGCHitAnalysis +topSequence += TGCHitAnalysis() +TGCHitAnalysis = TGCHitAnalysis() +TGCHitAnalysis.HistPath = '/TGCHitAnalysis/' + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +ServiceMgr.THistSvc.Output += [ "TGCHitAnalysis DATAFILE='TGCHitAnalysis.root' OPT='RECREATE'" ] + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = FALSE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include("TrkDetDescrSvc/AtlasTrackingGeometrySvc.py") # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/share/TRTHitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/TRTHitAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..799b65c1b5a9d0bb709b2c1f0ff9ed0b89c4d956 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/TRTHitAnalysis_topOptions.py @@ -0,0 +1,43 @@ +#from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +import AthenaPoolCnvSvc.ReadAthenaPool + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"HITS*root*" ) +ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # This is stupid and redundant, but necessary + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from HitAnalysis.HitAnalysisConf import TRTHitAnalysis +topSequence += TRTHitAnalysis() +TRTHitAnalysis = TRTHitAnalysis() +TRTHitAnalysis.HistPath = '/TRTHitAnalysis/' + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +ServiceMgr.THistSvc.Output += [ "TRTHitAnalysis DATAFILE='TRTHitAnalysis.root' OPT='RECREATE'" ] + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = TRUE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include( "TrkDetDescrSvc/AtlasTrackingGeometrySvc.py" ) # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/share/TrackRecordAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/TrackRecordAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..eb6c8b3d313cbd161f5cb9e6616ad9dbf7b9152e --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/TrackRecordAnalysis_topOptions.py @@ -0,0 +1,51 @@ +#from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +import AthenaPoolCnvSvc.ReadAthenaPool + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"HITS*root*" ) +ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # This is stupid and redundant, but necessary + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from HitAnalysis.HitAnalysisConf import TrackRecordAnalysis +topSequence += TrackRecordAnalysis('TrackRecordCaloEntry') +topSequence.TrackRecordCaloEntry.CollectionName='CaloEntryLayer' +topSequence.TrackRecordCaloEntry.HistPath='/TrackRecordAnalysis/' +topSequence += TrackRecordAnalysis('TrackRecordMuonEntry') +topSequence.TrackRecordMuonEntry.CollectionName='MuonEntryLayer' +topSequence.TrackRecordMuonEntry.HistPath='/TrackRecordAnalysis/' +topSequence += TrackRecordAnalysis('TrackRecordMuonExit') +topSequence.TrackRecordMuonExit.CollectionName='MuonExitLayer' +topSequence.TrackRecordMuonExit.HistPath='/TrackRecordAnalysis/' + + + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +ServiceMgr.THistSvc.Output += [ "TrackRecordAnalysis DATAFILE='TrackRecordAnalysis.root' OPT='RECREATE'" ] + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = FALSE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include("TrkDetDescrSvc/AtlasTrackingGeometrySvc.py") # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/share/TruthHitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/TruthHitAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..8a872418ae88dfc76cde9daed85f38f7a64b0ffd --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/TruthHitAnalysis_topOptions.py @@ -0,0 +1,43 @@ +#from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +import AthenaPoolCnvSvc.ReadAthenaPool + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"HITS*root*" ) +ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # This is stupid and redundant, but necessary + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from HitAnalysis.HitAnalysisConf import TruthHitAnalysis +topSequence += TruthHitAnalysis() +TruthHitAnalysis = TruthHitAnalysis() +TruthHitAnalysis.HistPath = '/TruthHitAnalysis/' + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +ServiceMgr.THistSvc.Output += [ "TruthHitAnalysis DATAFILE='TruthHitAnalysis.root' OPT='RECREATE'" ] + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = FALSE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include("TrkDetDescrSvc/AtlasTrackingGeometrySvc.py") # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/share/ZDCHitAnalysis_topOptions.py b/Simulation/Tools/HitAnalysis/share/ZDCHitAnalysis_topOptions.py new file mode 100755 index 0000000000000000000000000000000000000000..5e0ef00009e0d667a5008bb3fb4e165867b3074c --- /dev/null +++ b/Simulation/Tools/HitAnalysis/share/ZDCHitAnalysis_topOptions.py @@ -0,0 +1,43 @@ +#from AthenaCommon.AppMgr import ToolSvc +from AthenaCommon.AppMgr import ServiceMgr +import AthenaPoolCnvSvc.ReadAthenaPool + +from PartPropSvc.PartPropSvcConf import PartPropSvc + +include( "ParticleBuilderOptions/McAOD_PoolCnv_jobOptions.py") +include( "EventAthenaPool/EventAthenaPool_joboptions.py" ) + +import os +from glob import glob +from AthenaCommon.AthenaCommonFlags import athenaCommonFlags +athenaCommonFlags.FilesInput = glob( "/tmp/"+os.environ['USER']+"HITS*root*" ) +ServiceMgr.EventSelector.InputCollections = athenaCommonFlags.FilesInput() # This is stupid and redundant, but necessary + +from AthenaCommon.AlgSequence import AlgSequence +topSequence = AlgSequence() + +from HitAnalysis.HitAnalysisConf import ZDCHitAnalysis +topSequence += ZDCHitAnalysis() +ZDCHitAnalysis = ZDCHitAnalysis() +ZDCHitAnalysis.HistPath = '/ZDCHitAnalysis/' + +from GaudiSvc.GaudiSvcConf import THistSvc +ServiceMgr += THistSvc() +ServiceMgr.THistSvc.Output += [ "ZDCHitAnalysis DATAFILE='ZDCHitAnalysis.root' OPT='RECREATE'" ] + +ServiceMgr.MessageSvc.OutputLevel = INFO +ServiceMgr.MessageSvc.defaultLimit = 9999999 + +theApp.EvtMax = -1 + +ServiceMgr.AuditorSvc.Auditors += [ "ChronoAuditor"] + +AthenaPoolCnvSvc = Service("AthenaPoolCnvSvc") +AthenaPoolCnvSvc.UseDetailChronoStat = FALSE + +# To set up a geometry +from RecExConfig.AutoConfiguration import * +ConfigureFieldAndGeo() # Configure the settings for the geometry +include("RecExCond/AllDet_detDescr.py") # Actually load the geometry +#include("TrkDetDescrSvc/AtlasTrackingGeometrySvc.py") # Tracking geometry, handy for ID work + diff --git a/Simulation/Tools/HitAnalysis/src/AFPHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/AFPHitAnalysis.cxx new file mode 100755 index 0000000000000000000000000000000000000000..8e2dac96fca9f38ba29c7886299275fd21f7447c --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/AFPHitAnalysis.cxx @@ -0,0 +1,186 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "AFPHitAnalysis.h" + +#include "AFP_SimEv/AFP_SIDSimHit.h" +#include "AFP_SimEv/AFP_SIDSimHitCollection.h" + + +#include "TH1.h" +#include "TTree.h" +#include "TString.h" + + +#include <algorithm> +#include <math.h> +#include <functional> +#include <iostream> +#include <stdio.h> + +AFPHitAnalysis::AFPHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator) + : AthAlgorithm(name, pSvcLocator) + , h_hitID(0) + , h_pdgID(0) + , h_trackID(0) + , h_kine(0) + , h_edep(0) + , h_stepX(0) + , h_stepY(0) + , h_stepZ(0) + , h_time(0) + , h_stationID(0) + , h_detID(0) + , h_pixelRow(0) + , h_pixelCol(0) + , m_tree(0) + , m_ntupleFileName("/AFPHitAnalysis/ntuples/") + , m_path("/AFPHitAnalysis/histos/") + , m_thistSvc("THistSvc", name) +{ + declareProperty("HistPath", m_path); + declareProperty("NtupleFileName", m_ntupleFileName); +} + +StatusCode AFPHitAnalysis::initialize() { + ATH_MSG_DEBUG( "Initializing AFPHitAnalysis" ); + + // Grab the Ntuple and histogramming service for the tree + CHECK(m_thistSvc.retrieve()); + + + /** now define the histograms**/ + h_hitID = new TH1D("h_hitID", "hitID",100, 0., 100.); + h_hitID->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_hitID->GetName(), h_hitID)); + + h_pdgID = new TH1D("h_pdgID", "pdgID", 200, -100,100); + h_pdgID->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_pdgID->GetName(), h_pdgID)); + + h_trackID = new TH1D("h_trackID", "trackID", 100, 0,100); + h_trackID->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_trackID->GetName(), h_trackID)); + + h_kine = new TH1D("h_kine", "kine", 100, 0,1000); + h_kine->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_kine->GetName(), h_kine)); + + h_edep = new TH1D("h_edep", "edep", 100, 0,1000); + h_edep->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_edep->GetName(), h_edep)); + + h_stepX = new TH1D("h_stepX", "stepX", 100, 0,1000); + h_stepX->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_stepX->GetName(), h_stepX)); + + h_stepY = new TH1D("h_stepY", "stepY", 100, 0,1000); + h_stepY->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_stepY->GetName(), h_stepY)); + + h_stepZ = new TH1D("h_stepZ", "stepZ", 100, 0,1000); + h_stepZ->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_stepZ->GetName(), h_stepZ)); + + h_stationID = new TH1D("h_stationID", "stationID", 50, 0,50); + h_stationID->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_stationID->GetName(), h_stationID)); + + h_detID = new TH1D("h_detID", "detID", 50, 0,50); + h_detID->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_detID->GetName(), h_detID)); + + h_pixelRow = new TH1D("h_pixelRow", "pixelRow", 20, 0,20); + h_pixelRow->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_pixelRow->GetName(), h_pixelRow)); + + + h_pixelCol = new TH1D("h_pixelCol", "pixelCol", 20, 0,20); + h_pixelCol->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_pixelCol->GetName(), h_pixelCol)); + + /** now add branches and leaves to the tree */ + m_tree= new TTree("NtupleAFPHitAnanalysis","AFPHitAna"); + std::string fullNtupleName = "/"+m_ntupleFileName+"/"; + CHECK(m_thistSvc->regTree(fullNtupleName,m_tree)); + + if (m_tree){ + m_tree->Branch("hitID", &m_hitID); + m_tree->Branch("pdgID", &m_pdgID); + m_tree->Branch("trackID", &m_trackID); + m_tree->Branch("kine", &m_kine); + m_tree->Branch("edep", &m_edep); + m_tree->Branch("stepX", &m_stepX); + m_tree->Branch("stepY", &m_stepY); + m_tree->Branch("stepZ", &m_stepZ); + m_tree->Branch("stationID", &m_stationID); + m_tree->Branch("detID", &m_detID); + m_tree->Branch("pixelRow", &m_pixelRow); + m_tree->Branch("pixelCol", &m_pixelCol); + + + }else{ + ATH_MSG_ERROR("No tree found!"); + } + + return StatusCode::SUCCESS; +} + + + +StatusCode AFPHitAnalysis::execute() { + ATH_MSG_DEBUG( "In AFPHitAnalysis::execute()" ); + + m_hitID->clear(); + m_pdgID->clear(); + m_trackID->clear(); + m_kine->clear(); + m_edep->clear(); + m_stepX->clear(); + m_stepY->clear(); + m_stepZ->clear(); + m_time->clear(); + m_stationID->clear(); + m_detID->clear(); + m_pixelRow->clear(); + m_pixelCol->clear(); + + AFP_SIDSimHitConstIter hi; + const DataHandle<AFP_SIDSimHitCollection> iter; + CHECK(evtStore()->retrieve(iter,"AFP_SIDSimHitCollection")); + for(hi=(*iter).begin(); hi != (*iter).end();++hi){ + AFP_SIDSimHit ghit(*hi); + h_hitID->Fill(ghit.m_nHitID); + h_pdgID->Fill(ghit.m_nParticleEncoding); + h_trackID->Fill(ghit.m_nTrackID); + h_kine->Fill(ghit.m_fKineticEnergy); + h_edep->Fill(ghit.m_fEnergyDeposit); + h_stepX->Fill(ghit.m_fPostStepX-ghit.m_fPreStepX); + h_stepY->Fill(ghit.m_fPostStepY-ghit.m_fPreStepY); + h_stepX->Fill(ghit.m_fPostStepZ-ghit.m_fPreStepZ); + h_time->Fill(ghit.m_fGlobalTime); + h_stationID->Fill(ghit.m_nStationID); + h_detID->Fill(ghit.m_nDetectorID); + h_pixelRow->Fill(ghit.m_nPixelRow); + h_pixelCol->Fill(ghit.m_nPixelCol); + + + m_hitID->push_back(ghit.m_nHitID); + m_pdgID->push_back(ghit.m_nParticleEncoding); + m_trackID->push_back(ghit.m_nTrackID); + m_kine->push_back(ghit.m_fKineticEnergy); + m_edep->push_back(ghit.m_fEnergyDeposit); + m_stepX->push_back(ghit.m_fPostStepX-ghit.m_fPreStepX); + m_stepY->push_back(ghit.m_fPostStepY-ghit.m_fPreStepY); + m_stepX->push_back(ghit.m_fPostStepZ-ghit.m_fPreStepZ); + m_time->push_back(ghit.m_fGlobalTime); + m_stationID->push_back(ghit.m_nStationID); + m_detID->push_back(ghit.m_nDetectorID); + m_pixelRow->push_back(ghit.m_nPixelRow); + m_pixelCol->push_back(ghit.m_nPixelCol); + } + + if (m_tree) m_tree->Fill(); + return StatusCode::SUCCESS; +} diff --git a/Simulation/Tools/HitAnalysis/src/AFPHitAnalysis.h b/Simulation/Tools/HitAnalysis/src/AFPHitAnalysis.h new file mode 100755 index 0000000000000000000000000000000000000000..7dfd58e0e680fd1f5f66404d7b06b290852ce774 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/AFPHitAnalysis.h @@ -0,0 +1,70 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef AFP_HIT_ANALYSIS_H +#define AFP_HIT_ANALYSIS_H + +#include "AthenaBaseComps/AthAlgorithm.h" + +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ITHistSvc.h" + +#include <string> +#include <vector> +#include "TH1.h" +#include "TTree.h" + + +class TH1; +class TTree; + +class AFPHitAnalysis : public AthAlgorithm { + + public: + + AFPHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator); + ~AFPHitAnalysis(){} + + virtual StatusCode initialize(); + virtual StatusCode execute(); + + private: + + /** Some histograms**/ + TH1* h_hitID; + TH1* h_pdgID; + TH1* h_trackID; + TH1* h_kine; + TH1* h_edep; + TH1* h_stepX; + TH1* h_stepY; + TH1* h_stepZ; + TH1* h_time; + TH1* h_stationID; + TH1* h_detID; + TH1* h_pixelRow; + TH1* h_pixelCol; + + std::vector<float>* m_hitID; + std::vector<float>* m_pdgID; + std::vector<float>* m_trackID; + std::vector<float>* m_kine; + std::vector<float>* m_edep; + std::vector<float>* m_stepX; + std::vector<float>* m_stepY; + std::vector<float>* m_stepZ; + std::vector<float>* m_time; + std::vector<int>* m_stationID; + std::vector<int>* m_detID; + std::vector<int>* m_pixelRow; + std::vector<int>* m_pixelCol; + TTree * m_tree; + std::string m_ntupleFileName; + std::string m_path; + ServiceHandle<ITHistSvc> m_thistSvc; + +}; + +#endif // AFP_HIT_ANALYSIS_H + diff --git a/Simulation/Tools/HitAnalysis/src/ALFAHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/ALFAHitAnalysis.cxx new file mode 100644 index 0000000000000000000000000000000000000000..b1074bce7cd5d450b89eae56ecb73011be75cf41 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/ALFAHitAnalysis.cxx @@ -0,0 +1,169 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ALFAHitAnalysis.h" + +// Section of includes for Pixel and SCT tests +#include "ALFA_SimEv/ALFA_HitCollection.h" + +#include "TH1.h" +#include "TTree.h" +#include "TString.h" + + +#include <algorithm> +#include <math.h> +#include <functional> +#include <iostream> + +ALFAHitAnalysis::ALFAHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator) + : AthAlgorithm(name, pSvcLocator) + , m_station(0) + , m_plate(0) + , m_fiber(0) + , m_sign(0) + , m_energy(0) + , m_tree(0) + , m_ntupleFileName("/ALFAHitsAnalysis/ntuples/") + , m_path("/ALFAHitsAnalysis/histos") + , m_thistSvc("THistSvc", name) +{ + for(int i(0); i<8; i++){ + h_E_full_sum_h[i]=0; + h_E_layer_sum_h[i]=0; + h_hit_layer[i]=0; + h_hit_fiber[i]=0; + + } + declareProperty("NtupleFileName", m_ntupleFileName); + declareProperty("HistPath", m_path); +} + +StatusCode ALFAHitAnalysis::initialize() { + ATH_MSG_DEBUG( "Initializing ALFAHitAnalysis" ); + + + // Grab the Ntuple and histogramming service for the tree + CHECK(m_thistSvc.retrieve()); + + + + /** now add branches and leaves to the tree */ + std::stringstream s; + for(unsigned int j=0; j<8;j++){ + s.str(""); + s <<"edep_in_det_no."<< j+1; + float Emax = 5; + if(j==3) Emax=150; + h_E_full_sum_h[j] = new TH1D(s.str().c_str(),s.str().c_str(), 100,0,Emax); + h_E_full_sum_h[j]->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_E_full_sum_h[j]->GetName(), h_E_full_sum_h[j])); + + s.str(""); + s <<"edep_per_layer_det_no."<< j+1; + h_E_layer_sum_h[j] = new TH1D(s.str().c_str(),s.str().c_str(), 100,0,15); + h_E_layer_sum_h[j]->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_E_layer_sum_h[j]->GetName(), h_E_layer_sum_h[j])); + + s.str(""); + s <<"hit_layer_det_no."<< j+1; + h_hit_layer[j] = new TH1D(s.str().c_str(),s.str().c_str(),50,0,50); + h_hit_layer[j]->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_hit_layer[j]->GetName(), h_hit_layer[j])); + + s.str(""); + s <<"hit_fiber_det_no."<< j+1; + h_hit_fiber[j] = new TH1D(s.str().c_str(),s.str().c_str(),100,0,60); + h_hit_fiber[j]->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path+h_hit_fiber[j]->GetName(), h_hit_fiber[j])); + + } + + m_tree= new TTree("NtupleALFAHitAnalysis", "ALFAHitAna"); + std::string fullNtupleName = "/"+m_ntupleFileName+"/"; + CHECK(m_thistSvc->regTree(fullNtupleName,m_tree)); + + + + /** now add branches and leaves to the tree */ + if (m_tree){ + m_tree->Branch("station", &m_station); + m_tree->Branch("plate", &m_plate); + m_tree->Branch("fiber", &m_fiber); + m_tree->Branch("energy", &m_energy); + }else{ + ATH_MSG_ERROR("No tree found!"); + } + return StatusCode::SUCCESS; +} + + + +StatusCode ALFAHitAnalysis::execute() { + ATH_MSG_DEBUG( "In ALFAHitAnalysis::execute()" ); + + m_station->clear(); + m_plate->clear(); + m_fiber->clear(); + m_sign->clear(); + m_energy->clear(); + + //cleaning + int fiber,plate,sign,station; + double E_fiber_sum[8][10][64][2], E_full_sum[8], E_layer_sum[8][20]; + for (int l= 0;l<8;l++){ + E_full_sum[l] = 0.; + for ( int i = 0; i < 10; i++ ){ + E_layer_sum[l][i] = 0.; + E_layer_sum[l][i+10] = 0.; + for ( int j = 0; j < 64; j++ ){ + for ( int k = 0; k < 2; k++ ){ + E_fiber_sum[l][i][j][k] = 0.; + } + } + } + } + + ALFA_HitConstIter iter; + const DataHandle<ALFA_HitCollection> col_alfa; + CHECK(evtStore()->retrieve(col_alfa,"ALFA_HitCollection")); + for(iter=(*col_alfa).begin(); iter!=(*col_alfa).end();++iter){ + station = (*iter).GetStationNumber(); + plate = (*iter).GetPlateNumber(); + fiber = (*iter).GetFiberNumber(); + sign = (*iter).GetSignFiber(); + E_fiber_sum[station-1][plate-1][fiber-1][(1-sign)/2]+=((*iter).GetEnergyDeposit()); + + m_station->push_back(station); + m_plate->push_back(plate); + m_fiber->push_back(fiber); + m_sign->push_back(sign); + m_energy->push_back((*iter).GetEnergyDeposit()); + } // End iteration + + for(int l=0;l<8;l++){ + for(int i=0;i<10; i++){ + for(int j=0;j<64;j++){ + for(int k=0;k<2;k++){ + E_full_sum[l]+=E_fiber_sum[l][i][j][k]; + E_layer_sum[l][2*i+k]+=E_fiber_sum[l][i][j][k]; + if(E_fiber_sum[l][i][j][k]>0.){ + h_hit_layer[l]->Fill(2*i+k+1); + h_hit_fiber[l]->Fill(j+1); + } + } + } + } + } + for(int l = 0;l<8;l++){ + h_E_full_sum_h[l]->Fill(E_full_sum[l]); + for(int i = 0; i< 20;i++){ + h_E_layer_sum_h[l]->Fill(E_layer_sum[l][i]); + } + } + + if (m_tree) m_tree->Fill(); + return StatusCode::SUCCESS; +} + diff --git a/Simulation/Tools/HitAnalysis/src/ALFAHitAnalysis.h b/Simulation/Tools/HitAnalysis/src/ALFAHitAnalysis.h new file mode 100755 index 0000000000000000000000000000000000000000..8d833d12f703fef1138de93d749e410991476558 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/ALFAHitAnalysis.h @@ -0,0 +1,58 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ALFA_HIT_ANALYSIS_H +#define ALFA_HIT_ANALYSIS_H + +#include "AthenaBaseComps/AthAlgorithm.h" + +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ITHistSvc.h" + + +#include <string> +#include <vector> +#include "TH1.h" +#include "TTree.h" + +class TH1; +class TTree; + +class ALFAHitAnalysis : public AthAlgorithm { + + public: + + ALFAHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator); + ~ALFAHitAnalysis(){} + + virtual StatusCode initialize(); + virtual StatusCode execute(); + + private: + + std::string m_collection; + /** Some variables**/ + TH1* h_E_full_sum_h[8]; + TH1* h_E_layer_sum_h[8]; + TH1* h_hit_layer[8]; + TH1* h_hit_fiber[8]; + + std::vector<int>* m_station; + std::vector<int>* m_plate; + std::vector<int>* m_fiber; + std::vector<int>* m_sign; + std::vector<double>* m_energy; + + + + TTree * m_tree; + std::string m_ntupleFileName; + std::string m_path; + ServiceHandle<ITHistSvc> m_thistSvc; + + +}; + +#endif // ALFA_HIT_ANALYSIS_H + diff --git a/Simulation/Tools/HitAnalysis/src/CSCHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/CSCHitAnalysis.cxx new file mode 100755 index 0000000000000000000000000000000000000000..a03e6f7fad3582a399d1a77acf02478b6fa8cbd7 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/CSCHitAnalysis.cxx @@ -0,0 +1,248 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "CSCHitAnalysis.h" + +// Section of includes for CSC of the Muon Spectrometer tests +#include "GeoAdaptors/GeoMuonHits.h" + +#include "MuonSimEvent/CSCSimHitCollection.h" +#include "MuonSimEvent/CSCSimHit.h" +#include "CLHEP/Vector/LorentzVector.h" + +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" +#include "TString.h" + + +#include <algorithm> +#include <math.h> +#include <functional> +#include <iostream> +#include <stdio.h> + +CSCHitAnalysis::CSCHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator) + : AthAlgorithm(name, pSvcLocator) + , h_hits_x(0) + , h_hits_y(0) + , h_hits_z(0) + , h_hits_r(0) + , h_xy(0) + , h_zr(0) + , h_hits_eta(0) + , h_hits_phi(0) + , h_hits_sx(0) + , h_hits_sy(0) + , h_hits_sz(0) + , h_hits_ex(0) + , h_hits_ey(0) + , h_hits_ez(0) + , h_hits_time(0) + , h_hits_edep(0) + , h_hits_kine(0) + , m_hits_x(0) + , m_hits_y(0) + , m_hits_z(0) + , m_hits_r(0) + , m_hits_eta(0) + , m_hits_phi(0) + , m_hits_start_x(0) + , m_hits_start_y(0) + , m_hits_start_z(0) + , m_hits_end_x(0) + , m_hits_end_y(0) + , m_hits_end_z(0) + , m_hits_time(0) + , m_hits_edep(0) + , m_hits_kine(0) + , m_tree(0) + , m_ntupleFileName("/CSCHitAnalysis/ntuples/") + , m_path("/CSCHitAnalysis/histos/") + , m_thistSvc("THistSvc", name) +{ + declareProperty("NtupleFileName", m_ntupleFileName); + declareProperty("HistPath", m_path); +} + +StatusCode CSCHitAnalysis::initialize() { + ATH_MSG_DEBUG( "Initializing CSCHitAnalysis" ); + + // Grab the Ntuple and histogramming service for the tree + CHECK(m_thistSvc.retrieve()); + + + /** Histograms**/ + h_hits_x = new TH1D("h_csc_hits_x","hits_x", 100,-2000, 2000); + h_hits_x->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_x->GetName(), h_hits_x)); + + h_hits_y = new TH1D("h_csc_hits_y", "hits_y", 100,-2000,2000); + h_hits_y->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_y->GetName(), h_hits_y)); + + h_hits_z = new TH1D("h_csc_hits_z", "hits_z", 100,-10000,10000); + h_hits_z->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_z->GetName(), h_hits_z)); + + h_hits_r = new TH1D("h_csc_hits_r", "hits_r", 100,500,2500); + h_hits_r->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_r->GetName(), h_hits_r)); + + h_xy = new TH2D("h_csc_xy", "xy", 100,-2000.,2000.,100, -2000., 2000.); + h_xy->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_xy->GetName(), h_xy)); + + h_zr = new TH2D("h_csc_zr", "zr", 100,-10000.,10000.,100, 500., 2500.); + h_zr->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_zr->GetName(), h_zr)); + + h_hits_eta = new TH1D("h_csc_hits_eta", "hits_eta", 100,-3.0,3.0); + h_hits_eta->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_eta->GetName(), h_hits_eta)); + + h_hits_phi = new TH1D("h_csc_hits_phi", "hits_phi", 100,-3.2,3.2); + h_hits_phi->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_phi->GetName(), h_hits_phi)); + + h_hits_sx = new TH1D("h_csc_hits_sx","hits_sx", 100,-10, 10); + h_hits_sx->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_sx->GetName(), h_hits_sx)); + + h_hits_sy = new TH1D("h_csc_hits_sy", "hits_sy", 100,-500,500); + h_hits_sy->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_sy->GetName(), h_hits_sy)); + + h_hits_sz = new TH1D("h_csc_hits_sz", "hits_sz", 100,-1000,1000); + h_hits_sz->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_sz->GetName(), h_hits_sz)); + + + h_hits_ex = new TH1D("h_csc_hits_ex","hits_ex", 100,-10, 10); + h_hits_ex->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_ex->GetName(), h_hits_ex)); + + h_hits_ey = new TH1D("h_csc_hits_ey", "hits_ey", 100,-500,500); + h_hits_ey->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_ey->GetName(), h_hits_ey)); + + h_hits_ez = new TH1D("h_csc_hits_ez", "hits_ez", 100,-1000,1000); + h_hits_ez->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_ez->GetName(), h_hits_ez)); + + h_hits_time = new TH1D("h_csc_hits_time","hits_time", 100,20, 40); + h_hits_time->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_time->GetName(), h_hits_time)); + + h_hits_edep = new TH1D("h_csc_hits_edep", "hits_edep", 100,0,0.1); + h_hits_edep->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_edep->GetName(), h_hits_edep)); + + h_hits_kine = new TH1D("h_csc_hits_kine", "hits_kine", 100,0,3000); + h_hits_kine->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_kine->GetName(), h_hits_kine)); + + m_tree= new TTree("NtupleCSCHitAnalysis","CSCHitAna"); + std::string fullNtupleName = "/"+m_ntupleFileName+"/"; + CHECK(m_thistSvc->regTree(fullNtupleName,m_tree)); + + + + /** now add branches and leaves to the tree */ + if (m_tree){ + m_tree->Branch("x", &m_hits_x); + m_tree->Branch("y", &m_hits_y); + m_tree->Branch("z", &m_hits_z); + m_tree->Branch("r", &m_hits_r); + m_tree->Branch("eta", &m_hits_eta); + m_tree->Branch("phi", &m_hits_phi); + m_tree->Branch("startX", &m_hits_start_x); + m_tree->Branch("startY", &m_hits_start_y); + m_tree->Branch("startZ", &m_hits_start_z); + m_tree->Branch("endX", &m_hits_end_x); + m_tree->Branch("endY", &m_hits_end_y); + m_tree->Branch("endZ", &m_hits_end_z); + m_tree->Branch("time", &m_hits_time); + m_tree->Branch("edep", &m_hits_edep); + m_tree->Branch("kine", &m_hits_kine); + }else{ + ATH_MSG_ERROR("No tree found!"); + } + return StatusCode::SUCCESS; +} + + + +StatusCode CSCHitAnalysis::execute() { + ATH_MSG_DEBUG( "In CSCHitAnalysis::execute()" ); + + m_hits_x->clear(); + m_hits_y->clear(); + m_hits_z->clear(); + m_hits_r->clear(); + m_hits_eta->clear(); + m_hits_phi->clear(); + m_hits_start_x->clear(); + m_hits_start_y->clear(); + m_hits_start_z->clear(); + m_hits_end_x->clear(); + m_hits_end_y->clear(); + m_hits_end_z->clear(); + m_hits_time->clear(); + m_hits_edep->clear(); + m_hits_kine->clear(); + + + + const DataHandle<CSCSimHitCollection> csc_container; + if (evtStore()->retrieve(csc_container, "CSC_Hits" )==StatusCode::SUCCESS) { + for(CSCSimHitCollection::const_iterator i_hit = csc_container->begin(); + i_hit != csc_container->end();++i_hit){ + //CSCSimHitCollection::const_iterator i_hit; + //for(auto i_hit : *csc_container){ + GeoCSCHit ghit(*i_hit); + if(!ghit) continue; + Amg::Vector3D p = ghit.getGlobalPosition(); + h_hits_x->Fill(p.x()); + h_hits_y->Fill(p.y()); + h_hits_z->Fill(p.z()); + h_hits_r->Fill(p.perp()); + h_xy->Fill(p.x(), p.y()); + h_zr->Fill(p.z(), p.perp()); + h_hits_eta->Fill(p.eta()); + h_hits_phi->Fill(p.phi()); + h_hits_sx->Fill( (*i_hit).getHitStart().x()); + h_hits_sy->Fill( (*i_hit).getHitStart().y()); + h_hits_sz->Fill( (*i_hit).getHitStart().z()); + h_hits_ex->Fill( (*i_hit).getHitEnd().x()); + h_hits_ey->Fill( (*i_hit).getHitEnd().y()); + h_hits_ez->Fill( (*i_hit).getHitEnd().z()); + h_hits_edep->Fill((*i_hit).energyDeposit()); + h_hits_time->Fill((*i_hit).globalTime()); + h_hits_kine->Fill((*i_hit).kineticEnergy()); + + m_hits_x->push_back(p.x()); + m_hits_y->push_back(p.y()); + m_hits_z->push_back(p.z()); + m_hits_r->push_back(p.perp()); + m_hits_eta->push_back(p.eta()); + m_hits_phi->push_back(p.phi()); + m_hits_start_x->push_back( (*i_hit).getHitStart().x()); + m_hits_start_y->push_back( (*i_hit).getHitStart().y()); + m_hits_start_z->push_back( (*i_hit).getHitStart().z()); + m_hits_end_x->push_back( (*i_hit).getHitEnd().x()); + m_hits_end_y->push_back( (*i_hit).getHitEnd().y()); + m_hits_end_z->push_back( (*i_hit).getHitEnd().z()); + m_hits_edep->push_back((*i_hit).energyDeposit()); + m_hits_time->push_back((*i_hit).globalTime()); + m_hits_kine->push_back((*i_hit).kineticEnergy()); + + } + } // End while hits + if (m_tree) m_tree->Fill(); + + + + return StatusCode::SUCCESS; +} diff --git a/Simulation/Tools/HitAnalysis/src/CSCHitAnalysis.h b/Simulation/Tools/HitAnalysis/src/CSCHitAnalysis.h new file mode 100755 index 0000000000000000000000000000000000000000..c85d3e63a672d986c28635058f09125ae7c9415e --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/CSCHitAnalysis.h @@ -0,0 +1,80 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef CSC_HIT_ANALYSIS_H +#define CSC_HIT_ANALYSIS_H + +#include "AthenaBaseComps/AthAlgorithm.h" + +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ITHistSvc.h" + +#include <string> +#include <vector> +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" + + + +class TH1; +class TH2; +class TTree; + +class CSCHitAnalysis : public AthAlgorithm { + + public: + + CSCHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator); + ~CSCHitAnalysis(){} + + virtual StatusCode initialize(); + virtual StatusCode execute(); + + private: + + /** Some variables**/ + TH1* h_hits_x; + TH1* h_hits_y; + TH1* h_hits_z; + TH1* h_hits_r; + TH2* h_xy; + TH2* h_zr; + TH1* h_hits_eta; + TH1* h_hits_phi; + TH1* h_hits_sx; + TH1* h_hits_sy; + TH1* h_hits_sz; + TH1* h_hits_ex; + TH1* h_hits_ey; + TH1* h_hits_ez; + TH1* h_hits_time; + TH1* h_hits_edep; + TH1* h_hits_kine; + + std::vector<float>* m_hits_x; + std::vector<float>* m_hits_y; + std::vector<float>* m_hits_z; + std::vector<float>* m_hits_r; + std::vector<float>* m_hits_eta; + std::vector<float>* m_hits_phi; + std::vector<float>* m_hits_start_x; + std::vector<float>* m_hits_start_y; + std::vector<float>* m_hits_start_z; + std::vector<float>* m_hits_end_x; + std::vector<float>* m_hits_end_y; + std::vector<float>* m_hits_end_z; + std::vector<float>* m_hits_time; + std::vector<float>* m_hits_edep; + std::vector<float>* m_hits_kine; + + TTree * m_tree; + std::string m_ntupleFileName; + std::string m_path; + ServiceHandle<ITHistSvc> m_thistSvc; + +}; + +#endif // CSC_HIT_ANALYSIS_H + diff --git a/Simulation/Tools/HitAnalysis/src/CaloHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/CaloHitAnalysis.cxx index 9bf5fd2cdca5e9c62fce14e7fe5365f7292404b2..ae15f65605266565fcca81e86df14fb00676fe6d 100755 --- a/Simulation/Tools/HitAnalysis/src/CaloHitAnalysis.cxx +++ b/Simulation/Tools/HitAnalysis/src/CaloHitAnalysis.cxx @@ -2,6 +2,9 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ +// Base class +#include "CaloHitAnalysis.h" + // Section of includes for LAr calo tests #include "LArSimEvent/LArHitContainer.h" #include "CaloDetDescr/CaloDetDescrElement.h" @@ -14,20 +17,14 @@ #include "TileSimEvent/TileHit.h" #include "TileSimEvent/TileHitVector.h" -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/AlgFactory.h" -#include "GaudiKernel/IToolSvc.h" -#include "GaudiKernel/ITHistSvc.h" - -#include "StoreGate/StoreGateSvc.h" +//Section of includes for Calibrated Calo hits +#include "GeoAdaptors/GeoCaloCalibHit.h" +#include "CaloSimEvent/CaloCalibrationHitContainer.h" -#include "EventInfo/EventInfo.h" -#include "EventInfo/EventID.h" - -#include "TTree.h" #include "TString.h" - -#include "HitAnalysis/CaloHitAnalysis.h" +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" #include <algorithm> #include <math.h> @@ -36,131 +33,354 @@ CaloHitAnalysis::CaloHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator) : AthAlgorithm(name, pSvcLocator) - , m_storeGate(0) + , h_cell_eta(0) + , h_cell_phi(0) + , h_cell_e(0) + , h_cell_radius(0) + , h_xy(0) + , h_zr(0) + , h_etaphi(0) + , h_time_e(0) + , h_eta_e(0) + , h_phi_e(0) + , h_r_e(0) + , h_calib_eta(0) + , h_calib_phi(0) + , h_calib_rz(0) + , h_calib_etaphi(0) + , h_calib_eEM(0) + , h_calib_eNonEM(0) + , h_calib_eInv(0) + , h_calib_eEsc(0) + , h_calib_eTot(0) + , h_calib_eTotpartID(0) , m_cell_eta(0) , m_cell_phi(0) + , m_cell_x(0) + , m_cell_y(0) + , m_cell_z(0) , m_cell_e(0) , m_cell_radius(0) + , m_time(0) + , m_calib_eta(0) + , m_calib_phi(0) + , m_calib_radius(0) + , m_calib_z(0) + , m_calib_eEM(0) + , m_calib_eNonEM(0) + , m_calib_eInv(0) + , m_calib_eEsc(0) + , m_calib_eTot(0) + , m_calib_partID(0) + , m_expert("off") + , m_calib("off") + , m_thistSvc("THistSvc",name) + , m_path("/CaloHitAnalysis/") , m_tree(0) - , m_ntupleFileName("/ntuples/file1") - , m_ntupleDirName("CaloHitAnalysis") - , m_ntupleTreeName("CaloHitAna") - , m_thistSvc(0) + , m_ntupleFileName("/ntuples/") , m_tileID(0) , m_tileMgr(0) { - declareProperty("NtupleFileName", m_ntupleFileName); - declareProperty("NtupleDirectoryName", m_ntupleDirName); - declareProperty("NtupleTreeName", m_ntupleTreeName); + declareProperty("HistPath", m_path); + declareProperty("ExpertMode", m_expert="off"); + declareProperty("CalibHits", m_calib="off"); + declareProperty("NtupleFileName", m_ntupleFileName); } - -CaloHitAnalysis::~CaloHitAnalysis() -{;} - StatusCode CaloHitAnalysis::initialize() { ATH_MSG_DEBUG( "Initializing CaloHitAnalysis" ); - StoreGateSvc* detStore; - StatusCode sc = service("DetectorStore",detStore); - if (sc.isFailure()) { - ATH_MSG_ERROR( "Unable to get pointer to Detector Store Service" ); - return sc; - } + CHECK( detStore()->retrieve(m_tileMgr) ); - sc = detStore->retrieve(m_tileMgr); - if (sc.isFailure()) { - ATH_MSG_ERROR( "Unable to retrieve TileDetDescrManager from DetectorStore" ); - m_tileMgr=0; - } - - sc = detStore->retrieve(m_tileID); - if (sc.isFailure()) { - ATH_MSG_ERROR( "Unable to retrieve TileID helper from DetectorStore" ); - m_tileID=0; - } - - /** get a handle of StoreGate for access to the Event Store */ - sc = service("StoreGateSvc", m_storeGate); - if (sc.isFailure()) { - ATH_MSG_ERROR( "Unable to retrieve pointer to StoreGateSvc" ); - return sc; - } + CHECK( detStore()->retrieve(m_tileID) ); // Grab the Ntuple and histogramming service for the tree - sc = service("THistSvc",m_thistSvc); - if (sc.isFailure()) { - ATH_MSG_ERROR( "Unable to retrieve pointer to THistSvc" ); - return sc; - } + CHECK( m_thistSvc.retrieve() ); - m_tree = new TTree( TString(m_ntupleTreeName), "CaloHitAna" ); - std::string fullNtupleName = "/"+m_ntupleFileName+"/"+m_ntupleDirName+"/"+m_ntupleTreeName; - sc = m_thistSvc->regTree(fullNtupleName, m_tree); - if (sc.isFailure()) { - ATH_MSG_ERROR("Unable to register TTree: " << fullNtupleName); - return sc; - } - - /** now add branches and leaves to the tree */ - if (m_tree){ - m_tree->Branch("CellEta", &m_cell_eta); - m_tree->Branch("CellPhi", &m_cell_phi); - m_tree->Branch("CellE", &m_cell_e); - m_tree->Branch("CellRadius", &m_cell_radius); + h_cell_e = new TH1D("h_Calo_cell_e", "cell_e", 100,0.,500.); + h_cell_e->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_cell_e->GetName(), h_cell_e)); + + h_cell_eta = new TH1D("h_Calo_cell_eta", "cell_eta", 50,-5.,5.); + h_cell_eta->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_cell_eta->GetName(), h_cell_eta)); + + h_cell_phi = new TH1D("h_Calo_cell_phi", "cell_phi", 50,-3.1416,3.1416); + h_cell_phi->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_cell_phi->GetName(), h_cell_phi)); + + h_cell_radius = new TH1D("h_Calo_cell_radius", "cell_radius", 100, 0., 6000.); + h_cell_radius->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_cell_radius->GetName(), h_cell_radius)); + + h_xy = new TH2F("h_Calo_xy", "xy", 100,-4000,4000,100, -4000, 4000); + h_xy->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_xy->GetName(), h_xy)); + + h_zr = new TH2D("h_Calo_zr", "zr", 100,-7000.,7000.,100, 0., 6000.); + h_zr->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_zr->GetName(), h_zr)); + + h_etaphi = new TH2D("h_Calo_etaphi", "eta_phi", 50,-5.,5.,50, -3.1416, 3.1416); + h_etaphi->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_etaphi->GetName(), h_etaphi)); + + //These histograms will be filled only if expert mode is set on + h_time_e = new TH2D("h_Calo_time_e", "energy vs time", 100, 0,50, 100,0,500); + h_time_e->StatOverflows(); + + h_eta_e = new TH2D("h_Calo_eta_e", "energy vs eta", 50, -5,5, 100,0,500); + h_eta_e->StatOverflows(); + + h_phi_e = new TH2D("h_Calo_phi_e", "energy vs phi", 50, -3.1416,3.1416, 100,0,500); + h_phi_e->StatOverflows(); + + h_r_e = new TH2D("h_Calo_r_e", "energy vs radius", 100, 0,6000, 100,0,500); + h_r_e->StatOverflows(); + + if( m_expert == "on") + { + CHECK(m_thistSvc->regHist( m_path+h_time_e->GetName(), h_time_e)); + CHECK(m_thistSvc->regHist( m_path+h_eta_e->GetName(), h_eta_e)); + CHECK(m_thistSvc->regHist( m_path+h_phi_e->GetName(), h_phi_e)); + CHECK(m_thistSvc->regHist( m_path+h_r_e->GetName(), h_r_e)); + } + + //Histograms for calibrated hits + h_calib_eta = new TH1D("h_calib_eta", "calib. hits eta", 50,-5,5); + h_calib_eta->StatOverflows(); + + h_calib_phi = new TH1D("h_calib_phi", "calib. hits phi", 50,-3.1416,3.1416); + h_calib_phi->StatOverflows(); + + h_calib_rz = new TH2D("h_calib_rz", "calib. hits r vs z", 100,-7000,7000,1000, 0,6000); + h_calib_rz->StatOverflows(); + + h_calib_etaphi = new TH2D("h_calib_etaphi", "calib. hits eta vs phi",50,-5.,5., 50,-3.1416,3.1416); + h_calib_etaphi->StatOverflows(); + + h_calib_eEM = new TH1D("h_calib_eEM", "calib. hits EM energy", 100,0,100); + h_calib_eEM->StatOverflows(); + + h_calib_eNonEM = new TH1D("h_calib_nonEM", "calib. hits non EM energy", 100,0,100); + h_calib_eNonEM->StatOverflows(); + + h_calib_eInv = new TH1D("h_calib_eInv", "calib. hits invisible energy", 100,0,100); + h_calib_eInv->StatOverflows(); + + h_calib_eEsc = new TH1D("h_calib_eEsc", "calib. hits escaped energy", 100,0,100); + h_calib_eEsc->StatOverflows(); + + h_calib_eTot = new TH1D("h_calib_eTot", "calib. hits energy", 100,0,100); + h_calib_eTot->StatOverflows(); + + h_calib_eTotpartID = new TH1D("h_calib_eTotpartID", "calib. hits partID weighted with energy",600,0,300000); + h_calib_eTotpartID->StatOverflows(); + + if( m_calib == "on") + { + CHECK(m_thistSvc->regHist( m_path+h_calib_eta->GetName(), h_calib_eta)); + CHECK(m_thistSvc->regHist( m_path+h_calib_phi->GetName(), h_calib_phi)); + CHECK(m_thistSvc->regHist( m_path+h_calib_rz->GetName(), h_calib_rz)); + CHECK(m_thistSvc->regHist( m_path+h_calib_etaphi->GetName(), h_calib_etaphi)); + CHECK(m_thistSvc->regHist( m_path+h_calib_eEM->GetName(), h_calib_eEM)); + CHECK(m_thistSvc->regHist( m_path+h_calib_eNonEM->GetName(), h_calib_eNonEM)); + CHECK(m_thistSvc->regHist( m_path+h_calib_eInv->GetName(), h_calib_eInv)); + CHECK(m_thistSvc->regHist( m_path+h_calib_eEsc->GetName(), h_calib_eEsc)); + CHECK(m_thistSvc->regHist( m_path+h_calib_eTot->GetName(), h_calib_eTot)); + CHECK(m_thistSvc->regHist( m_path+h_calib_eTotpartID->GetName(), h_calib_eTotpartID)); + } + + + m_tree = new TTree( "CaloHitNtuple", "CaloHitAna" ); + std::string fullNtupleName = "/"+m_ntupleFileName+"/"; + CHECK( m_thistSvc->regTree(fullNtupleName, m_tree) ); + + if(m_tree) + { + m_tree->Branch("CellEta", &m_cell_eta); + m_tree->Branch("CellPhi", &m_cell_phi); + m_tree->Branch("CellX", &m_cell_x); + m_tree->Branch("CellY", &m_cell_y); + m_tree->Branch("CellZ", &m_cell_z); + m_tree->Branch("CellE", &m_cell_e); + m_tree->Branch("CellRadius", &m_cell_radius); + m_tree->Branch("Time", &m_time); + m_tree->Branch("CalibEta", &m_calib_eta); + m_tree->Branch("CalibPhi", &m_calib_phi); + m_tree->Branch("CalibRadius", &m_calib_radius); + m_tree->Branch("CalibZ", &m_calib_z); + m_tree->Branch("Calib_eEM", &m_calib_eEM); + m_tree->Branch("Calib_eNonEM", &m_calib_eNonEM); + m_tree->Branch("Calib_eInv", &m_calib_eInv); + m_tree->Branch("Calib_eEsc", &m_calib_eEsc); + m_tree->Branch("Calib_eTot", &m_calib_eTot); + m_tree->Branch("Calib_partID", &m_calib_partID); + + }else{ + ATH_MSG_ERROR( "No tree found!" ); } return StatusCode::SUCCESS; } -StatusCode CaloHitAnalysis::finalize() { - return StatusCode::SUCCESS; -} - StatusCode CaloHitAnalysis::execute() { ATH_MSG_DEBUG( "In CaloHitAnalysis::execute()" ); m_cell_eta->clear(); m_cell_phi->clear(); m_cell_e->clear(); + m_cell_x->clear(); + m_cell_y->clear(); + m_cell_z->clear(); m_cell_radius->clear(); + m_time->clear(); + m_calib_eta->clear(); + m_calib_phi->clear(); + m_calib_radius->clear(); + m_calib_z->clear(); + m_calib_eEM->clear(); + m_calib_eNonEM->clear(); + m_calib_eInv->clear(); + m_calib_eEsc->clear(); + m_calib_eTot->clear(); + m_calib_partID->clear(); std::string lArKey [4] = {"LArHitEMB", "LArHitEMEC", "LArHitFCAL", "LArHitHEC"}; for (unsigned int i=0;i<4;i++){ const DataHandle<LArHitContainer> iter; - if (m_storeGate->retrieve(iter,lArKey[i])==StatusCode::SUCCESS) { + if (evtStore()->retrieve(iter,lArKey[i])==StatusCode::SUCCESS) { LArHitContainer::const_iterator hi; - for (hi=(*iter).begin();hi!=(*iter).end();hi++){ - GeoLArHit ghit(**hi); + for (auto hi : *iter ){ + GeoLArHit ghit(*hi); if (!ghit) continue; - const CaloDetDescrElement *hitElement = ghit.getDetDescrElement(); - m_cell_e->push_back( ghit.Energy() ); - m_cell_eta->push_back( hitElement->eta() ); - m_cell_phi->push_back( hitElement->phi() ); - m_cell_radius->push_back( hitElement->r() ); + const CaloDetDescrElement *hitElement = ghit.getDetDescrElement(); + double energy = ghit.Energy(); + double time = ghit.Time(); + double eta = hitElement->eta(); + double phi = hitElement->phi(); + double radius = hitElement->r(); + float x = hitElement->x(); + float y = hitElement->y(); + double z = hitElement->z(); + + h_cell_e->Fill( energy ); + h_cell_eta->Fill( eta ); + h_cell_phi->Fill( phi ); + h_cell_radius->Fill( radius ); + h_xy->Fill(x,y); + h_zr->Fill(z,radius); + h_etaphi->Fill(eta, phi); + if( m_expert == "on"){ + h_time_e->Fill(time, energy); + h_eta_e->Fill(eta, energy); + h_phi_e->Fill(phi, energy); + h_r_e->Fill(radius, energy); + + } + m_cell_eta->push_back(eta); + m_cell_phi->push_back(phi); + m_cell_e->push_back(energy); + m_cell_x->push_back(x); + m_cell_y->push_back(y); + m_cell_z->push_back(z); + m_cell_radius->push_back(radius); + m_time->push_back(time); + } // End while hits } // End statuscode success upon retrieval of hits } // End detector type loop - - const TileHitVector * hitVec; - if (m_storeGate->retrieve(hitVec,"TileHitVec")==StatusCode::SUCCESS && + + const DataHandle<TileHitVector> hitVec; + //const TileHitVector* hitVec; + if (evtStore()->retrieve(hitVec,"TileHitVec")==StatusCode::SUCCESS && m_tileMgr && m_tileID ){ - for(TileHitVecConstIterator i_hit=hitVec->begin() ; i_hit!=hitVec->end() ; ++i_hit){ - Identifier pmt_id = (*i_hit).identify(); + for(auto i_hit : *hitVec ){ + Identifier pmt_id = (i_hit).identify(); Identifier cell_id = m_tileID->cell_id(pmt_id); - const CaloDetDescrElement* ddElement = m_tileMgr->get_cell_element(cell_id); - double tot_e=0.; - for (int t=0;t<(*i_hit).size();++t) tot_e += (*i_hit).energy(t); - m_cell_e->push_back( tot_e ); - m_cell_eta->push_back( ddElement->eta() ); - m_cell_phi->push_back( ddElement->phi() ); - m_cell_radius->push_back( ddElement->r() ); + const CaloDetDescrElement* ddElement = (m_tileID->is_tile_aux(cell_id)) ? 0 : m_tileMgr->get_cell_element(cell_id); + if(ddElement){ + double tot_e = 0.; + double tot_time = 0.; + for (int t=0;t<(i_hit).size();++t) tot_e += (i_hit).energy(t); + for (int t=0;t<(i_hit).size();++t) tot_time += (i_hit).time(t); + h_cell_e->Fill( tot_e ); + h_cell_eta->Fill( ddElement->eta() ); + h_cell_phi->Fill( ddElement->phi() ); + h_cell_radius->Fill( ddElement->z() ); + h_xy->Fill(ddElement->x(),ddElement->y()); + h_zr->Fill(ddElement->r(), ddElement->r()); + h_etaphi->Fill(ddElement->eta(), ddElement->phi()); + + if( m_expert == "on"){ + h_time_e->Fill(tot_time, tot_e); + h_eta_e->Fill(ddElement->eta(), tot_e); + h_phi_e->Fill(ddElement->phi(), tot_e); + h_r_e->Fill(ddElement->r(), tot_e); + } + m_cell_eta->push_back(ddElement->eta()); + m_cell_phi->push_back(ddElement->phi()); + m_cell_e->push_back(tot_e); + m_cell_x->push_back(ddElement->x()); + m_cell_y->push_back(ddElement->y()); + m_cell_z->push_back(ddElement->z()); + m_cell_radius->push_back(ddElement->r()); + m_time->push_back(tot_time); + } } } - if (m_tree) m_tree->Fill(); + //For calibrated hits + std::string LArCalibKey [3] = {"LArCalibrationHitActive", "LArCalibrationHitInactive","LArCalibrationHitDeadMaterial"}; + for(unsigned int j=0; j<3;j++){ + if(m_calib != "on") continue; + const DataHandle<CaloCalibrationHitContainer> iterator; + CaloCalibrationHitContainer::const_iterator hit_i; + if(evtStore()->retrieve(iterator, LArCalibKey[j])==StatusCode::SUCCESS){ + //Not tested + for(auto hit_i : *iterator){ + GeoCaloCalibHit geoHit(*hit_i, LArCalibKey[j]); + if(!geoHit) continue; + const CaloDetDescrElement* Element = geoHit.getDetDescrElement(); + double eta = Element->eta(); + double phi = Element->phi(); + double radius = Element->r(); + double z =Element->z(); + double emEnergy = geoHit.energyEM(); + double nonEmEnergy = geoHit.energyNonEM(); + double invEnergy = geoHit.energyInvisible(); + double escEnergy = geoHit.energyEscaped(); + double totEnergy = geoHit.energyTotal(); + double particleID = (*hit_i).particleID(); + + h_calib_eta->Fill(eta); + h_calib_phi->Fill(phi); + h_calib_rz->Fill(z,radius); + h_calib_etaphi->Fill(eta,phi); + h_calib_eEM->Fill(emEnergy); + h_calib_eNonEM->Fill(nonEmEnergy); + h_calib_eInv->Fill(invEnergy); + h_calib_eEsc->Fill(escEnergy); + h_calib_eTot->Fill(totEnergy); + h_calib_eTotpartID->Fill(particleID, totEnergy); + + m_calib_eta->push_back(eta); + m_calib_phi->push_back(phi); + m_calib_radius->push_back(radius); + m_calib_z->push_back(z); + m_calib_eEM->push_back(emEnergy); + m_calib_eNonEM->push_back(nonEmEnergy); + m_calib_eInv->push_back(invEnergy); + m_calib_eEsc->push_back(escEnergy); + m_calib_eTot->push_back(totEnergy); + m_calib_partID->push_back(particleID); + + } + } + } + if(m_tree) m_tree->Fill(); return StatusCode::SUCCESS; } diff --git a/Simulation/Tools/HitAnalysis/src/CaloHitAnalysis.h b/Simulation/Tools/HitAnalysis/src/CaloHitAnalysis.h new file mode 100755 index 0000000000000000000000000000000000000000..a0e04559e5ab75fabb3002f417ca6da6356b5eec --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/CaloHitAnalysis.h @@ -0,0 +1,93 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef CALO_HIT_ANALYSIS_H +#define CALO_HIT_ANALYSIS_H + +// Base class +#include "AthenaBaseComps/AthAlgorithm.h" + +// Members +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ITHistSvc.h" + +// STL includes +#include <string> +//#include <vector> + +class TileID; +class TileDetDescrManager; +class TH1; +class TH2; +class TTree; + +class CaloHitAnalysis : public AthAlgorithm { + + public: + + CaloHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator); + ~CaloHitAnalysis() {} + + virtual StatusCode initialize(); + virtual StatusCode execute(); + + private: + + /** Simple variables by Ketevi */ + TH1* h_cell_eta; + TH1* h_cell_phi; + TH1* h_cell_e; + TH1* h_cell_radius; + TH2* h_xy; + TH2* h_zr; + TH2* h_etaphi; + TH2* h_time_e; + TH2* h_eta_e; + TH2* h_phi_e; + TH2* h_r_e; + TH1* h_calib_eta; + TH1* h_calib_phi; + TH2* h_calib_rz; + TH2* h_calib_etaphi; + TH1* h_calib_eEM; + TH1* h_calib_eNonEM; + TH1* h_calib_eInv; + TH1* h_calib_eEsc; + TH1* h_calib_eTot; + TH1* h_calib_eTotpartID; + + std::vector<float>* m_cell_eta; + std::vector<float>* m_cell_phi; + std::vector<float>* m_cell_x; + std::vector<float>* m_cell_y; + std::vector<float>* m_cell_z; + std::vector<float>* m_cell_e; + std::vector<float>* m_cell_radius; + std::vector<float>* m_time; + std::vector<float>* m_calib_eta; + std::vector<float>* m_calib_phi; + std::vector<float>* m_calib_radius; + std::vector<float>* m_calib_z; + std::vector<float>* m_calib_eEM; + std::vector<float>* m_calib_eNonEM; + std::vector<float>* m_calib_eInv; + std::vector<float>* m_calib_eEsc; + std::vector<float>* m_calib_eTot; + std::vector<float>* m_calib_partID; + + + std::string m_expert; + std::string m_calib; + ServiceHandle<ITHistSvc> m_thistSvc; + std::string m_path; + + TTree* m_tree; + std::string m_ntupleFileName; + const TileID * m_tileID; + const TileDetDescrManager * m_tileMgr; + +}; + +#endif // CALO_HIT_ANALYSIS_H + diff --git a/Simulation/Tools/HitAnalysis/src/LucidHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/LucidHitAnalysis.cxx new file mode 100755 index 0000000000000000000000000000000000000000..57b312d3454ad69f889c3a27749002e15d845798 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/LucidHitAnalysis.cxx @@ -0,0 +1,212 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "LucidHitAnalysis.h" + + +#include "LUCID_SimEvent/LUCID_SimHitCollection.h" + + +#include "TH1.h" +#include "TTree.h" +#include "TString.h" + + +#include <algorithm> +#include <math.h> +#include <functional> +#include <iostream> +#include <stdio.h> + +LucidHitAnalysis::LucidHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator) + : AthAlgorithm(name, pSvcLocator) + , h_hit_x(0) + , h_hit_y(0) + , h_hit_z(0) + , h_xy(0) + , h_zr(0) + , h_hit_post_x(0) + , h_hit_post_y(0) + , h_hit_post_z(0) + , h_hit_edep(0) + , h_hit_pdgid(0) + , h_hit_pretime(0) + , h_hit_posttime(0) + , h_genvolume(0) + , h_wavelength(0) + , m_hit_x(0) + , m_hit_y(0) + , m_hit_z(0) + , m_hit_post_x(0) + , m_hit_post_y(0) + , m_hit_post_z(0) + , m_hit_edep(0) + , m_hit_pdgid(0) + , m_hit_pretime(0) + , m_hit_posttime(0) + , m_gen_volume(0) + , m_wavelength(0) + , m_tree(0) + , m_ntupleFileName("/LucidHitAnalysis/ntuple/") + , m_path("/LucidHitAnalysis/histos/") + , m_thistSvc("THistSvc", name) +{ + declareProperty("NtupleFileName", m_ntupleFileName); + declareProperty("HistPath", m_path); + +} + +StatusCode LucidHitAnalysis::initialize() { + ATH_MSG_DEBUG( "Initializing LucidHitAnalysis" ); + + // Grab the Ntuple and histogramming service for the tree + CHECK(m_thistSvc.retrieve()); + + + /** Histograms**/ + h_hit_x = new TH1D("h_hit_x", "hit_x", 100,-150.,150.); + h_hit_x->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_hit_x->GetName(), h_hit_x)); + + h_hit_y = new TH1D("h_hit_y", "hit_y", 100,-150.,150.); + h_hit_y->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_hit_y->GetName(), h_hit_y)); + + h_hit_z = new TH1D("h_hit_z", "hit_z", 100,-20000.,20000.); + h_hit_z->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_hit_z->GetName(), h_hit_z)); + + h_xy = new TH2D("h_xy", "hit_xy", 100,-150.,150.,100,-150,150); + h_xy->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_xy->GetName(), h_xy)); + + h_zr = new TH2D("h_zr", "hit_zr", 100,-20000.,20000.,100,0,250); + h_zr->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_zr->GetName(), h_zr)); + + h_hit_post_x = new TH1D("h_hit_post_x", "hit_post_x", 100,-150.,150.); + h_hit_post_x->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_hit_post_x->GetName(), h_hit_post_x)); + + h_hit_post_y = new TH1D("h_hit_post_y", "hit_post_y", 100,-150,150.); + h_hit_post_y->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_hit_post_y->GetName(), h_hit_post_y)); + + h_hit_post_z = new TH1D("h_hit_post_z", "hit_post_z", 100,-15000,15000.); + h_hit_post_z->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_hit_post_z->GetName(), h_hit_post_z)); + + h_hit_edep = new TH1D("h_hit_edep", "hit_edep", 100,0.,20.); + h_hit_edep->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_hit_edep->GetName(), h_hit_edep)); + + h_hit_pdgid = new TH1D("h_hit_pdgid", "hit_pdgid", 100,0.,7e6); + h_hit_pdgid->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_hit_pdgid->GetName(), h_hit_pdgid)); + + h_hit_pretime = new TH1D("h_hit_pretime", "hit_pretime", 100,0.,100.); + h_hit_pretime->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_hit_pretime->GetName(), h_hit_pretime)); + + h_hit_posttime = new TH1D("h_hit_posttime", "hit_posttime", 100,0.,100.); + h_hit_posttime->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_hit_posttime->GetName(), h_hit_posttime)); + + h_genvolume = new TH1D("h_genvolume", "genvolume", 20,0.,5.); + h_genvolume->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_genvolume->GetName(), h_genvolume)); + + h_wavelength = new TH1D("m_wavelength", "wavelength", 150,0.,800.); + h_wavelength->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_wavelength->GetName(), h_wavelength)); + + + m_tree= new TTree("NtupleLucidHitAnalysis","LucidHitAna"); + std::string fullNtupleName = "/"+m_ntupleFileName+"/"; + CHECK(m_thistSvc->regTree(fullNtupleName,m_tree)); + + if (m_tree){ + m_tree->Branch("hit_x", &m_hit_x); + m_tree->Branch("hit_y", &m_hit_y); + m_tree->Branch("hit_z", &m_hit_z); + m_tree->Branch("hit_post_x", &m_hit_post_x); + m_tree->Branch("hit_post_y", &m_hit_post_y); + m_tree->Branch("hit_post_z", &m_hit_post_z); + m_tree->Branch("edep", &m_hit_edep); + m_tree->Branch("pdgid", &m_hit_pdgid); + m_tree->Branch("pretime", &m_hit_pretime); + m_tree->Branch("posttime", &m_hit_posttime); + m_tree->Branch("gen_volume", &m_gen_volume); + m_tree->Branch("wavelength", &m_wavelength); + }else{ + ATH_MSG_ERROR("No tree found!"); + } + return StatusCode::SUCCESS; +} + + + +StatusCode LucidHitAnalysis::execute() { + ATH_MSG_DEBUG( "In LucidHitAnalysis::execute()" ); + + m_hit_x->clear(); + m_hit_y->clear(); + m_hit_z->clear(); + m_hit_post_x->clear(); + m_hit_post_y->clear(); + m_hit_post_z->clear(); + m_hit_edep->clear(); + m_hit_pdgid->clear(); + m_hit_pretime->clear(); + m_hit_posttime->clear(); + m_gen_volume->clear(); + m_wavelength->clear(); + + + const DataHandle<LUCID_SimHitCollection> iter; + if (evtStore()->retrieve(iter)==StatusCode::SUCCESS) { + for(LUCID_SimHitCollection::const_iterator i_hit = (*iter).begin(); + i_hit != (*iter).end();++i_hit){ + double x = i_hit->GetX(); + double y = i_hit->GetY(); + double z = i_hit->GetZ(); + double r = sqrt(x*x+y*y); + h_hit_x->Fill(i_hit->GetX()); + h_hit_y->Fill(i_hit->GetY()); + h_hit_z->Fill(i_hit->GetZ()); + h_xy->Fill(x, y); + h_zr->Fill(z, r); + h_hit_post_x->Fill(i_hit->GetEPX()); + h_hit_post_y->Fill(i_hit->GetEPY()); + h_hit_post_z->Fill(i_hit->GetEPZ()); + h_hit_edep->Fill(i_hit->GetEnergy()); + h_hit_pdgid->Fill(i_hit->GetPdgCode()); + h_hit_pretime->Fill(i_hit->GetPreStepTime()); + h_hit_posttime->Fill(i_hit->GetPostStepTime()); + h_genvolume->Fill(i_hit->GetGenVolume()); + h_wavelength->Fill(i_hit->GetWavelength()); + + + m_hit_x->push_back(i_hit->GetX()); + m_hit_y->push_back(i_hit->GetY()); + m_hit_z->push_back(i_hit->GetZ()); + m_hit_post_x->push_back(i_hit->GetEPX()); + m_hit_post_y->push_back(i_hit->GetEPY()); + m_hit_post_z->push_back(i_hit->GetEPZ()); + m_hit_edep->push_back(i_hit->GetEnergy()); + m_hit_pdgid->push_back(i_hit->GetPdgCode()); + m_hit_pretime->push_back(i_hit->GetPreStepTime()); + m_hit_posttime->push_back(i_hit->GetPostStepTime()); + m_gen_volume->push_back(i_hit->GetGenVolume()); + m_wavelength->push_back(i_hit->GetWavelength()); + } + } // End while hits + + if (m_tree) m_tree->Fill(); + + + + + return StatusCode::SUCCESS; +} diff --git a/Simulation/Tools/HitAnalysis/src/LucidHitAnalysis.h b/Simulation/Tools/HitAnalysis/src/LucidHitAnalysis.h new file mode 100755 index 0000000000000000000000000000000000000000..056751fbcbc68d8f623c38711cd83336c9772dc3 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/LucidHitAnalysis.h @@ -0,0 +1,77 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef LUCID_HIT_ANALYSIS_H +#define LUCID_HIT_ANALYSIS_H + +#include "AthenaBaseComps/AthAlgorithm.h" + +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ITHistSvc.h" + +#include <string> +#include <vector> +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" + + +class TH1; +class TH2; +class TTree; + +class LucidHitAnalysis : public AthAlgorithm { + + public: + + LucidHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator); + ~LucidHitAnalysis(){} + + virtual StatusCode initialize(); + virtual StatusCode execute(); + + private: + + std::string m_collection; + /** Some histograms**/ + TH1* h_hit_x; + TH1* h_hit_y; + TH1* h_hit_z; + TH2* h_xy; + TH2* h_zr; + TH1* h_hit_post_x; + TH1* h_hit_post_y; + TH1* h_hit_post_z; + TH1* h_hit_edep; + TH1* h_hit_pdgid; + TH1* h_hit_pretime; + TH1* h_hit_posttime; + TH1* h_genvolume; + TH1* h_wavelength; + + + std::vector<float>* m_hit_x; + std::vector<float>* m_hit_y; + std::vector<float>* m_hit_z; + std::vector<float>* m_hit_post_x; + std::vector<float>* m_hit_post_y; + std::vector<float>* m_hit_post_z; + std::vector<float>* m_hit_edep; + std::vector<float>* m_hit_pdgid; + std::vector<float>* m_hit_pretime; + std::vector<float>* m_hit_posttime; + std::vector<float>* m_gen_volume; + std::vector<float>* m_wavelength; + + + + TTree * m_tree; + std::string m_ntupleFileName; + std::string m_path; + ServiceHandle<ITHistSvc> m_thistSvc; + +}; + +#endif // LUCID_HIT_ANALYSIS_H + diff --git a/Simulation/Tools/HitAnalysis/src/MDTHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/MDTHitAnalysis.cxx new file mode 100755 index 0000000000000000000000000000000000000000..1f7ddd9d3fe849ae48c5ecee1303cded275b5e90 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/MDTHitAnalysis.cxx @@ -0,0 +1,236 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "MDTHitAnalysis.h" + +// Section of includes for MDT of the Muon Spectrometer tests +#include "GeoAdaptors/GeoMuonHits.h" + +#include "MuonSimEvent/MDTSimHitCollection.h" +#include "MuonSimEvent/MDTSimHit.h" +#include "CLHEP/Vector/LorentzVector.h" + +#include "TH1.h" +#include "TTree.h" +#include "TString.h" + + +#include <algorithm> +#include <math.h> +#include <functional> +#include <iostream> +#include <stdio.h> + +MDTHitAnalysis::MDTHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator) + : AthAlgorithm(name, pSvcLocator) + , h_hits_x(0) + , h_hits_y(0) + , h_hits_z(0) + , h_hits_r(0) + , h_xy(0) + , h_zr(0) + , h_hits_eta(0) + , h_hits_phi(0) + , h_hits_lx(0) + , h_hits_ly(0) + , h_hits_lz(0) + , h_hits_driftR(0) + , h_hits_time(0) + , h_hits_edep(0) + , h_hits_kine(0) + , h_hits_step(0) + , m_hits_x(0) + , m_hits_y(0) + , m_hits_z(0) + , m_hits_r(0) + , m_hits_eta(0) + , m_hits_phi(0) + , m_hits_lx(0) + , m_hits_ly(0) + , m_hits_lz(0) + , m_hits_driftR(0) + , m_hits_time(0) + , m_hits_edep(0) + , m_hits_kine(0) + , m_hits_step(0) + , m_tree(0) + , m_ntupleFileName("MDTHitAnalysis/ntuple/") + , m_path("/MDTHitAnalysis/histos/") + , m_thistSvc("THistSvc", name) +{ + declareProperty("NtupleFileName", m_ntupleFileName); + declareProperty("HistPath", m_path); + +} + +StatusCode MDTHitAnalysis::initialize() { + ATH_MSG_DEBUG( "Initializing MDTHitAnalysis" ); + + // Grab the Ntuple and histogramming service for the tree + CHECK(m_thistSvc.retrieve()); + + + /** Histograms */ + + h_hits_x = new TH1D("h_hits_mdt_x","hits_x", 100,-25000, 25000); + h_hits_x->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_x->GetName(), h_hits_x)); + + h_hits_y = new TH1D("h_hits_mdt_y", "hits_y", 100,-25000,25000); + h_hits_y->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_y->GetName(), h_hits_y)); + + h_hits_z = new TH1D("h_hits_mdt_z", "hits_z", 100,-45000,45000); + h_hits_z->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_z->GetName(), h_hits_z)); + + h_hits_r = new TH1D("h_hits_mdt_r", "hits_r", 100,4000,26000); + h_hits_r->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_r->GetName(), h_hits_r)); + + h_xy = new TH2D("h_mdt_xy", "xy", 100,-25000.,25000.,100, -25000., 25000.); + h_xy->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_xy->GetName(), h_xy)); + + h_zr = new TH2D("h_mdt_zr", "zr", 100,-45000.,45000.,100, 4000., 26000.); + h_zr->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_zr->GetName(), h_zr)); + + h_hits_eta = new TH1D("h_hits_mdt_eta", "hits_eta", 100,-3.0,3.0); + h_hits_eta->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_eta->GetName(), h_hits_eta)); + + h_hits_phi = new TH1D("h_hits_mdt_phi", "hits_phi", 100,-3.2,3.2); + h_hits_phi->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_phi->GetName(), h_hits_phi)); + + h_hits_lx = new TH1D("h_hits_mdt_lx","hits_lx", 100,-20, 20); + h_hits_lx->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_lx->GetName(), h_hits_lx)); + + h_hits_ly = new TH1D("h_hits_mdt_ly", "hits_ly", 100,-20,20); + h_hits_ly->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_ly->GetName(), h_hits_ly)); + + h_hits_lz = new TH1D("h_hits_mdt_lz", "hits_lz", 100,-2000,2000); + h_hits_lz->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_lz->GetName(), h_hits_lz)); + + h_hits_driftR = new TH1D("h_hits_mdt_driftR", "hits_driftR", 100,0,15); + h_hits_driftR->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_driftR->GetName(), h_hits_driftR)); + + h_hits_time = new TH1D("h_hits_mdt_time","hits_time", 100,0, 150); + h_hits_time->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_time->GetName(), h_hits_time)); + + h_hits_edep = new TH1D("h_hits_mdt_edep", "hits_edep", 100,0,0.2); + h_hits_edep->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_edep->GetName(), h_hits_edep)); + + h_hits_kine = new TH1D("h_hits_mdt_kine", "hits_kine", 100,0,20000); + h_hits_kine->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_kine->GetName(), h_hits_kine)); + + h_hits_step = new TH1D("h_hits_mdt_step", "hits_step", 100,0,100); + h_hits_step->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_step->GetName(), h_hits_step)); + + m_tree= new TTree("NtupleMDTHitAnalysis","MDTHitAna"); + std::string fullNtupleName = "/"+m_ntupleFileName+"/"; + CHECK(m_thistSvc->regTree(fullNtupleName,m_tree)); + + + + /** now add branches and leaves to the tree */ + if (m_tree){ + m_tree->Branch("x", &m_hits_x); + m_tree->Branch("y", &m_hits_y); + m_tree->Branch("z", &m_hits_z); + m_tree->Branch("r", &m_hits_r); + m_tree->Branch("eta", &m_hits_eta); + m_tree->Branch("phi", &m_hits_phi); + m_tree->Branch("lx", &m_hits_lx); + m_tree->Branch("ly", &m_hits_ly); + m_tree->Branch("lz", &m_hits_lz); + m_tree->Branch("driftR", &m_hits_driftR); + m_tree->Branch("time", &m_hits_time); + m_tree->Branch("edep", &m_hits_edep); + m_tree->Branch("kine", &m_hits_kine); + m_tree->Branch("step", &m_hits_step); + }else{ + ATH_MSG_ERROR("No tree found!"); + } + + return StatusCode::SUCCESS; +} + + + +StatusCode MDTHitAnalysis::execute() { + ATH_MSG_DEBUG( "In MDTHitAnalysis::execute()" ); + + m_hits_x->clear(); + m_hits_y->clear(); + m_hits_z->clear(); + m_hits_r->clear(); + m_hits_eta->clear(); + m_hits_phi->clear(); + m_hits_lx->clear(); + m_hits_ly->clear(); + m_hits_lz->clear(); + m_hits_driftR->clear(); + m_hits_time->clear(); + m_hits_edep->clear(); + m_hits_kine->clear(); + m_hits_step->clear(); + + const DataHandle<MDTSimHitCollection> mdt_container; + if (evtStore()->retrieve(mdt_container, "MDT_Hits" )==StatusCode::SUCCESS) { + for(MDTSimHitCollection::const_iterator i_hit = mdt_container->begin(); + i_hit != mdt_container->end();++i_hit){ + //MDTSimHitCollection::const_iterator i_hit; + //for(auto i_hit : *mdt_container){ + GeoMDTHit ghit(*i_hit); + if(!ghit) continue; + Amg::Vector3D p = ghit.getGlobalPosition(); + h_hits_x->Fill(p.x()); + h_hits_y->Fill(p.y()); + h_hits_z->Fill(p.z()); + h_hits_r->Fill(p.perp()); + h_xy->Fill(p.x(), p.y()); + h_zr->Fill(p.z(),p.perp()); + h_hits_eta->Fill(p.eta()); + h_hits_phi->Fill(p.phi()); + h_hits_driftR->Fill((*i_hit).driftRadius()); + h_hits_lx->Fill( (*i_hit).localPosition().x()); + h_hits_ly->Fill( (*i_hit).localPosition().y()); + h_hits_lz->Fill( (*i_hit).localPosition().z()); + h_hits_edep->Fill((*i_hit).energyDeposit()); + h_hits_time->Fill((*i_hit).globalTime()); + h_hits_step->Fill((*i_hit).stepLength()); + h_hits_kine->Fill((*i_hit).kineticEnergy()); + + + m_hits_x->push_back(p.x()); + m_hits_y->push_back(p.y()); + m_hits_z->push_back(p.z()); + m_hits_r->push_back(p.perp()); + m_hits_eta->push_back(p.eta()); + m_hits_phi->push_back(p.phi()); + m_hits_driftR->push_back((*i_hit).driftRadius()); + m_hits_lx->push_back( (*i_hit).localPosition().x()); + m_hits_ly->push_back( (*i_hit).localPosition().y()); + m_hits_lz->push_back( (*i_hit).localPosition().z()); + m_hits_edep->push_back((*i_hit).energyDeposit()); + m_hits_time->push_back((*i_hit).globalTime()); + m_hits_step->push_back((*i_hit).stepLength()); + m_hits_kine->push_back((*i_hit).kineticEnergy()); + } + } // End while hits + + if (m_tree) m_tree->Fill(); + + return StatusCode::SUCCESS; +} diff --git a/Simulation/Tools/HitAnalysis/src/MDTHitAnalysis.h b/Simulation/Tools/HitAnalysis/src/MDTHitAnalysis.h new file mode 100755 index 0000000000000000000000000000000000000000..85b154dad3711c524a9d9549bb93727fc1a1b0e1 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/MDTHitAnalysis.h @@ -0,0 +1,79 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef MDT_HIT_ANALYSIS_H +#define MDT_HIT_ANALYSIS_H + +#include "AthenaBaseComps/AthAlgorithm.h" + +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ITHistSvc.h" + +#include <string> +#include <vector> +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" + + + +class TH1; +class TH2; +class TTree; + + +class MDTHitAnalysis : public AthAlgorithm { + + public: + + MDTHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator); + ~MDTHitAnalysis(){} + + virtual StatusCode initialize(); + virtual StatusCode execute(); + + private: + + /** Some variables**/ + TH1* h_hits_x; + TH1* h_hits_y; + TH1* h_hits_z; + TH1* h_hits_r; + TH2* h_xy; + TH2* h_zr; + TH1* h_hits_eta; + TH1* h_hits_phi; + TH1* h_hits_lx; + TH1* h_hits_ly; + TH1* h_hits_lz; + TH1* h_hits_driftR; + TH1* h_hits_time; + TH1* h_hits_edep; + TH1* h_hits_kine; + TH1* h_hits_step; + std::vector<float>* m_hits_x; + std::vector<float>* m_hits_y; + std::vector<float>* m_hits_z; + std::vector<float>* m_hits_r; + std::vector<float>* m_hits_eta; + std::vector<float>* m_hits_phi; + std::vector<float>* m_hits_lx; + std::vector<float>* m_hits_ly; + std::vector<float>* m_hits_lz; + std::vector<float>* m_hits_driftR; + std::vector<float>* m_hits_time; + std::vector<float>* m_hits_edep; + std::vector<float>* m_hits_kine; + std::vector<float>* m_hits_step; + + TTree * m_tree; + std::string m_ntupleFileName; + + std::string m_path; + ServiceHandle<ITHistSvc> m_thistSvc; + +}; + +#endif // MDT_HIT_ANALYSIS_H + diff --git a/Simulation/Tools/HitAnalysis/src/RPCHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/RPCHitAnalysis.cxx new file mode 100755 index 0000000000000000000000000000000000000000..b83c04c183da51f37ba9d459e6794163912e1399 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/RPCHitAnalysis.cxx @@ -0,0 +1,225 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "RPCHitAnalysis.h" + +// Section of includes for the RPC of the Muon Spectrometer tests +#include "GeoAdaptors/GeoMuonHits.h" + +#include "MuonSimEvent/RPCSimHitCollection.h" +#include "MuonSimEvent/RPCSimHit.h" +#include "CLHEP/Vector/LorentzVector.h" + +#include "TH1.h" +#include "TTree.h" +#include "TString.h" + + +#include <algorithm> +#include <math.h> +#include <functional> +#include <iostream> +#include <stdio.h> + +RPCHitAnalysis::RPCHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator) + : AthAlgorithm(name, pSvcLocator) + , h_hits_x(0) + , h_hits_y(0) + , h_hits_z(0) + , h_hits_r(0) + , h_xy(0) + , h_zr(0) + , h_hits_eta(0) + , h_hits_phi(0) + , h_hits_lx(0) + , h_hits_ly(0) + , h_hits_lz(0) + , h_hits_time(0) + , h_hits_edep(0) + , h_hits_kine(0) + , h_hits_step(0) + , m_hits_x(0) + , m_hits_y(0) + , m_hits_z(0) + , m_hits_r(0) + , m_hits_eta(0) + , m_hits_phi(0) + , m_hits_lx(0) + , m_hits_ly(0) + , m_hits_lz(0) + , m_hits_time(0) + , m_hits_edep(0) + , m_hits_kine(0) + , m_hits_step(0) + , m_tree(0) + , m_ntupleFileName("/RPCHitAnalysis/ntuple/") + , m_path("/RPCHitAnalysis/histos/") + , m_thistSvc("THistSvc", name) +{ + declareProperty("NtupleFileName", m_ntupleFileName); + declareProperty("HistPath", m_path); + +} + +StatusCode RPCHitAnalysis::initialize() { + ATH_MSG_DEBUG( "Initializing RPCHitAnalysis" ); + + // Grab the Ntuple and histogramming service for the tree + CHECK(m_thistSvc.retrieve()); + + /** Histograms**/ + h_hits_x = new TH1D("h_hits_rpc_x","hits_x", 100,-11000, 11000); + h_hits_x->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_x->GetName(), h_hits_x)); + + h_hits_y = new TH1D("h_hits_rpc_y", "hits_y", 100,-11000,11000); + h_hits_y->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_y->GetName(), h_hits_y)); + + h_hits_z = new TH1D("h_hits_rpc_z", "hits_z", 100,-12500, 12500); + h_hits_z->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_z->GetName(), h_hits_z)); + + h_hits_r = new TH1D("h_hits_rpc_r", "hits_r", 100,6000,14000); + h_hits_r->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_r->GetName(), h_hits_r)); + + h_xy = new TH2D("h_rpc_xy", "xy", 100,-11000.,11000.,100, -11000., 11000.); + h_xy->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_xy->GetName(), h_xy)); + + h_zr = new TH2D("m_rpc_zr", "zr", 100,-12500.,12500.,100, 6000., 14000.); + h_zr->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_zr->GetName(), h_zr)); + + h_hits_eta = new TH1D("h_hits_rpc_eta", "hits_eta", 100,-1.5,1.5); + h_hits_eta->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_eta->GetName(), h_hits_eta)); + + h_hits_phi = new TH1D("h_hits_rpc_phi", "hits_phi", 100,-3.2,3.2); + h_hits_phi->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_phi->GetName(), h_hits_phi)); + + h_hits_lx = new TH1D("h_hits_rpc_lx","hits_lx", 100,-10, 10); + h_hits_lx->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_lx->GetName(), h_hits_lx)); + + h_hits_ly = new TH1D("h_hits_rpc_ly", "hits_ly", 100,-1500,1500); + h_hits_ly->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_ly->GetName(), h_hits_ly)); + + h_hits_lz = new TH1D("h_hits_rpc_lz", "hits_lz", 100,-600,600); + h_hits_lz->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_lz->GetName(), h_hits_lz)); + + + h_hits_time = new TH1D("h_hits_rpc_time","hits_time", 100,0, 120); + h_hits_time->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_time->GetName(), h_hits_time)); + + h_hits_edep = new TH1D("h_hits_rpc_edep", "hits_edep", 100,0,0.15); + h_hits_edep->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_edep->GetName(), h_hits_edep)); + + h_hits_kine = new TH1D("h_hits_rpc_kine", "hits_kine", 100,0,500); + h_hits_kine->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_kine->GetName(), h_hits_kine)); + + h_hits_step = new TH1D("h_hits_rpc_step", "hits_step", 100,0,25); + h_hits_step->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_step->GetName(), h_hits_step)); + + + m_tree= new TTree("NtupleRPCHitAnalysis","RPCHitAna"); + std::string fullNtupleName = "/"+m_ntupleFileName+"/"; + CHECK(m_thistSvc->regTree(fullNtupleName,m_tree)); + + + + /** now add branches and leaves to the tree */ + if (m_tree){ + m_tree->Branch("x", &m_hits_x); + m_tree->Branch("y", &m_hits_y); + m_tree->Branch("z", &m_hits_z); + m_tree->Branch("r", &m_hits_r); + m_tree->Branch("eta", &m_hits_eta); + m_tree->Branch("phi", &m_hits_phi); + m_tree->Branch("lx", &m_hits_lx); + m_tree->Branch("ly", &m_hits_ly); + m_tree->Branch("lz", &m_hits_lz); + m_tree->Branch("time", &m_hits_time); + m_tree->Branch("edep", &m_hits_edep); + m_tree->Branch("kine", &m_hits_kine); + m_tree->Branch("step", &m_hits_step); + }else{ + ATH_MSG_ERROR("No tree found!"); + } + + return StatusCode::SUCCESS; +} + + + +StatusCode RPCHitAnalysis::execute() { + ATH_MSG_DEBUG( "In RPCHitAnalysis::execute()" ); + + m_hits_x->clear(); + m_hits_y->clear(); + m_hits_z->clear(); + m_hits_r->clear(); + m_hits_eta->clear(); + m_hits_phi->clear(); + m_hits_lx->clear(); + m_hits_ly->clear(); + m_hits_lz->clear(); + m_hits_time->clear(); + m_hits_edep->clear(); + m_hits_kine->clear(); + m_hits_step->clear(); + + const DataHandle<RPCSimHitCollection> rpc_container; + if (evtStore()->retrieve(rpc_container, "RPC_Hits" )==StatusCode::SUCCESS) { + for(RPCSimHitCollection::const_iterator i_hit = rpc_container->begin(); + i_hit != rpc_container->end();++i_hit){ + //RPCSimHitCollection::const_iterator i_hit; + //for(auto i_hit : *rpc_container){ + GeoRPCHit ghit(*i_hit); + if(!ghit) continue; + Amg::Vector3D p = ghit.getGlobalPosition(); + h_hits_x->Fill(p.x()); + h_hits_y->Fill(p.y()); + h_hits_z->Fill(p.z()); + h_hits_r->Fill(p.perp()); + h_xy->Fill(p.x(), p.y()); + h_zr->Fill(p.z(),p.perp()); + h_hits_eta->Fill(p.eta()); + h_hits_phi->Fill(p.phi()); + h_hits_lx->Fill( (*i_hit).localPosition().x()); + h_hits_ly->Fill( (*i_hit).localPosition().y()); + h_hits_lz->Fill( (*i_hit).localPosition().z()); + h_hits_edep->Fill((*i_hit).energyDeposit()); + h_hits_time->Fill((*i_hit).globalTime()); + h_hits_step->Fill((*i_hit).stepLength()); + h_hits_kine->Fill((*i_hit).kineticEnergy()); + + m_hits_x->push_back(p.x()); + m_hits_y->push_back(p.y()); + m_hits_z->push_back(p.z()); + m_hits_r->push_back(p.perp()); + m_hits_eta->push_back(p.eta()); + m_hits_phi->push_back(p.phi()); + m_hits_lx->push_back( (*i_hit).localPosition().x()); + m_hits_ly->push_back( (*i_hit).localPosition().y()); + m_hits_lz->push_back( (*i_hit).localPosition().z()); + m_hits_edep->push_back((*i_hit).energyDeposit()); + m_hits_time->push_back((*i_hit).globalTime()); + m_hits_step->push_back((*i_hit).stepLength()); + m_hits_kine->push_back((*i_hit).kineticEnergy()); + } + } // End while hits + + + if (m_tree) m_tree->Fill(); + return StatusCode::SUCCESS; +} diff --git a/Simulation/Tools/HitAnalysis/src/RPCHitAnalysis.h b/Simulation/Tools/HitAnalysis/src/RPCHitAnalysis.h new file mode 100755 index 0000000000000000000000000000000000000000..fadb854c2127018a69936086aba16a5841417d52 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/RPCHitAnalysis.h @@ -0,0 +1,77 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef RPC_HIT_ANALYSIS_H +#define RPC_HIT_ANALYSIS_H + +#include "AthenaBaseComps/AthAlgorithm.h" + +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ITHistSvc.h" + +#include <string> +#include <vector> +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" + + + +class TH1; +class TH2; +class TTree; + +class RPCHitAnalysis : public AthAlgorithm { + + public: + + RPCHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator); + ~RPCHitAnalysis(){} + + virtual StatusCode initialize(); + virtual StatusCode execute(); + + private: + + /** Some variables**/ + TH1* h_hits_x; + TH1* h_hits_y; + TH1* h_hits_z; + TH1* h_hits_r; + TH2* h_xy; + TH2* h_zr; + TH1* h_hits_eta; + TH1* h_hits_phi; + TH1* h_hits_lx; + TH1* h_hits_ly; + TH1* h_hits_lz; + TH1* h_hits_time; + TH1* h_hits_edep; + TH1* h_hits_kine; + TH1* h_hits_step; + + + std::vector<float>* m_hits_x; + std::vector<float>* m_hits_y; + std::vector<float>* m_hits_z; + std::vector<float>* m_hits_r; + std::vector<float>* m_hits_eta; + std::vector<float>* m_hits_phi; + std::vector<float>* m_hits_lx; + std::vector<float>* m_hits_ly; + std::vector<float>* m_hits_lz; + std::vector<float>* m_hits_time; + std::vector<float>* m_hits_edep; + std::vector<float>* m_hits_kine; + std::vector<float>* m_hits_step; + + TTree * m_tree; + std::string m_ntupleFileName; + std::string m_path; + ServiceHandle<ITHistSvc> m_thistSvc; + +}; + +#endif // RPC_HIT_ANALYSIS_H + diff --git a/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.cxx new file mode 100644 index 0000000000000000000000000000000000000000..8c757c7893afc2c1ee7a44037b905f510cebe616 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.cxx @@ -0,0 +1,232 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "SiHitAnalysis.h" + +// Section of includes for Pixel and SCT tests +#include "InDetSimEvent/SiHitCollection.h" +#include "GeoAdaptors/GeoSiHit.h" + +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" +#include "TString.h" + + +#include <algorithm> +#include <math.h> +#include <functional> +#include <iostream> + +//m_collection: "PixelHits", "SCT_Hits", "BCMHits" and "BLMHits" +SiHitAnalysis::SiHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator) + : AthAlgorithm(name, pSvcLocator) + , m_collection("BCMHits") + , h_hits_x(0) + , h_hits_y(0) + , h_hits_z(0) + , h_hits_r(0) + , h_xy(0) + , h_zr(0) + , h_hits_time(0) + , h_hits_eloss(0) + , h_hits_step(0) + , h_hits_barcode(0) + , h_time_eloss(0) + , h_z_eloss(0) + , h_r_eloss(0) + , m_hits_x(0) + , m_hits_y(0) + , m_hits_z(0) + , m_hits_r(0) + , m_hits_time(0) + , m_hits_eloss(0) + , m_hits_step(0) + , m_hits_barcode(0) + , m_tree(0) + , m_ntupleFileName("/ntuples/") + , m_expert("off") + , m_path("/SiHitAnalysis/") + , m_thistSvc("THistSvc", name) +{ + declareProperty("CollectionName", m_collection="BCMHits"); + declareProperty("HistPath", m_path); + declareProperty("ExpertMode", m_expert = "off"); + declareProperty("NtupleFileName", m_ntupleFileName); +} + +StatusCode SiHitAnalysis::initialize() { + ATH_MSG_DEBUG( "Initializing SiHitAnalysis" ); + + std::string detName("Pixel"); + //initialise pixel or SCT variables + if(m_collection=="PixelHits"){ + detName = "Pixel"; + }else if (m_collection=="SCT_Hits"){ + detName = "SCT"; + }else if(m_collection=="BCMHits"){ + detName = "BCM"; + }else if(m_collection=="BLMHits"){ + detName = "BLM"; + }else{ + ATH_MSG_ERROR("SiHitsAnalysis for "<< name()<<"not supported!!! \n"); + return StatusCode::FAILURE; + } + + // Grab the Ntuple and histogramming service for the tree + CHECK(m_thistSvc.retrieve()); + + /** Histograms**/ + float bin_down = -600; + float bin_up = 600; + float radius_up = 600; + float radius_down = 200; + if(detName=="Pixel"){ + bin_down = -170; + bin_up = 170; + radius_up = 170; + radius_down = 0; + } + + h_hits_x = new TH1D(("h_"+detName+"_x").c_str(),("h_"+detName+"_x").c_str(), 100,bin_down, bin_up); + h_hits_x->StatOverflows(); + + h_hits_y = new TH1D(("h_"+detName+"_y").c_str(), ("h_"+detName+"_y").c_str(), 100,bin_down,bin_up); + h_hits_y->StatOverflows(); + + h_hits_z = new TH1D(("h_"+detName+"_z").c_str(), ("h_"+detName+"_z").c_str(), 200,-1200,1200); + h_hits_z->StatOverflows(); + + h_hits_r = new TH1D(("h_"+detName+"_r").c_str(), ("h_"+detName+"_r").c_str(), 100,radius_down,radius_up); + h_hits_r->StatOverflows(); + + h_xy = new TH2D(("h_"+detName+"_xy").c_str(), ("h_"+detName+"_xy").c_str(), 100,bin_down,bin_up,100, bin_down, bin_up); + h_xy->StatOverflows(); + + h_zr = new TH2D(("h_"+detName+"_zr").c_str(), ("h_"+detName+"_zr").c_str(), 100,-1200,1200.,100, radius_down, radius_up); + h_zr->StatOverflows(); + + h_hits_time = new TH1D(("h_"+detName+"_time").c_str(), ("h_"+detName+"_time").c_str(), 100,0,500); + h_hits_time->StatOverflows(); + + h_hits_eloss = new TH1D(("h_"+detName+"_eloss").c_str(), ("h_"+detName+"_eloss").c_str(), 100,0,50); + h_hits_eloss->StatOverflows(); + + h_hits_step = new TH1D(("h_"+detName+"_step").c_str(), ("h_"+detName+"_step").c_str(), 100,0,50); + h_hits_step->StatOverflows(); + + h_hits_barcode = new TH1D(("h_"+detName+"_barcode").c_str(), ("h_"+detName+"_barcode").c_str(), 200,0,250000); + h_hits_barcode->StatOverflows(); + + h_time_eloss = new TH2D(("h_"+detName+"_time_eloss").c_str(), ("h_"+detName+" Eloss vs. time").c_str(),100, 0,500,100,0,50); + h_time_eloss->StatOverflows(); + + h_z_eloss = new TH2D(("h_"+detName+"_z_eloss").c_str(), ("h_"+detName+" Eloss vs. z").c_str(),100, -1200,1200,100,0,50); + h_z_eloss->StatOverflows(); + + h_r_eloss = new TH2D(("h_"+detName+"_r_eloss").c_str(), ("h_"+detName+ " Eloss vs. r").c_str(),100, radius_down,radius_down,100,0,50); + h_r_eloss->StatOverflows(); + + + CHECK(m_thistSvc->regHist(m_path + h_hits_x->GetName(), h_hits_x)); + CHECK(m_thistSvc->regHist(m_path + h_hits_y->GetName(), h_hits_y)); + CHECK(m_thistSvc->regHist(m_path + h_hits_z->GetName(), h_hits_z)); + CHECK(m_thistSvc->regHist(m_path + h_hits_r->GetName(), h_hits_r)); + CHECK(m_thistSvc->regHist( m_path+h_xy->GetName(), h_xy)); + CHECK(m_thistSvc->regHist( m_path+h_zr->GetName(), h_zr)); + CHECK(m_thistSvc->regHist(m_path + h_hits_time->GetName(), h_hits_time)); + CHECK(m_thistSvc->regHist(m_path + h_hits_eloss->GetName(), h_hits_eloss)); + CHECK(m_thistSvc->regHist(m_path + h_hits_step->GetName(), h_hits_step)); + CHECK(m_thistSvc->regHist(m_path + h_hits_barcode->GetName(), h_hits_barcode)); + + + //To be filled only when the expert mode is on. + if(m_expert == "on") + { + CHECK(m_thistSvc->regHist(m_path + h_time_eloss->GetName(), h_time_eloss)); + CHECK(m_thistSvc->regHist(m_path + h_z_eloss->GetName(), h_z_eloss)); + CHECK(m_thistSvc->regHist(m_path + h_r_eloss->GetName(), h_r_eloss)); + } + + /**ntuple**/ + CHECK(m_thistSvc.retrieve()); + m_tree= new TTree(detName.c_str(), detName.c_str()); + std::string fullNtupleName = "/"+m_ntupleFileName+"/"+detName; + CHECK(m_thistSvc->regTree(fullNtupleName,m_tree)); + + + /** now add branches and leaves to the tree */ + if (m_tree){ + m_tree->Branch((detName+"_x").c_str(), &m_hits_x); + m_tree->Branch((detName+"_y").c_str(), &m_hits_y); + m_tree->Branch((detName+"_z").c_str(), &m_hits_z); + m_tree->Branch((detName+"_r").c_str(), &m_hits_r); + m_tree->Branch((detName+"_time").c_str(), &m_hits_time); + m_tree->Branch((detName+"_eloss").c_str(), &m_hits_eloss); + m_tree->Branch((detName+"_step").c_str(), &m_hits_step); + m_tree->Branch((detName+"_barcode").c_str(), &m_hits_barcode); + }else{ + ATH_MSG_ERROR("No tree found!"); + } + + return StatusCode::SUCCESS; +} + + + +StatusCode SiHitAnalysis::execute() { + ATH_MSG_DEBUG( "In SiHitAnalysis::execute()" ); + m_hits_x->clear(); + m_hits_y->clear(); + m_hits_z->clear(); + m_hits_r->clear(); + m_hits_time->clear(); + m_hits_eloss->clear(); + m_hits_step->clear(); + m_hits_barcode->clear(); + + const DataHandle<SiHitCollection> p_collection; + if (evtStore()->retrieve(p_collection, m_collection )==StatusCode::SUCCESS) { + for(SiHitConstIterator i_hit = p_collection->begin(); + i_hit != p_collection->end();++i_hit){ + GeoSiHit ghit(*i_hit); + HepGeom::Point3D<double> p = ghit.getGlobalPosition(); + h_hits_x->Fill(p.x()); + h_hits_y->Fill(p.y()); + h_hits_z->Fill(p.z()); + h_hits_r->Fill(p.perp()); + h_xy->Fill(p.x(), p.y()); + h_zr->Fill(p.z(),p.perp()); + h_hits_eloss->Fill(i_hit->energyLoss()); + h_hits_time->Fill(i_hit->meanTime()); + double step_length=(i_hit->localStartPosition()-i_hit->localEndPosition()).mag(); + h_hits_step->Fill(step_length); + h_hits_barcode->Fill(i_hit->particleLink().barcode()); + + if(m_expert == "on") + { + h_time_eloss->Fill(i_hit->meanTime(), i_hit->energyLoss()); + if(i_hit->getBarrelEndcap()==0) { + h_z_eloss->Fill(p.z(), i_hit->energyLoss()); + }else{ + h_r_eloss->Fill(p.perp(), i_hit->energyLoss()); + } + } + + m_hits_x->push_back(p.x()); + m_hits_y->push_back(p.y()); + m_hits_z->push_back(p.z()); + m_hits_r->push_back(p.perp()); + m_hits_eloss->push_back(i_hit->energyLoss()); + m_hits_time->push_back(i_hit->meanTime()); + m_hits_step->push_back(step_length); + m_hits_barcode->push_back(i_hit->particleLink().barcode()); + } // End while hits + } // End statuscode success upon retrieval of hits + if (m_tree) m_tree->Fill(); + + + return StatusCode::SUCCESS; +} + diff --git a/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.h b/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.h new file mode 100755 index 0000000000000000000000000000000000000000..29fdc72de8e1852d763dfefe9ed2c2d22d8ef289 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/SiHitAnalysis.h @@ -0,0 +1,70 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef SI_HIT_ANALYSIS_H +#define SI_HIT_ANALYSIS_H + +#include "AthenaBaseComps/AthAlgorithm.h" + +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ITHistSvc.h" + + +#include <string> +#include <vector> +#include "TH1.h" +#include "TH2.h" + +class TH1; +class TH2; +class TTree; + +class SiHitAnalysis : public AthAlgorithm { + + public: + + SiHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator); + ~SiHitAnalysis(){} + + virtual StatusCode initialize(); + virtual StatusCode execute(); + + private: + + std::string m_collection; + /** Some variables**/ + TH1* h_hits_x; + TH1* h_hits_y; + TH1* h_hits_z; + TH1* h_hits_r; + TH2* h_xy; + TH2* h_zr; + TH1* h_hits_time; + TH1* h_hits_eloss; + TH1* h_hits_step; + TH1* h_hits_barcode; + TH2* h_time_eloss; + TH2* h_z_eloss; + TH2* h_r_eloss; + + std::vector<float>* m_hits_x; + std::vector<float>* m_hits_y; + std::vector<float>* m_hits_z; + std::vector<float>* m_hits_r; + std::vector<float>* m_hits_time; + std::vector<float>* m_hits_eloss; + std::vector<float>* m_hits_step; + std::vector<float>* m_hits_barcode; + + TTree* m_tree; + std::string m_ntupleFileName; + + std::string m_expert; + std::string m_path; + ServiceHandle<ITHistSvc> m_thistSvc; + +}; + +#endif // SI_HIT_ANALYSIS_H + diff --git a/Simulation/Tools/HitAnalysis/src/TGCHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/TGCHitAnalysis.cxx new file mode 100755 index 0000000000000000000000000000000000000000..437baef10b8bbd0e5440bb93b24a4177142f00a5 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/TGCHitAnalysis.cxx @@ -0,0 +1,255 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TGCHitAnalysis.h" + +// Section of includes for TGC of the Muon Spectrometer tests +#include "GeoAdaptors/GeoMuonHits.h" + +#include "MuonSimEvent/TGCSimHitCollection.h" +#include "MuonSimEvent/TGCSimHit.h" +#include "CLHEP/Vector/LorentzVector.h" + +#include "TH1.h" +#include "TTree.h" +#include "TString.h" + + +#include <algorithm> +#include <math.h> +#include <functional> +#include <iostream> +#include <stdio.h> + +TGCHitAnalysis::TGCHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator) + : AthAlgorithm(name, pSvcLocator) + , h_hits_x(0) + , h_hits_y(0) + , h_hits_z(0) + , h_hits_r(0) + , h_xy(0) + , h_rz(0) + , h_hits_eta(0) + , h_hits_phi(0) + , h_hits_lx(0) + , h_hits_ly(0) + , h_hits_lz(0) + , h_hits_dcx(0) + , h_hits_dcy(0) + , h_hits_dcz(0) + , h_hits_time(0) + , h_hits_edep(0) + , h_hits_kine(0) + , h_hits_step(0) + , m_hits_x(0) + , m_hits_y(0) + , m_hits_z(0) + , m_hits_r(0) + , m_hits_eta(0) + , m_hits_phi(0) + , m_hits_lx(0) + , m_hits_ly(0) + , m_hits_lz(0) + , m_hits_dcx(0) + , m_hits_dcy(0) + , m_hits_dcz(0) + , m_hits_time(0) + , m_hits_edep(0) + , m_hits_kine(0) + , m_hits_step(0) + , m_tree(0) + , m_ntupleFileName("/TGCHitAnalysis/ntuple/") + , m_path("/TGCHitAnalysis/histos/") + , m_thistSvc("THistSvc", name) +{ + declareProperty("NtupleFileName", m_ntupleFileName); + declareProperty("HistPath", m_path); +} + +StatusCode TGCHitAnalysis::initialize() { + ATH_MSG_DEBUG( "Initializing TGCHitAnalysis" ); + + // Grab the Ntuple and histogramming service for the tree + CHECK(m_thistSvc.retrieve()); + + /** Histograms**/ + h_hits_x = new TH1D("h_hits_tgc_x","hits_x", 100,-5000, 5000); + h_hits_x->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_x->GetName(), h_hits_x)); + + h_hits_y = new TH1D("h_hits_tgc_y", "hits_y", 100,-5000,5000); + h_hits_y->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_y->GetName(), h_hits_y)); + + h_hits_z = new TH1D("h_hits_tgc_z", "hits_z", 100,-12000,12000); + h_hits_z->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_z->GetName(), h_hits_z)); + + h_hits_r = new TH1D("h_hits_tgc_r", "hits_r", 100,2000,10000); + h_hits_r->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_r->GetName(), h_hits_r)); + + h_xy = new TH2D("h_tgc_xy", "xy", 100,-5000.,5000.,100, -5000., 5000.); + h_xy->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_xy->GetName(), h_xy)); + + h_rz = new TH2D("h_tgc_rz", "rz", 100,2000.,10000.,100, -12000., 12000.); + h_rz->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_rz->GetName(), h_rz)); + + + h_hits_eta = new TH1D("h_hits_tgc_eta", "hits_eta", 100,-10.0,10.0); + h_hits_eta->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_eta->GetName(), h_hits_eta)); + + h_hits_phi = new TH1D("h_hits_tgc_phi", "hits_phi", 100,-3.2,3.2); + h_hits_phi->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_phi->GetName(), h_hits_phi)); + + h_hits_lx = new TH1D("h_hits_tgc_lx","hits_lx", 100,-800, 800); + h_hits_lx->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_lx->GetName(), h_hits_lx)); + + h_hits_ly = new TH1D("h_hits_tgc_ly", "hits_ly", 100,-800,800); + h_hits_ly->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_ly->GetName(), h_hits_ly)); + + h_hits_lz = new TH1D("h_hits_tgc_lz", "hits_lz", 100,-800,800); + h_hits_lz->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_lz->GetName(), h_hits_lz)); + + h_hits_dcx = new TH1D("h_hits_tgc_dcx","hits_dcx", 100,-1, 1); + h_hits_dcx->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_dcx->GetName(), h_hits_dcx)); + + h_hits_dcy = new TH1D("h_hits_tgc_dcy", "hits_dcy", 100,-1,1); + h_hits_dcy->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_dcy->GetName(), h_hits_dcy)); + + h_hits_dcz = new TH1D("h_hits_tgc_dcz", "hits_dcz", 100,-1,1); + h_hits_dcz->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_dcz->GetName(), h_hits_dcz)); + + h_hits_time = new TH1D("h_hits_tgc_time","hits_time", 100,0, 250); + h_hits_time->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_time->GetName(), h_hits_time)); + + h_hits_edep = new TH1D("h_hits_tgc_edep", "hits_edep", 100,0,0.5); + h_hits_edep->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_edep->GetName(), h_hits_edep)); + + h_hits_kine = new TH1D("h_hits_tgc_kine", "hits_kine", 100,0,1000); + h_hits_kine->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_kine->GetName(), h_hits_kine)); + + h_hits_step = new TH1D("h_hits_tgc_step", "hits_step", 100,0,50); + h_hits_step->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_step->GetName(), h_hits_step)); + + m_tree= new TTree("NtupleTGCHitAnalysis","TGCHitAna"); + std::string fullNtupleName = "/"+m_ntupleFileName+"/"; + CHECK(m_thistSvc->regTree(fullNtupleName,m_tree)); + + + + /** now add branches and leaves to the tree */ + if (m_tree){ + m_tree->Branch("x", &m_hits_x); + m_tree->Branch("y", &m_hits_y); + m_tree->Branch("z", &m_hits_z); + m_tree->Branch("r", &m_hits_r); + m_tree->Branch("eta", &m_hits_eta); + m_tree->Branch("phi", &m_hits_phi); + m_tree->Branch("lx", &m_hits_lx); + m_tree->Branch("ly", &m_hits_ly); + m_tree->Branch("lz", &m_hits_lz); + m_tree->Branch("dcx", &m_hits_dcx); + m_tree->Branch("dcy", &m_hits_dcy); + m_tree->Branch("dcz", &m_hits_dcz); + m_tree->Branch("time", &m_hits_time); + m_tree->Branch("edep", &m_hits_edep); + m_tree->Branch("kine", &m_hits_kine); + m_tree->Branch("step", &m_hits_step); + }else{ + ATH_MSG_ERROR("No tree found!"); + } + + + return StatusCode::SUCCESS; +} + + + +StatusCode TGCHitAnalysis::execute() { + ATH_MSG_DEBUG( "In TGCHitAnalysis::execute()" ); + + m_hits_x->clear(); + m_hits_y->clear(); + m_hits_z->clear(); + m_hits_r->clear(); + m_hits_eta->clear(); + m_hits_phi->clear(); + m_hits_lx->clear(); + m_hits_ly->clear(); + m_hits_lz->clear(); + m_hits_dcx->clear(); + m_hits_dcy->clear(); + m_hits_dcz->clear(); + m_hits_time->clear(); + m_hits_edep->clear(); + m_hits_kine->clear(); + m_hits_step->clear(); + + const DataHandle<TGCSimHitCollection> tgc_container; + if (evtStore()->retrieve(tgc_container, "TGC_Hits" )==StatusCode::SUCCESS) { + for(TGCSimHitCollection::const_iterator i_hit = tgc_container->begin(); + i_hit != tgc_container->end();++i_hit){ + //TGCSimHitCollection::const_iterator i_hit; + //for(auto i_hit : *tgc_container){ + GeoTGCHit ghit(*i_hit); + if(!ghit) continue; + Amg::Vector3D p = ghit.getGlobalPosition(); + h_hits_x->Fill(p.x()); + h_hits_y->Fill(p.y()); + h_hits_z->Fill(p.z()); + h_hits_r->Fill(p.perp()); + h_xy->Fill(p.x(), p.y()); + h_rz->Fill(p.perp(), p.z()); + h_hits_eta->Fill(p.eta()); + h_hits_phi->Fill(p.phi()); + h_hits_lx->Fill( (*i_hit).localPosition().x()); + h_hits_ly->Fill( (*i_hit).localPosition().y()); + h_hits_lz->Fill( (*i_hit).localPosition().z()); + h_hits_dcx->Fill((*i_hit).localDireCos().x()); + h_hits_dcy->Fill((*i_hit).localDireCos().y()); + h_hits_dcz->Fill((*i_hit).localDireCos().z()); + h_hits_edep->Fill((*i_hit).energyDeposit()); + h_hits_time->Fill((*i_hit).globalTime()); + h_hits_step->Fill((*i_hit).stepLength()); + h_hits_kine->Fill((*i_hit).kineticEnergy()); + + m_hits_x->push_back(p.x()); + m_hits_y->push_back(p.y()); + m_hits_z->push_back(p.z()); + m_hits_r->push_back(p.perp()); + m_hits_eta->push_back(p.eta()); + m_hits_phi->push_back(p.phi()); + m_hits_lx->push_back( (*i_hit).localPosition().x()); + m_hits_ly->push_back( (*i_hit).localPosition().y()); + m_hits_lz->push_back( (*i_hit).localPosition().z()); + m_hits_dcx->push_back((*i_hit).localDireCos().x()); + m_hits_dcy->push_back((*i_hit).localDireCos().y()); + m_hits_dcz->push_back((*i_hit).localDireCos().z()); + m_hits_edep->push_back((*i_hit).energyDeposit()); + m_hits_time->push_back((*i_hit).globalTime()); + m_hits_step->push_back((*i_hit).stepLength()); + m_hits_kine->push_back((*i_hit).kineticEnergy()); + } + } // End while hits + + if (m_tree) m_tree->Fill(); + + + return StatusCode::SUCCESS; +} diff --git a/Simulation/Tools/HitAnalysis/src/TGCHitAnalysis.h b/Simulation/Tools/HitAnalysis/src/TGCHitAnalysis.h new file mode 100755 index 0000000000000000000000000000000000000000..74a73d450312bf0dc6c073df970cd3f3b8f80ef1 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/TGCHitAnalysis.h @@ -0,0 +1,85 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TGC_HIT_ANALYSIS_H +#define TGC_HIT_ANALYSIS_H + +#include "AthenaBaseComps/AthAlgorithm.h" + +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ITHistSvc.h" + +#include <string> +#include <vector> +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" + + +class TH1; +class TH2; +class TTree; + +class TGCHitAnalysis : public AthAlgorithm { + + public: + + TGCHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator); + ~TGCHitAnalysis(){} + + virtual StatusCode initialize(); + virtual StatusCode execute(); + + private: + + /** Some variables**/ + + + TH1* h_hits_x; + TH1* h_hits_y; + TH1* h_hits_z; + TH1* h_hits_r; + TH2* h_xy; + TH2* h_rz; + TH1* h_hits_eta; + TH1* h_hits_phi; + TH1* h_hits_lx; + TH1* h_hits_ly; + TH1* h_hits_lz; + TH1* h_hits_dcx; + TH1* h_hits_dcy; + TH1* h_hits_dcz; + TH1* h_hits_time; + TH1* h_hits_edep; + TH1* h_hits_kine; + TH1* h_hits_step; + + std::vector<float>* m_hits_x; + std::vector<float>* m_hits_y; + std::vector<float>* m_hits_z; + std::vector<float>* m_hits_r; + std::vector<float>* m_hits_eta; + std::vector<float>* m_hits_phi; + std::vector<float>* m_hits_lx; + std::vector<float>* m_hits_ly; + std::vector<float>* m_hits_lz; + std::vector<float>* m_hits_dcx; + std::vector<float>* m_hits_dcy; + std::vector<float>* m_hits_dcz; + std::vector<float>* m_hits_time; + std::vector<float>* m_hits_edep; + std::vector<float>* m_hits_kine; + std::vector<float>* m_hits_step; + + + + TTree * m_tree; + std::string m_ntupleFileName; + std::string m_path; + ServiceHandle<ITHistSvc> m_thistSvc; + +}; + +#endif // TGC_HIT_ANALYSIS_H + diff --git a/Simulation/Tools/HitAnalysis/src/TRTHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/TRTHitAnalysis.cxx new file mode 100755 index 0000000000000000000000000000000000000000..e5fdacefa9374b5726c2b48cd0260f4011ffe2d5 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/TRTHitAnalysis.cxx @@ -0,0 +1,206 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TRTHitAnalysis.h" + +// Section of includes for TRT tests +#include "InDetSimEvent/TRTUncompressedHitCollection.h" +#include "GeoAdaptors/GeoTRTUncompressedHit.h" + +#include "TH1.h" +#include "TTree.h" +#include "TString.h" + + +#include <algorithm> +#include <math.h> +#include <functional> +#include <iostream> + +TRTHitAnalysis::TRTHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator) + : AthAlgorithm(name, pSvcLocator) + , h_TRT_x(0) + , h_TRT_y(0) + , h_TRT_z(0) + , h_TRT_r(0) + , h_TRT_xy(0) + , h_TRT_zr(0) + , h_TRT_time_photons(0) + , h_TRT_time_nonphotons(0) + , h_TRT_edep_photons(0) + , h_TRT_edep_nonphotons(0) + , h_TRT_kine_photons(0) + , h_TRT_kine_nonphotons(0) + , h_TRT_barcode(0) + , m_TRT_x(0) + , m_TRT_y(0) + , m_TRT_z(0) + , m_TRT_r(0) + , m_TRT_time_photons(0) + , m_TRT_time_nonphotons(0) + , m_TRT_edep_photons(0) + , m_TRT_edep_nonphotons(0) + , m_TRT_kine_photons(0) + , m_TRT_kine_nonphotons(0) + , m_TRT_barcode(0) + , m_tree(0) + , m_path("/histos/TRTHitAnalysis/") + , m_ntupleFileName("/ntuples/TRTHitAnalysis/") + , m_thistSvc("THistSvc", name) + +{ + declareProperty("HistPath", m_path); + declareProperty("NtupleFileName", m_ntupleFileName); +} + +StatusCode TRTHitAnalysis::initialize() { + ATH_MSG_DEBUG( "Initializing TRTHitAnalysis" ); + + // Grab the Ntuple and histogramming service for the tree + CHECK(m_thistSvc.retrieve()); + + /** Histograms **/ + + h_TRT_x = new TH1D("h_TRT_x","hits_x", 100,-1100, 1100); + h_TRT_x->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_TRT_x->GetName(), h_TRT_x)); + + h_TRT_y = new TH1D("h_TRT_y", "hits_y", 100,-1100,1100); + h_TRT_y->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_TRT_y->GetName(), h_TRT_y)); + + h_TRT_z = new TH1D("h_TRT_z", "hits_z", 100,-3000,3000); + h_TRT_z->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_TRT_z->GetName(), h_TRT_z)); + + h_TRT_r = new TH1D("h_TRT_r", "hits_r", 100,500,1100); + h_TRT_r->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_TRT_r->GetName(), h_TRT_r)); + + h_TRT_xy = new TH2D("h_TRT_xy", "xy", 100,-1100.,1100.,100, -1100., 1100.); + h_TRT_xy->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_TRT_xy->GetName(), h_TRT_xy)); + + h_TRT_zr = new TH2D("h_TRT_zr", "zr", 100,-3000,3000,100,500.,1100.); + h_TRT_zr->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_TRT_zr->GetName(), h_TRT_zr)); + + h_TRT_time_photons = new TH1D("h_TRT_time_photons", "hits_time_photons", 100,0,500); + h_TRT_time_photons->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_TRT_time_photons->GetName(), h_TRT_time_photons)); + + h_TRT_time_nonphotons = new TH1D("h_TRT_time_nonphotons", "hits_time_nonphotons", 100,0,500); + h_TRT_time_nonphotons->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_TRT_time_nonphotons->GetName(), h_TRT_time_nonphotons)); + + h_TRT_edep_photons = new TH1D("h_TRT_edep_photons", "hits_edep_photons", 100,0,500); + h_TRT_edep_photons->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_TRT_edep_photons->GetName(), h_TRT_edep_photons)); + + h_TRT_edep_nonphotons = new TH1D("m_TRT_edep_nonphotons", "hits_edep_nonphotons", 100,0,500); + h_TRT_edep_nonphotons->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_TRT_edep_nonphotons->GetName(), h_TRT_edep_nonphotons)); + + h_TRT_kine_photons = new TH1D("h_TRT_kine_photons", "hits_kine_photons", 100,0,2); + h_TRT_kine_photons->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_TRT_kine_photons->GetName(), h_TRT_kine_photons)); + + h_TRT_kine_nonphotons = new TH1D("h_TRT_kine_nonphotons", "hits_kine_nonphotons", 100,0,1000); + h_TRT_kine_nonphotons->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_TRT_kine_nonphotons->GetName(), h_TRT_kine_nonphotons)); + + h_TRT_barcode = new TH1D("h_TRT_barcode", "hits_barcode", 100,-500,300000); + h_TRT_barcode->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_TRT_barcode->GetName(), h_TRT_barcode)); + + + /*ntuples*/ + + m_tree= new TTree("TRTHitNtuple","TRTHitAna"); + std::string fullNtupleName = "/"+m_ntupleFileName+"/"; + CHECK(m_thistSvc->regTree(fullNtupleName,m_tree)); + + if (m_tree){ + m_tree->Branch("x", &m_TRT_x); + m_tree->Branch("y", &m_TRT_y); + m_tree->Branch("z", &m_TRT_z); + m_tree->Branch("r", &m_TRT_r); + m_tree->Branch("time_photons", &m_TRT_time_photons); + m_tree->Branch("time_nonphotons", &m_TRT_time_nonphotons); + m_tree->Branch("EnergyDeposit_photons", &m_TRT_edep_photons); + m_tree->Branch("EnergyDeposit_nonphotons", &m_TRT_edep_nonphotons); + m_tree->Branch("KineticEnergy_photons", &m_TRT_kine_photons); + m_tree->Branch("KineticEnergy_nonphotons", &m_TRT_kine_nonphotons); + m_tree->Branch("barcode", &m_TRT_barcode); + }else{ + ATH_MSG_ERROR("No tree found!"); + } + + + return StatusCode::SUCCESS; +} + + + +StatusCode TRTHitAnalysis::execute() { + ATH_MSG_DEBUG( "In TRTHitAnalysis::execute()" ); + + m_TRT_x->clear(); + m_TRT_y->clear(); + m_TRT_z->clear(); + m_TRT_r->clear(); + m_TRT_time_photons->clear(); + m_TRT_time_nonphotons->clear(); + m_TRT_edep_photons->clear(); + m_TRT_edep_nonphotons->clear(); + m_TRT_kine_photons->clear(); + m_TRT_kine_nonphotons->clear(); + m_TRT_barcode->clear(); + + const DataHandle<TRTUncompressedHitCollection> p_collection; + if (evtStore()->retrieve(p_collection, "TRTUncompressedHits" )==StatusCode::SUCCESS) { + for(TRTUncompressedHitConstIter i_hit = p_collection->begin(); + i_hit != p_collection->end();++i_hit){ + GeoTRTUncompressedHit ghit(*i_hit); + HepGeom::Point3D<double> p = ghit.getGlobalPosition(); + + h_TRT_x->Fill(p.x()); + h_TRT_y->Fill(p.y()); + h_TRT_z->Fill(p.z()); + h_TRT_r->Fill(p.perp()); + h_TRT_xy->Fill(p.x(), p.y()); + h_TRT_zr->Fill(p.z(),sqrt(pow(p.x(),2)+pow(p.y(),2))); + h_TRT_barcode->Fill(i_hit->particleLink().barcode()); + + m_TRT_x->push_back(p.x()); + m_TRT_y->push_back(p.y()); + m_TRT_z->push_back(p.z()); + m_TRT_r->push_back(p.perp()); + m_TRT_barcode->push_back(i_hit->particleLink().barcode()); + int particleId(i_hit->GetParticleEncoding()); + if(particleId == 22 || static_cast<int>(abs(particleId)/100000)==41 || static_cast<int>(abs(particleId)/10000000) == 1){ + h_TRT_time_photons->Fill(i_hit->GetGlobalTime()); + h_TRT_edep_photons->Fill(i_hit->GetEnergyDeposit()); + h_TRT_kine_photons->Fill(i_hit->GetKineticEnergy()); + m_TRT_time_photons->push_back(i_hit->GetGlobalTime()); + m_TRT_edep_photons->push_back(i_hit->GetEnergyDeposit()); + m_TRT_kine_photons->push_back(i_hit->GetKineticEnergy()); + }else{ + h_TRT_time_nonphotons->Fill(i_hit->GetGlobalTime()); + h_TRT_edep_nonphotons->Fill(i_hit->GetEnergyDeposit()); + h_TRT_kine_nonphotons->Fill(i_hit->GetKineticEnergy()); + + m_TRT_time_nonphotons->push_back(i_hit->GetGlobalTime()); + m_TRT_edep_nonphotons->push_back(i_hit->GetEnergyDeposit()); + m_TRT_kine_nonphotons->push_back(i_hit->GetKineticEnergy()); + } + } // End while hits + } + if (m_tree) m_tree->Fill(); + + + + return StatusCode::SUCCESS; +} + diff --git a/Simulation/Tools/HitAnalysis/src/TRTHitAnalysis.h b/Simulation/Tools/HitAnalysis/src/TRTHitAnalysis.h new file mode 100755 index 0000000000000000000000000000000000000000..7c34cfe043cdb34c2f6f8f843b906f72ca32ff59 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/TRTHitAnalysis.h @@ -0,0 +1,73 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TRT_HIT_ANALYSIS_H +#define TRT_HIT_ANALYSIS_H + +#include "AthenaBaseComps/AthAlgorithm.h" + +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ITHistSvc.h" + + +#include <string> +#include <vector> +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" + +class TH1; +class TH2; +class TTree; + +class TRTHitAnalysis : public AthAlgorithm { + + public: + + TRTHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator); + ~TRTHitAnalysis(){} + + virtual StatusCode initialize(); + virtual StatusCode execute(); + + private: + + /** Some variables**/ + TH1* h_TRT_x; + TH1* h_TRT_y; + TH1* h_TRT_z; + TH1* h_TRT_r; + TH2* h_TRT_xy; + TH2* h_TRT_zr; + TH1* h_TRT_time_photons; + TH1* h_TRT_time_nonphotons; + TH1* h_TRT_edep_photons; + TH1* h_TRT_edep_nonphotons; + TH1* h_TRT_kine_photons; + TH1* h_TRT_kine_nonphotons; + TH1* h_TRT_barcode; + + + std::vector<float>* m_TRT_x; + std::vector<float>* m_TRT_y; + std::vector<float>* m_TRT_z; + std::vector<float>* m_TRT_r; + std::vector<float>* m_TRT_time_photons; + std::vector<float>* m_TRT_time_nonphotons; + std::vector<float>* m_TRT_edep_photons; + std::vector<float>* m_TRT_edep_nonphotons; + std::vector<float>* m_TRT_kine_photons; + std::vector<float>* m_TRT_kine_nonphotons; + std::vector<float>* m_TRT_barcode; + + TTree * m_tree; + std::string m_path; + std::string m_ntupleFileName; + ServiceHandle<ITHistSvc> m_thistSvc; + + +}; + +#endif // TRT_HIT_ANALYSIS_H + diff --git a/Simulation/Tools/HitAnalysis/src/TrackRecordAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/TrackRecordAnalysis.cxx new file mode 100755 index 0000000000000000000000000000000000000000..92e687af1d599a7859e1de4445ddf53f13b7ffe3 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/TrackRecordAnalysis.cxx @@ -0,0 +1,264 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TrackRecordAnalysis.h" + +// Section of includes for TrackRecord tests + +#include "TrackRecord/TrackRecord.h" +#include "TrackRecord/TrackRecordCollection.h" +#include "CLHEP/Vector/LorentzVector.h" + +#include "TH1.h" +#include "TTree.h" +#include "TString.h" + + +#include <algorithm> +#include <math.h> +#include <functional> +#include <iostream> +#include <stdio.h> + +TrackRecordAnalysis::TrackRecordAnalysis(const std::string& name, ISvcLocator* pSvcLocator) + : AthAlgorithm(name, pSvcLocator) + , h_hits_x(0) + , h_hits_y(0) + , h_hits_z(0) + , h_hits_r(0) + , h_xy(0) + , h_zr(0) + , h_hits_eta(0) + , h_hits_phi(0) + , h_hits_px(0) + , h_hits_py(0) + , h_hits_pz(0) + , h_hits_pt(0) + , h_time(0) + , h_edep(0) + , h_pdg(0) + , m_x(0) + , m_y(0) + , m_z(0) + , m_r(0) + , m_eta(0) + , m_phi(0) + , m_px(0) + , m_py(0) + , m_pz(0) + , m_pt(0) + , m_time(0) + , m_edep(0) + , m_pdg(0) + , m_tree(0) + , m_ntupleFileName("/TrackRecordAnalysis/ntuple/") + , m_path("/TrackRecordAnalysis/histos/") + , m_thistSvc("THistSvc", name) + , m_collection("CaloEntryLayer") +{ + declareProperty("NtupleFileName", m_ntupleFileName); + declareProperty("HistPath", m_path); + declareProperty("CollectionName", m_collection="CaloEntryLayer"); +} + +StatusCode TrackRecordAnalysis::initialize() { + ATH_MSG_DEBUG( "Initializing TrackRecordAnalysis" ); + + // Grab the Ntuple and histogramming service for the tree + std::string detName("CaloEntry"); + std::string ntupName("TrackRecordCaloEntry"); + if(m_collection=="CaloEntryLayer"){ + detName="CaloEntry"; + ntupName="TrackRecordCaloEntry"; + } else if(m_collection=="MuonEntryLayer"){ + detName="MuonEntry"; + ntupName="TrackRecordMuonEntry"; + } else if(m_collection=="MuonExitLayer"){ + detName="MuonExit"; + ntupName="TrackRecordMuonExit"; + }else{ + ATH_MSG_ERROR("TrackRecordAnalysis for "<< name() << "not supported !!! \n"); + return StatusCode::FAILURE; + + } + std::cout<<"Name "<<name()<<std::endl; + //Grab the Ntuple and histogramming service for the tree + CHECK(m_thistSvc.retrieve()); + + float x_down = -5000; + float x_up = 5000; + float radius = 4500; + float eta_down = -5.8; + float eta_up = 5.8; + float z_down = -7000; + float z_up = 7000; + if(detName =="CaloEntry"){ + x_down = -1180; + x_up = 1180; + radius = 1200; + eta_down = - 5.6; + eta_up = 5.6; + z_down = -3700; + z_up = 3700; + + } + + /** Histograms**/ + h_hits_x = new TH1D((detName+"_x").c_str(),"hits_x", 100,x_down, x_up); + h_hits_x->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_x->GetName(), h_hits_x)); + + h_hits_y = new TH1D((detName+"_y").c_str(), "hits_y", 100,x_down,x_up); + h_hits_y->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_y->GetName(), h_hits_y)); + + h_hits_z = new TH1D((detName+"_z").c_str(), "hits_z", 100,z_down,z_up); + h_hits_z->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_z->GetName(), h_hits_z)); + + h_hits_r = new TH1D((detName+"_r").c_str(), "hits_r", 100,0,radius); + h_hits_r->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_r->GetName(), h_hits_r)); + + h_xy = new TH2D((detName+"_xy").c_str(), "xy", 100,x_down,x_up,100, x_down, x_up); + h_xy->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_xy->GetName(), h_xy)); + + h_zr = new TH2D((detName+"_zr").c_str(), "zr", 100,z_down,z_up,100, 0., radius); + h_zr->StatOverflows(); + CHECK(m_thistSvc->regHist( m_path+h_zr->GetName(), h_zr)); + + h_hits_eta = new TH1D((detName+"_eta").c_str(), "hits_eta", 100,eta_down,eta_up); + h_hits_eta->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_eta->GetName(), h_hits_eta)); + + h_hits_phi = new TH1D((detName+"_phi").c_str(), "hits_phi", 100,-3.1416,3.1416); + h_hits_phi->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_phi->GetName(), h_hits_phi)); + + h_hits_px = new TH1D((detName+"_px").c_str(),"Px", 100, -1500, 1500); + h_hits_px->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_px->GetName(), h_hits_px)); + + h_hits_py = new TH1D((detName+"_py").c_str(), "Py", 100,-1500,1500); + h_hits_py->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_py->GetName(), h_hits_py)); + + h_hits_pz = new TH1D((detName+"_pz").c_str(), "Pz", 100,-1500,1500); + h_hits_pz->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_pz->GetName(), h_hits_pz)); + + h_hits_pt = new TH1D((detName+"_pt").c_str(), "hits_pt", 100,0,2500); + h_hits_pt->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_hits_pt->GetName(), h_hits_pt)); + + h_time = new TH1D((detName+"_time").c_str(),"time", 100,0, 250); + h_time->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_time->GetName(), h_time)); + + h_edep = new TH1D((detName+"_edep").c_str(), "energy", 100,0,7500); + h_edep->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_edep->GetName(), h_edep)); + + h_pdg = new TH1D((detName+"_pdg").c_str(), "pdg", 100,-1000,1000); + h_pdg->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_pdg->GetName(), h_pdg)); + + + m_tree= new TTree(ntupName.c_str(),ntupName.c_str()); + std::string fullNtupleName = "/"+m_ntupleFileName+"/"+detName; + CHECK(m_thistSvc->regTree(fullNtupleName,m_tree)); + + + + /** now add branches and leaves to the tree */ + if (m_tree){ + m_tree->Branch("x", &m_x); + m_tree->Branch("y", &m_y); + m_tree->Branch("z", &m_z); + m_tree->Branch("r", &m_r); + m_tree->Branch("eta", &m_eta); + m_tree->Branch("phi", &m_phi); + m_tree->Branch("px", &m_px); + m_tree->Branch("py", &m_py); + m_tree->Branch("pz", &m_pz); + m_tree->Branch("pt", &m_pt); + m_tree->Branch("time", &m_time); + m_tree->Branch("energy", &m_edep); + m_tree->Branch("pdg", &m_pdg); + }else{ + ATH_MSG_ERROR("No tree found!"); + } + + + return StatusCode::SUCCESS; +} + + + +StatusCode TrackRecordAnalysis::execute() { + ATH_MSG_DEBUG( "In TrackRecordAnalysis::execute()" ); + + m_x->clear(); + m_y->clear(); + m_z->clear(); + m_r->clear(); + m_eta->clear(); + m_phi->clear(); + m_px->clear(); + m_py->clear(); + m_pz->clear(); + m_pt->clear(); + m_time->clear(); + m_edep->clear(); + m_pdg->clear(); + + const DataHandle<TrackRecordCollection> TRcoll; + if (evtStore()->retrieve(TRcoll, m_collection )==StatusCode::SUCCESS) { + for(TrackRecordCollection::const_iterator track = TRcoll->begin(); + track != TRcoll->end();++track){ + //TrackRecordCollection::const_iterator track; + //for(auto track : *TRcoll){ + std::cout<<"Entra en el loop"<<std::endl; + CLHEP::Hep3Vector p =(*track).GetPosition(); + h_hits_x->Fill(p.x()); + h_hits_y->Fill(p.y()); + h_hits_z->Fill(p.z()); + h_hits_r->Fill(p.perp()); + h_xy->Fill(p.x(), p.y()); + h_zr->Fill(p.z(),p.perp()); + h_hits_eta->Fill(p.eta()); + h_hits_phi->Fill(p.phi()); + CLHEP::Hep3Vector mom = (*track).GetMomentum(); + h_hits_px->Fill( mom.x()); + h_hits_py->Fill( mom.y()); + h_hits_pz->Fill( mom.z()); + h_hits_pt->Fill( mom.perp()); + h_edep->Fill((*track).GetEnergy()); + h_time->Fill((*track).GetTime()); + h_pdg->Fill((*track).GetPDGCode()); + + m_x->push_back(p.x()); + m_y->push_back(p.y()); + m_z->push_back(p.z()); + m_r->push_back(p.perp()); + m_eta->push_back(p.eta()); + m_phi->push_back(p.phi()); + m_px->push_back( mom.x()); + m_py->push_back( mom.y()); + m_pz->push_back( mom.z()); + m_pt->push_back( mom.perp()); + m_edep->push_back((*track).GetEnergy()); + m_time->push_back((*track).GetTime()); + m_pdg->push_back((*track).GetPDGCode()); + } + } // End while hits + + + if (m_tree) m_tree->Fill(); + + + + return StatusCode::SUCCESS; +} diff --git a/Simulation/Tools/HitAnalysis/src/TrackRecordAnalysis.h b/Simulation/Tools/HitAnalysis/src/TrackRecordAnalysis.h new file mode 100755 index 0000000000000000000000000000000000000000..9f530143fde1b4695f4e4139edb67d72c2183d0b --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/TrackRecordAnalysis.h @@ -0,0 +1,80 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TRACK_RECORD_ANALYSIS_H +#define TRACK_RECORD_ANALYSIS_H + +#include "AthenaBaseComps/AthAlgorithm.h" + +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ITHistSvc.h" + +#include <string> +#include <vector> +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" + + + +class TH1; +class TH2; +class TTree; + + +class TrackRecordAnalysis : public AthAlgorithm { + + public: + + TrackRecordAnalysis(const std::string& name, ISvcLocator* pSvcLocator); + ~TrackRecordAnalysis(){} + + virtual StatusCode initialize(); + virtual StatusCode execute(); + + private: + + + /** Some variables**/ + TH1* h_hits_x; + TH1* h_hits_y; + TH1* h_hits_z; + TH1* h_hits_r; + TH2* h_xy; + TH2* h_zr; + TH1* h_hits_eta; + TH1* h_hits_phi; + TH1* h_hits_px; + TH1* h_hits_py; + TH1* h_hits_pz; + TH1* h_hits_pt; + TH1* h_time; + TH1* h_edep; + TH1* h_pdg; + + + + std::vector<float>* m_x; + std::vector<float>* m_y; + std::vector<float>* m_z; + std::vector<float>* m_r; + std::vector<float>* m_eta; + std::vector<float>* m_phi; + std::vector<float>* m_px; + std::vector<float>* m_py; + std::vector<float>* m_pz; + std::vector<float>* m_pt; + std::vector<float>* m_time; + std::vector<float>* m_edep; + std::vector<float>* m_pdg; + + TTree * m_tree; + std::string m_ntupleFileName; + std::string m_path; + ServiceHandle<ITHistSvc> m_thistSvc; + std::string m_collection; +}; + +#endif // TRACK_RECORD_ANALYSIS_H + diff --git a/Simulation/Tools/HitAnalysis/src/TruthHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/TruthHitAnalysis.cxx new file mode 100755 index 0000000000000000000000000000000000000000..36025ca049e38c4eca204129de9f74d55a1b5d5b --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/TruthHitAnalysis.cxx @@ -0,0 +1,358 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TruthHitAnalysis.h" + +// Section of includes for Truth tests +#include "HepMC/GenEvent.h" +#include "GeneratorObjects/McEventCollection.h" +#include "EventInfo/EventInfo.h" +#include "EventInfo/EventID.h" + +#include "TH1.h" +#include "TTree.h" +#include "TString.h" + + +#include <algorithm> +#include <math.h> +#include <functional> +#include <iostream> + +TruthHitAnalysis::TruthHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator) + : AthAlgorithm(name, pSvcLocator) + , h_n_vert(0) + , h_n_part(0) + , h_n_vert_prim(0) + , h_n_part_prim(0) + , h_n_vert_sec(0) + , h_n_part_sec(0) + , h_vtx_x(0) + , h_vtx_y(0) + , h_vtx_z(0) + , h_vtx_r(0) + , h_vtx_prim_xy(0) + , h_vtx_prim_zr(0) + , h_vtx_sec_xy(0) + , h_vtx_sec_zr(0) + , h_n_generations(0) + , h_truth_px(0) + , h_truth_py(0) + , h_truth_pz(0) + , h_truth_pt(0) + , h_truth_eta(0) + , h_truth_phi(0) + , h_barcode(0) + , h_part_status(0) + , h_part_pdgid(0) + , h_part_pdgid_sec(0) + , h_part_eta(0) + , h_part_phi(0) + , h_part_p(0) + , m_vtx_x(0) + , m_vtx_y(0) + , m_vtx_z(0) + , m_vtx_r(0) + , m_vtx_barcode(0) + , m_truth_px(0) + , m_truth_py(0) + , m_truth_pz(0) + , m_truth_pt(0) + , m_truth_eta(0) + , m_truth_phi(0) + , m_barcode(0) + , m_status(0) + , m_pdgid(0) + , m_tree(0) + , m_ntupleFileName("/TruthHitAnalysis/ntuples/") + , m_path("/TruthHitAnalysis/histos/") + , m_thistSvc("THistSvc", name) + +{ + declareProperty("HistPath", m_path); + declareProperty("NtupleFileName", m_ntupleFileName); +} + +StatusCode TruthHitAnalysis::initialize() { + ATH_MSG_DEBUG( "Initializing TruthHitAnalysis" ); + + // Grab the Ntuple and histogramming service for the tree + CHECK(m_thistSvc.retrieve()); + + + /** histograms declaration */ + h_n_vert = new TH1D("h_n_vert","n_vert", 100,200, 1500); + h_n_vert->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_n_vert->GetName(), h_n_vert)); + + h_n_part = new TH1D("h_n_part","n_part", 100,1000, 10000); + h_n_part->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_n_part->GetName(), h_n_part)); + + h_n_vert_prim = new TH1D("h_n_vert_prim","n_vert prim", 100,0, 1000); + h_n_vert_prim->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_n_vert_prim->GetName(), h_n_vert_prim)); + + + h_n_part_prim = new TH1D("h_n_part_prim","n_part prim", 100,200, 1500); + h_n_part_prim->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_n_part_prim->GetName(), h_n_part_prim)); + + h_n_vert_sec = new TH1D("h_n_vert_sec","n_vert sec", 100,0, 1000); + h_n_vert_sec->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_n_vert_sec->GetName(), h_n_vert_sec)); + + h_n_part_sec = new TH1D("h_n_part_sec","n_part sec", 100,0, 5000); + h_n_part_sec->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_n_part_sec->GetName(), h_n_part_sec)); + + h_vtx_x = new TH1D("h_vtx_x","vtx_x", 100,-1300, 1300); + h_vtx_x->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_vtx_x->GetName(), h_vtx_x)); + + h_vtx_y = new TH1D("h_vtx_y","vtx_y", 100,-1200, 1200); + h_vtx_y->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_vtx_y->GetName(), h_vtx_y)); + + h_vtx_z = new TH1D("h_vtx_z","vtx_z", 100,-5000, 5000); + h_vtx_z->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_vtx_z->GetName(), h_vtx_z)); + + h_vtx_r = new TH1D("h_vtx_r","vtx_r", 100,0, 1160); + h_vtx_r->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_vtx_r->GetName(), h_vtx_r)); + + h_vtx_prim_xy = new TH2D("h_vtx_prim_xy","vtx_prim_xy", 100,-100, 100, 100,-100, 100); + h_vtx_prim_xy->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_vtx_prim_xy->GetName(), h_vtx_prim_xy)); + + h_vtx_prim_zr = new TH2D("h_vtx_prim_zr","vtx_prim_zr", 100,-1500, 1500, 100,0, 150); + h_vtx_prim_zr->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_vtx_prim_zr->GetName(), h_vtx_prim_zr)); + + h_vtx_sec_xy = new TH2D("h_vtx_sec_xy","vtx_sec_xy", 100,-1200, 1200, 100,-1200, 1200); + h_vtx_sec_xy->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_vtx_sec_xy->GetName(), h_vtx_sec_xy)); + + h_vtx_sec_zr = new TH2D("h_vtx_sec_zr","vtx_sec_zr", 100,-6000, 6000, 100,0, 1160); + h_vtx_sec_zr->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_vtx_sec_zr->GetName(), h_vtx_sec_zr)); + + + h_n_generations = new TH1D("h_n_generations","h_generations", 100,0, 25); + h_n_generations->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_n_generations->GetName(), h_n_generations)); + + h_truth_px = new TH1D("h_turht_px","truth_px", 100,0, 4000); + h_truth_px->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_truth_px->GetName(), h_truth_px)); + + h_truth_py = new TH1D("h_turht_py","truth_py", 100,0, 4000); + h_truth_py->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_truth_py->GetName(), h_truth_py)); + + h_truth_pz = new TH1D("h_truth_pz","truth_pz", 100,0, 4000); + h_truth_pz->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_truth_pz->GetName(), h_truth_pz)); + + h_truth_pt = new TH1D("h_truth_pt","truth_pt", 100,0, 4000); + h_truth_pt->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_truth_pt->GetName(), h_truth_pt)); + + h_truth_eta = new TH1D("h_truth_eta","truth_eta", 50,-10, 10); + h_truth_eta->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_truth_eta->GetName(), h_truth_eta)); + + h_truth_phi = new TH1D("h_truth_phi","truth_phi", 25,-3.1416, 3.1416); + h_truth_phi->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_truth_phi->GetName(), h_truth_phi)); + + h_barcode = new TH1D("h_truth_barcode","truth_barcode", 100,0, 300000); + h_barcode->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_barcode->GetName(), h_barcode)); + + h_part_status = new TH1D("h_part_status","part status", 100,0,50); + h_part_status->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_part_status->GetName(), h_part_status)); + + h_part_pdgid = new TH1D("h_part_pdgid","part pdgid", 100,-5000, 5000); + h_part_pdgid->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_part_pdgid->GetName(), h_part_pdgid)); + + h_part_pdgid_sec = new TH1D("h_part_pdgid_sec","part pdgid sec", 100,-5000, 5000); + h_part_pdgid_sec->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_part_pdgid_sec->GetName(), h_part_pdgid_sec)); + + h_part_eta = new TH1D("h_part_eta","part eta", 100,-10, 10); + h_part_eta->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_part_eta->GetName(), h_part_eta)); + + h_part_phi = new TH1D("h_part_phi","part phi", 100,-3.2, 3.2); + h_part_phi->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_part_phi->GetName(), h_part_phi)); + + h_part_p = new TH1D("h_part_p","part p", 100,0, 5000); + h_part_p->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_part_p->GetName(), h_part_p)); + + + m_tree= new TTree("TruthHitNtuple ","TruthHitAna"); + std::string fullNtupleName = "/"+m_ntupleFileName+"/"; + CHECK(m_thistSvc->regTree(fullNtupleName,m_tree)); + + + + /** now add branches and leaves to the tree */ + if (m_tree){ + + m_tree->Branch("vtx_x", &m_vtx_x); + m_tree->Branch("vtx_y", &m_vtx_y); + m_tree->Branch("vtx_z", &m_vtx_z); + m_tree->Branch("vtx_r", &m_vtx_r); + m_tree->Branch("vtx_barcode", &m_vtx_barcode); + m_tree->Branch("truth_px", &m_truth_px); + m_tree->Branch("truth_py", &m_truth_py); + m_tree->Branch("truth_pz", &m_truth_pz); + m_tree->Branch("truth_pt", &m_truth_pt); + m_tree->Branch("truth_eta", &m_truth_eta); + m_tree->Branch("truth_phi", &m_truth_phi); + m_tree->Branch("barcode", &m_barcode); + m_tree->Branch("status", &m_status); + m_tree->Branch("pdg_id", &m_pdgid); + + }else{ + ATH_MSG_ERROR("No tree found!"); + } + + + return StatusCode::SUCCESS; +} + + + +StatusCode TruthHitAnalysis::execute() { + ATH_MSG_DEBUG( "In TruthHitAnalysis::execute()" ); + + m_vtx_x->clear(); + m_vtx_y->clear(); + m_vtx_z->clear(); + m_vtx_r->clear(); + m_vtx_barcode->clear(); + m_truth_px->clear(); + m_truth_py->clear(); + m_truth_pz->clear(); + m_truth_pt->clear(); + m_truth_eta->clear(); + m_truth_phi->clear(); + m_barcode->clear(); + m_status->clear(); + m_pdgid->clear(); + + + const DataHandle<EventInfo> event; + if (!evtStore()->retrieve(event, "McEventInfo" ).isSuccess()) + return StatusCode::FAILURE; + const DataHandle<McEventCollection> mcCollection; + if(evtStore()->retrieve(mcCollection,"TruthEvent")==StatusCode::SUCCESS){ + McEventCollection::const_iterator currentGenEventIter = mcCollection->begin(); + if(currentGenEventIter != mcCollection->end()){ + int nvtx = 0; + int nvtx_sec=0; + for(HepMC::GenEvent::vertex_const_iterator vtx=(*currentGenEventIter)->vertices_begin(); vtx!=(*currentGenEventIter)->vertices_end();++vtx){ + + + double x = (*vtx)->position().x(); + double y = (*vtx)->position().y(); + double z = (*vtx)->position().z(); + double r = sqrt(x*x+y*y); + h_vtx_x->Fill(x); + h_vtx_y->Fill(y); + h_vtx_r->Fill(r); + h_vtx_z->Fill(z); + + + int bcode = (*vtx)->barcode(); + m_vtx_x->push_back(x); + m_vtx_y->push_back(y); + m_vtx_r->push_back(r); + m_vtx_z->push_back(z); + m_vtx_barcode->push_back(bcode); + + if((*vtx)->barcode()>-20000){ + h_vtx_prim_xy->Fill(x,y); + h_vtx_prim_zr->Fill(z,r); + ++nvtx; + } else{ + h_vtx_sec_xy->Fill(x,y); + h_vtx_sec_zr->Fill(z,r); + ++nvtx_sec; + } + + } //End iteration over vertices + + h_n_vert->Fill(nvtx+nvtx_sec); + h_n_vert_prim->Fill(nvtx); + h_n_vert_sec->Fill(nvtx_sec); + int npart_prim=0; + int npart_sec=0; + HepMC::GenEvent::particle_const_iterator currentGenParticleIter; + for(currentGenParticleIter=(*currentGenEventIter)->particles_begin(); currentGenParticleIter!=(*currentGenEventIter)->particles_end(); ++currentGenParticleIter){ + + + const HepMC::FourVector mom=(*currentGenParticleIter)->momentum(); + + + h_truth_px->Fill(mom.x()); + h_truth_py->Fill(mom.y()); + h_truth_pz->Fill(mom.z()); + h_truth_pt->Fill(mom.perp()); + h_truth_eta->Fill(mom.eta()); + h_truth_phi->Fill(mom.phi()); + h_barcode->Fill((*currentGenParticleIter)->barcode()); + + h_part_status->Fill((*currentGenParticleIter)->status()); + + m_truth_px->push_back(mom.x()); + m_truth_py->push_back(mom.y()); + m_truth_pz->push_back(mom.z()); + m_truth_pt->push_back(mom.perp()); + m_truth_eta->push_back(mom.eta()); + m_truth_phi->push_back(mom.phi()); + m_barcode->push_back((*currentGenParticleIter)->barcode()); + m_status->push_back((*currentGenParticleIter)->status()); + int pdg = (*currentGenParticleIter)->pdg_id(); + m_pdgid->push_back(pdg); + + if((*currentGenParticleIter)->barcode()<200000){ + h_part_pdgid->Fill(pdg); + h_part_p->Fill(mom.rho()); + h_part_eta->Fill(mom.eta()); + h_part_phi->Fill(mom.phi()); + ++npart_prim; + if((*currentGenParticleIter)->barcode()<10000){ + h_n_generations->Fill(0); + }else{ + h_n_generations->Fill(1); + } + } //End barcode <200000 + else{ + h_part_pdgid_sec->Fill(pdg); + ++npart_sec; + const int gen = (*currentGenParticleIter)->barcode()/1000000 +2; + h_n_generations ->Fill(gen); + } } // End iteration over particles + + h_n_part_prim->Fill(npart_prim); + h_n_part_sec->Fill(npart_sec); + h_n_part->Fill(npart_prim+npart_sec); + + } // End mcCollection + } // End statuscode success upon retrieval of events + + + if (m_tree) m_tree->Fill(); + + return StatusCode::SUCCESS; +} + diff --git a/Simulation/Tools/HitAnalysis/src/TruthHitAnalysis.h b/Simulation/Tools/HitAnalysis/src/TruthHitAnalysis.h new file mode 100755 index 0000000000000000000000000000000000000000..e868d555a3d09d1d57ae541141adbe7c23d875d3 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/TruthHitAnalysis.h @@ -0,0 +1,92 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TRUTH_HIT_ANALYSIS_H +#define TRUTH_HIT_ANALYSIS_H + +#include "AthenaBaseComps/AthAlgorithm.h" + +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ITHistSvc.h" + + +#include <string> +#include <vector> +#include "TH1.h" +#include "TH2.h" +#include "TTree.h" + +class TH1; +class TH2; +class TTree; + +class TruthHitAnalysis : public AthAlgorithm { + + public: + + TruthHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator); + ~TruthHitAnalysis(){} + + virtual StatusCode initialize(); + virtual StatusCode execute(); + + private: + + /** Some variables**/ + TH1* h_n_vert; + TH1* h_n_part; + TH1* h_n_vert_prim; + TH1* h_n_part_prim; + TH1* h_n_vert_sec; + TH1* h_n_part_sec; + TH1* h_vtx_x; + TH1* h_vtx_y; + TH1* h_vtx_z; + TH1* h_vtx_r; + TH2* h_vtx_prim_xy; + TH2* h_vtx_prim_zr; + TH2* h_vtx_sec_xy; + TH2* h_vtx_sec_zr; + TH1* h_n_generations; + TH1* h_truth_px; + TH1* h_truth_py; + TH1* h_truth_pz; + TH1* h_truth_pt; + TH1* h_truth_eta; + TH1* h_truth_phi; + TH1* h_barcode; + TH1* h_part_status; + TH1* h_part_pdgid; + TH1* h_part_pdgid_sec; + TH1* h_part_eta; + TH1* h_part_phi; + TH1* h_part_p; + + + std::vector<float>* m_vtx_x; + std::vector<float>* m_vtx_y; + std::vector<float>* m_vtx_z; + std::vector<float>* m_vtx_r; + std::vector<float>* m_vtx_barcode; + std::vector<float>* m_truth_px; + std::vector<float>* m_truth_py; + std::vector<float>* m_truth_pz; + std::vector<float>* m_truth_pt; + std::vector<float>* m_truth_eta; + std::vector<float>* m_truth_phi; + std::vector<float>* m_barcode; + std::vector<float>* m_status; + std::vector<float>* m_pdgid; + + TTree * m_tree; + std::string m_ntupleFileName; + std::string m_path; + ServiceHandle<ITHistSvc> m_thistSvc; + + + +}; + +#endif // TRUTH_HIT_ANALYSIS_H + diff --git a/Simulation/Tools/HitAnalysis/src/ZDCHitAnalysis.cxx b/Simulation/Tools/HitAnalysis/src/ZDCHitAnalysis.cxx new file mode 100755 index 0000000000000000000000000000000000000000..7b838ddb1266acf312544ec72cbc17520d4545ab --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/ZDCHitAnalysis.cxx @@ -0,0 +1,218 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "ZDCHitAnalysis.h" + + +#include "ZDC_SimEvent/ZDC_SimStripHit_Collection.h" +#include "ZDC_SimEvent/ZDC_SimStripHit.h" +#include "ZDC_SimEvent/ZDC_SimPixelHit_Collection.h" +#include "ZDC_SimEvent/ZDC_SimPixelHit.h" + + +#include "TH1.h" +#include "TString.h" + + +#include <algorithm> +#include <math.h> +#include <functional> +#include <iostream> +#include <stdio.h> + +ZDCHitAnalysis::ZDCHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator) + : AthAlgorithm(name, pSvcLocator) + , h_zdc_sidea_0(0) + , h_zdc_sidea_1(0) + , h_zdc_sidea_2(0) + , h_zdc_sidea_3(0) + , h_zdc_sidec_0(0) + , h_zdc_sidec_1(0) + , h_zdc_sidec_2(0) + , h_zdc_sidec_3(0) + , m_zdc_strip_side(0) + , m_zdc_strip_mod(0) + , m_zdc_strip_energy(0) + , m_zdc_pix_side(0) + , m_zdc_pix_mod(0) + , m_zdc_pix_energy(0) + , m_path("/ZDCHitAnalysis/") + , m_thistSvc("THistSvc", name) +{ + declareProperty("HistPath", m_path); +} + +StatusCode ZDCHitAnalysis::initialize() { + ATH_MSG_DEBUG( "Initializing ZDCHitAnalysis" ); + + // Grab the Ntuple and histogramming service for the tree + CHECK(m_thistSvc.retrieve()); + + /** Histograms*/ + + h_zdc_sidea_0 = new TH1D("m_edep_side_a0","edep_side_a0", 100,0, 1000); + h_zdc_sidea_0->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_zdc_sidea_0->GetName(), h_zdc_sidea_0)); + + h_zdc_sidea_1 = new TH1D("m_edep_side_a1","edep_side_a1", 100,0, 1000); + h_zdc_sidea_1->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_zdc_sidea_1->GetName(), h_zdc_sidea_1)); + + h_zdc_sidea_2 = new TH1D("m_edep_side_a2","edep_side_a2", 100,0, 1000); + h_zdc_sidea_2->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_zdc_sidea_2->GetName(), h_zdc_sidea_2)); + + h_zdc_sidea_3 = new TH1D("m_edep_side_a3","edep_side_a3", 100,0, 1000); + h_zdc_sidea_3->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_zdc_sidea_3->GetName(), h_zdc_sidea_3)); + + h_zdc_sidec_0 = new TH1D("m_edep_side_c0","edep_side_c0", 100,0, 1000); + h_zdc_sidec_0->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_zdc_sidec_0->GetName(), h_zdc_sidec_0)); + + h_zdc_sidec_1 = new TH1D("m_edep_side_c1","edep_side_c1", 100,0, 1000); + h_zdc_sidec_1->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_zdc_sidec_1->GetName(), h_zdc_sidec_1)); + + h_zdc_sidec_2 = new TH1D("m_edep_side_c2","edep_side_c2", 100,0, 1000); + h_zdc_sidec_2->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_zdc_sidec_2->GetName(), h_zdc_sidec_2)); + + h_zdc_sidec_3 = new TH1D("m_edep_side_c3","edep_side_c3", 100,0, 1000); + h_zdc_sidec_3->StatOverflows(); + CHECK(m_thistSvc->regHist(m_path + h_zdc_sidec_3->GetName(), h_zdc_sidec_3)); + + + m_tree= new TTree("NtupleZDCHitAnalysis","ZDCHitAna"); + std::string fullNtupleName = "/"+m_ntupleFileName+"/"; + CHECK(m_thistSvc->regTree(fullNtupleName,m_tree)); + + /** now add branches and leaves to the tree */ + if (m_tree){ + m_tree->Branch("strip_side", &m_zdc_strip_side); + m_tree->Branch("strip_mode", &m_zdc_strip_mod); + m_tree->Branch("strip_energy", &m_zdc_strip_energy); + + m_tree->Branch("pix_side", &m_zdc_pix_side); + m_tree->Branch("pix_mode", &m_zdc_pix_mod); + m_tree->Branch("pix_energy", &m_zdc_pix_energy); + + }else{ + ATH_MSG_ERROR("No tree found!"); + } + return StatusCode::SUCCESS; +} + + + +StatusCode ZDCHitAnalysis::execute() { + ATH_MSG_DEBUG( "In ZDCHitAnalysis::execute()" ); + + m_zdc_strip_side->clear(); + m_zdc_strip_mod->clear(); + m_zdc_strip_energy->clear(); + m_zdc_pix_side->clear(); + m_zdc_pix_mod->clear(); + m_zdc_pix_energy->clear(); + double ene_strip = -999.; + int side_strip = -1; + int mod_strip = -1; + double ene_pix = -999.; + int side_pix = -1; + int mod_pix = -1; + + ZDC_SimStripHit_ConstIterator striphi; + const DataHandle<ZDC_SimStripHit_Collection> stripiter; + CHECK(evtStore()->retrieve(stripiter,"ZDC_SimStripHit_Collection")); + for(striphi=(*stripiter).begin(); striphi != (*stripiter).end();++striphi){ + ZDC_SimStripHit ghit(*striphi); + ene_strip=ghit.GetEdep(); + side_strip = ghit.GetSide(); + mod_strip = ghit.GetMod(); + + if(side_pix==1){ + switch(mod_strip){ + case 0: + h_zdc_sidea_0->Fill(ene_strip); + break; + case 1: + h_zdc_sidea_1->Fill(ene_strip); + break; + case 2: + h_zdc_sidea_2->Fill(ene_strip); + break; + case 3: + h_zdc_sidea_3->Fill(ene_strip); + break; + } + }else{ + switch (mod_strip){ + case 0: + h_zdc_sidec_0->Fill(ene_strip); + break; + case 1: + h_zdc_sidec_1->Fill(ene_strip); + break; + case 2: + h_zdc_sidec_2->Fill(ene_strip); + break; + case 3: + h_zdc_sidec_3->Fill(ene_strip); + break; + } + } + } + + ZDC_SimPixelHit_ConstIterator pixelhi; + const DataHandle<ZDC_SimPixelHit_Collection> pixeliter; + CHECK(evtStore()->retrieve(pixeliter,"ZDC_SimPixelHit_Collection")); + for(pixelhi=(*pixeliter).begin(); pixelhi != (*pixeliter).end();++pixelhi){ + ZDC_SimPixelHit ghit(*pixelhi); + ene_pix=ghit.GetEdep(); + side_pix = ghit.GetSide(); + mod_pix = ghit.GetMod(); + + if(side_pix==1){ + switch(mod_pix){ + case 0: + h_zdc_sidea_0->Fill(ene_pix); + break; + case 1: + h_zdc_sidea_1->Fill(ene_pix); + break; + case 2: + h_zdc_sidea_2->Fill(ene_pix); + break; + case 3: + h_zdc_sidea_3->Fill(ene_pix); + break; + } + }else{ + switch (mod_pix){ + case 0: + h_zdc_sidec_0->Fill(ene_pix); + break; + case 1: + h_zdc_sidec_1->Fill(ene_pix); + break; + case 2: + h_zdc_sidec_2->Fill(ene_pix); + break; + case 3: + h_zdc_sidec_3->Fill(ene_pix); + break; + } + } + + m_zdc_strip_side->push_back(side_strip); + m_zdc_strip_mod->push_back(mod_strip); + m_zdc_strip_energy->push_back(ene_strip); + m_zdc_pix_side->push_back(side_pix); + m_zdc_pix_mod->push_back(mod_pix); + m_zdc_pix_energy->push_back(ene_pix); + } + + if (m_tree) m_tree->Fill(); + return StatusCode::SUCCESS; +} diff --git a/Simulation/Tools/HitAnalysis/src/ZDCHitAnalysis.h b/Simulation/Tools/HitAnalysis/src/ZDCHitAnalysis.h new file mode 100755 index 0000000000000000000000000000000000000000..cf7678b4e77f7e72e20a8687084d36fd68b6afd2 --- /dev/null +++ b/Simulation/Tools/HitAnalysis/src/ZDCHitAnalysis.h @@ -0,0 +1,61 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef ZDC_HIT_ANALYSIS_H +#define ZDC_HIT_ANALYSIS_H + +#include "AthenaBaseComps/AthAlgorithm.h" + +#include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/ITHistSvc.h" + +#include <string> +#include <vector> +#include "TH1.h" +#include "TTree.h" + + +class TH1; +class TTree; + + +class ZDCHitAnalysis : public AthAlgorithm { + + public: + + ZDCHitAnalysis(const std::string& name, ISvcLocator* pSvcLocator); + ~ZDCHitAnalysis(){} + + virtual StatusCode initialize(); + virtual StatusCode execute(); + + private: + + /** Some variables**/ + TH1* h_zdc_sidea_0; + TH1* h_zdc_sidea_1; + TH1* h_zdc_sidea_2; + TH1* h_zdc_sidea_3; + TH1* h_zdc_sidec_0; + TH1* h_zdc_sidec_1; + TH1* h_zdc_sidec_2; + TH1* h_zdc_sidec_3; + + std::vector<int>* m_zdc_strip_side; + std::vector<int>* m_zdc_strip_mod; + std::vector<double>* m_zdc_strip_energy; + + std::vector<int>* m_zdc_pix_side; + std::vector<int>* m_zdc_pix_mod; + std::vector<double>* m_zdc_pix_energy; + + TTree * m_tree; + std::string m_ntupleFileName; + std::string m_path; + ServiceHandle<ITHistSvc> m_thistSvc; + +}; + +#endif // ZDC_HIT_ANALYSIS_H + diff --git a/Simulation/Tools/HitAnalysis/src/components/HitAnalysis_entries.cxx b/Simulation/Tools/HitAnalysis/src/components/HitAnalysis_entries.cxx index 0b28107422c7765358dbdc36425f3c87caed8bc7..ee89af53ce7dcd141d5329f44748de814851eefc 100755 --- a/Simulation/Tools/HitAnalysis/src/components/HitAnalysis_entries.cxx +++ b/Simulation/Tools/HitAnalysis/src/components/HitAnalysis_entries.cxx @@ -1,10 +1,48 @@ -#include "HitAnalysis/CaloHitAnalysis.h" - #include "GaudiKernel/DeclareFactoryEntries.h" +#include "../SiHitAnalysis.h" +#include "../CaloHitAnalysis.h" +#include "../TRTHitAnalysis.h" +#include "../TGCHitAnalysis.h" +#include "../RPCHitAnalysis.h" +#include "../MDTHitAnalysis.h" +#include "../CSCHitAnalysis.h" +#include "../TruthHitAnalysis.h" +#include "../TrackRecordAnalysis.h" +#include "../ALFAHitAnalysis.h" +#include "../LucidHitAnalysis.h" +#include "../ZDCHitAnalysis.h" +#include "../AFPHitAnalysis.h" + DECLARE_ALGORITHM_FACTORY( CaloHitAnalysis ) +DECLARE_ALGORITHM_FACTORY( SiHitAnalysis ) +DECLARE_ALGORITHM_FACTORY( TRTHitAnalysis ) +DECLARE_ALGORITHM_FACTORY( TGCHitAnalysis ) +DECLARE_ALGORITHM_FACTORY( RPCHitAnalysis ) +DECLARE_ALGORITHM_FACTORY( MDTHitAnalysis ) +DECLARE_ALGORITHM_FACTORY( CSCHitAnalysis ) +DECLARE_ALGORITHM_FACTORY( TruthHitAnalysis ) +DECLARE_ALGORITHM_FACTORY( TrackRecordAnalysis ) +DECLARE_ALGORITHM_FACTORY( ALFAHitAnalysis ) +DECLARE_ALGORITHM_FACTORY( LucidHitAnalysis ) +DECLARE_ALGORITHM_FACTORY( ZDCHitAnalysis ) +DECLARE_ALGORITHM_FACTORY( AFPHitAnalysis ) DECLARE_FACTORY_ENTRIES( HitAnalysis ) { DECLARE_ALGORITHM( CaloHitAnalysis ) + DECLARE_ALGORITHM( SiHitAnalysis ) + DECLARE_ALGORITHM( TRTHitAnalysis ) + DECLARE_ALGORITHM( TGCHitAnalysis ) + DECLARE_ALGORITHM( RPCHitAnalysis ) + DECLARE_ALGORITHM( MDTHitAnalysis ) + DECLARE_ALGORITHM( CSCHitAnalysis ) + DECLARE_ALGORITHM( TruthHitAnalysis ) + DECLARE_ALGORITHM( TrackRecordAnalysis ) + DECLARE_ALGORITHM( ALFAHitAnalysis ) + DECLARE_ALGORITHM( LucidHitAnalysis ) + DECLARE_ALGORITHM( ZDCHitAnalysis ) + DECLARE_ALGORITHM( AFPHitAnalysis ) + + } diff --git a/TileCalorimeter/TileMonitoring/share/TileMon_jobOptions.py b/TileCalorimeter/TileMonitoring/share/TileMon_jobOptions.py index 75ef8827e8a44c63b04eeec39439ebdd3a7d23cb..50c74f9d59791a88a8014a7300186b3ecb0c527d 100644 --- a/TileCalorimeter/TileMonitoring/share/TileMon_jobOptions.py +++ b/TileCalorimeter/TileMonitoring/share/TileMon_jobOptions.py @@ -113,7 +113,7 @@ if tileESDMon: , jetPtMin = 20000.0 , jetEtaMax = 1.6 , jetCollectionName = 'AntiKt4EMTopoJets' - , do_1dim_histos = True + , do_1dim_histos = False , do_2dim_histos = False , do_enediff_histos = False , energyChanMin = 2000 # Default: 2000 diff --git a/Tools/FullChainTests/test/FullChainTests_TestConfiguration.xml b/Tools/FullChainTests/test/FullChainTests_TestConfiguration.xml index 6537109fdf3ac46e181bc6ac2ef53982bf0b4573..60893060f5cea3a58742334b9f4f17663a08190a 100644 --- a/Tools/FullChainTests/test/FullChainTests_TestConfiguration.xml +++ b/Tools/FullChainTests/test/FullChainTests_TestConfiguration.xml @@ -21,53 +21,12 @@ <jobList> <!-- COSMICS CHAIN --> - <chain> - <chainName>CosmicsChainJob</chainName> <!-- Only letters allowed, no white space or punctuation --> - <sequential> + <!-- retire the chain, not useful for Prod rel --> <!-- Run Simulation --> - <chainElement> - <jobTransform userJobId="cosmicsSimul"> - <doc>simul</doc> - <jobTransformJobName>cosmics_sim_trf_s1994_2010</jobTransformJobName> - <jobTransformCmd> - Sim_tf.py --simulator 'MC12G4' --outputHitsFile 'cosmics.HITS.pool.root' --maxEvents '5000' --DataRunNumber '155697' --physicsList 'FTFP_BERT' --geometryVersion 'ATLAS-R2-2015-03-01-00' --conditionsTag 'OFLCOND-RUN12-SDR-21' --enableLooperKiller 'True' --CosmicFilterVolume 'Calo' --CosmicPtSlice 'slice3' --beamType 'cosmics' --preInclude 'SimulationJobOptions/preInclude.BeamPipeKill.py' --postInclude 'PyJobTransforms/UseFrontier.py' --postExec 'from IOVDbSvc.CondDB import conddb;conddb.addOverride("/EXT/DCS/MAGNETS/SENSORDATA", "ExtDCSMagnetsSensorData-001");conddb.addOverride("/GLOBAL/BField/Map", "BFieldMap-FullAsym-09");' --ignorePatterns=ToolSvc.ISFG4.+ERROR\s+ISF_to_G4Event.+article.conversion.failed+ISF_Particle+PDG+code+=+1000260560 - </jobTransformCmd> - <group>FCTTransform</group> - <queue>long</queue> - <batchWallTime>300</batchWallTime> - </jobTransform> - - <chainfileout>cosmics.HITS.pool.root</chainfileout> - </chainElement> - <!-- Run Digitisation --> - <chainElement> - <jobTransform userJobId="cosmicsDigi"> - <doc>digi</doc> - <jobTransformJobName>cosmics_digi_trf</jobTransformJobName> - <jobTransformCmd> - Digi_tf.py --inputHITSFile 'cosmics.HITS.pool.root' --outputRDOFile 'cosmics.RDO.pool.root' --maxEvents 100 --skipEvents 0 --geometryVersion 'ATLAS-R2-2015-03-01-00' --digiSeedOffset1 1232 --digiSeedOffset2 342 --conditionsTag 'OFLCOND-RUN12-SDR-21' --beamType 'cosmics' --DataRunNumber '155697' --postInclude 'PyJobTransforms/UseFrontier.py' - </jobTransformCmd> - <group>FCTTransform</group> - <chaindataset_info> - <jobTransformData/> - <chaindatasetName>cosmics.HITS.pool.root</chaindatasetName> - <dataset_info> - <jobTransformData/> - <datasetName>/afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/cosmics.HITS.pool.root</datasetName> - </dataset_info> - </chaindataset_info> - <queue>long</queue> - <batchWallTime>300</batchWallTime> - </jobTransform> - <chainfileout>cosmics.RDO.pool.root</chainfileout> - </chainElement> - <!-- Run Reconstruction --> <!-- retired, cosmics trigger menu is not prod rel [ATR-10605] --> - </sequential> - </chain> <!-- LONG RECONSTRUCTION CHAIN with fct_trf.py --> <chain> @@ -339,7 +298,7 @@ <doc>evgen</doc> <jobTransformJobName>minbias2Cavern_trf</jobTransformJobName> <jobTransformCmd> - Sim_tf.py --simulator 'MC12G4' --inputEVNTFile 'MC14.108351.pythia_minbias.8TeV.EVNT.pool.root' --outputHITSFile 'discard.HITS.pool.root' --outputEVNT_CAVERNTRFile 'MC14.cavbg8TeV.EVNT.pool.root' --maxEvents 5 --skipEvents 0 --geometryVersion 'ATLAS-R2-2015-03-01-00' --conditionsTag 'OFLCOND-RUN12-SDR-21' --DataRunNumber='222222' --physicsList 'FTFP_BERT' --randomSeed 5678 --postInclude 'PyJobTransforms/UseFrontier.py' + AtlasG4_tf.py --inputEVNTFile 'MC14.108351.pythia_minbias.8TeV.EVNT.pool.root' --outputHITSFile 'discard.HITS.pool.root' --outputEVNT_CAVERNTRFile 'MC14.cavbg8TeV.EVNT.pool.root' --maxEvents 5 --skipEvents 0 --geometryVersion 'ATLAS-R2-2015-03-01-00' --conditionsTag 'OFLCOND-RUN12-SDR-21' --DataRunNumber='222222' --physicsList 'FTFP_BERT' --randomSeed 5678 --postInclude 'PyJobTransforms/UseFrontier.py' </jobTransformCmd> <group>FCTTransform</group> <chaindataset_info> @@ -483,6 +442,8 @@ <!-- MC15c CHAIN --> <chain> <chainName>ChainJobwthMC15c</chainName> + <sequential> + <parallel> <!-- Only letters allowed, no white space or punctuation in Name --> <sequential> <!-- Run Event Generation --> @@ -562,7 +523,172 @@ </chainfileout> </chainElement> </sequential> + + + <sequential> + <!-- Minbias Event Generation --> + <chainElement> + <!-- <jobTransform> --> + <jobTransform userJobId="MinbiasEvgen_MC15c"> + <!-- create minbias chain similar to above Zhad r7725 MC15c chain --> + <doc>evgen</doc> + <jobTransformJobName>MinbiasEvgen_MC15c</jobTransformJobName> + <jobTransformCmd> + export JODIR=/cvmfs/atlas.cern.ch/repo/sw/Generators/MC15JobOptions/latest;export JOBOPTSEARCHPATH=$JODIR/share/DSID361xxx:$JOBOPTSEARCHPATH; Generate_tf.py --ecmEnergy=13000. --runNumber=361033 --firstEvent=1 --maxEvents=5000 --randomSeed=8917284 --jobConfig=MC15.361033.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic.py --outputEVNTFile=MC15.361033.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic.13TeV.EVNT.pool.root + </jobTransformCmd> + <group>FCTTransform</group> + <queue>short</queue> + <batchWallTime>300</batchWallTime> + <keepFilePattern>log.*</keepFilePattern> + </jobTransform> + <chainfileout> + MC15.361033.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic.13TeV.EVNT.pool.root + </chainfileout> + </chainElement> + <!-- Run Simulation --> + <chainElement> + <jobTransform userJobId="MinbiasSimul_MC15c"> + <doc>simul</doc> + <jobTransformJobName>MinbiasSimul_MC15c</jobTransformJobName> + <jobTransformCmd> + Sim_tf.py --conditionsTag "default:OFLCOND-RUN12-SDR-19" --DataRunNumber 222525 --DBRelease "default:current" --geometryVersion "default:ATLAS-R2-2015-03-01-00_VALIDATION" --physicsList FTFP_BERT --postInclude "default:PyJobTransforms/UseFrontier.py" --preInclude "EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.FrozenShowersFCalOnly.py" --runNumber=304628 --simulator MC12G4 --truthStrategy MC15aPlus --inputEVNTFile MC15.361033.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic.13TeV.EVNT.pool.root --outputHITSFile MC15.361033.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic.13TeV.HITS.pool.root --maxEvents=10 + </jobTransformCmd> + <group>FCTTransform</group> + <chaindataset_info> + <jobTransformData /> + <chaindatasetName> + MC15.361033.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic.13TeV.EVNT.pool.root + </chaindatasetName> + <dataset_info> + <jobTransformData /> + <datasetName> + /afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.108351.pythia_minbias.8TeV.EVNT.pool.root + </datasetName> + </dataset_info> + </chaindataset_info> + <queue>long</queue> + <batchWallTime> + 300 + </batchWallTime> + </jobTransform> + <chainfileout> + MC15.361033.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic.13TeV.HITS.pool.root + </chainfileout> + </chainElement> + + <chainElement> + <jobTransform userJobId="minbiasEvt2CavernEvt_MC15c"> + <doc>evgen</doc> + <jobTransformJobName>minbiasEvt2CavernEvt_MC15c</jobTransformJobName> + <jobTransformCmd> + AtlasG4_tf.py --inputEVNTFile 'MC15.361033.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic.13TeV.EVNT.pool.root' --outputHITSFile 'discard.HITS.pool.root' --outputEVNT_CAVERNTRFile 'MC15.cavbg13TeV.EVNT.pool.root' --maxEvents 10 --skipEvents 0 --geometryVersion 'default:ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'default:OFLCOND-RUN12-SDR-19' --DataRunNumber='222525' --physicsList 'FTFP_BERT' --randomSeed 5678 --preInclude 'SimulationJobOptions/preInclude.G4WriteCavern.py' --postInclude 'PyJobTransforms/UseFrontier.py' + </jobTransformCmd> + <group>FCTTransform</group> + <chaindataset_info> + <jobTransformData /> + <chaindatasetName> + MC15.361033.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic.13TeV.EVNT.pool.root + </chaindatasetName> + <dataset_info> + <jobTransformData /> + <datasetName> + /afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.108351.pythia_minbias.8TeV.EVNT.pool.root + </datasetName> + </dataset_info> + </chaindataset_info> + <queue>long</queue> + <batchWallTime>300</batchWallTime> + </jobTransform> + <chainfileout> + MC15.cavbg13TeV.EVNT.pool.root + </chainfileout> + </chainElement> + <!-- Run Simulation --> + <chainElement> + <jobTransform userJobId="cavernSimul_MC15c"> + <doc>simul</doc> + <jobTransformJobName>cavernSimul_MC15c</jobTransformJobName> + <jobTransformCmd> + Sim_tf.py --simulator 'MC12G4' --inputEVNT_CAVERNFile 'MC15.cavbg13TeV.EVNT.pool.root' --outputHITSFile 'MC15.cavbg13TeV.HITS.pool.root' --maxEvents -1 --skipEvents 0 --geometryVersion 'default:ATLAS-R2-2015-03-01-00_VALIDATION' --conditionsTag 'default:OFLCOND-RUN12-SDR-19' --DataRunNumber '222525' --physicsList 'FTFP_BERT' --enableLooperKiller 'True' --randomSeed 8765 --preInclude 'EVNTtoHITS:SimulationJobOptions/preInclude.BeamPipeKill.py,SimulationJobOptions/preInclude.G4ReadCavern.py' --postInclude 'PyJobTransforms/UseFrontier.py' --ignorePatterns='ToolSvc.ISFG4.+ERROR\s+ISF_to_G4Event.+article.conversion.failed' + </jobTransformCmd> + <group>FCTTransform</group> + <chaindataset_info> + <jobTransformData /> + <chaindatasetName> + MC15.cavbg13TeV.EVNT.pool.root + </chaindatasetName> + <dataset_info> + <jobTransformData /> + <datasetName> + /afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.cavbg8TeV.EVNT.pool.root + </datasetName> + </dataset_info> + </chaindataset_info> + <queue>long</queue> + <batchWallTime>300</batchWallTime> + </jobTransform> + <chainfileout> + MC15.cavbg13TeV.HITS.pool.root + </chainfileout> + </chainElement> + </sequential> + </parallel> + + <!-- Pileup DIY --> + <!-- Run DigiReco --> + <chainElement> + <jobTransform userJobId="pileupDigiReco_MC15c"> + <doc>digireco</doc> + <jobTransformJobName>pileupDigiReco_MC15c</jobTransformJobName> + <jobTransformCmd> + Reco_tf.py --inputHITSFile MC15.304628.Pythia8EvtGen_A14NNPDF23LO_ZHad_280_500.13TeV.HITS.pool.root --outputRDOFile MC15.Pileup.RDO.pool.root --outputESDFile 'MC15.Pileup.ESD.pool.root' --outputAODFile 'MC15.Pileup.AOD.pool.root' --maxEvents 2 --jobNumber 1 --skipEvents 0 --geometryVersion 'ATLAS-R2-2015-03-01-00' --conditionsTag 'OFLCOND-RUN12-SDR-21' --DataRunNumber='222525' --digiSeedOffset1 123456 --digiSeedOffset2 2345678 --LowPtMinbiasHitsFile 'MC15.361033.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic.13TeV.HITS.pool.root' --cavernHitsFile 'MC15.cavbg13TeV.HITS.pool.root' --preInclude 'HITtoRDO:SimulationJobOptions/preInclude.PileUpBunchTrainsMC15_2015_25ns_Config1.py,Digitization/ForceUseOfPileUpTools.py,RunDependentSimData/configLumi_run284500_v2.py' --postInclude 'PyJobTransforms/UseFrontier.py' + </jobTransformCmd> + <group>FCTTransform</group> + <chaindataset_info> + <jobTransformData /> + <chaindatasetName> + MC15.304628.Pythia8EvtGen_A14NNPDF23LO_ZHad_280_500.13TeV.HITS.pool.root + </chaindatasetName> + <dataset_info> + <jobTransformData /> + <datasetName> + /afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.147818.Pythia8_AU2CTEQ6L1_Ztautau.8TeV.HITS.pool.root + </datasetName> + </dataset_info> + </chaindataset_info> + <chaindataset_info> + <jobTransformData /> + <chaindatasetName> + MC15.361033.Pythia8EvtGen_A2MSTW2008LO_minbias_inelastic.13TeV.HITS.pool.root + </chaindatasetName> + <dataset_info> + <jobTransformData /> + <datasetName> + /afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.108351.pythia_minbias.8TeV.HITS.pool.root + </datasetName> + </dataset_info> + </chaindataset_info> + <chaindataset_info> + <jobTransformData /> + <chaindatasetName> + MC15.cavbg13TeV.HITS.pool.root + </chaindatasetName> + <dataset_info> + <jobTransformData /> + <datasetName> + /afs/cern.ch/atlas/offline/external/FullChainTest/long/rtt.fallback/MC12/MC12.cavbg8TeV.HITS.pool.root + </datasetName> + </dataset_info> + </chaindataset_info> + <queue>long</queue> + <batchWallTime>300</batchWallTime> + </jobTransform> + <chainfileout> + MC15.Pileup.AOD.pool.root + </chainfileout> + </chainElement> </chain> + </jobList> <jobGroups> <jobGroup name="FCTTransform" parent="Transform"> diff --git a/Tools/PROCTools/python/RunTier0Tests.py b/Tools/PROCTools/python/RunTier0Tests.py index 86912b3c24a14befcca2884be20ed9669980b6a7..10421ef843164b3a5dddccec56ab311ea4db4895 100755 --- a/Tools/PROCTools/python/RunTier0Tests.py +++ b/Tools/PROCTools/python/RunTier0Tests.py @@ -28,6 +28,11 @@ def RunCleanQTest(qtest,pwd,release,extraArg,CleanRunHeadDir,UniqID, doR2A=False q=qtest if q == 'q431' and doR2A: extraArg += " --steering='doRAWtoALL'" + if 'CMTPATH' in os.environ: + if q == 'q431': + extraArg += " --geometryVersion all:ATLAS-R2-2015-04-00-00 --conditionsTag all:CONDBR2-BLKPA-2016-11 " + elif q == 'q221': + extraArg += " --conditionsTag all:OFLCOND-RUN12-SDR-25 " logging.info("Running clean in rel "+release+" \"Reco_tf.py --AMI "+q+" "+extraArg+"\"") #Check if CleanRunHead directory exists if not exist with a warning @@ -43,6 +48,11 @@ def RunPatchedQTest(qtest,pwd,release,theTestArea,extraArg, doR2A=False): q=qtest if q == 'q431' and doR2A: extraArg += " --steering='doRAWtoALL'" + if 'CMTPATH' in os.environ: + if q == 'q431': + extraArg += " --geometryVersion all:ATLAS-R2-2015-04-00-00 --conditionsTag all:CONDBR2-BLKPA-2016-11 " + elif q == 'q221': + extraArg += " --conditionsTag all:OFLCOND-RUN12-SDR-25 " logging.info("Running patched in rel "+release+" \"Reco_tf.py --AMI "+q+" "+extraArg+"\"") diff --git a/Tools/PmbUtils/cmt/requirements b/Tools/PmbUtils/cmt/requirements index f68c181acfc43a56e10cb5622d5934c7847b448e..7f4952a06763041568ec2089e9ed7f7c89da307b 100644 --- a/Tools/PmbUtils/cmt/requirements +++ b/Tools/PmbUtils/cmt/requirements @@ -3,7 +3,7 @@ package PmbUtils use AtlasPolicy AtlasPolicy-* use CoolDozer CoolDozer-* Tools -no_auto_imports use PyUtils PyUtils-* Tools -no_auto_imports -use AtlasMatplotlib AtlasMatplotlib-* External + apply_pattern declare_python_modules files="*.py" apply_pattern declare_scripts files="*.py pmb-rtt-domain-callgrind" diff --git a/Tools/PmbUtils/python/CreateSQLiteJobDatabase.py b/Tools/PmbUtils/python/CreateSQLiteJobDatabase.py new file mode 100644 index 0000000000000000000000000000000000000000..8efb03c726fd534e36d1c6ca7b6dbeb8d84c5fff --- /dev/null +++ b/Tools/PmbUtils/python/CreateSQLiteJobDatabase.py @@ -0,0 +1,422 @@ +#!/usr/bin/env python + +# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration + +## CreateSQLiteJobDatabase.py - +# $Id$ + +### INCLUDED MODULE +from sqlalchemy import * + +import sys +import datetime +import time +import re +import json +import subprocess +import logging +import os + +### Setup global logging +logging.basicConfig(level=logging.INFO, + format='%(asctime)s %(levelname)-8s %(message)s', + datefmt='%m-%d %H:%M', + filename='./CreateSQLiteJobDatabase.log', + filemode='w') +console = logging.StreamHandler() +console.setLevel(logging.INFO) +formatter = logging.Formatter('%(levelname)-8s %(message)s') +console.setFormatter(formatter) +logging.getLogger('').addHandler(console) + +def pwd(): + Proc = subprocess.Popen('pwd', shell = False, stdout = subprocess.PIPE, stderr = subprocess.STDOUT, bufsize = 1) + Out = (Proc.communicate()[0])[:-1] + return Out + + +def GetReleaseSetup(): + + atlas_base_dir = os.environ['AtlasBaseDir'] + + if 'AtlasPatchVersion' in os.environ: + current_nightly = os.environ['AtlasPatchVersion'] + elif 'AtlasArea' in os.environ: + current_nightly = os.environ['AtlasArea'].split('/')[-1] + elif 'AtlasVersion' in os.environ: + current_nightly = os.environ['AtlasVersion'] + + if "rel" not in current_nightly: + platform = os.environ['GEANT4'].split('/')[-1] + setup="%s,%s"%(platform.replace("-", ","),current_nightly) + else : + latest_tag = "latest_copied_release" + if atlas_base_dir.split('/')[1] == 'cvmfs': + latest_tag = "latest" + latest_nightly = (os.environ['AtlasBaseDir'].split('rel')[:-1])[0]+latest_tag + elif atlas_base_dir.split('/')[1] == 'afs': + latest_nightly = (os.environ['AtlasArea'].split('rel')[:-1])[0]+latest_tag + + latest_nightly = subprocess.Popen(['/bin/bash', '-c',"ls -l "+latest_nightly], stdout=subprocess.PIPE, stderr=subprocess.PIPE).communicate()[0].split()[-1] + + release = os.environ['ATLAS_RELEASE_BASE'] + if 'afs' in release.split('/'): + release = release.split('/')[-1] + elif 'cvmfs' in release.split('/'): + release = release.split('/')[-2] + + platform = os.environ['GEANT4'].split('/')[-1] + + setup="%s,%s,%s"%(release,platform.replace("-", ","),current_nightly) + + logging.info("The environment is "+setup) + + return setup + + +def main(): + from optparse import OptionParser + + parser=OptionParser(usage="\n ./CreateSQLiteJobDatabase.py \n") + +# parser.add_option("-n","--nightly",type="string",dest="nightly",default="rel_0",help="specify nightly") # echo $AtlasVersion +# parser.add_option("-r","--release",type="string",dest="release",default="dev" ,help="specify release") # basename ${ATLAS_RELEASE_BASE} +# parser.add_option("-r","--platform",type="string",dest="platform",default="x86_64-slc6-gcc49-opt" ,help="specify platform") #basename $ROOTSYS + + parser.add_option("-j","--jobname",type="string",dest="jobname",default="test" ,help="You must specify the job name") #basename $ROOTSYS + parser.add_option("-p","--path",type="string",dest="path",default="./" ,help="You must specify the job name") #basename $ROOTSYS + + + (options,args)=parser.parse_args() + + mysetup = GetReleaseSetup() + mypwd = pwd() + + # 21.0.X-VAL,x86_64,slc6,gcc49,opt,rel_0 + + desc = mysetup.split(',') + release = desc[0] + platform = desc[1]+'_'+desc[2]+'_'+desc[3]+'_'+desc[4] + nightly = desc[5] + + path = options.path + jobname = options.jobname + + + import glob + StepLogFiles = glob.glob(path+'log.*') + + for logFile in StepLogFiles: + step = logFile.split('log.')[1] + + long_name = jobname+"_"+platform+"_"+release+"_"+nightly + + +################################################################ + +############ CREATE DATABASE + db = create_engine('sqlite:///'+long_name+'.db') + db.echo = False # Try changing this to True and see what happens + metadata = MetaData(db) + + job_t = Table('job', metadata, + Column('jid' , Integer, primary_key=True), #(1, + Column('name' , String(60) ), # u'calo_reco_mc15_ttbar_valid_13tev_25ns_mu00_to_mu40', + Column('step' , String(20) ), # u'RAWtoESD', + Column('platform' , String(30) ), # u'x86_64-slc6-gcc49-opt', + Column('release' , String(30) ), # u'rel_0', + Column('date' , DATE ), # datetime.date(2016, 8, 27), + Column('nightly' , String(10) ), # u'rel_0', + Column('exitcode' , Integer ), # 1616876, + Column('vmem_peak' , Integer ), # 1616876, + Column('vmem_mean' , Integer ), # 1606616, + Column('rss_mean' , Integer ), # 971141, + Column('jobcfg_walltime' , Integer ), # 108007, + Column('jobstart' , Integer ), # u'2016-08-28T03:50:48+0000', + Column('cpu_bmips' , Integer ), # 10, + Column('cpu_res' , Integer ), # u'rel_0/x86_64-slc6-gcc49-opt', + Column('cpu_model' , String(60) ), # u'Intel(R)_Xeon(R)_CPU_E5-2630_v3_@_2.40GHz/20480_KB', + Column('malloc' , String(30) ), # u'libtcmalloc_minimal.so/ok', + Column('cost_perevt' , Integer ), # 2, 1 + Column('cost_onceperjob' , Integer )) # 8) + + + job_t.create() + + component = Table('component', metadata, + Column('name', String(80) ), + Column('domain', String(40) ), + Column('stage', String(10) ), + Column('n', Integer ), + Column('cpu', Integer ), + Column('maxcpu', Integer ), + Column('wall', Integer ), + Column('vmem', Integer ), + Column('maxvmem', String(10) ), + Column('malloc', Integer ), + Column('maxmalloc',String(10) ), + Column('jid', Integer, ForeignKey('job.jid')) + ) + component.create() + +################################################################ + import calendar + abbr_to_num = {name: num for num, name in enumerate(calendar.month_abbr) if num} +################################################################ + + for logFile in StepLogFiles: + step = logFile.split('log.')[1] + exitcode="-1" + + try: + infile = open(logFile) + except: + continue + + data = {} + data["name"] = jobname + data["platform"] = platform + data["nightly"] = nightly + data["release"] = release + data["step"] = step + + #Read in data into dictionary + my_domain_dict = {} + my_domain_dict['AthAlgSeq']="master" + my_domain_dict['RecoMemoryBegin']="master" + my_domain_dict['RecoTimerBegin']="master" + my_domain_dict['AthMasterSeq']="master" + my_domain_dict['AthOutSeq']="master" + my_domain_dict['AthRegSeq']="master" + my_domain_dict['StreamAOD']="output" + + exitcode=-1 + timestamp=0 + #FIRST ITERATION THROUGH FILE TO INPUT JOB INFO AND GATHER DOMAIN INFORMATION + for line in infile: + if ' CET ' in line: + timestamp=line.split() + myYear = timestamp[6] + myMonth = timestamp[2] + myDay = timestamp[3] + + myTime = timestamp[4] + myHour = myTime.split(':')[0] + myMinute = myTime.split(':')[1] + mySecond = myTime.split(':')[2] + + myMonthNum = abbr_to_num[myMonth] + dt = datetime.datetime(int(myYear), int(myMonthNum), int(myDay), int(myHour), int(myMinute), int(mySecond)) + UTCtime = int((dt-datetime.datetime(1970,1,1)).total_seconds()) + data["jid"]=UTCtime + + if 'INFO leaving with code' in line: + exitcode = line.split()[6].split(':')[0] + data["exitcode"]=exitcode + elif 'jobstart' in line: + mydate = ((line.split()[4]).split('T')[0]).split('=')[1] + mydateJ =mydate.split('-') + mydate = datetime.date(int(mydateJ[0]),int(mydateJ[1]),int(mydateJ[2])) + #Get domain definitions from logfile + data["date"]=mydateJ + + if 'PerfMon domains :' in line: + domains = line.split(':')[-1] + domains = re.sub('[\[\]\',\n"]', '', domains).split(" ") + domains = [x for x in domains if x is not None] + domains.remove('') + domains.remove('') + + if '::: domain [' in line and not 'WARNING' in line: + specific_domain = [re.sub('[\]\[\n]','',line.split(' ')[-1])] + nextline = next(infile) + myalgs = nextline + myalgs = myalgs.split('algs:')[-1] + myalgs = re.sub('[\[\]\',"]', '', myalgs).split() + myalgs = [x for x in myalgs if x is not None or x is not ''] + + for myalg in myalgs: + my_domain_dict[str(myalg)]=str(specific_domain[0]) + + + if 'vmem_peak' in line : + data["vmem_peak"]=(line.split()[3]).split('=')[1] + data["vmem_mean"]=(line.split()[4]).split('=')[1] + data["rss_mean"]=(line.split()[5]).split('=')[1] + + elif 'jobcfg_walltime' in line : + data["jobcfg_walltime"]=(line.split()[3]).split('=')[1] + data["jobstart"] =(line.split()[4]).split('=')[1] + + elif 'cpu_bmips' in line : + data["cpu_bmips"]=(line.split()[3]).split('=')[1] + data["cpu_res"]=(line.split()[4]).split('=')[1] + + elif 'cpu_model' in line : + data["cpu_model"]=(line.split()[3]).split('=')[1] + + elif 'pycintex_vmemfix' in line : + data["malloc"]=(line.split()[3]).split('=')[1] + + elif 'pmonsd_cost' in line : + data["pmonsd_cost_onceperjob"]=(line.split()[3]).split('=')[1] + data["pmonsd_cost_perevt"] =(line.split()[4]).split('=')[1] + + ins = job_t.insert() + result = db.execute(ins, + jid = data["jid"] , + name = data["name"] , + platform = data["platform"] , + release = data["release"] , + step = data["step"] , + date = mydate , + nightly = data["nightly"] , + exitcode = data["exitcode"] , + vmem_peak = data["vmem_peak"] , + vmem_mean = data["vmem_mean"] , + rss_mean = data["rss_mean"] , + jobcfg_walltime = data["jobcfg_walltime"] , + jobstart = data["jobstart"] , + cpu_bmips = data["cpu_bmips"] , + cpu_res = data["cpu_res"] , + cpu_model = data["cpu_model"] , + malloc = data["malloc"] , + cost_perevt = data["pmonsd_cost_perevt"] , + cost_onceperjob = data["pmonsd_cost_onceperjob"] ) + + data["jid"]=result.inserted_primary_key[0] + + ### SECOND ITERATION TO GATHER JOB INFORMATION AND FILL DOMAIN DICTIONARY + components = [] + infile = open(logFile) + for line in infile: + if '[evt]' in line and not '[total_for' in line and not 'collapsed' in line: + pmon =line.split() + stage =str(pmon[2]) + nevts =int(pmon[3]) + cpu =int(pmon[4]) + maxcpu =int(str(pmon[5]).split("@")[0]) + wall =-1 + vmem =int(pmon[6]) + maxvmem =str(pmon[7]) + mlc =int(pmon[8]) + maxmlc =str(pmon[9]) + cname =str(pmon[10]) + try: + domain=str(my_domain_dict[cname]) + except Exception: + domain="Unknown" + + new_component = { "jid" : data["jid"], + "name" : cname , + "step" : step , + "domain" : domain , + "stage" : "evt" , + "n" : nevts , + "cpu" : cpu , + "maxcpu" : maxcpu , + "wall" : wall , + "vmem" : vmem , + "maxvmem": maxvmem , + "malloc" : mlc , + "maxmalloc" : maxmlc , + "step" : step } + + components.append(new_component) + + ins = component.insert() + db.execute(ins, + jid = data["jid"] , + name = cname , + step = step , + domain = domain , + stage = stage , + n = nevts , + cpu = cpu , + maxcpu = maxcpu , + wall = wall , + vmem = vmem , + maxvmem = maxvmem , + malloc = mlc , + maxmalloc = maxmlc ) + + + elif 'PMonSD' in line and ('[ini]' in line or '[1st]' in line or '[cbk]' in line or '[dso]' in line or '[fin]' in line or '[preLoadProxy]' in line or '[evt]' in line) and ('vmem_peak' not in line and 'jobstart' not in line and 'bmips' not in line and 'cpu_model' not in line and 'vmemfix' not in line and 'pmonsd_cost_perevt' not in line): + pmon =line.split() + + stage=str(pmon[2]) + nevts=int(pmon[3]) + cpu =pmon[4] + vmem =pmon[5] + mlc =pmon[6] + + + wall = -1 + maxcpu = -1 + maxvmem = -1 + maxmlc = -1 + cname =str(pmon[7]) + + + if '[---]' in line: + stage=str(pmon[2]) + nevts=int(pmon[3]) + cpu =pmon[4] + wall =pmon[5] + vmem =pmon[6] + mlc =pmon[7] + cname =str(pmon[8]) + + + if '[dso]' in line: + cname = cname.split('/')[-1] + + if '[cbk]' in line: + cname = cname.split('[')[0] + + + new_component = { "jid" : data["jid"] , + "name" : cname , + "step" : step , + "domain" : "" , + "stage" : stage , + "n" : nevts , + "cpu" : cpu , + "maxcpu" : maxcpu , + "wall" : wall , + "vmem" : vmem , + "maxvmem": maxvmem , + "malloc" : mlc , + "maxmalloc" : maxmlc , + "step" : step } + + components.append(new_component) + + ins = component.insert() + db.execute(ins, + jid = data["jid"] , + name = cname , + step = step , + domain = "" , + stage = stage , + n = nevts , + cpu = cpu , + maxcpu = maxcpu , + wall = wall , + vmem = vmem , + maxvmem = maxvmem , + malloc = mlc , + maxmalloc = maxmlc ) + + + #END SECOND ITERATION THROUGH LOG FILE + + data["components"] = components + + json_filename = "rtt_"+nightly+"_"+release+"_"+platform+"_"+jobname+"_"+step+".json" + with open(json_filename, 'w') as fp: + json.dump(data,fp) + +if __name__ == '__main__': + main() + diff --git a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc index 241cc626e7c898e8be82ba6d00f0ad53c4674cd8..2ab0a6ebdf2f02ebdfaecd70b63f33a89e4903c7 100644 --- a/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc +++ b/Tracking/TrkEvent/TrkParametersBase/TrkParametersBase/ParametersT.icc @@ -189,7 +189,8 @@ template <int DIM, class T, class S> Trk::ParametersT<DIM, T, S>& Trk::Parameter { if (this!=&rhs) { - if ( m_surface->isFree() ) delete m_surface; m_surface = 0; + if ( m_surface->isFree() ) delete m_surface; + m_surface = 0; // call the base class assignment operator Trk::ParametersBase<DIM,T>::operator=(rhs); m_surface = ( rhs.m_surface->isFree() ? rhs.m_surface->clone() : rhs.m_surface ); @@ -216,7 +217,8 @@ Trk::ParametersT<DIM, T, S>& Trk::ParametersT<DIM, T, S>::operator= // Destructor template <int DIM, class T, class S> Trk::ParametersT<DIM, T, S>::~ParametersT () { - if ( m_surface && m_surface->isFree() ) delete m_surface; m_surface = 0; + if ( m_surface && m_surface->isFree() ) delete m_surface; + m_surface = 0; } // PROTECTED Constructor with local arguments - persistency only, ownership of surface given diff --git a/Tracking/TrkEvent/TrkParametersBase/doc/mainpage.h b/Tracking/TrkEvent/TrkParametersBase/doc/mainpage.h deleted file mode 100644 index e679c7fe394d64e2ebbc5510e924fbb679fb21b4..0000000000000000000000000000000000000000 --- a/Tracking/TrkEvent/TrkParametersBase/doc/mainpage.h +++ /dev/null @@ -1,34 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - -@mainpage TrkParametersBase Package - -@author Andreas.Salzburger@cern.ch - -@section TrkParametersBaseIntro Introduction - -This package defines all track parameterisations in ATLAS by a set of 3 classes - - - template <int DIM, class T, class S> Trk::ParametersT - - template <int DIM, class T, class S> Trk::CurvilinearParametersT - - template <int DIM, class T> Trk::ParametersBase - -The template arguments are - - int DIM : the dimension of the parameterisation 5 for standard, 6 for extended with mass - - class T : the type can either by Charged or Neutral - - class S : the surface from Trk::Surface to define the parameterisation frame - -All local/global transformations are outsourced to the surfaces. - -Note that CurvilinearParameters make best sense on planar surfaces. - -@section TrkParametersBaseReq Requirements file - -@include requirements - -*/ - - diff --git a/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/TrkExSTEP_Propagator/STEP_Propagator.h b/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/TrkExSTEP_Propagator/STEP_Propagator.h index d6bc0967eec28b64ded032af55409c53aa01a9da..5da163d5618066b0c9c559342a90374339095634 100755 --- a/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/TrkExSTEP_Propagator/STEP_Propagator.h +++ b/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/TrkExSTEP_Propagator/STEP_Propagator.h @@ -18,6 +18,7 @@ #define STEP_Propagator_H #include <list> +#include <vector> #include "AthenaBaseComps/AthAlgTool.h" #include "AthenaKernel/IAtRndmGenSvc.h" #include "GaudiKernel/ToolHandle.h" @@ -25,12 +26,12 @@ #include "MagFieldInterfaces/IMagFieldSvc.h" #include "TrkEventPrimitives/PropDirection.h" #include "TrkEventPrimitives/ParticleHypothesis.h" -#include "TrkParameters/TrackParameters.h" -#include "TrkGeometry/BinnedMaterial.h" +#include "TrkParameters/TrackParameters.h" //TrackParameters typedef +#include "TrkGeometry/BinnedMaterial.h" //Identified material typedef #include "TrkExUtils/MaterialInteraction.h" #include "TrkMaterialOnTrack/EnergyLoss.h" #include "TrkExUtils/TrackSurfaceIntersection.h" -#include "TrkExUtils/ExtrapolationCache.h" +//#include "TrkExUtils/ExtrapolationCache.h" // Amg #include "GeoPrimitives/GeoPrimitives.h" #include "EventPrimitives/EventPrimitives.h" @@ -42,55 +43,54 @@ namespace Trk { class ScatteringAngles; class AlignableTrackingVolume; class ExtrapolationCache; - /** - @class STEP_Propagator + @class STEP_Propagator - STEP_Propagator is an algorithm for track parameters propagation through a - magnetic field, including material effects, with or without jacobian of transformation. - This algorithm contains three steps: + STEP_Propagator is an algorithm for track parameters propagation through a + magnetic field, including material effects, with or without jacobian of transformation. + This algorithm contains three steps: - 1.The first step of the algorithm is track parameters transformation from - local presentation for given start surface to global Runge Kutta coordinates. + 1.The first step of the algorithm is track parameters transformation from + local presentation for given start surface to global Runge Kutta coordinates. - 2.The second step is propagation through magnetic field with or without jacobian. + 2.The second step is propagation through magnetic field with or without jacobian. - 3.Third step is transformation from global Runge Kutta presentation to local - presentation of given output surface. + 3.Third step is transformation from global Runge Kutta presentation to local + presentation of given output surface. - AtaPlane AtaStraightLine AtaDisc AtaCylinder Perigee - | | | | | - | | | | | + AtaPlane AtaStraightLine AtaDisc AtaCylinder Perigee + | | | | | + | | | | | V V V V V ----------------------------------------------------------------- - | Local->Global transformation + | Local->Global transformation V Global position (Runge Kutta presentation) - | - | + | + | Propagation to next surface with or without jacobian - | + | V Global->Local transformation ---------------------------------------------------------------- - | | | | | - | | | | | + | | | | | + | | | | | V V V V V - PlaneSurface StraightLineSurface DiscSurface CylinderSurface PerigeeSurface + PlaneSurface StraightLineSurface DiscSurface CylinderSurface PerigeeSurface - For propagation using Runge Kutta method we use global coordinate, direction, - inverse momentum and Jacobian of transformation. All this parameters we save - in array P[42]. + For propagation using Runge Kutta method we use global coordinate, direction, + inverse momentum and Jacobian of transformation. All this parameters we save + in array P[42]. /dL0 /dL1 /dPhi /dThe /dCM - X ->P[0] dX / P[ 7] P[14] P[21] P[28] P[35] - Y ->P[1] dY / P[ 8] P[15] P[22] P[29] P[36] - Z ->P[2] dZ / P[ 9] P[16] P[23] P[30] P[37] - Ax ->P[3] dAx/ P[10] P[17] P[24] P[31] P[38] - Ay ->P[4] dAy/ P[11] P[18] P[25] P[32] P[39] - Az ->P[5] dAz/ P[12] P[19] P[26] P[33] P[40] - CM ->P[6] dCM/ P[13] P[20] P[27] P[34] P[41] - - where + X ->P[0] dX / P[ 7] P[14] P[21] P[28] P[35] + Y ->P[1] dY / P[ 8] P[15] P[22] P[29] P[36] + Z ->P[2] dZ / P[ 9] P[16] P[23] P[30] P[37] + Ax ->P[3] dAx/ P[10] P[17] P[24] P[31] P[38] + Ay ->P[4] dAy/ P[11] P[18] P[25] P[32] P[39] + Az ->P[5] dAz/ P[12] P[19] P[26] P[33] P[40] + CM ->P[6] dCM/ P[13] P[20] P[27] P[34] P[41] + + where in case local presentation L0 - first local coordinate (surface dependent) @@ -109,24 +109,24 @@ namespace Trk { Az - direction cosine to z-axis = Cos(The) CM - charge/momentum = local CM - The Runge-Kutta method: - The equations of motion are solved using an embedded pair of Runge-Kutta formulas. - This method, Runge-Kutta-Fehlberg, calculates a number of points along the step and - adds them up in different ways to get two different solutions, of different order, for the integration. - The higher order solution is used for the propagation and the lower order solution for error control. - The difference between these solutions is used to estimate the quality of the integration (propagation), - and to calculate the step size for the next step. If the quality is below a given tolerance then the - step is rejected and repeated with a shorter step length. This propagator uses the TP43 - (Tsitouras-Papakostas 4th and 3rd order) Runge-Kutta pair. + The Runge-Kutta method: + The equations of motion are solved using an embedded pair of Runge-Kutta formulas. + This method, Runge-Kutta-Fehlberg, calculates a number of points along the step and + adds them up in different ways to get two different solutions, of different order, for the integration. + The higher order solution is used for the propagation and the lower order solution for error control. + The difference between these solutions is used to estimate the quality of the integration (propagation), + and to calculate the step size for the next step. If the quality is below a given tolerance then the + step is rejected and repeated with a shorter step length. This propagator uses the TP43 + (Tsitouras-Papakostas 4th and 3rd order) Runge-Kutta pair. - The step size algoritm by L.P.Endresen and J.Myrheim was choosen for its low step rejection and effective - step size calculation. The low step rejection is achieved by letting the step size oscillate around - the optimal value instead of repeating steps every time they fall below the tolerance level. + The step size algoritm by L.P.Endresen and J.Myrheim was choosen for its low step rejection and effective + step size calculation. The low step rejection is achieved by letting the step size oscillate around + the optimal value instead of repeating steps every time they fall below the tolerance level. - Units are mm, MeV and kiloGauss. + Units are mm, MeV and kiloGauss. - @author esben.lund@fys.uio.no - **/ + @author esben.lund@fys.uio.no + **/ class STEP_Propagator : public AthAlgTool, virtual public IPropagator { @@ -134,7 +134,6 @@ namespace Trk { // Public methods: ///////////////////////////////////////////////////////////////////////////////// public: - STEP_Propagator(const std::string&,const std::string&,const IInterface*); @@ -166,22 +165,22 @@ namespace Trk { const Trk::NeutralParameters* propagate (const Trk::NeutralParameters&, const Trk::Surface&, - Trk::PropDirection, - Trk::BoundaryCheck, - bool rC=false) const; - - + Trk::PropDirection, + Trk::BoundaryCheck, + bool rC=false) const; + + /** Propagate parameters and covariance without returning the Jacobian */ const Trk::TrackParameters* propagate (const Trk::TrackParameters& trackParameters, const Trk::Surface& targetSurface, - Trk::PropDirection propagationDirection, - Trk::BoundaryCheck boundaryCheck, + Trk::PropDirection propagationDirection, + Trk::BoundaryCheck boundaryCheck, const MagneticFieldProperties& magneticFieldProperties, - ParticleHypothesis particle, - bool returnCurv = false, + ParticleHypothesis particle, + bool returnCurv = false, const Trk::TrackingVolume* tVol = 0) const; - + /** Propagate parameters and covariance with search of closest surface */ const Trk::TrackParameters* propagate (const Trk::TrackParameters& trackParameters, @@ -194,7 +193,7 @@ namespace Trk { bool usePathLimit = false, bool returnCurv = false, const Trk::TrackingVolume* tVol = 0) const; - + /** Propagate parameters and covariance with search of closest surface */ const Trk::TrackParameters* propagateT (const Trk::TrackParameters& trackParameters, @@ -229,217 +228,217 @@ namespace Trk { const Trk::TrackParameters* propagate (const Trk::TrackParameters& trackParameters, const Trk::Surface& targetSurface, - Trk::PropDirection propagationDirection, - Trk::BoundaryCheck boundaryCheck, + Trk::PropDirection propagationDirection, + Trk::BoundaryCheck boundaryCheck, const MagneticFieldProperties& magneticFieldProperties, - Trk::TransportJacobian*& jacobian, - double& pathLimit, - ParticleHypothesis particle, - bool returnCurv=false, + Trk::TransportJacobian*& jacobian, + double& pathLimit, + ParticleHypothesis particle, + bool returnCurv=false, const Trk::TrackingVolume* tVol = 0) const; - - + + /** Propagate parameters only */ const Trk::TrackParameters* propagateParameters (const Trk::TrackParameters& trackParameters, const Trk::Surface& targetSurface, - Trk::PropDirection propagationDirection, - Trk::BoundaryCheck boundaryCheck, + Trk::PropDirection propagationDirection, + Trk::BoundaryCheck boundaryCheck, const MagneticFieldProperties& magneticFieldProperties, - ParticleHypothesis particle, - bool returnCurv = false, + ParticleHypothesis particle, + bool returnCurv = false, const Trk::TrackingVolume* tVol = 0) const; - - + + /** Propagate parameters and return Jacobian. WARNING: Multiple Scattering is not included in the Jacobian! */ const Trk::TrackParameters* propagateParameters (const Trk::TrackParameters& trackParameters, const Trk::Surface& targetSurface, - Trk::PropDirection propagationDirection, - Trk::BoundaryCheck boundaryCheck, + Trk::PropDirection propagationDirection, + Trk::BoundaryCheck boundaryCheck, const MagneticFieldProperties& magneticFieldProperties, - Trk::TransportJacobian*& jacobian, - ParticleHypothesis particle, - bool returnCurv = false, + Trk::TransportJacobian*& jacobian, + ParticleHypothesis particle, + bool returnCurv = false, const Trk::TrackingVolume* tVol = 0) const; - - + + /** Propagate parameters and return path (Similar to propagateParameters */ const IntersectionSolution* intersect (const Trk::TrackParameters& trackParameters, const Trk::Surface& targetSurface, const Trk::MagneticFieldProperties& magneticFieldProperties, - ParticleHypothesis particle, + ParticleHypothesis particle, const Trk::TrackingVolume* tVol = 0) const; - - /** Intersection and propagation: - */ - + + /** Intersection and propagation: + */ + const TrackSurfaceIntersection* intersectSurface(const Surface& surface, const TrackSurfaceIntersection* trackIntersection, const double qOverP, const MagneticFieldProperties& mft, ParticleHypothesis particle) const; - + /** Return a list of positions along the track */ void - globalPositions ( std::list<Amg::Vector3D>& positionsList, - const TrackParameters& trackParameters, + globalPositions (std::list<Amg::Vector3D>& positionsList, + const TrackParameters& trackParameters, const MagneticFieldProperties& magneticFieldProperties, - const CylinderBounds& cylinderBounds, - double maxStepSize, - ParticleHypothesis particle, + const CylinderBounds& cylinderBounds, + double maxStepSize, + ParticleHypothesis particle, const Trk::TrackingVolume* tVol = 0) const; - - + + ///////////////////////////////////////////////////////////////////////////////// // Private methods: ///////////////////////////////////////////////////////////////////////////////// private: - + enum SurfaceType { LINE, PLANE, CYLINDER, CONE}; - + ///////////////////////////////////////////////////////////////////////////////// // Main functions for propagation ///////////////////////////////////////////////////////////////////////////////// const Trk::TrackParameters* - propagateRungeKutta ( bool errorPropagation, - const Trk::TrackParameters& trackParameters, - const Trk::Surface& targetSurface, - Trk::PropDirection propagationDirection, - const MagneticFieldProperties& magneticFieldProperties, - ParticleHypothesis particle, - Trk::BoundaryCheck boundaryCheck, - double* Jacobian, - bool returnCurv=false) const; - + propagateRungeKutta (bool errorPropagation, + const Trk::TrackParameters& trackParameters, + const Trk::Surface& targetSurface, + Trk::PropDirection propagationDirection, + const MagneticFieldProperties& magneticFieldProperties, + ParticleHypothesis particle, + Trk::BoundaryCheck boundaryCheck, + double* Jacobian, + bool returnCurv=false) const; + ///////////////////////////////////////////////////////////////////////////////// // Main function for propagation // with search of closest surface (ST) ///////////////////////////////////////////////////////////////////////////////// const Trk::TrackParameters* - propagateRungeKutta ( bool errorPropagation, - const Trk::TrackParameters& trackParameters, - std::vector<DestSurf>& targetSurfaces, - Trk::PropDirection propagationDirection, + propagateRungeKutta (bool errorPropagation, + const Trk::TrackParameters& trackParameters, + std::vector<DestSurf>& targetSurfaces, + Trk::PropDirection propagationDirection, const MagneticFieldProperties& magneticFieldProperties, - ParticleHypothesis particle, - std::vector<unsigned int>& solutions, - double& path, - bool returnCurv=false) const; - + ParticleHypothesis particle, + std::vector<unsigned int>& solutions, + double& path, + bool returnCurv=false) const; + ///////////////////////////////////////////////////////////////////////////////// // Method of the propagation ///////////////////////////////////////////////////////////////////////////////// bool - propagateWithJacobian ( bool errorPropagation, - Surface::SurfaceType surfaceType, - double* targetSurface, - double* P, - double& path) const; - + propagateWithJacobian (bool errorPropagation, + Surface::SurfaceType surfaceType, + double* targetSurface, + double* P, + double& path) const; + //////////////////////////////////////////////////////////////////////////////// // Method for propagation with search of closest surface (ST) //////////////////////////////////////////////////////////////////////////////// bool - propagateWithJacobian ( bool errorPropagation, - std::vector< DestSurf >& sfs, - double* P, - Trk::PropDirection propDir, - std::vector<unsigned int>& solutions, - double& path, - double sumPath) const; - + propagateWithJacobian (bool errorPropagation, + std::vector< DestSurf >& sfs, + double* P, + Trk::PropDirection propDir, + std::vector<unsigned int>& solutions, + double& path, + double sumPath) const; + ///////////////////////////////////////////////////////////////////////////////// // Trajectory model ///////////////////////////////////////////////////////////////////////////////// bool - rungeKuttaStep( bool errorPropagation, - double& h, - double* P, - double* dDir, - float* BG1, - bool& firstStep, - double& distanceStepped) const; - - + rungeKuttaStep(bool errorPropagation, + double& h, + double* P, + double* dDir, + float* BG1, + bool& firstStep, + double& distanceStepped) const; + + ///////////////////////////////////////////////////////////////////////////////// // Get the magnetic field and gradients // Input: Globalposition // Output: BG, which contains Bx, By, Bz, dBx/dx, dBx/dy, dBx/dz, dBy/dx, dBy/dy, dBy/dz, dBz/dx, dBz/dy, dBz/dz ///////////////////////////////////////////////////////////////////////////////// void - getMagneticField( const Amg::Vector3D& position, - bool getGradients, - float* BG) const; - - + getMagneticField(const Amg::Vector3D& position, + bool getGradients, + float* BG) const; + + ///////////////////////////////////////////////////////////////////////////////// // Distance to surface ///////////////////////////////////////////////////////////////////////////////// double - distance ( Surface::SurfaceType surfaceType, - double* targetSurface, - const double* P, - bool& distanceSuccessful) const; - - + distance (Surface::SurfaceType surfaceType, + double* targetSurface, + const double* P, + bool& distanceSuccessful) const; + + ///////////////////////////////////////////////////////////////////////////////// // dg/dlambda for non-electrons (g=dEdX and lambda=q/p). ///////////////////////////////////////////////////////////////////////////////// double dgdlambda( double l) const; - - + + ///////////////////////////////////////////////////////////////////////////////// // Multiple scattering and straggling contributionto the covariance matrix // local covariance - to be phased out ///////////////////////////////////////////////////////////////////////////////// void covarianceContribution( const Trk::TrackParameters* trackParameters, - double path, + double path, const Trk::TrackParameters* targetParms, - AmgSymMatrix(5)* measurementCovariance) const; - + AmgSymMatrix(5)* measurementCovariance) const; + //////////////////////////////////////////////////////////////////////////////////////////////////////// // Multiple scattering and straggling contributionto the covariance matrix in curvilinear representation //////////////////////////////////////////////////////////////////////////////////////////////////////// void covarianceContribution( const Trk::TrackParameters* trackParameters, - double path, - double finalMomentum, - AmgSymMatrix(5)* measurementCovariance) const; - + double path, + double finalMomentum, + AmgSymMatrix(5)* measurementCovariance) const; + //////////////////////////////////////////////////////////////////////////////////////////////////////// // dump material effects //////////////////////////////////////////////////////////////////////////////////////////////////////// - + void dumpMaterialEffects( const Trk::CurvilinearParameters* trackParameters, double path) const; - + //////////////////////////////////////////////////////////////////////////////////////////////////////// // update material effects // to follow change of material //////////////////////////////////////////////////////////////////////////////////////////////////////// void updateMaterialEffects( double p, double sinTh, double path) const; - - + + ///////////////////////////////////////////////////////////////////////////////// // Create straight line in case q/p = 0 ///////////////////////////////////////////////////////////////////////////////// const Trk::TrackParameters* createStraightLine( const Trk::TrackParameters* inputTrackParameters) const; - + void clearCache() const; - + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Calculate energy loss in MeV/mm. The radiative effects are scaled by m_radiationScale (1=mean, 0.5=mean(log10), 0.1=mpv) ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// double dEds( double p) const; - + ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// // Momentum smearing (simulation mode) ///////////////////////////////////////////////////////////////////////////////////////////////////////////////////// @@ -556,7 +555,7 @@ namespace Trk { //if(m_solenoid) return m_fieldService->getFieldZR(R,H); return m_fieldService->getField (R,H); } - + inline void STEP_Propagator::getFieldGradient(double* R,double* H,double* dH) const { //if(m_solenoid) return m_fieldService->getFieldZR(R,H,dH); diff --git a/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/src/STEP_Propagator.cxx b/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/src/STEP_Propagator.cxx index e2327e395be4cd6247804af3a8a2d81fa4c6442f..baa278ef735a3ff5fa1ef60606178253c1177e3c 100755 --- a/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/src/STEP_Propagator.cxx +++ b/Tracking/TrkExtrapolation/TrkExSTEP_Propagator/src/STEP_Propagator.cxx @@ -15,12 +15,10 @@ #include "TrkExSTEP_Propagator/STEP_Propagator.h" #include "TrkDetDescrUtils/BinUtility.h" #include "TrkSurfaces/Surface.h" -//#include "TrkGeometry/TrackingVolume.h" #include "TrkGeometry/AlignableTrackingVolume.h" #include "TrkGeometry/MagneticFieldProperties.h" #include "TrkGeometry/BinnedMaterial.h" #include "TrkEventPrimitives/ParamDefs.h" -//#include "TrkEventPrimitives/Vector.h" #include "TrkExUtils/IntersectionSolution.h" #include "TrkExUtils/RungeKuttaUtils.h" #include "TrkExUtils/TransportJacobian.h" @@ -31,11 +29,8 @@ #include "TrkExUtils/TrackSurfaceIntersection.h" #include "TrkExUtils/ExtrapolationCache.h" // CLHEP -//#include "CLHEP/Units/SystemOfUnits.h" -//#include "CLHEP/Vector/ThreeVector.h" #include "CLHEP/Random/RandFlat.h" #include "CLHEP/Random/RandGauss.h" -//#include "AthenaKernel/IAtRndmGenSvc.h" //Gaudi #include "GaudiKernel/PhysicalConstants.h" #include "EventPrimitives/EventPrimitivesToStringConverter.h" @@ -68,21 +63,51 @@ Trk::STEP_Propagator::STEP_Propagator m_maxPath(100000.), //Maximum propagation length in mm. m_maxSteps(10000), //Maximum number of allowed steps (to avoid infinite loops). m_layXmax(1.), // maximal layer thickness for multiple scattering calculations + m_binMat{}, + m_matstates{}, + m_identifiedParameters{}, + m_hitVector{}, + m_currentLayerBin{}, + m_matupd_lastmom{}, + m_matupd_lastpath{}, + m_matdump_lastpath{}, + m_delRad{}, + m_delIoni{}, + m_sigmaIoni{}, + m_kazL{}, + m_sigmaRad{}, + m_stragglingVariance{}, + m_combinedEloss{}, + m_combinedThickness{}, + m_combinedCovariance{}, + m_covariance{}, + m_inputThetaVariance{}, + m_matInt{}, m_simulation(false), //flag for simulation mode m_rndGenSvc("AtDSFMTGenSvc", n), m_randomEngine(0), m_randomEngineName("FatrasRnd"), + m_pathLimit{}, m_propagateWithPathLimit(0), //flag for propagation with path limit + m_timeOfFlight{}, + m_timeStep{}, m_particleMass(0), + m_charge{}, m_matPropOK( true), //Flag for missing material properties. + m_particle{}, + m_trackingVolume{}, + m_material{}, m_fieldServiceHandle("AtlasFieldSvc",n), - m_fieldService(0), + m_fieldService(nullptr), m_solenoid(false), + m_currentDist{}, + m_maxCurrentDist{}, + m_timeIn{}, m_brem(false), m_bremMom(0.), m_bremEmitThreshold(0.), m_bremSampleThreshold(0.), - m_extrapolationCache(0) + m_extrapolationCache(nullptr) { declareInterface<Trk::IPropagator>(this); declareProperty( "Tolerance", m_tolerance); @@ -118,7 +143,7 @@ Trk::STEP_Propagator::~STEP_Propagator(){} // initialize StatusCode Trk::STEP_Propagator::initialize() { - msg(MSG::INFO) << name() <<" STEP_Propagator initialize() successful" << endmsg; + ATH_MSG_VERBOSE(" STEP_Propagator initialize() successful" ); if (!m_materialEffects) { //override all material interactions m_multipleScattering = false; @@ -173,7 +198,7 @@ StatusCode Trk::STEP_Propagator::initialize() // finalize StatusCode Trk::STEP_Propagator::finalize() { - msg(MSG::INFO) << name() <<" finalize() successful" << endmsg; + ATH_MSG_VERBOSE(" finalize() successful" ); return StatusCode::SUCCESS; } @@ -185,7 +210,7 @@ const Trk::NeutralParameters* Trk::BoundaryCheck, bool) const { - msg(MSG::WARNING) << "[STEP_Propagator] STEP_Propagator does not handle neutral track parameters. Use the StraightLinePropagator instead." << endmsg; + ATH_MSG_WARNING( "[STEP_Propagator] STEP_Propagator does not handle neutral track parameters. Use the StraightLinePropagator instead." ); return 0; } @@ -326,7 +351,7 @@ const Trk::TrackParameters* double beta = 1.; if (dTim>0.) { double mom = trackParameters.momentum().mag(); - beta = mom/sqrt(mom*mom+m_particleMass*m_particleMass); + beta = mom/std::sqrt(mom*mom+m_particleMass*m_particleMass); } double timMax = dTim>0 ? dTim*beta*Gaudi::Units::c_light : -1.; @@ -1223,7 +1248,7 @@ bool if (errorPropagation && m_straggling) { double sigTot2 = m_sigmaIoni*m_sigmaIoni + m_sigmaRad*m_sigmaRad; // /(beta*beta*p*p*p*p) transforms Var(E) to Var(q/p) - mom = fabs(1./P[6]); beta = mom/sqrt(mom*mom+m_particleMass*m_particleMass); + mom = fabs(1./P[6]); beta = mom/std::sqrt(mom*mom+m_particleMass*m_particleMass); double bp2 = beta*mom*mom; m_stragglingVariance += sigTot2/(bp2*bp2)*distanceStepped*distanceStepped; } @@ -1264,7 +1289,7 @@ bool dir[2] = dir[2] + distanceToTarget*dDir[2]; //Normalize dir - double norm = 1./sqrt(dir[0]*dir[0] + dir[1]*dir[1] + dir[2]*dir[2]); + double norm = 1./std::sqrt(dir[0]*dir[0] + dir[1]*dir[1] + dir[2]*dir[2]); dir[0] = norm*dir[0]; dir[1] = norm*dir[1]; dir[2] = norm*dir[2]; @@ -1425,7 +1450,7 @@ bool // collect material and update timing path = path + distanceStepped; // timing - mom = fabs(1./P[6]); beta = mom/sqrt(mom*mom+m_particleMass*m_particleMass); + mom = fabs(1./P[6]); beta = mom/std::sqrt(mom*mom+m_particleMass*m_particleMass); m_timeStep += distanceStepped/beta/CLHEP::c_light; if(fabs(distanceStepped)>0.001) m_sigmaIoni = m_sigmaIoni - m_kazL*log(fabs(distanceStepped)); @@ -1450,7 +1475,7 @@ bool absPath += fabs(distanceStepped); // timing - mom = fabs(1./P[6]); beta = mom/sqrt(mom*mom+m_particleMass*m_particleMass); + mom = fabs(1./P[6]); beta = mom/std::sqrt(mom*mom+m_particleMass*m_particleMass); m_timeStep += distanceStepped/beta/Gaudi::Units::c_light; if(fabs(distanceStepped)>0.001) m_sigmaIoni = m_sigmaIoni - m_kazL*log(fabs(distanceStepped)); @@ -1789,7 +1814,7 @@ bool path = path + distanceToTarget; // timing - mom = fabs(1./P[6]); beta = mom/sqrt(mom*mom+m_particleMass*m_particleMass); + mom = fabs(1./P[6]); beta = mom/std::sqrt(mom*mom+m_particleMass*m_particleMass); m_timeStep += distanceToTarget/beta/Gaudi::Units::c_light; //pos = pos + h*dir + 1/2*h*h*dDir. Second order Taylor expansion. @@ -1803,7 +1828,7 @@ bool dir[2] = dir[2] + distanceToTarget*dDir[2]; //Normalize dir - double norm = 1./sqrt(dir[0]*dir[0] + dir[1]*dir[1] + dir[2]*dir[2]); + double norm = 1./std::sqrt(dir[0]*dir[0] + dir[1]*dir[1] + dir[2]*dir[2]); dir[0] = norm*dir[0]; dir[1] = norm*dir[1]; dir[2] = norm*dir[2]; @@ -1865,7 +1890,7 @@ bool double momentum = initialMomentum; // Current momentum if (m_energyLoss && m_matPropOK) { g = dEds( momentum); //Use the same energy loss throughout the step. - double E = sqrt( momentum*momentum + particleMass*particleMass); + double E = std::sqrt( momentum*momentum + particleMass*particleMass); dP1 = g*E/momentum; if (errorPropagation) { if (m_includeGgradient) { @@ -1892,7 +1917,7 @@ bool if (m_energyLoss && m_matPropOK) { momentum = initialMomentum + (h/2.)*dP1; if (momentum <= m_momentumCutOff) return false; //Abort propagation - double E = sqrt( momentum*momentum + particleMass*particleMass); + double E = std::sqrt( momentum*momentum + particleMass*particleMass); dP2 = g*E/momentum; lambda2 = charge/momentum; if (errorPropagation) { @@ -1911,7 +1936,7 @@ bool if (m_energyLoss && m_matPropOK) { momentum = initialMomentum + (h/2.)*dP2; if (momentum <= m_momentumCutOff) return false; //Abort propagation - double E = sqrt( momentum*momentum + particleMass*particleMass); + double E = std::sqrt( momentum*momentum + particleMass*particleMass); dP3 = g*E/momentum; lambda3 = charge/momentum; if (errorPropagation) { @@ -1928,7 +1953,7 @@ bool if (m_energyLoss && m_matPropOK) { momentum = initialMomentum + h*dP3; if (momentum <= m_momentumCutOff) return false; //Abort propagation - double E = sqrt( momentum*momentum + particleMass*particleMass); + double E = std::sqrt( momentum*momentum + particleMass*particleMass); dP4 = g*E/momentum; lambda4 = charge/momentum; if (errorPropagation) { @@ -1948,11 +1973,8 @@ bool //Use the error estimate to calculate new step length. h is returned by reference. distanceStepped = h; //Store old step length. - if ( h >= 0.) { - h = std::min( std::max( 0.25*h, std::pow((m_tolerance / errorEstimate), 0.25)*h), 4.*h); - } else { - h = std::max( std::min( 0.25*h, std::pow((m_tolerance / errorEstimate), 0.25)*h), 4.*h); - } + h = h*std::min( std::max( 0.25, std::pow((m_tolerance / errorEstimate), 0.25)), 4.); + //Repeat step with the new step size if error is too big. if (errorEstimate > 4.*m_tolerance) continue; @@ -1970,7 +1992,7 @@ bool P[5] = dir.z(); //Normalize direction - double norm = 1./sqrt( P[3]*P[3] + P[4]*P[4] + P[5]*P[5]); + double norm = 1./std::sqrt( P[3]*P[3] + P[4]*P[4] + P[5]*P[5]); P[3] = norm*P[3]; P[4] = norm*P[4]; P[5] = norm*P[5]; @@ -2218,7 +2240,7 @@ double Trk::STEP_Propagator::dgdlambda( double l) const double p = fabs( 1./l); double m = s_particleMasses.mass[m_particle]; double me = s_particleMasses.mass[Trk::electron]; - double E = sqrt(p*p+m*m); + double E = std::sqrt(p*p+m*m); double beta = p/E; double gamma = E/m; double I = 16.e-6*std::pow( m_material->averageZ(),0.9); @@ -2233,7 +2255,7 @@ double Trk::STEP_Propagator::dgdlambda( double l) const //density effect, only valid for high energies (gamma > 10 -> p > 1GeV for muons) if (gamma > 10.) { - double delta = 2.*log(28.816e-6 * sqrt(1000.*m_material->zOverAtimesRho())/I) + 2.*log(beta*gamma) - 1.; + double delta = 2.*log(28.816e-6 * std::sqrt(1000.*m_material->zOverAtimesRho())/I) + 2.*log(beta*gamma) - 1.; double delta_deriv = -2./(l*beta*beta)+2.*delta*l*m*m; Bethe_Bloch_deriv += kaz*delta_deriv; } @@ -2338,7 +2360,7 @@ void Trk::STEP_Propagator::dumpMaterialEffects( const Trk::CurvilinearParameters m_combinedEloss.meanIoni(), m_combinedEloss.sigmaIoni(), m_combinedEloss.meanRad(), m_combinedEloss.sigmaRad(), path ) ; - Trk::ScatteringAngles* sa = new Trk::ScatteringAngles(0.,0.,sqrt(m_covariance(2,2)), sqrt(m_covariance(3,3))); + Trk::ScatteringAngles* sa = new Trk::ScatteringAngles(0.,0.,std::sqrt(m_covariance(2,2)), std::sqrt(m_covariance(3,3))); Trk::CurvilinearParameters* cvlTP = parms->clone(); Trk::MaterialEffectsOnTrack* mefot = new Trk::MaterialEffectsOnTrack(m_combinedThickness,sa,eloss,cvlTP->associatedSurface()); @@ -2417,7 +2439,7 @@ void Trk::STEP_Propagator::updateMaterialEffects( double mom, double sinTheta,do momentum = m_matupd_lastmom + totalMomentumLoss*(layer - 0.5)/msLayers; mom2 = momentum*momentum; - E = sqrt( mom2 + massSquared); + E = std::sqrt( mom2 + massSquared); beta = momentum/E; double C0 = 13.6*13.6/mom2/beta/beta; @@ -2518,10 +2540,10 @@ void Trk::STEP_Propagator::smear( double& phi, double& theta, const Trk::TrackPa //Calculate polar angle double particleMass = s_particleMasses.mass[m_particle]; //Get particle mass from ParticleHypothesis double momentum = parms->momentum().mag(); - double energy = sqrt( momentum*momentum + particleMass*particleMass); + double energy = std::sqrt( momentum*momentum + particleMass*particleMass); double beta = momentum/energy; - double th = sqrt(2.)*15.*sqrt(radDist)/(beta*momentum) * CLHEP::RandGauss::shoot(m_randomEngine); //Moliere - //double th = (sqrt(2.)*13.6*sqrt(radDist)/(beta*momentum)) * (1.+0.038*log(radDist/(beta*beta))) * m_gaussian->shoot(); //Highland + double th = std::sqrt(2.)*15.*std::sqrt(radDist)/(beta*momentum) * CLHEP::RandGauss::shoot(m_randomEngine); //Moliere + //double th = (sqrt(2.)*13.6*std::sqrt(radDist)/(beta*momentum)) * (1.+0.038*log(radDist/(beta*beta))) * m_gaussian->shoot(); //Highland //Calculate azimuthal angle double ph = 2.*M_PI*CLHEP::RandFlat::shoot(m_randomEngine); diff --git a/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitMatrices.cxx b/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitMatrices.cxx index 73b2746e63965b430d2010364dcada97f8ff91c7..a789c9dadea2f2774fc10a3004089cf2b4460178 100755 --- a/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitMatrices.cxx +++ b/Tracking/TrkFitter/TrkiPatFitterUtils/src/FitMatrices.cxx @@ -846,41 +846,95 @@ FitMatrices::avoidMomentumSingularity(void) bool FitMatrices::solveEquationsEigen(void) { - // Note: matrix multiplication uses for loops from struct - // with indices optimised for sparse DerivativeMatrix - // first loop to fill off-diagonal symmetric weight matrix + // default is to use Eigen multiplication (ATR-15723) as proposed by Stewart Martin-Haugh Amg::MatrixX& weight = *m_weight; - for (int row = 0; row < m_columnsDM; ++row) + Amg::VectorX& weightedDifference = *m_weightedDifference; + + // useMatrixLoops && useSparseCode = true gives code as for tags 00-13-19 and lower + bool useMatrixLoops = false; + if (useMatrixLoops) { - for (int col = 0; col < row; ++col) + bool useSparseCode = true; + + // matrix multiplication using for loops from struct + if (useSparseCode) { - double element = 0.; - int iBegin = m_firstRowForParameter[col]; - if (iBegin < m_firstRowForParameter[row]) iBegin = m_firstRowForParameter[row]; - int iEnd = m_lastRowForParameter[col]; - if (iEnd > m_lastRowForParameter[row]) iEnd = m_lastRowForParameter[row]; - for (int i = iBegin; i < iEnd; ++i) - element += fitMatrix.derivative[i][row] * fitMatrix.derivative[i][col]; - weight(row,col) = element; - weight(col,row) = element; + // here the indices are optimised for the sparse DerivativeMatrix + // first loop fills off-diagonal terms in symmetric weight matrix + for (int row = 0; row < m_columnsDM; ++row) + { + for (int col = 0; col < row; ++col) + { + double element = 0.; + int iBegin = m_firstRowForParameter[col]; + if (iBegin < m_firstRowForParameter[row]) iBegin = m_firstRowForParameter[row]; + int iEnd = m_lastRowForParameter[col]; + if (iEnd > m_lastRowForParameter[row]) iEnd = m_lastRowForParameter[row]; + for (int i = iBegin; i < iEnd; ++i) + element += fitMatrix.derivative[i][row] * fitMatrix.derivative[i][col]; + weight(row,col) = element; + weight(col,row) = element; + } + } + + // second loop fills diagonal and weightedDifference vector + for (int row = 0; row < m_columnsDM; ++row) + { + double element = 0.; + double residual = 0.; + for (int i = m_firstRowForParameter[row]; i < m_lastRowForParameter[row]; ++i) + { + element += fitMatrix.derivative[i][row] * fitMatrix.derivative[i][row]; + residual += (*m_residuals)[i] * fitMatrix.derivative[i][row]; + } + weight(row,row) = element; + weightedDifference(row) = residual; + } + } + else + { + // complete (dumb) loops for checking + for (int col = 0; col < m_columnsDM; ++col) + { + double residual = 0.; + for (int i = 0; i < m_rowsDM; ++i) + { + residual += (*m_residuals)[i] * fitMatrix.derivative[i][col]; + } + weightedDifference(col) = residual; + + for (int row = 0; row < m_columnsDM; ++row) + { + double element = 0.; + for (int i = 0; i < m_rowsDM; ++i) + { + element += fitMatrix.derivative[i][col] * fitMatrix.derivative[i][row]; + } + weight(col,row) = element; + } + } } } - - // second loop fills diagonal and weightedDifference vector - Amg::VectorX& weightedDifference = *m_weightedDifference; - for (int row = 0; row < m_columnsDM; ++row) + else { - double element = 0.; - double residual = 0.; - for (int i = m_firstRowForParameter[row]; i < m_lastRowForParameter[row]; ++i) + // use Eigen Matrix multiplication ATR-15723 + // note: fitMatrix (struct) is row-major whereas Eigen prefers column-major storage + // hence the loops are nested to optimise row-major and to form the Eigen transpose + Amg::MatrixX fitMatrixDerivativeT(m_columnsDM, m_rowsDM); + Amg::MatrixX residuals(m_rowsDM,1); + for (int row = 0; row < m_rowsDM; ++row) { - element += fitMatrix.derivative[i][row] * fitMatrix.derivative[i][row]; - residual += (*m_residuals)[i] * fitMatrix.derivative[i][row]; - } - weight(row,row) = element; - weightedDifference(row) = residual; + residuals(row,0) = (*m_residuals)[row]; + for (int col = 0; col < m_columnsDM; ++col) + { + fitMatrixDerivativeT(col,row) = fitMatrix.derivative[row][col]; + } + } + weight = fitMatrixDerivativeT*fitMatrixDerivativeT.transpose(); + weightedDifference = fitMatrixDerivativeT*residuals; } + // stabilize fits with badly determined phi if (m_parameters->phiInstability()) weight(0,0) += m_largePhiWeight; // avoid some possible singularities in matrix inversion @@ -889,7 +943,7 @@ FitMatrices::solveEquationsEigen(void) // bool debugEigen = false; // for (int col = 0; col < m_columnsDM; ++col) { // double Eigen = weightedDifference(col); -// if(debugEigen) std::cout << " col " << col << " Eigen weightedDifference input " << Eigen << std::endl; +// if(debugEigen) std::cout << " col " << col << " Eigen weightedDifference input " << Eigen << " weight " << weight(col,col) << std::endl; // } // solve is faster than inverse: wait for explicit request for covariance before inversion diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/doc/mainpage.h b/Tracking/TrkTools/TrkAmbiguityProcessor/doc/mainpage.h deleted file mode 100644 index bc62b0aaae18d55f0b538cba8760dbaf74981f8e..0000000000000000000000000000000000000000 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/doc/mainpage.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - -@mainpage - -The TrkAmbiguityProcessor is responsible for resolving ambiguities in the passed TrackCollection. To do this, it attempts to improve the 'score' of an event, where the score of an event is the summed scores of all the tracks it contains. To this end, there is a (currently simplistic) Trk::TrackScoringTool, as well as a Trk::ITrackScoringHelperTool interface (to allow for ID and muon-specific implementation, without introducing a dependency). Additionally, the TrkAmbiguityProcessor makes use of a Trk::PRD_AssociationTool which keeps track of all the Trk::PrepRawData on the tracks, and knows which are shared with which Trk::Track etc. - -There are two algtools provided: - - SimpleAmbiguityProcessorTool - - TrackSelectionProcessorTool - -For more details see "A New Algorithm For Solving Tracking Ambiguities, Daniel Wicke" - -@ref used_MyPackage - -@ref requirements_MyPackage - -*/ - -/** -@page used_MyPackage Used Packages -@htmlinclude used_packages.html -*/ - -/** -@page requirements_MyPackage Requirements -@include requirements -*/ diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx index 5cf582c0ee53d4513d0d3b58aa8b5ca5766e5398..5f189b3314084bf9b1af6cc67b6397ede8840b54 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.cxx @@ -103,6 +103,7 @@ Trk::DenseEnvironmentsAmbiguityProcessorTool::DenseEnvironmentsAmbiguityProcesso const IInterface* p ) : AthAlgTool(t,n,p), + m_particleHypothesis{undefined}, m_incidentSvc("IncidentSvc", n), m_scoringTool("Trk::TrackScoringTool/TrackScoringTool"), m_observerTool("Trk::TrkObserverTool/TrkObserverTool"), @@ -157,7 +158,6 @@ Trk::DenseEnvironmentsAmbiguityProcessorTool::DenseEnvironmentsAmbiguityProcesso declareProperty("sharedProbCut2" , m_sharedProbCut2 = 0.3); declareProperty("SplitClusterAmbiguityMap" , m_splitClusterMapName); declareProperty("MonitorAmbiguitySolving" , m_monitorTracks = false); - declareProperty("MonitorAmbiguitySolving" , m_monitorTracks = false); #ifdef SIMPLEAMBIGPROCDEBUGCODE declareProperty("TruthLocationTRT" , m_truth_locationTRT ); @@ -184,13 +184,9 @@ Trk::DenseEnvironmentsAmbiguityProcessorTool::~DenseEnvironmentsAmbiguityProcess StatusCode Trk::DenseEnvironmentsAmbiguityProcessorTool::initialize() { + StatusCode sc = StatusCode::SUCCESS; - StatusCode sc = AthAlgTool::initialize(); - if (sc.isFailure()) - { - ATH_MSG_FATAL( "AlgTool::initialise failed" ); - return StatusCode::FAILURE; - } + ATH_CHECK( m_scoringTool.retrieve()); if (m_incidentSvc.retrieve().isFailure()){ @@ -215,41 +211,18 @@ StatusCode Trk::DenseEnvironmentsAmbiguityProcessorTool::initialize() if (m_monitorTracks) { sc = m_observerTool.retrieve(); //Dot, not asterik! This is a method of the observerTool, not of the tool it holds. if (sc.isFailure()) { - ATH_MSG_ERROR("Failed to retrieve AlgTool " << m_observerTool); + ATH_MSG_WARNING("Failed to retrieve AlgTool " << m_observerTool); m_monitorTracks = false; + sc=StatusCode::RECOVERABLE; //return sc; // continue without observer tool } else ATH_MSG_INFO( "Retrieved tool " << m_observerTool ); } - sc = m_selectionTool.retrieve(); - if (sc.isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve tool " << m_selectionTool ); - return StatusCode::FAILURE; - } - else - ATH_MSG_INFO( "Retrieved tool " << m_selectionTool ); - - sc = m_fitterTool.retrieve(); - if (sc.isFailure() || m_fitterTool.empty()) - - { - ATH_MSG_FATAL("Failed to retrieve tool " << m_fitterTool ); - return sc; - } - else - ATH_MSG_INFO( "Retrieved tool " << m_fitterTool ); - - sc = m_extrapolatorTool.retrieve(); - if (sc.isFailure()) - { - ATH_MSG_FATAL("Failed to retrieve tool " << m_extrapolatorTool ); - return sc; - } - else - ATH_MSG_INFO( "Retrieved tool " << m_extrapolatorTool ); + ATH_CHECK( m_selectionTool.retrieve()); + ATH_CHECK( m_fitterTool.retrieve()); + ATH_CHECK( m_extrapolatorTool.retrieve()); if (!m_splitProbTool.empty() && m_splitProbTool.retrieve().isFailure()) { ATH_MSG_FATAL( "Could not retrieve the split probability tool " << m_splitProbTool << "'."); @@ -258,13 +231,7 @@ StatusCode Trk::DenseEnvironmentsAmbiguityProcessorTool::initialize() ATH_MSG_INFO( "Retrieved tool " << m_splitProbTool ); } - if (m_assoTool.retrieve().isFailure()) - { - ATH_MSG_FATAL( "Failed to retrieve tool " << m_assoTool ); - return StatusCode::FAILURE; - } - else - ATH_MSG_INFO( "Retrieved tool " << m_assoTool ); + ATH_CHECK(m_assoTool.retrieve()) ; // suppress refit overwrites force refit if (m_forceRefit && m_suppressTrackFit ) @@ -575,7 +542,7 @@ TrackCollection* Trk::DenseEnvironmentsAmbiguityProcessorTool::process(const Tr if(m_applydRcorrection) { - TrackCollection refit_tracks; + std::vector<const Trk::Track*> refit_tracks; // create map of track dRs storeTrkDistanceMapdR(*m_finalTracks,refit_tracks); for(const Trk::Track* track : refit_tracks) @@ -803,6 +770,7 @@ void Trk::DenseEnvironmentsAmbiguityProcessorTool::addTrack(const Trk::Track* tr // clean up delete(track); + track=nullptr; } else @@ -814,7 +782,7 @@ void Trk::DenseEnvironmentsAmbiguityProcessorTool::addTrack(const Trk::Track* tr } // clean up - delete(track); + //delete(track); <- too early; still want to use track further down... // statistic increment_by_eta(m_NgoodFits,bremTrack); @@ -826,6 +794,8 @@ void Trk::DenseEnvironmentsAmbiguityProcessorTool::addTrack(const Trk::Track* tr // Update observed track score m_observerTool->updateScore(*track, static_cast<double>(score)); } + delete(track); + track=nullptr; // do we accept the track ? if (score!=0) @@ -1552,7 +1522,7 @@ void Trk::DenseEnvironmentsAmbiguityProcessorTool::dumpTracks( const TrackCollec //================================================================================================== -void Trk::DenseEnvironmentsAmbiguityProcessorTool::storeTrkDistanceMapdR( const TrackCollection& tracks, TrackCollection &refit_tracks_out ) +void Trk::DenseEnvironmentsAmbiguityProcessorTool::storeTrkDistanceMapdR( const TrackCollection& tracks, std::vector<const Trk::Track*> &refit_tracks_out ) { ATH_MSG_VERBOSE ("Creating track Distance dR map"); m_dRMap = new InDet::DRMap; diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h index 862b0c77a89941db60af1782afccd6fcc1ceed54..99192d03d4490ca4b28bde64ad11b58104a7ae9c 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/DenseEnvironmentsAmbiguityProcessorTool.h @@ -121,7 +121,8 @@ namespace Trk { void dumpTracks(const TrackCollection& tracks); /** stores the minimal dist(trk,trk) for covariance correction*/ - void storeTrkDistanceMapdR(const TrackCollection& tracks, TrackCollection &refit_tracks_out ); + void storeTrkDistanceMapdR(const TrackCollection& tracks, + std::vector<const Trk::Track*> &refit_tracks_out ); /** Find SiS Tracks that share hits in the track score map*/ void overlapppingTracks(); diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx index a149bd882b06a19e0f8bd1ba8c6281eb338afbb0..599ef1261b16cd380f13b0f6e7678752972065b8 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/SimpleAmbiguityProcessorTool.cxx @@ -44,6 +44,7 @@ Trk::SimpleAmbiguityProcessorTool::SimpleAmbiguityProcessorTool(const std::strin const IInterface* p ) : AthAlgTool(t,n,p), + m_particleHypothesis{undefined}, m_scoringTool("Trk::TrackScoringTool/TrackScoringTool"), m_fitterTool ("Trk::KalmanFitter/InDetTrackFitter"), m_selectionTool("InDet::InDetAmbiTrackSelectionTool/InDetAmbiTrackSelectionTool"), @@ -125,49 +126,49 @@ StatusCode Trk::SimpleAmbiguityProcessorTool::initialize() StatusCode sc = AthAlgTool::initialize(); if (sc.isFailure()) { - msg(MSG::FATAL) << "AlgTool::initialise failed" << endreq; + msg(MSG::FATAL) << "AlgTool::initialise failed" << endmsg; return StatusCode::FAILURE; } sc = m_scoringTool.retrieve(); if (sc.isFailure()) { - msg(MSG::FATAL) << "Failed to retrieve tool " << m_scoringTool << endreq; + msg(MSG::FATAL) << "Failed to retrieve tool " << m_scoringTool << endmsg; return StatusCode::FAILURE; } else - msg(MSG::INFO) << "Retrieved tool " << m_scoringTool << endreq; + msg(MSG::INFO) << "Retrieved tool " << m_scoringTool << endmsg; sc = m_selectionTool.retrieve(); if (sc.isFailure()) { - msg(MSG::FATAL) << "Failed to retrieve tool " << m_selectionTool << endreq; + msg(MSG::FATAL) << "Failed to retrieve tool " << m_selectionTool << endmsg; return StatusCode::FAILURE; } else - msg(MSG::INFO) << "Retrieved tool " << m_selectionTool << endreq; + msg(MSG::INFO) << "Retrieved tool " << m_selectionTool << endmsg; sc = m_fitterTool.retrieve(); if (sc.isFailure()) { - msg(MSG::FATAL) << "Failed to retrieve tool " << m_fitterTool << endreq; + msg(MSG::FATAL) << "Failed to retrieve tool " << m_fitterTool << endmsg; return sc; } else - msg(MSG::INFO) << "Retrieved tool " << m_fitterTool << endreq; + msg(MSG::INFO) << "Retrieved tool " << m_fitterTool << endmsg; // suppress refit overwrites force refit if (m_forceRefit && m_suppressTrackFit ) { - msg(MSG::WARNING) << "Inconsistent parameter settings, forced refit is true, but fitting suppressed, resetingt force refit !" << endreq; + msg(MSG::WARNING) << "Inconsistent parameter settings, forced refit is true, but fitting suppressed, resetingt force refit !" << endmsg; m_forceRefit = false; } // Print out memo that tracks have to be fitted if (!m_forceRefit) { - msg(MSG::INFO) << "The forced refit of Tracks is switched off." << endreq; - msg(MSG::INFO) << "Ensure, that the tracks are fitted after the ambiguity processing!" << endreq; + msg(MSG::INFO) << "The forced refit of Tracks is switched off." << endmsg; + msg(MSG::INFO) << "Ensure, that the tracks are fitted after the ambiguity processing!" << endmsg; } // Configuration of the material effects @@ -176,7 +177,7 @@ StatusCode Trk::SimpleAmbiguityProcessorTool::initialize() // brem fitting enabled ? if (m_tryBremFit) - msg(MSG::INFO) << "Try brem fit and recovery for electron like tracks." << endreq; + msg(MSG::INFO) << "Try brem fit and recovery for electron like tracks." << endmsg; // statistics for (int i=0; i<5; i++) { @@ -259,20 +260,20 @@ StatusCode Trk::SimpleAmbiguityProcessorTool::initialize() // to get the brem truth IToolSvc* toolSvc; if ((sc=service("ToolSvc", toolSvc)).isFailure()) { - msg(MSG::FATAL) << "Toll service not found !" << endreq; + msg(MSG::FATAL) << "Toll service not found !" << endmsg; return StatusCode::FAILURE; } sc = toolSvc->retrieveTool("Trk::TruthToTrack", m_truthToTrack); if(sc.isFailure()) { - msg(MSG::FATAL) << "Cannot retrieve the TruthToTrack tool... Exiting" << endreq; + msg(MSG::FATAL) << "Cannot retrieve the TruthToTrack tool... Exiting" << endmsg; return StatusCode::FAILURE; } sc = detStore()->retrieve(m_pixelId, "PixelID"); if (sc.isFailure()) { - msg(MSG::ERROR) << "Could not get PixelID helper !" << endreq; + msg(MSG::ERROR) << "Could not get PixelID helper !" << endmsg; return StatusCode::FAILURE; } #endif @@ -463,7 +464,7 @@ TrackCollection* Trk::SimpleAmbiguityProcessorTool::process(const TrackCollecti #ifdef SIMPLEAMBIGPROCNTUPLECODE const xAOD::EventInfo* eventInfo; if (evtStore()->retrieve(eventInfo).isFailure()) - msg(MSG::WARNING)<<"Could not get EventInfo object" << endreq; + msg(MSG::WARNING)<<"Could not get EventInfo object" << endmsg; else { m_event = (int)eventInfo->eventNumber(); } @@ -472,10 +473,10 @@ TrackCollection* Trk::SimpleAmbiguityProcessorTool::process(const TrackCollecti m_truthSCT = 0; // retrieve the multi-truth maps if (evtStore()->contains<PRD_MultiTruthCollection>(m_truth_locationPixel) && evtStore()->retrieve(m_truthPIX,m_truth_locationPixel).isFailure()) - msg(MSG::WARNING)<<"Could not find TruthPixel" << endreq; + msg(MSG::WARNING)<<"Could not find TruthPixel" << endmsg; if (evtStore()->contains<PRD_MultiTruthCollection>(m_truth_locationSCT) && evtStore()->retrieve(m_truthSCT,m_truth_locationSCT).isFailure()) - msg(MSG::WARNING)<<"Could not find TruthSCT" << endreq; + msg(MSG::WARNING)<<"Could not find TruthSCT" << endmsg; m_trackBarcodeMap.clear(); @@ -600,15 +601,15 @@ TrackCollection* Trk::SimpleAmbiguityProcessorTool::process(const TrackCollecti sc1 = evtStore()->retrieve(m_truthPIX,m_truth_locationPixel); if (sc1.isFailure()) - msg(MSG::WARNING)<<"Could not find TruthPixel"<<endreq; + msg(MSG::WARNING)<<"Could not find TruthPixel"<<endmsg; sc1 = evtStore()->retrieve(m_truthSCT,m_truth_locationSCT); if (sc1.isFailure()) - msg(MSG::WARNING)<<"Could not find TruthSCT"<<endreq; + msg(MSG::WARNING)<<"Could not find TruthSCT"<<endmsg; sc1 = evtStore()->retrieve(m_truthTRT,m_truth_locationTRT); if (sc1.isFailure()) - msg(MSG::FATAL)<<"Could not find TruthTRT"<<endreq; + msg(MSG::FATAL)<<"Could not find TruthTRT"<<endmsg; #endif ++m_Nevents; // statistics @@ -678,13 +679,13 @@ void Trk::SimpleAmbiguityProcessorTool::addNewTracks(const TrackCollection* trac #ifdef SIMPLEAMBIGPROCNTUPLECODE if (!evtStore()->contains<TrackSeedMap>(m_trackSeedMapLocation)){ - msg(MSG::DEBUG)<<"Could not find TrackSeedMap, Seed validation needs to be run as well to have full output!" << endreq; + msg(MSG::DEBUG)<<"Could not find TrackSeedMap, Seed validation needs to be run as well to have full output!" << endmsg; m_trackSeedMap = 0; } else if (evtStore()->retrieve(m_trackSeedMap,m_trackSeedMapLocation).isFailure()){ - msg(MSG::WARNING)<<"Could not retrieve TrackSeedMap" << endreq; + msg(MSG::WARNING)<<"Could not retrieve TrackSeedMap" << endmsg; m_trackSeedMap = 0; } else{ - msg(MSG::DEBUG)<<"Retrieved TrackSeedMap" << endreq; + msg(MSG::DEBUG)<<"Retrieved TrackSeedMap" << endmsg; } if (m_trackTrackMap) delete m_trackTrackMap; m_trackTrackMap = new std::map<const Trk::Track* , Trk::Track*> ; @@ -768,12 +769,12 @@ void Trk::SimpleAmbiguityProcessorTool::addNewTracks(const TrackCollection* trac #ifdef SIMPLEAMBIGPROCDEBUGCODE if( isTrueTrack(*trackIt)){ - msg(MSG::INFO)<< "the # of Outliers before is: " << numOutliersBefore << " and after is: " << numOutliersAfter<<endreq; + msg(MSG::INFO)<< "the # of Outliers before is: " << numOutliersBefore << " and after is: " << numOutliersAfter<<endmsg; if(numOutliersBefore != numOutliersAfter){ - msg(MSG::INFO)<<"Rejecting True Track:"<< origTrack(*trackIt) << " Because of Outlier change" <<endreq; + msg(MSG::INFO)<<"Rejecting True Track:"<< origTrack(*trackIt) << " Because of Outlier change" <<endmsg; numOutliersDiff++; } else { - msg(MSG::INFO)<<"Rejecting True Track:"<< origTrack(*trackIt) << " Because of Zero Score" <<endreq; + msg(MSG::INFO)<<"Rejecting True Track:"<< origTrack(*trackIt) << " Because of Zero Score" <<endmsg; } prdTruth(*trackIt); tsosTruth(*trackIt); @@ -842,7 +843,7 @@ void Trk::SimpleAmbiguityProcessorTool::addNewTracks(const TrackCollection* trac if(isTrueTrack(itnext->second.first)) numTrueMap++; } - msg(MSG::INFO)<<"Number of TRUE tracks in map:"<< numTrueMap <<endreq; + msg(MSG::INFO)<<"Number of TRUE tracks in map:"<< numTrueMap <<endmsg; #endif return; @@ -942,12 +943,12 @@ void Trk::SimpleAmbiguityProcessorTool::addTrack(const Trk::Track* track, const #ifdef SIMPLEAMBIGPROCDEBUGCODE if(isTrueTrack(track)){ - msg(MSG::INFO)<< "the # of Outliers before is: " << numOutliersBefore << " and after is: " << numOutliersAfter<<endreq; + msg(MSG::INFO)<< "the # of Outliers before is: " << numOutliersBefore << " and after is: " << numOutliersAfter<<endmsg; if(numOutliersBefore != numOutliersAfter){ - msg(MSG::INFO)<<"Rejecting True Track:"<< origTrack(track) << " Because of Outlier change" <<endreq; + msg(MSG::INFO)<<"Rejecting True Track:"<< origTrack(track) << " Because of Outlier change" <<endmsg; numOutliersDiff++; }else { - msg(MSG::INFO)<<"Rejecting True Track:"<< origTrack(track) << " Because of Zero Score" <<endreq; + msg(MSG::INFO)<<"Rejecting True Track:"<< origTrack(track) << " Because of Zero Score" <<endmsg; } prdTruth(track); tsosTruth(track); @@ -1027,7 +1028,7 @@ void Trk::SimpleAmbiguityProcessorTool::solveTracks() // add track to PRD_AssociationTool StatusCode sc = m_selectionTool->registerPRDs(itnext->second.first); - if (sc.isFailure()) msg(MSG::ERROR) << "addPRDs() failed" << endreq; + if (sc.isFailure()) msg(MSG::ERROR) << "addPRDs() failed" << endmsg; // add to output list m_finalTracks->push_back( const_cast<Track*>(itnext->second.first) ); @@ -1110,17 +1111,17 @@ void Trk::SimpleAmbiguityProcessorTool::solveTracks() if ( isTrueTrack(*m_itFinal) ) truthAfter++; } - msg(MSG::INFO)<<"Where, the number of true track on output is: "<<truthAfter <<endreq; - msg(MSG::INFO)<<"And the number of TRUE track failed fits is: "<< n_trueFitFails <<endreq; - msg(MSG::INFO)<<"And the number of TRUE tracks rejected due to outliers is: "<< numOutliersDiff <<endreq; - msg(MSG::INFO)<<"And the number of TRUE tracks rejected after the first fit is: "<< numFirstFitLost <<endreq; - msg(MSG::INFO)<<"And the number of TRUE tracks rejected after the second fit is: "<< numSecondFitLost <<endreq; + msg(MSG::INFO)<<"Where, the number of true track on output is: "<<truthAfter <<endmsg; + msg(MSG::INFO)<<"And the number of TRUE track failed fits is: "<< n_trueFitFails <<endmsg; + msg(MSG::INFO)<<"And the number of TRUE tracks rejected due to outliers is: "<< numOutliersDiff <<endmsg; + msg(MSG::INFO)<<"And the number of TRUE tracks rejected after the first fit is: "<< numFirstFitLost <<endmsg; + msg(MSG::INFO)<<"And the number of TRUE tracks rejected after the second fit is: "<< numSecondFitLost <<endmsg; if(truthBefore != truthAfter) - msg(MSG::INFO)<<"The number of tracks lost this events is: "<< truthBefore-truthAfter << endreq; + msg(MSG::INFO)<<"The number of tracks lost this events is: "<< truthBefore-truthAfter << endmsg; if (n_trueFitFails >0 && m_isBackTracking){ - msg(MSG::INFO) << "DOING THE BREM TRUTH" << endreq; + msg(MSG::INFO) << "DOING THE BREM TRUTH" << endmsg; getBremTruth();//problem with statuscode } @@ -1201,12 +1202,12 @@ void Trk::SimpleAmbiguityProcessorTool::refitTrack( const Trk::Track* track) #endif #ifdef SIMPLEAMBIGPROCDEBUGCODE - msg(MSG::INFO) << "The Track: " << origTrack(track) << " failed to fit" << endreq; + msg(MSG::INFO) << "The Track: " << origTrack(track) << " failed to fit" << endmsg; n_fitFails++; - msg(MSG::INFO) << "The total number of failed fits is now" << n_fitFails <<endreq; + msg(MSG::INFO) << "The total number of failed fits is now" << n_fitFails <<endmsg; if ( isTrueTrack(track)) { n_trueFitFails++; - msg(MSG::INFO)<< "The total number of TRUE failed fits is now" << n_trueFitFails <<endreq; + msg(MSG::INFO)<< "The total number of TRUE failed fits is now" << n_trueFitFails <<endmsg; prdTruth(track); tsosTruth(track); } @@ -1227,7 +1228,7 @@ const Trk::Track* Trk::SimpleAmbiguityProcessorTool::refitPrds( const Trk::Track std::vector<const Trk::PrepRawData*> prds = m_selectionTool->getPrdsOnTrack(track); if ( 0==prds.size() ) { - msg(MSG::WARNING) << "No PRDs on track"<<endreq; + msg(MSG::WARNING) << "No PRDs on track"<<endmsg; return 0; } @@ -1411,10 +1412,10 @@ void Trk::SimpleAmbiguityProcessorTool::findTrueTracks(const TrackCollection* re m_trackHistory.clear(); m_tracksShared.clear(); - msg(MSG::DEBUG) << "Acessing TrackTruthCollection " << endreq; + msg(MSG::DEBUG) << "Acessing TrackTruthCollection " << endmsg; const TrackTruthCollection* truthMap = 0; if (evtStore()->retrieve(truthMap , m_truthCollection).isFailure()) - msg(MSG::WARNING) << "No truth map present, abort TrueTrack search" << endreq; + msg(MSG::WARNING) << "No truth map present, abort TrueTrack search" << endmsg; @@ -1425,7 +1426,7 @@ void Trk::SimpleAmbiguityProcessorTool::findTrueTracks(const TrackCollection* re for (;trackIt!=trackItEnd;++trackIt) { - msg(MSG::DEBUG) << "The Track is now " << *trackIt << endreq; + msg(MSG::DEBUG) << "The Track is now " << *trackIt << endmsg; // initialise history tracing m_trackHistory.insert(std::make_pair(*trackIt,*trackIt)); @@ -1444,7 +1445,7 @@ void Trk::SimpleAmbiguityProcessorTool::findTrueTracks(const TrackCollection* re if (!isSharedTrack(*trackIt)) addTrackToMap(*trackIt);//add track and pdrs to map else numSharedTruth++; int barcode=found->second.particleLink().barcode(); - msg(MSG::DEBUG) << "The Barcode is: " << barcode << endreq; + msg(MSG::DEBUG) << "The Barcode is: " << barcode << endmsg; std::pair<int , std::pair<float , const Trk::Track*> > insertion = std::make_pair(barcode,std::make_pair(found->second.probability(),*trackIt)); std::pair<std::map<int,std::pair<float,const Trk::Track*> >::iterator, bool > barcodeMapInsert = @@ -1452,12 +1453,12 @@ void Trk::SimpleAmbiguityProcessorTool::findTrueTracks(const TrackCollection* re if (!(barcodeMapInsert.second) && insertion.second.first > barcodeMapInsert.first->second.first) { // if the barcode is already known and the new entry would be better, erase old and insert new - msg(MSG::DEBUG) << "Erasing Track:" << origTrack(barcodeMapInsert.first->second.second) <<endreq; + msg(MSG::DEBUG) << "Erasing Track:" << origTrack(barcodeMapInsert.first->second.second) <<endmsg; barcodeMap.erase(barcodeMapInsert.first); - msg(MSG::DEBUG) << "Inserting Track:"<< origTrack(insertion.second.second)<< endreq; + msg(MSG::DEBUG) << "Inserting Track:"<< origTrack(insertion.second.second)<< endmsg; barcodeMap.insert(insertion); } - msg(MSG::DEBUG) << "The probability of " << origTrack(barcodeMapInsert.first->second.second) << "is "<< barcodeMapInsert.first->second.first <<endreq; + msg(MSG::DEBUG) << "The probability of " << origTrack(barcodeMapInsert.first->second.second) << "is "<< barcodeMapInsert.first->second.first <<endmsg; } } @@ -1466,8 +1467,8 @@ void Trk::SimpleAmbiguityProcessorTool::findTrueTracks(const TrackCollection* re std::map<int,std::pair<float,const Trk::Track*> >::const_iterator end = barcodeMap.end(); for (; it!=end; ++it) m_trueTracks.insert(it->second.second); truthBefore = m_trueTracks.size(); - msg(MSG::INFO) << "True Track set up with " << truthBefore << " true tracks." << endreq; - msg(MSG::INFO)<< "OF THE TRUE TRACKS " << numSharedTruth << " ARE SHARED" << endreq; + msg(MSG::INFO) << "True Track set up with " << truthBefore << " true tracks." << endmsg; + msg(MSG::INFO)<< "OF THE TRUE TRACKS " << numSharedTruth << " ARE SHARED" << endmsg; } @@ -1500,7 +1501,7 @@ void Trk::SimpleAmbiguityProcessorTool::produceInputOutputConnection() pos = m_trackHistory.find(pos->second); if (pos == m_trackHistory.end()) - msg(MSG::ERROR) << "Track not found in history" << endreq; + msg(MSG::ERROR) << "Track not found in history" << endmsg; else siSP_ResolvedConnection->insert(std::make_pair(pos->second,*itFinal)); @@ -1509,9 +1510,9 @@ void Trk::SimpleAmbiguityProcessorTool::produceInputOutputConnection() StatusCode sc = evtStore()->record(siSP_ResolvedConnection, m_resolvedTrackConnection,false); if (sc.isFailure()) - msg(MSG::ERROR) << "Could not record trackCollectionConnecton" << endreq; + msg(MSG::ERROR) << "Could not record trackCollectionConnecton" << endmsg; else - msg(MSG::VERBOSE) << "Saved "<<siSP_ResolvedConnection->size()<<" track collection connections"<<endreq; + msg(MSG::VERBOSE) << "Saved "<<siSP_ResolvedConnection->size()<<" track collection connections"<<endmsg; } } //============================================================================================ @@ -1576,7 +1577,7 @@ void Trk::SimpleAmbiguityProcessorTool::prdTruth(const Trk::Track* track){ std::vector<const Trk::PrepRawData*>::const_iterator prdit = prds.begin(); std::vector<const Trk::PrepRawData*>::const_iterator prdite = prds.end(); double m_eta = (*(track)->trackParameters()->begin())->eta(); - msg(MSG::INFO)<< "The eta of this track is " << m_eta << endreq; + msg(MSG::INFO)<< "The eta of this track is " << m_eta << endmsg; for( ; prdit != prdite; ++prdit){ const InDet::SiCluster * si = dynamic_cast<const InDet::SiCluster*> (*prdit); @@ -1588,28 +1589,28 @@ void Trk::SimpleAmbiguityProcessorTool::prdTruth(const Trk::Track* track){ mc=m_truthPIX->find((*prdit)->identify()); mce=m_truthPIX->end(); if(mc==mce) { - msg(MSG::INFO)<< "the hit " << *prdit << "On the track " << origTrack(track) << "was pixel noise" << endreq; + msg(MSG::INFO)<< "the hit " << *prdit << "On the track " << origTrack(track) << "was pixel noise" << endmsg; continue; } - msg(MSG::INFO)<< "the hit " << *prdit << "On the track " << origTrack(track) << "was a pixel hit" << endreq; + msg(MSG::INFO)<< "the hit " << *prdit << "On the track " << origTrack(track) << "was a pixel hit" << endmsg; } else if(si) { mc=m_truthSCT->find((*prdit)->identify()); mce=m_truthSCT->end(); if(mc==mce) { - msg(MSG::INFO)<< "the hit " << *prdit << "On the track " <<origTrack(track) << "was si noise" << endreq; + msg(MSG::INFO)<< "the hit " << *prdit << "On the track " <<origTrack(track) << "was si noise" << endmsg; continue; } - msg(MSG::INFO)<< "the hit " << *prdit << "On the track " << origTrack(track) << "was a si hit" << endreq; + msg(MSG::INFO)<< "the hit " << *prdit << "On the track " << origTrack(track) << "was a si hit" << endmsg; } else if(tr) { mc=m_truthTRT->find((*prdit)->identify()); mce=m_truthTRT->end(); if(mc==mce) { - msg(MSG::INFO)<< "the hit " << *prdit << "On the track " << origTrack(track) << "was trt noise" << endreq; + msg(MSG::INFO)<< "the hit " << *prdit << "On the track " << origTrack(track) << "was trt noise" << endmsg; continue; } - msg(MSG::INFO)<< "the hit " << *prdit << "On the track " << origTrack(track) << "was a trt hit" << endreq; + msg(MSG::INFO)<< "the hit " << *prdit << "On the track " << origTrack(track) << "was a trt hit" << endmsg; } else { continue; @@ -1621,8 +1622,8 @@ void Trk::SimpleAmbiguityProcessorTool::prdTruth(const Trk::Track* track){ //HepLorentzVector m = pa->momentum(); double m_theta = pa->momentum().theta(); - msg(MSG::INFO)<< "the theta of the hit was " << m_theta << endreq; - msg(MSG::INFO)<< "The hit " << *prdit << "came from " << partid << " With a barcode of " << partBc << endreq; + msg(MSG::INFO)<< "the theta of the hit was " << m_theta << endmsg; + msg(MSG::INFO)<< "The hit " << *prdit << "came from " << partid << " With a barcode of " << partBc << endmsg; @@ -1638,14 +1639,14 @@ void Trk::SimpleAmbiguityProcessorTool::tsosTruth(const Trk::Track* track){ DataVector<const TrackStateOnSurface>::const_iterator iTsos = tsos->begin(); DataVector<const TrackStateOnSurface>::const_iterator iTsosEnd = tsos->end(); for(; iTsos != iTsosEnd; ++iTsos){ - msg(MSG::INFO)<< "the type of " << *iTsos << " is "<< (*iTsos)->type() << endreq; + msg(MSG::INFO)<< "the type of " << *iTsos << " is "<< (*iTsos)->type() << endmsg; const FitQualityOnSurface* fq = (*iTsos)->fitQualityOnSurface(); if (fq) - msg(MSG::INFO)<< "the chi2 of " << *iTsos << " is "<< fq->chiSquared() << endreq; + msg(MSG::INFO)<< "the chi2 of " << *iTsos << " is "<< fq->chiSquared() << endmsg; const MeasurementBase* mb = (*iTsos)->measurementOnTrack(); if (mb){ Identifier Id = mb->associatedSurface().associatedDetectorElementIdentifier(); - msg(MSG::INFO)<< "the global r of the hit is " << mb->associatedSurface().center().perp() << endreq; + msg(MSG::INFO)<< "the global r of the hit is " << mb->associatedSurface().center().perp() << endmsg; std::string detType = " unknown "; if (m_pixelId->is_pixel(Id)) detType = " Pixel "; @@ -1653,7 +1654,7 @@ void Trk::SimpleAmbiguityProcessorTool::tsosTruth(const Trk::Track* track){ detType = " SCT "; else if (m_pixelId->is_trt(Id)) detType = " TRT "; - msg(MSG::INFO)<< "the surface is " << detType << endreq; + msg(MSG::INFO)<< "the surface is " << detType << endmsg; } } } @@ -1679,17 +1680,17 @@ StatusCode Trk::SimpleAmbiguityProcessorTool::getBremTruth(){ // Synchronise event number with reconstruction event number int eventNumber = (*event)->event_number(); - msg(MSG::INFO) << "Event number: " << eventNumber - 1 << endreq; + msg(MSG::INFO) << "Event number: " << eventNumber - 1 << endmsg; // Determine the momentum of the original particle const double initialMomentum = originalMomentum( *event ); - msg(MSG::INFO) << "Initial momentum: " << initialMomentum << endreq; + msg(MSG::INFO) << "Initial momentum: " << initialMomentum << endmsg; // Calculate the total momentum loss as a result of brem double pLostByBrem = momentumLostByBrem( *event ); - msg(MSG::INFO) << "Total momentum lost by original particle due to Brem: " << pLostByBrem << " MeV" << endreq; + msg(MSG::INFO) << "Total momentum lost by original particle due to Brem: " << pLostByBrem << " MeV" << endmsg; // Calculate the fraction of incident energy lost per vertex on track @@ -1697,7 +1698,7 @@ StatusCode Trk::SimpleAmbiguityProcessorTool::getBremTruth(){ int countBrem = 0; //Si brem counter std::vector<double>::const_iterator fractionLostInLayer = fractionOfIncidentEnergyLost.begin(); for ( ; fractionLostInLayer != fractionOfIncidentEnergyLost.end(); ++fractionLostInLayer ){ - msg(MSG::INFO) << "Fraction of incident energy lost at vertex: " << (*fractionLostInLayer) << endreq; + msg(MSG::INFO) << "Fraction of incident energy lost at vertex: " << (*fractionLostInLayer) << endmsg; countBrem++; } @@ -1706,7 +1707,7 @@ StatusCode Trk::SimpleAmbiguityProcessorTool::getBremTruth(){ countBrem = 0; //Reinitialize brem counter std::vector<HepPoint3D>::const_iterator positionOfVertex = positionsOfVertices.begin(); for ( ; positionOfVertex != positionsOfVertices.end(); ++positionOfVertex ){ - msg(MSG::INFO) << "(x, y, z) of vertex: " << positionOfVertex->perp() << endreq; + msg(MSG::INFO) << "(x, y, z) of vertex: " << positionOfVertex->perp() << endmsg; countBrem++; } @@ -1726,7 +1727,7 @@ const double Trk::SimpleAmbiguityProcessorTool::originalMomentum( const HepMC::G // Double check - should come from vertex barcode = -1 & have id 10001. Particle must also be defined //if ( !initialParticle || initialParticle->production_vertex()->barcode() != -1 || initialParticle->barcode() != 10001 ) - // msg(MSG::WARNING) << "Inconsistency between initial particle and initial vertex" << endreq; + // msg(MSG::WARNING) << "Inconsistency between initial particle and initial vertex" << endmsg; //Hep3Vector& initial3Momentum = initialParticle->momentum(); diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackScoringTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackScoringTool.cxx index f43af1cf008381ea60f2aa6bb8abcd856da1a662..e1c7b8f0bf9491bffebf4d23242cfc9b9624a0fd 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackScoringTool.cxx +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackScoringTool.cxx @@ -67,11 +67,11 @@ StatusCode Trk::TrackScoringTool::initialize() sc = m_trkSummaryTool.retrieve(); if (sc.isFailure()) { - msg(MSG::FATAL)<< "Failed to retrieve tool " << m_trkSummaryTool << endreq; + msg(MSG::FATAL)<< "Failed to retrieve tool " << m_trkSummaryTool << endmsg; return sc; } else - msg(MSG::INFO)<< "Retrieved tool " << m_trkSummaryTool << endreq; + msg(MSG::INFO)<< "Retrieved tool " << m_trkSummaryTool << endmsg; return StatusCode::SUCCESS; } @@ -101,7 +101,7 @@ Trk::TrackScore Trk::TrackScoringTool::simpleScore( const Track& track, const Tr // --- reject bad tracks if (track.fitQuality() && track.fitQuality()->numberDoF() < 0) { - msg(MSG::VERBOSE)<<"numberDoF < 0, reject it"<<endreq; + msg(MSG::VERBOSE)<<"numberDoF < 0, reject it"<<endmsg; return TrackScore(0); } @@ -120,7 +120,7 @@ Trk::TrackScore Trk::TrackScoringTool::simpleScore( const Track& track, const Tr //value is -1 if undefined. if (value>0) { score+=m_summaryTypeScore[i]*value; - msg(MSG::VERBOSE)<<"\tType ["<<i<<"], value \t= "<<value<<"], score \t="<<score<<endreq; + msg(MSG::VERBOSE)<<"\tType ["<<i<<"], value \t= "<<value<<"], score \t="<<score<<endmsg; } } return score; diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackScoringTool.h b/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackScoringTool.h index 4b52c9cd6f6fa9e823ab53d0a4850df22aead8af..6948979e72832672dedce05d23f92a7255e67901 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackScoringTool.h +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackScoringTool.h @@ -29,10 +29,10 @@ class TrackSummary; virtual StatusCode initialize(); virtual StatusCode finalize (); /** create a score based on how good the passed track is*/ - TrackScore score( const Track& track, const bool suppressHoleSearch ); + TrackScore score( const Track& track, const bool suppressHoleSearch ) override; /** create a score based on how good the passed TrackSummary is*/ - TrackScore simpleScore( const Track& track, const TrackSummary& trackSummary ); + TrackScore simpleScore( const Track& track, const TrackSummary& trackSummary ) override; private: diff --git a/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackSelectionProcessorTool.cxx b/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackSelectionProcessorTool.cxx index 70dcd55a3a1ddbb6579c271cd0846b39a272a511..3dfd8cac29423c5aa11f9c63ddf46234731abe85 100644 --- a/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackSelectionProcessorTool.cxx +++ b/Tracking/TrkTools/TrkAmbiguityProcessor/src/TrackSelectionProcessorTool.cxx @@ -40,31 +40,31 @@ StatusCode Trk::TrackSelectionProcessorTool::initialize() StatusCode sc = AthAlgTool::initialize(); if (sc.isFailure()) { - msg(MSG::FATAL) << "AlgTool::initialise failed" << endreq; + msg(MSG::FATAL) << "AlgTool::initialise failed" << endmsg; return StatusCode::FAILURE; } sc = m_scoringTool.retrieve(); if (sc.isFailure()) { - msg(MSG::FATAL) << "Failed to retrieve tool " << m_scoringTool << endreq; + msg(MSG::FATAL) << "Failed to retrieve tool " << m_scoringTool << endmsg; return StatusCode::FAILURE; } else - msg(MSG::INFO) << "Retrieved tool " << m_scoringTool << endreq; + msg(MSG::INFO) << "Retrieved tool " << m_scoringTool << endmsg; sc = m_selectionTool.retrieve(); if (sc.isFailure()) { - msg(MSG::FATAL) << "Failed to retrieve tool " << m_selectionTool << endreq; + msg(MSG::FATAL) << "Failed to retrieve tool " << m_selectionTool << endmsg; return StatusCode::FAILURE; } else - msg(MSG::INFO) << "Retrieved tool " << m_selectionTool << endreq; + msg(MSG::INFO) << "Retrieved tool " << m_selectionTool << endmsg; if(m_disableSorting) - msg(MSG::INFO) << "Internal sorting disabled, using external ordering!" << endreq; + msg(MSG::INFO) << "Internal sorting disabled, using external ordering!" << endmsg; return sc; } @@ -200,7 +200,7 @@ void Trk::TrackSelectionProcessorTool::solveTracks() ATH_MSG_DEBUG ("Accepted track "<<itnext->second.first<<"\t has score "<<-(itnext->first)); // add track to PRD_AssociationTool StatusCode sc = m_selectionTool->registerPRDs(itnext->second.first); - if (sc.isFailure()) msg(MSG::ERROR) << "addPRDs() failed" << endreq; + if (sc.isFailure()) msg(MSG::ERROR) << "addPRDs() failed" << endmsg; // add to output list m_finalTracks->push_back( const_cast<Track*>(itnext->second.first) ); diff --git a/Tracking/TrkTools/TrkTrackSlimmingTool/src/TrackSlimmingTool.cxx b/Tracking/TrkTools/TrkTrackSlimmingTool/src/TrackSlimmingTool.cxx index 81d9ff0d8eb20b19b1e2aeff98f07c2079f6e1e5..5d2b6f743467cd02f1efb81a4eb22ffd12fb47ee 100755 --- a/Tracking/TrkTools/TrkTrackSlimmingTool/src/TrackSlimmingTool.cxx +++ b/Tracking/TrkTools/TrkTrackSlimmingTool/src/TrackSlimmingTool.cxx @@ -161,9 +161,6 @@ Trk::Track* Trk::TrackSlimmingTool::slim(const Trk::Track& track) dynamic_cast<const MaterialEffectsOnTrack*>((**itTSoS).materialEffectsOnTrack()); if (meot && meot->energyLoss()) { - const EnergyLoss* energyLoss = new EnergyLoss(*meot->energyLoss()); - //std::cout<<"Keeping EnergyLoss "<<std::endl; - if (m_setPersistificationHints) { // (**itTSoS).resetHint(Trk::TrackStateOnSurface::PartialPersistification); (**itTSoS).setHint(Trk::TrackStateOnSurface::PersistifySlimCaloDeposit); @@ -176,7 +173,7 @@ Trk::Track* Trk::TrackSlimmingTool::slim(const Trk::Track& track) 0, new MaterialEffectsOnTrack(meot->thicknessInX0(), 0, - energyLoss, + new EnergyLoss(*meot->energyLoss()), meot->associatedSurface()), (**itTSoS).types())); } diff --git a/Tracking/TrkUtilityPackages/TrkDriftCircleMath/TrkDriftCircleMath/MatchCrossedTubes.h b/Tracking/TrkUtilityPackages/TrkDriftCircleMath/TrkDriftCircleMath/MatchCrossedTubes.h index 3077591bdac54605fa031083a149cf9ab6cd4e61..3df53f6aad892e4a3475bc49a568c0ec459fb602 100644 --- a/Tracking/TrkUtilityPackages/TrkDriftCircleMath/TrkDriftCircleMath/MatchCrossedTubes.h +++ b/Tracking/TrkUtilityPackages/TrkDriftCircleMath/TrkDriftCircleMath/MatchCrossedTubes.h @@ -74,7 +74,7 @@ namespace TrkDriftCircleMath { ++sit2; // dc1 == dc2 }else{ - std::cout << " shouldn't come here, I think .... " << std::endl; + //std::cout << " shouldn't come here, I think .... " << std::endl; ++sit1;++sit2; } } diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/PlotBase.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/PlotBase.cxx index cbde0b437f22a760b3f71cb950a960e97027cd88..6add3597b53e3241d2c41ece9f2a69967862d6e9 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/PlotBase.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/PlotBase.cxx @@ -18,7 +18,6 @@ #include "TH2F.h" #include "TH3F.h" #include "TProfile.h" -#include "TEfficiency.h" #include <algorithm> PlotBase::PlotBase(PlotBase *pParent, const std::string &sDir) { @@ -54,9 +53,9 @@ PlotBase::setDetailLevel(int iDetailLevel) { m_iDetailLevel = iDetailLevel; } -std::vector<HistData> PlotBase::retrieveBookedHistograms() { +std::vector<HistData> +PlotBase::retrieveBookedHistograms() { std::vector<HistData> vBookedHistograms = m_vBookedHistograms; - for (const auto &subNode: m_vSubNodes) { std::vector<HistData> subNodeHists = subNode->retrieveBookedHistograms(); vBookedHistograms.insert(vBookedHistograms.end(), subNodeHists.begin(), subNodeHists.end()); @@ -64,9 +63,9 @@ std::vector<HistData> PlotBase::retrieveBookedHistograms() { return vBookedHistograms; } -std::vector<TreeData> PlotBase::retrieveBookedTrees() { +std::vector<TreeData> +PlotBase::retrieveBookedTrees() { std::vector<TreeData> vBookedTrees = m_vBookedTrees; - for (auto subNode: m_vSubNodes) { std::vector<TreeData> subNodeTrees = subNode->retrieveBookedTrees(); vBookedTrees.insert(vBookedTrees.end(), subNodeTrees.begin(), subNodeTrees.end()); @@ -74,6 +73,17 @@ std::vector<TreeData> PlotBase::retrieveBookedTrees() { return vBookedTrees; } +std::vector<EfficiencyData> +PlotBase::retrieveBookedEfficiencies() { + std::vector<EfficiencyData> vBookedEfficiencies = m_vBookedEfficiencies; + for (const auto &subNode: m_vSubNodes) { + std::vector<EfficiencyData> subNodeHists = subNode->retrieveBookedEfficiencies(); + vBookedEfficiencies.insert(vBookedEfficiencies.end(), subNodeHists.begin(), subNodeHists.end()); + } + return vBookedEfficiencies; +} + + TH1F * PlotBase::Book1D(const std::string &name, const std::string &labels, int nBins, float start, float end, bool prependDir) { @@ -168,16 +178,16 @@ PlotBase::Book3D(const std::string &name, TH3 *refHist, const std::string &label TProfile * PlotBase::BookTProfile(const std::string &name, const std::string &labels, int nBinsX, float startX, float endX, - float startY, float endY, bool prependDir) { + float startY, float endY, bool prependDir, bool useRMS) { std::string prefix = constructPrefix(m_sDirectory, prependDir); TProfile *hist(0); Bool_t oldstat = TProfile::AddDirectoryStatus(); TProfile::AddDirectory(false); - - if (startY == -1 and endY == -1) { - hist = new TProfile((prefix + name).c_str(), labels.c_str(), nBinsX, startX, endX); + std::string opt = useRMS ? "S" : ""; + if ((startY == -1) and (endY == -1)) { + hist = new TProfile((prefix + name).c_str(), labels.c_str(), nBinsX, startX, endX, opt.c_str()); } else { - hist = new TProfile((prefix + name).c_str(), labels.c_str(), nBinsX, startX, endX, startY, endY); + hist = new TProfile((prefix + name).c_str(), labels.c_str(), nBinsX, startX, endX, startY, endY, opt.c_str()); } TProfile::AddDirectory(oldstat); m_vBookedHistograms.push_back(HistData(hist, m_sDirectory)); @@ -214,13 +224,26 @@ PlotBase::BookTProfileRangeY(const std::string &name, const std::string &labels, TProfile2D * PlotBase::BookTProfile2D(const std::string &name, const std::string &labels, const int nBinsX, const double xlo, const double xhi, const int nBinsY, const double ylo, const double yhi, - bool prependDir) { + bool prependDir, bool useRMS) { std::string prefix = constructPrefix(m_sDirectory, prependDir); Bool_t oldstat = TProfile2D::AddDirectoryStatus(); TProfile2D::AddDirectory(false); - TProfile2D *hist = new TProfile2D((prefix + name).c_str(), labels.c_str(), nBinsX, xlo, xhi, nBinsY, ylo, yhi); + std::string opt = useRMS ? "S" : ""; + TProfile2D *hist = new TProfile2D((prefix + name).c_str(), labels.c_str(), nBinsX, xlo, xhi, nBinsY, ylo, yhi, opt.c_str()); TProfile2D::AddDirectory(oldstat); + m_vBookedHistograms.push_back(HistData(hist, m_sDirectory)); + return hist; +} +TProfile2D * +PlotBase::BookTProfile2D(const std::string &name, const std::string &labels, const int nBinsX, double* binsX, const int nBinsY, double* binsY, bool prependDir, bool useRMS) { + std::string prefix = constructPrefix(m_sDirectory, prependDir); + Bool_t oldstat = TProfile2D::AddDirectoryStatus(); + TProfile2D::AddDirectory(false); + std::string opt = useRMS ? "S" : ""; + TProfile2D *hist = new TProfile2D((prefix + name).c_str(), labels.c_str(), nBinsX, binsX, nBinsY, binsY, opt.c_str()); + TProfile2D::AddDirectory(oldstat); + m_vBookedHistograms.push_back(HistData(hist, m_sDirectory)); return hist; } @@ -229,6 +252,10 @@ PlotBase::BookTEfficiency(const std::string &name, const std::string & labels, c std::string prefix = constructPrefix(m_sDirectory, prependDir); //Bool_t oldstat = TEfficiency::AddDirectoryStatus(); TEfficiency *hist = new TEfficiency((prefix + name).c_str(), labels.c_str(), nBinsX, xlo, xhi); + //hist->SetAutoSave(0); + //hist->SetAtoFlush(0); + hist->SetDirectory(0); + m_vBookedEfficiencies.push_back(EfficiencyData(hist, m_sDirectory)); //TEfficiency::AddDirectory(oldstat); return hist; } diff --git a/Tracking/TrkValidation/TrkValHistUtils/Root/TruthTrkExtrapolationPlots.cxx b/Tracking/TrkValidation/TrkValHistUtils/Root/TruthTrkExtrapolationPlots.cxx index 1eebd643e515a55c2be5856ffa2f42de4c9eb295..4ebe9d43db5f7b69241e0c4d6db3869790764fcc 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/Root/TruthTrkExtrapolationPlots.cxx +++ b/Tracking/TrkValidation/TrkValHistUtils/Root/TruthTrkExtrapolationPlots.cxx @@ -8,7 +8,8 @@ namespace Trk { TruthTrkExtrapolationPlots::TruthTrkExtrapolationPlots(PlotBase *pParent, std::string sDir) : PlotBase(pParent, sDir), m_CaloEntry(this, "", "CaloEntry"), m_MuonEntry(this, "", "MuonEntry"), - m_MuonExit(this, "", "MuonExit") {// , + m_MuonExit(this, "", "MuonExit") + {// , // m_Calo(this,"Scattering/CaloOnly","CaloEntryLayer", "MuonEntryLayer"), // m_MS(this,"/Scattering/MSOnly","MuonEntryLayer", "MuonExitLayer"), // m_IP(this,"/Scattering/IPOnly","IP","CaloEntryLayer"), @@ -33,7 +34,7 @@ namespace Trk { ExtrLayerPlots::ExtrLayerPlots(PlotBase *pParent, std::string sDir, std::string sLayerName) : PlotBase(pParent, sDir), m_sLayerName(sLayerName), - p{},px{},py{},pz{},p_extr{},px_extr{},pz_extr{},dp_truth{},dpx_truth{},dpy_truth{},dpz_truth{}, + p{},px{},py{},pz{},p_extr{},px_extr{},py_extr{},pz_extr{},dp_truth{},dpx_truth{},dpy_truth{},dpz_truth{}, pt{},eta{},phi{},theta{}{ //nop } @@ -114,9 +115,10 @@ namespace Trk { std::string sRegionEnd) : PlotBase(pParent, sDir), m_sRegionBegin(sRegionBegin), m_sRegionEnd(sRegionEnd), - dp{},dpt{},dpx{},dpy{},dpz{},dp_extr{},dpx_extr{},dpz_extr{}, + dp{},dpt{},dpx{},dpy{},dpz{},dp_extr{},dpx_extr{},dpy_extr{},dpz_extr{}, dp_vs_p{},dp_vs_phi{},dp_vs_eta{},dp_vs_eta_phi{},p_vs_p{},p_extr_vs_p_extr{},dp_extr_vs_eta{}, - dR{},dR_vs_p{},dR_vs_dp{},dR_vs_eta{},dR_vs_phi{},dR_vs_eta_phi{},dphi{},dtheta{},dAngle{} { + dR{},dR_vs_p{},dR_vs_dp{},dR_vs_eta{},dR_vs_phi{},dR_vs_eta_phi{},dphi{},dtheta{},dAngle{}, + dp_CaloEntry_IP_dp_CaloEntry_etxr{} { //nop } diff --git a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/PlotBase.h b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/PlotBase.h index cb411742c5358d2ca24d14dfb36dc33389fa453e..84b4ec93c0bafd87919ccad807baff6a82085296 100644 --- a/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/PlotBase.h +++ b/Tracking/TrkValidation/TrkValHistUtils/TrkValHistUtils/PlotBase.h @@ -20,12 +20,15 @@ #include "TProfile.h" #include "TProfile2D.h" #include "TTree.h" +#include "TEfficiency.h" + //fwd-declares class TEfficiency; typedef std::pair<TH1*, std::string> HistData; typedef std::pair<TTree*, std::string> TreeData; +typedef std::pair<TEfficiency*, std::string> EfficiencyData; class PlotBase { public: @@ -40,7 +43,8 @@ public: std::vector<HistData> retrieveBookedHistograms(); ///Retrieve all booked trees std::vector<TreeData> retrieveBookedTrees(); - + ///Retrieve all booked efficiency objects + std::vector<EfficiencyData> retrieveBookedEfficiencies(); ///@name Methods to book monitoring histograms ///Note: methods starting with capitals should be deprecated in favour of camel-cased methods ///@{ @@ -63,14 +67,15 @@ public: TH3F* Book3D(const std::string & name, TH3* refHist, const std::string & labels, bool prependDir = true); /// Book a TProfile histogram - TProfile* BookTProfile(const std::string &name, const std::string & labels, int nBinsX, float startX, float endX, float startY=-1, float endY=-1, bool prependDir = true); + TProfile* BookTProfile(const std::string &name, const std::string & labels, int nBinsX, float startX, float endX, float startY=-1, float endY=-1, bool prependDir = true, bool useRMS=false); /// Book a TProfile histogram with variable binning in x-axis TProfile* BookTProfile(const std::string &name, const std::string & labels, int nBinsX, float* binsX, bool prependDir = true); /// Book a TProfile histogram with variable binning in x-axis and limits in y-values TProfile* BookTProfileRangeY(const std::string &name, const std::string & labels, int nBinsX, double* binsX, double startY, double endY, bool prependDir = true); //cannot overload, conflicts with previous definitions /// Book a TProfile 2D histogram with variable binning in x-axis and limits in y-values - TProfile2D * BookTProfile2D(const std::string &name, const std::string & labels, const int nBinsX, - const double xlo, const double xhi, const int nBinsY, const double ylo, const double yhi, bool prependDir=true); + TProfile2D * BookTProfile2D(const std::string &name, const std::string & labels, const int nBinsX, const double xlo, const double xhi, const int nBinsY, const double ylo, const double yhi, bool prependDir=true, bool useRMS=false); + /// Book a TProfile 2D histogram with variable binning in x-axis and limits in y-values + TProfile2D * BookTProfile2D(const std::string &name, const std::string &labels, const int nBinsX, double* binsX, const int nBinsY, double* binsY, bool prependDir=true, bool useRMS=false); /// Book a (1-D) TEfficiency histogram TEfficiency * BookTEfficiency(const std::string &name, const std::string & labels, const int nBinsX, const float xlo, const float xhi, const bool prependDir = true); ///@} @@ -88,6 +93,7 @@ protected: std::vector<PlotBase*> m_vSubNodes; std::vector<HistData> m_vBookedHistograms; std::vector<TreeData> m_vBookedTrees; + std::vector<EfficiencyData> m_vBookedEfficiencies; std::string m_sDirectory; int m_iDetailLevel; }; diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/DetectorTimingAlgo.h b/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/DetectorTimingAlgo.h index 570ff9469819e5d5deab880092067999fa5b4af6..af995feda4ac6a4f84a7f9f643567a785d0a9dd2 100644 --- a/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/DetectorTimingAlgo.h +++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/DetectorTimingAlgo.h @@ -16,6 +16,7 @@ #include "TrigInterfaces/AllTEAlgo.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" +#include "GaudiKernel/Property.h" #include <string> #include <vector> @@ -40,12 +41,6 @@ #include "xAODTrigL1Calo/TriggerTowerContainer.h" -/// for muon tests -class Property; - - - - class DetectorTimingAlgo : public HLT::AllTEAlgo { public: diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/DummyCopyAllTEAlgo.h b/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/DummyCopyAllTEAlgo.h new file mode 100755 index 0000000000000000000000000000000000000000..81800972166a2b7877e83eaefaba19fec7396f88 --- /dev/null +++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/DummyCopyAllTEAlgo.h @@ -0,0 +1,37 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TrigGenericAlgs_DummyCopyAllTEAlgo_h +#define TrigGenericAlgs_DummyCopyAllTEAlgo_h + +#include <string> +#include "TrigInterfaces/AllTEAlgo.h" + +namespace HLT { + class TriggerElement; +} + +/** + * @brief Algorithm creating TE when nothing none of TEs present at the input is present + * @warning If in the configuration the empty input is given then it will always create TE. + * @warning This algorithm doe not create RoI descriptor. Nor it creates RoI type node. + **/ + + +namespace PESA +{ + class DummyCopyAllTEAlgo : public HLT::AllTEAlgo { + public: + DummyCopyAllTEAlgo(const std::string& name, ISvcLocator* pSvcLocator); + HLT::ErrorCode hltInitialize() { return HLT::OK; } + HLT::ErrorCode hltFinalize() { return HLT::OK; } + + HLT::ErrorCode hltExecute(std::vector<std::vector<HLT::TriggerElement*> >& input, + unsigned int output); + + private: + + }; +} +#endif diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/L1CorrelationAlgo.h b/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/L1CorrelationAlgo.h index 8c437df7c32cb7f0266b91184b78f15098ab4b5c..4f0bc2b4939f30ffdb4453d8971f4152fa274772 100644 --- a/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/L1CorrelationAlgo.h +++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/TrigGenericAlgs/L1CorrelationAlgo.h @@ -16,6 +16,7 @@ #include "TrigInterfaces/AllTEAlgo.h" #include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/Property.h" #include <string> #include <vector> @@ -31,7 +32,6 @@ #include "xAODTrigger/TrigCompositeContainer.h" class IROBDataProviderSvc; -class Property; typedef std::vector<uint32_t> ROBList; diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/DummyCopyAllTEAlgo.cxx b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/DummyCopyAllTEAlgo.cxx new file mode 100755 index 0000000000000000000000000000000000000000..3c27ce5a4074f9382a48e62de5f64698de9f7610 --- /dev/null +++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/DummyCopyAllTEAlgo.cxx @@ -0,0 +1,49 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include "TrigGenericAlgs/DummyCopyAllTEAlgo.h" +#include "boost/foreach.hpp" +#include "TrigConfHLTData/HLTTriggerElement.h" +/* + * create TE for each input TE except last + * copy all previouse features from last TE to each outputTE + */ +using namespace PESA; +DummyCopyAllTEAlgo::DummyCopyAllTEAlgo(const std::string& name, ISvcLocator* pSvcLocator) + : HLT::AllTEAlgo(name, pSvcLocator) { + +} + +HLT::ErrorCode DummyCopyAllTEAlgo::hltExecute(std::vector<std::vector<HLT::TriggerElement*> >& input, + unsigned int output) { + unsigned counter(0); + + if ( input.size() != 2 ) { + ATH_MSG_WARNING("Expect 2 inputs, got " << input.size()); + return HLT::OK; + } + + if ( input.back().size() != 1 ) { + ATH_MSG_WARNING("Expect 1 TE, got " << input.back().size()); + return HLT::OK; + } + + const HLT::TriggerElement *cacheTE=input.back().back(); + ATH_MSG_DEBUG("cacheTE features " << cacheTE->getPreviousFeatures().size()); + + for(auto vec : input){ + for(auto *te : vec){ + if(te==cacheTE) continue; + HLT::TriggerElement* outputTE = config()->getNavigation()->addNode(te, output); + outputTE->setActiveState(true); + for ( auto f: cacheTE->getPreviousFeatures() ){ + outputTE->addFeature(f); + } + ++counter; + } + } + ATH_MSG_DEBUG("Created: " << counter << " TEs seeded by every input passed"); + return HLT::OK; +} + diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/ROBRequestAlgo.h b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/ROBRequestAlgo.h index 019b1ce8f49728088b8f11691138cbbed2b2d43f..0d3c4318a2345530f8653bea0d20f41e9affad4c 100644 --- a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/ROBRequestAlgo.h +++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/ROBRequestAlgo.h @@ -16,6 +16,7 @@ #include "TrigInterfaces/AllTEAlgo.h" #include "GaudiKernel/ServiceHandle.h" +#include "GaudiKernel/Property.h" #include <string> #include <vector> @@ -23,7 +24,6 @@ #include <stdint.h> class IROBDataProviderSvc; -class Property; typedef std::vector<uint32_t> ROBList; diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TrigRoiUpdater.cxx b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TrigRoiUpdater.cxx index 23647c828f75fd27e778994d8b149db620bcc955..bbbac4d8640e249011809758018901e661ae0ec4 100644 --- a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TrigRoiUpdater.cxx +++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/TrigRoiUpdater.cxx @@ -66,7 +66,8 @@ namespace PESA int priority = 100; pIncsvc->addListener( this, "BeginEvent", priority); } else { - msg(MSG::ERROR) << "No connection to incidentSvc used for cleanup" << endreq; + msg(MSG::ERROR) << "No connection to incidentSvc used for cleanup" + << endmsg; return StatusCode::FAILURE; } diff --git a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/components/TrigGenericAlgs_entries.cxx b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/components/TrigGenericAlgs_entries.cxx index b9be41276786bcc4f9f9f67fa2fb1d6dbfe608b1..d481ba43743d3478ba8421423a4f182a88498a05 100755 --- a/Trigger/TrigAlgorithms/TrigGenericAlgs/src/components/TrigGenericAlgs_entries.cxx +++ b/Trigger/TrigAlgorithms/TrigGenericAlgs/src/components/TrigGenericAlgs_entries.cxx @@ -1,6 +1,7 @@ #include "GaudiKernel/DeclareFactoryEntries.h" #include "TrigGenericAlgs/DummyFEX.h" #include "TrigGenericAlgs/DummyUnseededAllTEAlgo.h" +#include "TrigGenericAlgs/DummyCopyAllTEAlgo.h" #include "TrigGenericAlgs/DummyCombineAlgo.h" #include "TrigGenericAlgs/OverlapRemoval.h" #include "TrigGenericAlgs/ReverseRoI.h" @@ -21,6 +22,7 @@ using namespace PESA; DECLARE_ALGORITHM_FACTORY( DummyFEX ) DECLARE_ALGORITHM_FACTORY( DummyUnseededAllTEAlgo ) +DECLARE_ALGORITHM_FACTORY( DummyCopyAllTEAlgo ) DECLARE_ALGORITHM_FACTORY( DummyCombineAlgo ) DECLARE_ALGORITHM_FACTORY( OverlapRemoval ) DECLARE_ALGORITHM_FACTORY( ReverseRoI ) @@ -40,7 +42,8 @@ DECLARE_ALGORITHM_FACTORY( MergeTopoStarts ) DECLARE_FACTORY_ENTRIES(TrigGenericAlgs) { DECLARE_ALGORITHM( DummyFEX ) DECLARE_ALGORITHM( DummyUnseededAllTEAlgo ) - DECLARE_ALGORITHM( DummyComnbineAlgo ) + DECLARE_ALGORITHM( DummyCopyAllTEAlgo ) + DECLARE_ALGORITHM( DummyCombineAlgo ) DECLARE_ALGORITHM( OverlapRemoval ) DECLARE_ALGORITHM( ReverseRoI ) DECLARE_ALGORITHM( AcceptWhenInputMissing ) diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/TrigL2LongLivedParticles/MuonCluster.h b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/TrigL2LongLivedParticles/MuonCluster.h index dde4c75b454a6517241cfd4072aedf27a04de000..b8cca0cd2c4b854965af8612a8246a5fad8dacef 100644 --- a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/TrigL2LongLivedParticles/MuonCluster.h +++ b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/TrigL2LongLivedParticles/MuonCluster.h @@ -2,8 +2,8 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -#ifndef __MuonCluster_h__ -#define __MuonCluster_h__ +#ifndef TRIGL2LONGLIVEDPARTICLES_MUONCLUSTER_H +#define TRIGL2LONGLIVEDPARTICLES_MUONCLUSTER_H /* MuonCluster Algorithm: Trigger/TrigAlgorithm/TrigMuonCluster @@ -23,7 +23,6 @@ #include "TrigInterfaces/AllTEAlgo.h" #include "TrigInterfaces/IMonitoredAlgo.h" #include "TrigTimeAlgs/ITrigTimerSvc.h" -#include "TrigMuonEvent/TrigMuonClusterFeature.h" #include "TrigT1Interfaces/RecMuonRoI.h" #include "xAODTrigger/TrigComposite.h" #include "xAODTrigger/TrigCompositeContainer.h" @@ -35,8 +34,6 @@ public: enum { ITIMER_INIT, ITIMER_CLUSTER, - ITIMER_JETS, - ITIMER_TRACKS, ITIMER_FINAL }; @@ -67,7 +64,7 @@ public: * * This is used to reset the internal caching mechanism of this MuonCluster algorithm. */ - HLT::ErrorCode hltEndEvent() { m_useCachedResult = false; m_old_feature = 0; m_clu_feature = 0; m_cachedTE=0; return HLT::OK; } + HLT::ErrorCode hltEndEvent() { m_useCachedResult = false; m_clu_feature = 0; m_cachedTE=0; return HLT::OK; } // monitored quantities std::vector<double> m_RoiEta; @@ -85,28 +82,14 @@ protected: protected: // JobOption properties /** A property which specifies the radius of the cluster */ - float mDeltaR; - /** A property which specifies the matching of the jet and of the cluster */ - float mDeltaRJet; + float m_DeltaR; /** Eta of the Center RoI cluster, for monitoring purpose */ - float mCluEta; + float m_CluEta; /** Phi of the Center RoI cluster, for monitoring purpose */ - float mCluPhi; + float m_CluPhi; /** Numbers of Roi in cluster */ - int mCluNum; - /** Number of Jet with Log(h/e)<0.5 **/ - int mNumJet; - - /** Minimum Et for jets in calorimeter based isolation. */ - double m_minJetEt; - - /** Minimum Pt for tracks in ID based isolation. */ - double m_PtMinID; - /** A property which specifies the matching of the track and of the cluster */ - float mDeltaRTrk; - /** Cut on Tracks */ - int mNumTrk; + int m_CluNum; /** calculcate the deltaR between two Rois */ float DeltaR(std::vector<const LVL1::RecMuonRoI*>::const_iterator, lvl1_muclu_roi ); @@ -116,15 +99,12 @@ protected: std::string m_featureLabel; //!< label for the mucluster feature in the HLT Navigation std::string m_featureLabelOld; //!< label for the mucluster feature in the HLT Navigation bool m_useCachedResult; //!< internal caching: true when the hltExecute will run in cached mode - TrigMuonClusterFeature *m_old_feature; //!< internal caching: m_old_feature of the first execution xAOD::TrigCompositeContainer *m_clu_feature; //!< internal caching: m_clu_feature of the first execution HLT::TriggerElement* m_cachedTE; //!< internal caching: output TE from the first exectution // Services - /** A service handle to StoreGate */ - ServiceHandle<StoreGateSvc> mStoreGate; /** Timers */ - std::vector<TrigTimer*> mTimers; + std::vector<TrigTimer*> m_Timers; }; -#endif // __MuonCluster_h__ +#endif // TRIGL2LONGLIVEDPARTICLES_MUONCLUSTER_H diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/TrigL2LongLivedParticles/MuonClusterIsolation.h b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/TrigL2LongLivedParticles/MuonClusterIsolation.h new file mode 100644 index 0000000000000000000000000000000000000000..dc4ceab0988dedd161c49a31be4ac3e6b16cb18c --- /dev/null +++ b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/TrigL2LongLivedParticles/MuonClusterIsolation.h @@ -0,0 +1,109 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#ifndef TRIGL2LONGLIVEDPARTICLES_MUONCLUSTERISOLATION_H +#define TRIGL2LONGLIVEDPARTICLES_MUONCLUSTERISOLATION_H +/* + MuonClusterIsolation Algorithm: Trigger/TrigAlgorithm/TrigMuonClusterIsolation + + Authors: Stefano.Giagu@cern.ch + Antonio.Policicchio@cern.ch + + Algorithm for selection of Long-Lived neutral particle decays (Hidden Valley sector): + Clustering of LVL1 muon RoIs, access to LVL2 jets and SITRACK tracks. +*/ +#include <string> +#include <vector> +#include <set> +#include <map> +#include "GaudiKernel/Algorithm.h" +#include "GaudiKernel/ToolHandle.h" +#include "GaudiKernel/ServiceHandle.h" +#include "TrigInterfaces/AllTEAlgo.h" +#include "TrigInterfaces/IMonitoredAlgo.h" +#include "TrigTimeAlgs/ITrigTimerSvc.h" +#include "TrigT1Interfaces/RecMuonRoI.h" +#include "xAODTrigger/TrigComposite.h" +#include "xAODTrigger/TrigCompositeContainer.h" + +#define kMAX_ROI 20 + +class MuonClusterIsolation : public HLT::AllTEAlgo { +public: + enum { + ITIMER_INIT, + ITIMER_CLUSTER, + ITIMER_JETS, + ITIMER_TRACKS, + ITIMER_FINAL + }; + +public: + /** Constructor */ + MuonClusterIsolation(const std::string& name, ISvcLocator* svc); + ~MuonClusterIsolation(); + + /** hltBeginRun() */ + HLT::ErrorCode hltBeginRun(); + /** hltEndRun() */ + HLT::ErrorCode hltEndRun(); + + /** hltInitialize() */ + HLT::ErrorCode hltInitialize(); + /** hltFinalize() */ + HLT::ErrorCode hltFinalize(); + /** hltExecute(), main code of the algorithm */ + HLT::ErrorCode hltExecute(std::vector<std::vector<HLT::TriggerElement*> >& input, + unsigned int output); + + + + /** A function which clears internal data for a new event */ + void clearEvent(); + /** + * @brief This method overwrites the default one (doing nothing) in the algo.h class + * + * This is used to reset the internal caching mechanism of this MuonClusterIsolation algorithm. + */ + HLT::ErrorCode hltEndEvent() { m_useCachedResult = false; m_clu_feature = 0; m_cachedTE=0; return HLT::OK; } + + // monitored quantities + std::vector<double> m_RoiEta; + std::vector<double> m_RoiPhi; + + +protected: + // JobOption properties + /** A property which specifies the radius of the cluster */ + float m_DeltaR; + /** A property which specifies the matching of the jet and of the cluster */ + float m_DeltaRJet; + + /** Eta of the Center RoI cluster, for monitoring purpose */ + float m_CluEta; + /** Phi of the Center RoI cluster, for monitoring purpose */ + float m_CluPhi; + /** Numbers of Roi in cluster */ + int m_CluNum; + + int m_NumTrk; + int m_NumJet; + + double m_PtMinID; + float m_DeltaRTrk; + double m_minJetEt; + + + //Output parameters. Keep old container so we don't break Frozen Tier0. Should be removed in the future! + std::string m_featureLabel; //!< label for the mucluster feature in the HLT Navigation + bool m_useCachedResult; //!< internal caching: true when the hltExecute will run in cached mode + xAOD::TrigCompositeContainer *m_clu_feature; //!< internal caching: m_clu_feature of the first execution + HLT::TriggerElement* m_cachedTE; //!< internal caching: output TE from the first exectution + + // Services + /** Timers */ + std::vector<TrigTimer*> m_Timers; +}; + +#endif // TRIGL2LONGLIVEDPARTICLES_MUONCLUSTERISOLATION_H diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/doc/mainpage.h b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/doc/mainpage.h deleted file mode 100644 index 31a31621badf2734b365aa41ae6f44b9fc9712c7..0000000000000000000000000000000000000000 --- a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/doc/mainpage.h +++ /dev/null @@ -1,42 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - -@mainpage -@author Stefano Giagu, Antonio Policicchio - -@section TrigL2LongLivedParticlesOverview Overview -This package contains LVL2 Fex algorithms for Long-Lived -neutral particle triggers: MuonCluster and TrigMuonJetFex. -The MuonCluster AllTE algorithm is consisting of a muon ROI cluster -algorithm which computes the number of LVL1 muon ROIs in a -cone of DR = 0.4. Then it looks for jets associated in a -cone of Dr=0.7 around the L1 ROI cluster and computes the number -of tracks with a Pt > 2 GeV in a region etaxphi 0.2x0.2 -around the muon cluster. -All relevant variable are saved in a TrigMuonClusterFeature abject attached to the -event record for further analysis. - -The TrigMuonJetFex is a Combo Fex algorithm which looks for angular matching between a LVL2 jet and a LVL1 muon. -The LVL2 jet has to be a jet without connecting tracks to the interaction point. In order to accompish this request the -algorithm computes the number -of tracks with a Pt > 1 GeV in a region etaxphi 0.2x0.2 -around the jet direction. No feature is written for this algorithm. - -@ref used_TrigL2LongLivedParticles - -@ref requirements_TrigL2LongLivedParticles - -*/ - -/** -@page used_TrigL2LongLivedParticles Used Packages -@htmlinclude used_packages.html -*/ - -/** -@page requirements_TrigL2LongLivedParticles Requirements -@include requirements -*/ diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/python/TrigL2LongLivedParticlesConfig.py b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/python/TrigL2LongLivedParticlesConfig.py index 8462e62f223a55c3cbb9711c901c1025f06cbcea..46f59b7efee1534260617daf81882b449c1e0dab 100755 --- a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/python/TrigL2LongLivedParticlesConfig.py +++ b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/python/TrigL2LongLivedParticlesConfig.py @@ -1,6 +1,7 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConf import MuonCluster +from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConf import MuonClusterIsolation from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConf import TrigMuonJetFex from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConf import TrigJetSplitter from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConf import TrigBHremoval @@ -83,9 +84,25 @@ class MuonClusterConfig(MuonCluster): # muClu Parameters self.DeltaR = 0.4 - self.DeltaRJet = 0.7 - self.DeltaRTrk = 0.4 - + +class MuonClusterIsolationConfig(MuonClusterIsolation): + __slots__ = [] + def __init__ (self, name="MuonClusterIsolationConfig"): + super(MuonClusterIsolationConfig, self).__init__(name) + + from TrigL2LongLivedParticles.TrigL2LongLivedParticlesMonitoring import TrigMuonClusterValidationMonitoring, TrigMuonClusterOnlineMonitoring, TrigMuonClusterCosmicMonitoring + validation = TrigMuonClusterValidationMonitoring() + online = TrigMuonClusterOnlineMonitoring() + cosmic = TrigMuonClusterCosmicMonitoring() + + + from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig + time = TrigTimeHistToolConfig("muClu_Time") + + self.AthenaMonTools = [ validation, online, time, cosmic] + + # muClu Parameters + self.DeltaR = 0.4 class TrigL2MuonJetFexGlobal (TrigMuonJetFex): __slots__ = [] diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonCluster.cxx b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonCluster.cxx index c055e93ea1e705afa7c87601461f155348a0cd2f..800ada49c1797ad6c8bad34b299673ead7d8df10 100644 --- a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonCluster.cxx +++ b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonCluster.cxx @@ -3,7 +3,8 @@ */ /* - TrigMuonCluster.cxx + MuonCluster.cxx + Muon cluster finding, creates an RoI cluster for track finding */ #include "TMath.h" #include <cmath> @@ -21,39 +22,24 @@ #include "TrigTimeAlgs/TrigTimer.h" //MUON CLUSTER #include "TrigL2LongLivedParticles/MuonCluster.h" -#include "TrigMuonEvent/TrigMuonClusterFeature.h" -//JETS -#include "xAODJet/JetContainer.h" -#include "xAODJet/Jet.h" -//ID TRACKING -#include "xAODTracking/TrackParticleContainer.h" #include "CxxUtils/fpcompare.h" using namespace std; MuonCluster::MuonCluster(const std::string& name, ISvcLocator* svc) - : HLT::AllTEAlgo(name, svc), m_useCachedResult(false),m_old_feature(0), m_clu_feature(0), m_cachedTE(0), - mStoreGate("StoreGateSvc", this->name()) { - - mCluEta = 0.; - mCluPhi = 0.; - mCluNum = 0; - mNumJet = -1; - mNumTrk = -1; - - declareProperty("DeltaR", mDeltaR=0.4, "radius of the muon cluster"); - declareProperty("DeltaRJet", mDeltaRJet=0.7, "distance between jet and muon cluster"); - declareProperty("DeltaRTrk", mDeltaRTrk=0.4, "distance between track and muon cluster"); - declareProperty("MuonCluLabel", m_featureLabel = "MuonRoICluster", "label for the MuonCluster feature in the HLT Navigation, for the xAOD::TrigCompositeContainer"); - declareProperty("MuonCluLabel_old", m_featureLabelOld = "MuonCluster", "label for the MuonCluster feature in the HLT Navigation, for the TrigMuonClusterFeature container"); - declareProperty("MinJetEt", m_minJetEt = 30000.0, "minimum Et (MeV) to consider a jet for isolation"); - declareProperty("PtMinID", m_PtMinID = 5000.0, "minimum Pt (MeV) for ID track"); - - declareMonitoredVariable("RoIEta", mCluEta); - declareMonitoredVariable("RoIPhi", mCluPhi); - declareMonitoredVariable("NumClu", mCluNum); - declareMonitoredVariable("NumJet", mNumJet); - declareMonitoredVariable("NumTrk", mNumTrk); + : HLT::AllTEAlgo(name, svc), m_useCachedResult(false), m_clu_feature(0), m_cachedTE(0) +{ + + m_CluEta = 0.; + m_CluPhi = 0.; + m_CluNum = 0; + + declareProperty("DeltaR", m_DeltaR=0.4, "radius of the muon cluster"); + declareProperty("MuonCluLabel", m_featureLabel = "MuonClusterInput", "label for the MuonCluster feature in the HLT Navigation, for the xAOD::TrigCompositeContainer"); + + declareMonitoredVariable("RoIEta", m_CluEta); + declareMonitoredVariable("RoIPhi", m_CluPhi); + declareMonitoredVariable("NumClu", m_CluNum); declareMonitoredStdContainer("RoiEta",m_RoiEta); declareMonitoredStdContainer("RoiPhi",m_RoiPhi); @@ -64,69 +50,56 @@ MuonCluster::~MuonCluster() { HLT::ErrorCode MuonCluster::hltInitialize() { - msg() << MSG::INFO << "initialize()" << endreq; + msg() << MSG::INFO << "initialize()" << endmsg; - msg() << MSG::INFO << "Parameters for MuonCluster:" << name() << endreq; - msg() << MSG::INFO << "DeltaR : " << mDeltaR << endreq; - msg() << MSG::INFO << "DeltaRJet : " << mDeltaRJet << endreq; - msg() << MSG::INFO << "DeltaRTrk : " << mDeltaRTrk << endreq; - msg() << MSG::INFO << "MuonCluLabel : " << m_featureLabel << endreq; + msg() << MSG::INFO << "Parameters for MuonCluster:" << name() << endmsg; + msg() << MSG::INFO << "DeltaR : " << m_DeltaR << endmsg; + msg() << MSG::INFO << "MuonCluLabel : " << m_featureLabel << endmsg; if (msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "Retrieve service StoreGateSvc" << endreq; - } - - if (mStoreGate.retrieve().isFailure()) { - msg() << MSG::ERROR << "Cannot retrieve service StoreGateSvc" << endreq; - return HLT::BAD_JOB_SETUP; + msg() << MSG::DEBUG << "Retrieve service StoreGateSvc" << endmsg; } if (msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "Timers are initializated here" << endreq; + msg() << MSG::DEBUG << "Timers are initializated here" << endmsg; } - mTimers.push_back(addTimer("ClusterMuon_Initialization")); - mTimers.push_back(addTimer("ClusterMuon_ClusterFinding")); - mTimers.push_back(addTimer("ClusterMuon_JetsFinding")); - mTimers.push_back(addTimer("ClusterMuon_tracksFinding")); - mTimers.push_back(addTimer("ClusterMuon_Finalization")); + m_Timers.push_back(addTimer("ClusterMuon_Initialization")); + m_Timers.push_back(addTimer("ClusterMuon_ClusterFinding")); + m_Timers.push_back(addTimer("ClusterMuon_Finalization")); declareMonitoredObject("Initialization", - *(mTimers[ITIMER_INIT]), + *(m_Timers[ITIMER_INIT]), &TrigTimer::elapsed); - declareMonitoredObject("ClusterFinder", *(mTimers[ITIMER_CLUSTER]), + declareMonitoredObject("ClusterFinder", *(m_Timers[ITIMER_CLUSTER]), &TrigTimer::elapsed); - declareMonitoredObject("JetsFinder", *(mTimers[ITIMER_JETS]), - &TrigTimer::elapsed); - declareMonitoredObject("tracksFinder", *(mTimers[ITIMER_TRACKS]), - &TrigTimer::elapsed); - declareMonitoredObject("Finalization", *(mTimers[ITIMER_FINAL]), + declareMonitoredObject("Finalization", *(m_Timers[ITIMER_FINAL]), &TrigTimer::elapsed); - msg() << MSG::INFO << "initialize() success" << endreq; + msg() << MSG::INFO << "initialize() success" << endmsg; return HLT::OK; } HLT::ErrorCode MuonCluster::hltBeginRun() { - msg() << MSG::INFO << "hltBeginRun"<< endreq; + msg() << MSG::INFO << "hltBeginRun"<< endmsg; return HLT::OK; } HLT::ErrorCode MuonCluster::hltEndRun() { - msg() << MSG::INFO << "hltEndRun"<< endreq; + msg() << MSG::INFO << "hltEndRun"<< endmsg; return HLT::OK; } HLT::ErrorCode MuonCluster::hltFinalize() { - msg() << MSG::INFO << "hltFinalize()" << endreq; + msg() << MSG::INFO << "hltFinalize()" << endmsg; return HLT::OK; } HLT::ErrorCode MuonCluster::hltExecute(std::vector<std::vector<HLT::TriggerElement*> >& tes_in, unsigned int type_out) { if (msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "execute()" << endreq; + msg() << MSG::DEBUG << "execute()" << endmsg; } clearEvent(); @@ -136,17 +109,19 @@ HLT::ErrorCode MuonCluster::hltExecute(std::vector<std::vector<HLT::TriggerEleme // CACHING / Update implemented since tag 00-00-19 / A.C. // Caching disabled to avoid cross-talk between similar chains // i.e. chains seeded by 2MU6 or 2MU10 + // nothing is seeded by 2MU6 though. does this code even work right? + if (m_useCachedResult) { if (msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "Executing this " << name() << " in cached mode" << endreq; + msg() << MSG::DEBUG << "Executing this " << name() << " in cached mode" << endmsg; } // Only count mu as an input TE (for seeding relation of navigation structure) HLT::TEVec allTEs; if ( (tes_in.size()>0) && (tes_in[0].size()>0) ){ - allTEs.push_back( tes_in[0][0] ); + allTEs.push_back( tes_in[0][0] );//this is a list of L1 Muon RoIs } - if( tes_in.size() > 1) allTEs.push_back(tes_in.at(1).front()); + if( tes_in.size() > 1) allTEs.push_back(tes_in.at(1).front());//this should be impossible now (jets in MuonClusterIsolation) // create output TE: // Create an output TE seeded by the inputs @@ -160,11 +135,11 @@ HLT::ErrorCode MuonCluster::hltExecute(std::vector<std::vector<HLT::TriggerEleme } // end of caching - if (timerSvc()) mTimers[ITIMER_INIT]->stop(); + if (timerSvc()) m_Timers[ITIMER_INIT]->stop(); - if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "execHLTAlgorithm called" << endreq; - + if (msgLvl() <= MSG::DEBUG){ + msg() << MSG::DEBUG << "execHLTAlgorithm called" << endmsg; + } //Setup the composite container we will put the MuonRoICluster in m_clu_feature = new xAOD::TrigCompositeContainer(); xAOD::TrigCompositeAuxContainer compAux; @@ -174,68 +149,63 @@ HLT::ErrorCode MuonCluster::hltExecute(std::vector<std::vector<HLT::TriggerEleme beforeExecMonitors().ignore(); //check to make sure we have all the input trigger elements! - if ( (tes_in.size() < 2) ){ + if ( (tes_in.size() < 1) ){ //should be the L1 Muon RoI container msg() << MSG::ERROR << "input trigger element vector isn't the correct size! Aborting chain." - << endreq; + << endmsg; return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } - int i_cl=0; + int iter_cl=0; lvl1_muclu_roi muonClu[20]; lvl1_muclu_roi muonClu0[20]; HLT::TEVec allTEs; - vector<double> VEta,VPhi; if (msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "begin loop on TE and get muon RoIs" << endreq; + msg() << MSG::DEBUG << "begin loop on TE and get muon RoIs" << endmsg; } - if(tes_in[0].size()==0) { - msg() << MSG::WARNING << "Can't get any TE " << endreq; + if(tes_in.at(0).size()==0) { + msg() << MSG::WARNING << "Can't get any TEs " << endmsg; return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } else { - for (HLT::TEVec::const_iterator it = tes_in[0].begin();it != tes_in[0].end(); ++it) { + for (HLT::TEVec::const_iterator it = tes_in.at(0).begin();it != tes_in.at(0).end(); ++it) { const TrigRoiDescriptor* roi; if ( HLT::OK != getFeature(*it, roi) ) { - msg() << MSG::WARNING << "Can't get RoI for TE " << (*it)->getId()<< endreq; + msg() << MSG::WARNING << "Can't get RoI for TE " << (*it)->getId()<< endmsg; return HLT::NAV_ERROR; } - if(i_cl>= kMAX_ROI) { - msg() << MSG::WARNING << "Too many Muon RoIs: bailing out" << endreq; + if(iter_cl>= kMAX_ROI) { + msg() << MSG::WARNING << "Too many Muon RoIs: bailing out" << endmsg; break; } - VEta.push_back(roi->eta()); - VPhi.push_back(roi->phi()); - m_RoiEta.push_back(roi->eta()); m_RoiPhi.push_back(roi->phi()); lvl1_muclu_roi my_lvl1_clu_roi; my_lvl1_clu_roi.eta = roi->eta(); my_lvl1_clu_roi.phi = roi->phi(); my_lvl1_clu_roi.nroi = 0; - muonClu[i_cl] = my_lvl1_clu_roi; - muonClu0[i_cl] = my_lvl1_clu_roi; + muonClu[iter_cl] = my_lvl1_clu_roi; + muonClu0[iter_cl] = my_lvl1_clu_roi; allTEs.push_back(*it); - ++i_cl; + ++iter_cl; } } - + int n_cl = iter_cl; + if (msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "Accumulated " << i_cl << " ROI Directions: " << endreq; - for (int unsigned i=0;i<VEta.size();i++) { - msg() << MSG::DEBUG << "[" << VEta[i] << "," << VPhi[i] << "]" << endreq; + msg() << MSG::DEBUG << "Accumulated " << n_cl << " ROI Directions: " << endmsg; + for (int unsigned i=0;i<m_RoiEta.size();i++) { + msg() << MSG::DEBUG << "[" << m_RoiEta.at(i) << "," << m_RoiPhi.at(i) << "]" << endmsg; } } - - int n_cl = i_cl; - if (timerSvc()) mTimers[ITIMER_INIT]->stop(); - if (timerSvc()) mTimers[ITIMER_CLUSTER]->start(); + if (timerSvc()) m_Timers[ITIMER_INIT]->stop(); + if (timerSvc()) m_Timers[ITIMER_CLUSTER]->start(); // start the clustering if (msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "Start the Muon RoI clustering" << endreq; + msg() << MSG::DEBUG << "Start the Muon RoI clustering" << endmsg; } for(int i_cl=0; i_cl<n_cl; ++i_cl) { // loop on cluster bool improvement = true; @@ -248,7 +218,7 @@ HLT::ErrorCode MuonCluster::hltExecute(std::vector<std::vector<HLT::TriggerEleme int n_in_clu = 0; for (int j_cl=0; j_cl<n_cl; ++j_cl) { // loop on cluster float deltaR = DeltaR(muonClu0[j_cl],muonClu[i_cl]); - if(deltaR<mDeltaR){ + if(deltaR<m_DeltaR){ ++n_in_clu; if(n_itr==1){ muonClu[i_cl].eta = muonClu[i_cl].eta + (muonClu0[j_cl].eta-muonClu[i_cl].eta)/n_in_clu; @@ -273,12 +243,12 @@ HLT::ErrorCode MuonCluster::hltExecute(std::vector<std::vector<HLT::TriggerEleme Int_t n_in_clu2=0; for (int j_cl=0; j_cl<n_cl; ++j_cl) { // loop on cluster float deltaR = DeltaR(muonClu0[j_cl],muonClu[i_cl]); - if(deltaR<mDeltaR){ + if(deltaR<m_DeltaR){ ++n_in_clu2; } } if (msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "Finding the number of Muon RoIs in the new Cluster.... " << n_in_clu2 << endreq; + msg() << MSG::DEBUG << "Finding the number of Muon RoIs in the new Cluster.... " << n_in_clu2 << endmsg; } if(n_in_clu2>muonClu[i_cl].nroi){ muonClu[i_cl].nroi=n_in_clu2; @@ -286,214 +256,61 @@ HLT::ErrorCode MuonCluster::hltExecute(std::vector<std::vector<HLT::TriggerEleme } else improvement = false; }//end while } - if (timerSvc()) mTimers[ITIMER_CLUSTER]->stop(); + if (timerSvc()){ m_Timers[ITIMER_CLUSTER]->stop();} // find the cluster with max number of rois int ncl_max = 0; for(int i_cl=0; i_cl<n_cl; ++i_cl) { // loop on cluster if(muonClu[i_cl].nroi>ncl_max){ - mCluEta = muonClu[i_cl].eta; - mCluPhi = muonClu[i_cl].phi; - mCluNum = muonClu[i_cl].nroi; + m_CluEta = muonClu[i_cl].eta; + m_CluPhi = muonClu[i_cl].phi; + m_CluNum = muonClu[i_cl].nroi; ncl_max = muonClu[i_cl].nroi; } } if (msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "Finding the Cluster with the maximum number of RoIs.... " << ncl_max << endreq; - } - - - if (timerSvc()) mTimers[ITIMER_JETS]->start(); - - int njets = 0; - - const xAOD::JetContainer* vectorOfJets = 0; - - std::vector<HLT::TriggerElement*>& inputTE = tes_in.at(1); - HLT::ErrorCode ec = getFeature(inputTE.front(), vectorOfJets); - - if(ec!=HLT::OK) { - msg() << MSG::WARNING << " Failed to get the Jets " << endreq; - return ec; - } - - if(vectorOfJets==0) { - if (msgLvl() <= MSG::WARNING) - msg() << MSG::WARNING << "Missing feature." << endreq; - return HLT::MISSING_FEATURE; - } - - if (msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "The number of Jets attached to the TE is " << vectorOfJets->size() << endreq; - } - - for (xAOD::JetContainer::const_iterator jet = vectorOfJets->begin(); jet != vectorOfJets->end(); jet++) { - - double etjet = (*jet)->p4().Et(); - if(etjet <= m_minJetEt) continue; - - double jetEMF = (*jet)->getAttribute<float>("EMFrac"); - double jetEta = (*jet)->eta(); - double jetPhi = (*jet)->phi(); - double erat = -99999999.; - - double delta_eta = mCluEta - jetEta; - double delta_phi = HLT::wrapPhi(mCluPhi - jetPhi); - - double dR = sqrt( (delta_eta*delta_eta) + (delta_phi*delta_phi) ); - - if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "HLT jet /eta=" << jetEta << " /phi= " << jetPhi << "/Et= " << etjet << "/DR= " << dR << endreq; - - if (dR<mDeltaRJet) { - double zero = 0.; - double one = 1.; - if (CxxUtils::fpcompare::greater(jetEMF,zero)){ - if(CxxUtils::fpcompare::greater_equal(jetEMF,one)) erat = -999.; - else erat = log10(double(1./jetEMF - 1.)); - } else { - erat = 999; - } - if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Jet log10 of had/em energy ratio: " << erat << endreq; - - if (erat<=0.5) { - njets++; - } - } - } - - mNumJet = njets; - - if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Found " << mNumJet << " Jets with Log(H/E)<1.0" << endreq; - - if (timerSvc()) mTimers[ITIMER_JETS]->stop(); - - if (timerSvc()) mTimers[ITIMER_TRACKS]->start(); - - if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Accessing the ID track collection" << endreq; - - int ntrk = 0; - - if (msgLvl() <= MSG::DEBUG){ - msg() << MSG::DEBUG << "there are: " << tes_in[0].size() << " trigger elements with track collections." << - " This should be equal to the number of MU10 RoIs" << std::endl; - } - - int nTEs = 0; - - for (HLT::TEVec::const_iterator it = tes_in[0].begin();it != tes_in[0].end(); ++it) { - - nTEs++; - if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "trigger element: " << nTEs << " of tes_in[0] "<< endreq; - - std::vector<const xAOD::TrackParticleContainer*> vectorOfTrackCollections; - HLT::ErrorCode ect = getFeatures(*it,vectorOfTrackCollections, "InDetTrigTrackingxAODCnv_Muon_IDTrig"); - - if( ect!=HLT::OK ) { - if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << " Failed to get tracks" << endreq; - } else { - if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << " Got " << vectorOfTrackCollections.size() << " collections of tracks " << endreq; - - std::vector<const xAOD::TrackParticleContainer*>::iterator - theTrackColl = vectorOfTrackCollections.begin(), - endTrackColl = vectorOfTrackCollections.end(); - - for( ; theTrackColl != endTrackColl; theTrackColl++) { - - xAOD::TrackParticleContainer::const_iterator - track = (*theTrackColl)->begin(), - lasttrack = (*theTrackColl)->end(); - - for(; track !=lasttrack; track++ ) { - - float theta = (*track)->theta(); - float qOverPt = (*track)->qOverP()/TMath::Sin(theta); - float pT = (1/qOverPt); - - if (fabs(pT) <= m_PtMinID) continue; - - double phi = (*track)->phi0(); - double eta = (*track)->eta(); - - if(msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "track with " << "pt=" << pT << ", eta=" << eta << ", phi=" << phi << endreq; - - double delta_etat = mCluEta - eta; - double delta_phit = HLT::wrapPhi(mCluPhi - phi); - - double dRt = sqrt( (delta_etat*delta_etat) + (delta_phit*delta_phit) ); - if (dRt<mDeltaRTrk) { - ntrk++; - } - } - } - } - } - - //monitored variable - mNumTrk = ntrk; - - if (msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "Found " << mNumTrk << " tracks around the Muon Cluster direction (inaccurate, often duplicate tracks in container)" << endreq; + msg() << MSG::DEBUG << "Found the Cluster with the maximum number of RoIs.... " << ncl_max << endmsg; } - - if (timerSvc()) mTimers[ITIMER_TRACKS]->stop(); - - if (timerSvc()) mTimers[ITIMER_FINAL]->start(); + if (timerSvc()){ m_Timers[ITIMER_FINAL]->start();} - //WRITE FEATURE - m_old_feature = new TrigMuonClusterFeature(mCluEta,mCluPhi, mCluNum, mNumJet, mNumTrk); - // finished now debugging if (msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "Create an output TE seeded by the input" << endreq; + msg() << MSG::DEBUG << "Create an output TE seeded by the input" << endmsg; } + //create an outputTE + HLT::TriggerElement* outputTE = config()->getNavigation()->addNode(allTEs, type_out); + outputTE->setActiveState(true); + xAOD::TrigComposite *compClu = new xAOD::TrigComposite(); m_clu_feature->push_back(compClu); //add jets to the composite container compClu->setName("Cluster"); - compClu->setDetail( "nTrks", mNumTrk); - compClu->setDetail( "nJets", mNumJet); - compClu->setDetail( "ClusterEta", mCluEta); - compClu->setDetail( "ClusterPhi", mCluPhi); - compClu->setDetail( "nRoIs", mCluNum); - + compClu->setDetail( "ClusterEta", m_CluEta); + compClu->setDetail( "ClusterPhi", m_CluPhi); + compClu->setDetail( "nRoIs", m_CluNum); - if ( (tes_in.size()>1) && (tes_in.at(0).size()>0) ){ - //add each muon RoI and its associated features (tracks) - for(unsigned int iTE=0; iTE < tes_in.at(0).size(); iTE++){ allTEs.push_back( tes_in.at(0).at(iTE) ); } - //add the jet container - if( tes_in.at(1).size() > 0){ allTEs.push_back(tes_in.at(1).front());} - } else { - msg() << MSG::ERROR << "input trigger element vector isn't the correct size! Aborting chain." - << endreq; - return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); + //create a TrigRoiDescriptor to send to ID tracking, to seed track-finding + //only need to do this if the MuonCluster will pass the hypo! + if( (m_CluNum >= 3 && fabs(m_CluEta) < 1.0) || (m_CluNum >= 4 && fabs(m_CluEta) >= 1.0 && fabs(m_CluEta) <= 2.5)){ + double m_phiHalfWidth = 0.35; + double phiMinus = HLT::wrapPhi(m_CluPhi-m_phiHalfWidth); + double phiPlus = HLT::wrapPhi(m_CluPhi+m_phiHalfWidth); + TrigRoiDescriptor* roi = new TrigRoiDescriptor(m_CluEta, m_CluEta-0.4, m_CluEta+0.4,m_CluPhi, phiMinus, phiPlus); + + HLT::ErrorCode hltStatus = attachFeature(outputTE, roi, "forID"); + if ( hltStatus != HLT::OK ) { + msg() << MSG::ERROR << "Failed to attach TrigRoiDescriptor as feature " << *roi << endmsg; + return hltStatus; + } } - // create output TE: - // Create an output TE seeded by the inputs - HLT::TriggerElement* outputTE = config()->getNavigation()->addNode(allTEs, type_out); - outputTE->setActiveState(true); - - // save feature to output TE: + // save trigger cluster feature to output TE: HLT::ErrorCode hltStatus = attachFeature(outputTE, m_clu_feature, m_featureLabel); - HLT::ErrorCode hltStatusOld = attachFeature(outputTE, m_old_feature, m_featureLabelOld); if ( hltStatus != HLT::OK ) { msg() << MSG::ERROR << "Write of MuonRoICluster TrigCompositeContainer feature into outputTE failed" - << endreq; + << endmsg; return hltStatus; } - if (hltStatusOld != HLT::OK ) { - msg() << MSG::ERROR << "Write of MuonCluster TrigMuonCluster feature into outputTE failed" - << endreq; - return hltStatusOld; - } - - if (timerSvc()) mTimers[ITIMER_FINAL]->stop(); + if (timerSvc()) m_Timers[ITIMER_FINAL]->stop(); // CACHING // if we got here, everything was okay. so, we cache the feature for further execution of this instance in e.g. other MET Sequences: @@ -504,18 +321,14 @@ HLT::ErrorCode MuonCluster::hltExecute(std::vector<std::vector<HLT::TriggerEleme // i.e. chains seeded by 2MU6 or 2MU10 m_useCachedResult = false; m_cachedTE = outputTE; - - //---------------------------------------------------------------- // REGTEST //---------------------------------------------------------------- if (msgLvl() <= MSG::DEBUG) { msg() << MSG::DEBUG << " REGTEST \t Cluster with : " - << mCluNum << " LVL1-Roi" << endreq; - msg() << MSG::DEBUG << " REGTEST \t Cluster Eta " << mCluEta << " Cluster Phi " << mCluPhi << endreq; - msg() << MSG::DEBUG << " REGTEST \t with " << mNumJet << " jets in the cluster cone " << endreq; - msg() << MSG::DEBUG << " REGTEST \t and with " << mNumTrk << " tracks around the cluster direction " << endreq; + << m_CluNum << " LVL1-Roi" << endmsg; + msg() << MSG::DEBUG << " REGTEST \t Cluster Eta " << m_CluEta << " Cluster Phi " << m_CluPhi << endmsg; } //---------------------------------------------------------------- @@ -524,17 +337,12 @@ HLT::ErrorCode MuonCluster::hltExecute(std::vector<std::vector<HLT::TriggerEleme return HLT::OK; } - void MuonCluster::clearEvent() { - mCluEta = 0.; - mCluPhi = 0.; - mCluNum = 0; - mNumJet = -1; - mNumTrk = -1; + m_CluEta = 0.; + m_CluPhi = 0.; + m_CluNum = 0; } - - float MuonCluster::DeltaR(std::vector<const LVL1::RecMuonRoI*>::const_iterator p_roi,lvl1_muclu_roi q_roi){ float delPhi = HLT::wrapPhi((*p_roi)->phi()-(q_roi).phi); @@ -550,4 +358,3 @@ float MuonCluster::DeltaR(lvl1_muclu_roi p_roi,lvl1_muclu_roi q_roi){ return(sqrt(delPhi*delPhi+delEta*delEta)); } - diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonClusterIsolation.cxx b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonClusterIsolation.cxx new file mode 100644 index 0000000000000000000000000000000000000000..06966672d5ea900ae8989e5f87ee853d33ab5c4c --- /dev/null +++ b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/MuonClusterIsolation.cxx @@ -0,0 +1,430 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +/* + MuonClusterIsolation.cxx +*/ +#include "TMath.h" +#include <cmath> +#include <algorithm> +#include <sstream> +#include "CLHEP/Units/SystemOfUnits.h" +#include "GaudiKernel/ITHistSvc.h" +#include "PathResolver/PathResolver.h" +#include "TrigInterfaces/FexAlgo.h" +#include "TrigSteeringEvent/PhiHelper.h" +//LVL1 ROIS +#include "TrigT1Interfaces/RecMuonRoI.h" +#include "TrigSteeringEvent/TrigRoiDescriptor.h" +//TIMERS +#include "TrigTimeAlgs/TrigTimer.h" +//MUON CLUSTER +#include "TrigL2LongLivedParticles/MuonClusterIsolation.h" +//JETS +#include "xAODJet/JetContainer.h" +#include "xAODJet/Jet.h" +//ID TRACKING +#include "xAODTracking/TrackParticleContainer.h" +#include "CxxUtils/fpcompare.h" + +using namespace std; + +MuonClusterIsolation::MuonClusterIsolation(const std::string& name, ISvcLocator* svc) + : HLT::AllTEAlgo(name, svc), m_useCachedResult(false), m_clu_feature(0), m_cachedTE(0) +{ + + m_CluEta = 0.; + m_CluPhi = 0.; + m_CluNum = 0; + m_NumJet = -1; + m_NumTrk = -1; + + declareProperty("DeltaR", m_DeltaR=0.4, "radius of the muon cluster"); + declareProperty("DeltaRJet", m_DeltaRJet=0.7, "distance between jet and muon cluster"); + declareProperty("DeltaRTrk", m_DeltaRTrk=0.4, "distance between track and muon cluster"); + declareProperty("MuonCluLabel", m_featureLabel = "MuonRoICluster", "label for the MuonCluster feature in the HLT Navigation, for the xAOD::TrigCompositeContainer"); + declareProperty("MinJetEt", m_minJetEt = 30000.0, "minimum Et (MeV) to consider a jet for isolation"); + declareProperty("PtMinID", m_PtMinID = 5000.0, "minimum Pt (MeV) for ID track"); + + declareMonitoredVariable("RoIEta", m_CluEta); + declareMonitoredVariable("RoIPhi", m_CluPhi); + declareMonitoredVariable("NumClu", m_CluNum); + declareMonitoredVariable("NumJet", m_NumJet); + declareMonitoredVariable("NumTrk", m_NumTrk); + declareMonitoredStdContainer("RoiEta",m_RoiEta); + declareMonitoredStdContainer("RoiPhi",m_RoiPhi); + +} + +MuonClusterIsolation::~MuonClusterIsolation() { +} + +HLT::ErrorCode MuonClusterIsolation::hltInitialize() { + + msg() << MSG::INFO << "initialize()" << endmsg; + + msg() << MSG::INFO << "Parameters for MuonCluster:" << name() << endmsg; + msg() << MSG::INFO << "DeltaR : " << m_DeltaR << endmsg; + msg() << MSG::INFO << "DeltaRJet : " << m_DeltaRJet << endmsg; + msg() << MSG::INFO << "DeltaRTrk : " << m_DeltaRTrk << endmsg; + msg() << MSG::INFO << "MuonCluLabel : " << m_featureLabel << endmsg; + + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Retrieve service StoreGateSvc" << endmsg; + } + + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Timers are initializated here" << endmsg; + } + + m_Timers.push_back(addTimer("ClusterMuon_Initialization")); + m_Timers.push_back(addTimer("ClusterMuon_ClusterIsolation")); + m_Timers.push_back(addTimer("ClusterMuon_JetIsolation")); + m_Timers.push_back(addTimer("ClusterMuon_TrackIsolation")); + m_Timers.push_back(addTimer("ClusterMuon_Finalization")); + + declareMonitoredObject("Initialization", *(m_Timers[ITIMER_INIT]), + &TrigTimer::elapsed); + declareMonitoredObject("JetIsolation", *(m_Timers[ITIMER_JETS]), + &TrigTimer::elapsed); + declareMonitoredObject("TrackIsolation", *(m_Timers[ITIMER_TRACKS]), + &TrigTimer::elapsed); + declareMonitoredObject("Finalization", *(m_Timers[ITIMER_FINAL]), + &TrigTimer::elapsed); + + msg() << MSG::INFO << "initialize() success" << endmsg; + + return HLT::OK; +} + +HLT::ErrorCode MuonClusterIsolation::hltBeginRun() { + msg() << MSG::INFO << "hltBeginRun"<< endmsg; + return HLT::OK; +} + +HLT::ErrorCode MuonClusterIsolation::hltEndRun() { + msg() << MSG::INFO << "hltEndRun"<< endmsg; + return HLT::OK; +} + +HLT::ErrorCode MuonClusterIsolation::hltFinalize() { + msg() << MSG::INFO << "hltFinalize()" << endmsg; + return HLT::OK; +} + +HLT::ErrorCode MuonClusterIsolation::hltExecute(std::vector<std::vector<HLT::TriggerElement*> >& tes_in, unsigned int type_out) +{ + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "hltExecute()" << endmsg; + } + + clearEvent(); + + // CACHING + // first check whether we executed this instance before: + // CACHING / Update implemented since tag 00-00-19 / A.C. + // Caching disabled to avoid cross-talk between similar chains + // i.e. chains seeded by 2MU6 or 2MU10 + if (m_useCachedResult) { + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Executing this " << name() << " in cached mode" << endmsg; + } + + // Only count mu as an input TE (for seeding relation of navigation structure) + HLT::TEVec allTEs; + if ( (tes_in.size()>0) && (tes_in[0].size()>0) ){ + allTEs.push_back( tes_in[0][0] ); + } + if( tes_in.size() > 1) allTEs.push_back(tes_in.at(1).front()); + + // create output TE: + // Create an output TE seeded by the inputs + HLT::TriggerElement* outputTE = config()->getNavigation()->addNode(allTEs, type_out); + outputTE->setActiveState(true); + + // save (cached) feature to output TE: + m_config->getNavigation()->copyAllFeatures( m_cachedTE, outputTE ); + + return HLT::OK; + + } // end of caching + + if (timerSvc()) m_Timers[ITIMER_INIT]->stop(); + + if (msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "execHLTAlgorithm called" << endmsg; + + m_clu_feature = new xAOD::TrigCompositeContainer(); + xAOD::TrigCompositeAuxContainer compAux; + m_clu_feature->setStore(&compAux); + + // start monitoring + beforeExecMonitors().ignore(); + + HLT::TEVec allTEs; + + //check to make sure we have all the input trigger elements! + if ( (tes_in.size() < 2) ){ + msg() << MSG::ERROR << "input trigger element vector isn't the correct size! Aborting chain." + << endmsg; + return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); + } + + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "begin loop on TE and get muon RoI cluster" << endmsg; + } + // xAOD::TrigComposite *compClu = new xAOD::TrigComposite(); + //m_clu_feature->push_back(compClu); //add jets to the composite container + + const xAOD::TrigCompositeContainer* vectorOfClusters = 0; + std::vector<HLT::TriggerElement*>& inputClusterTE = tes_in.at(0); + HLT::ErrorCode ec = getFeature(inputClusterTE.front(), vectorOfClusters); + + if(ec!=HLT::OK) { + msg() << MSG::WARNING << " Failed to get the input cluster " << endmsg; + return ec; + } + + if(vectorOfClusters->size() > 1){ + msg() << MSG::WARNING << "Too many muon RoI clusters! Decision will be made based on the last one in the container." << endmsg; + } + + for (xAOD::TrigCompositeContainer::const_iterator clus = vectorOfClusters->begin(); clus != vectorOfClusters->end(); clus++) { + if(!(*clus)->getDetail("ClusterEta", m_CluEta)) { + msg() << MSG::ERROR << "Failed to get input cluster eta! Aborting chain." << endmsg; + return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); + } + if(!(*clus)->getDetail("ClusterPhi", m_CluPhi)) { + msg() << MSG::ERROR << "Failed to get input cluster phi! Aborting chain." << endmsg; + return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); + } + if(!(*clus)->getDetail("nRoIs", m_CluNum)) { + msg() << MSG::ERROR << "Failed to get input cluster nRoIs! Aborting chain." << endmsg; + return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); + } + } + + if (timerSvc()) m_Timers[ITIMER_INIT]->stop(); + if (timerSvc()) m_Timers[ITIMER_JETS]->start(); + + int njets = 0; + + const xAOD::JetContainer* vectorOfJets = 0; + + std::vector<HLT::TriggerElement*>& inputTE = tes_in.at(1); + ec = getFeature(inputTE.front(), vectorOfJets); + + if(ec!=HLT::OK) { + msg() << MSG::WARNING << " Failed to get the Jets " << endmsg; + return ec; + } + //Is this bad? What happens in events with zero jets? + if(vectorOfJets==0) { + if (msgLvl() <= MSG::WARNING) + msg() << MSG::WARNING << "Missing feature, no jets in this event!" << endmsg; + return HLT::MISSING_FEATURE; + } + + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "The number of Jets attached to the TE is " << vectorOfJets->size() << endmsg; + } + + for (xAOD::JetContainer::const_iterator jet = vectorOfJets->begin(); jet != vectorOfJets->end(); jet++) { + + double etjet = (*jet)->p4().Et(); + if(etjet <= m_minJetEt) continue; + + double jetEMF = (*jet)->getAttribute<float>("EMFrac"); + double jetEta = (*jet)->eta(); + double jetPhi = (*jet)->phi(); + double erat = -99999999.; + + double delta_eta = m_CluEta - jetEta; + double delta_phi = HLT::wrapPhi(m_CluPhi - jetPhi); + + double dR = sqrt( (delta_eta*delta_eta) + (delta_phi*delta_phi) ); + + if (msgLvl() <= MSG::DEBUG){ + msg() << MSG::DEBUG << "HLT jet /eta=" << jetEta << " /phi= " << jetPhi << "/Et= " << etjet << "/DR= " << dR << endmsg; + } + if (dR<m_DeltaRJet) { + double zero = 0.; + double one = 1.; + if (CxxUtils::fpcompare::greater(jetEMF,zero)){ + if(CxxUtils::fpcompare::greater_equal(jetEMF,one)){ erat = -999.;} + else { erat = log10(double(1./jetEMF - 1.));} + } else { + erat = 999; + } + if (msgLvl() <= MSG::DEBUG){ + msg() << MSG::DEBUG << "Jet log10 of had/em energy ratio: " << erat << endmsg; + } + if (erat<=0.5) { + njets++; + } + } + } + + m_NumJet = njets; + + if (msgLvl() <= MSG::DEBUG){ + msg() << MSG::DEBUG << "Found " << m_NumJet << " Jets with Log(H/E)<1.0 matched to the Muon RoI Cluster" << endmsg; + } + + if (timerSvc()) m_Timers[ITIMER_JETS]->stop(); + + if (timerSvc()) m_Timers[ITIMER_TRACKS]->start(); + + if (msgLvl() <= MSG::DEBUG) + msg() << MSG::DEBUG << "Accessing the ID track collection" << endmsg; + + int ntrk = 0; + + if (msgLvl() <= MSG::DEBUG){ + msg() << MSG::DEBUG << "there are: " << tes_in.at(0).size() << " trigger elements with track collections." << + " This should be equal to the number of MU10 RoIs" << endmsg; + } + + int nTEs = 0; + + for (HLT::TEVec::const_iterator it = tes_in.at(0).begin();it != tes_in.at(0).end(); ++it) { + nTEs++; + if (msgLvl() <= MSG::DEBUG){ msg() << MSG::DEBUG << "trigger element: " << nTEs << " of tes_in.at(0) "<< endmsg;} + + std::vector<const xAOD::TrackParticleContainer*> vectorOfTrackCollections; + HLT::ErrorCode ect = getFeatures(*it,vectorOfTrackCollections, "InDetTrigTrackingxAODCnv_Muon_IDTrig"); + + if( ect!=HLT::OK ) { + if (msgLvl() <= MSG::DEBUG){ + msg() << MSG::DEBUG << " Failed to get tracks" << endmsg; + } + } else { + if (msgLvl() <= MSG::DEBUG){ + msg() << MSG::DEBUG << " Got " << vectorOfTrackCollections.size() << " collections of tracks " << endmsg; + } + std::vector<const xAOD::TrackParticleContainer*>::iterator + theTrackColl = vectorOfTrackCollections.begin(), + endTrackColl = vectorOfTrackCollections.end(); + + for( ; theTrackColl != endTrackColl; theTrackColl++) { + + xAOD::TrackParticleContainer::const_iterator + track = (*theTrackColl)->begin(), + lasttrack = (*theTrackColl)->end(); + + for(; track !=lasttrack; track++ ) { + + float pT = fabs(TMath::Sin((*track)->theta())/(*track)->qOverP()); + + if ( pT <= m_PtMinID) continue; + double eta = (*track)->eta(); + double phi = (*track)->phi0(); + if(msgLvl() <= MSG::DEBUG){ + msg() << MSG::DEBUG << "track with " << "pt=" << pT << ", eta=" << eta << ", phi=" << phi << endmsg; + } + + double delta_etat = m_CluEta - eta; + double delta_phit = HLT::wrapPhi(m_CluPhi - phi); + + double dRt = sqrt( (delta_etat*delta_etat) + (delta_phit*delta_phit) ); + if (dRt<m_DeltaRTrk) { + ntrk++; + } + } + } + } + } //end loop over input track TEs + + //monitored variable + m_NumTrk = ntrk; + + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Found " << m_NumTrk << " tracks around the Muon Cluster direction (inaccurate, often duplicate tracks in container)" << endmsg; + } + + if (timerSvc()) m_Timers[ITIMER_TRACKS]->stop(); + + if (timerSvc()) m_Timers[ITIMER_FINAL]->start(); + + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Create an output TE seeded by the input" << endmsg; + } + + xAOD::TrigComposite *compClu = new xAOD::TrigComposite(); + m_clu_feature->push_back(compClu); //add cluster to the composite container + compClu->setName("Cluster"); + compClu->setDetail( "nTrks", m_NumTrk); + compClu->setDetail( "nJets", m_NumJet); + compClu->setDetail( "ClusterEta", m_CluEta); + compClu->setDetail( "ClusterPhi", m_CluPhi); + compClu->setDetail( "nRoIs", m_CluNum); + + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Created a new cluster that has the isolation parameters" << endmsg; + } + //add the track container + if(tes_in.at(0).size() > 0 ){ + allTEs.push_back(tes_in.at(0).back()); + } else { + msg() << MSG::ERROR << "can't add the track container! Aborting chain." << endmsg; + return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); + } + //add the jet container + if( tes_in.at(1).size() > 0){ + allTEs.push_back(tes_in.at(1).front()); + } else { + msg() << MSG::ERROR << "can't add the jet container! Aborting chain." << endmsg; + return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); + } + + // create output TE: + // Create an output TE seeded by the inputs + HLT::TriggerElement* outputTE = config()->getNavigation()->addNode(allTEs, type_out); + outputTE->setActiveState(true); + + // save feature to output TE: + HLT::ErrorCode hltStatus = attachFeature(outputTE, m_clu_feature, m_featureLabel); + + if ( hltStatus != HLT::OK ) { + msg() << MSG::ERROR << "Write of MuonRoICluster TrigCompositeContainer feature into outputTE failed" << endmsg; + return hltStatus; + } + + if (timerSvc()) m_Timers[ITIMER_FINAL]->stop(); + + // CACHING + // if we got here, everything was okay. so, we cache the feature for further execution of this instance in e.g. other MET Sequences: + // m_useCachedResult = true; + + // CACHING / Update implemented since tag 00-00-19 / A.C. + // Caching disabled to avoid cross-talk between similar chains + // i.e. chains seeded by 2MU6 or 2MU10 + m_useCachedResult = false; + m_cachedTE = outputTE; + + //---------------------------------------------------------------- + // REGTEST + //---------------------------------------------------------------- + if (msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << " REGTEST \t Cluster with : " << m_CluNum << " LVL1-Roi" << endmsg; + msg() << MSG::DEBUG << " REGTEST \t Cluster Eta " << m_CluEta << " Cluster Phi " << m_CluPhi << endmsg; + msg() << MSG::DEBUG << " REGTEST \t with " << m_NumJet << " jets in the cluster cone " << endmsg; + msg() << MSG::DEBUG << " REGTEST \t and with " << m_NumTrk << " tracks around the cluster direction " << endmsg; + } + //---------------------------------------------------------------- + + afterExecMonitors().ignore(); + + return HLT::OK; +} + + +void MuonClusterIsolation::clearEvent() { + m_CluEta = 0.; + m_CluPhi = 0.; + m_CluNum = 0; + m_NumJet = -1; + m_NumTrk = -1; +} + diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/TrigBHremoval.cxx b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/TrigBHremoval.cxx index 2c9c51b20a45b00ce576459f4b6fb16460a67f26..19739953c1f2aa4480fd8436e1c4e9528d30f913 100755 --- a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/TrigBHremoval.cxx +++ b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/TrigBHremoval.cxx @@ -55,19 +55,19 @@ TrigBHremoval::TrigBHremoval(const std::string & name, ISvcLocator* pSvcLocator) HLT::ErrorCode TrigBHremoval::hltInitialize() { if (msgLvl() <= MSG::INFO) - msg() << MSG::INFO << "Initializing TrigBHremoval, version " << PACKAGE_VERSION << endreq; + msg() << MSG::INFO << "Initializing TrigBHremoval, version " << PACKAGE_VERSION << endmsg; //* declareProperty overview *// if (msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "declareProperty review:" << endreq; - msg() << MSG::DEBUG << " JetInputKey = " << m_jetInputKey << endreq; - msg() << MSG::DEBUG << " JetOutputKey = " << m_jetOutputKey << endreq; - msg() << MSG::DEBUG << " EtaHalfWidth = " << m_etaHalfWidth << endreq; - msg() << MSG::DEBUG << " PhiHalfWidth = " << m_phiHalfWidth << endreq; - msg() << MSG::DEBUG << " ZHalfWidth = " << m_zHalfWidth << endreq; - msg() << MSG::DEBUG << " MinJetEt = " << m_minJetEt << endreq; - msg() << MSG::DEBUG << " MaxJetEta = " << m_maxJetEta << endreq; - msg() << MSG::DEBUG << " MinLogRatio = " << m_minLogRatio << endreq; + msg() << MSG::DEBUG << "declareProperty review:" << endmsg; + msg() << MSG::DEBUG << " JetInputKey = " << m_jetInputKey << endmsg; + msg() << MSG::DEBUG << " JetOutputKey = " << m_jetOutputKey << endmsg; + msg() << MSG::DEBUG << " EtaHalfWidth = " << m_etaHalfWidth << endmsg; + msg() << MSG::DEBUG << " PhiHalfWidth = " << m_phiHalfWidth << endmsg; + msg() << MSG::DEBUG << " ZHalfWidth = " << m_zHalfWidth << endmsg; + msg() << MSG::DEBUG << " MinJetEt = " << m_minJetEt << endmsg; + msg() << MSG::DEBUG << " MaxJetEta = " << m_maxJetEta << endmsg; + msg() << MSG::DEBUG << " MinLogRatio = " << m_minLogRatio << endmsg; } return HLT::OK; @@ -85,11 +85,11 @@ TrigBHremoval::~TrigBHremoval(){} HLT::ErrorCode TrigBHremoval::hltExecute(std::vector<std::vector<HLT::TriggerElement*> >& inputTEs, unsigned int output) { - if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "Running TrigBHremoval::hltExecute" << endreq; + if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "Running TrigBHremoval::hltExecute" << endmsg; beforeExecMonitors().ignore(); - if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << " inputTEs.size() " << inputTEs.size() << endreq; + if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << " inputTEs.size() " << inputTEs.size() << endmsg; // ----------------------- // Retreive jets @@ -97,10 +97,10 @@ HLT::ErrorCode TrigBHremoval::hltExecute(std::vector<std::vector<HLT::TriggerEle std::vector<HLT::TriggerElement*>& jetTE = inputTEs.at(1); - if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << " jetTE.size() " << jetTE.size() << endreq; + if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << " jetTE.size() " << jetTE.size() << endmsg; if (jetTE.size() == 0) { - msg() << MSG::WARNING << "Got an empty inputTE (jets)" << endreq; + msg() << MSG::WARNING << "Got an empty inputTE (jets)" << endmsg; afterExecMonitors().ignore(); return HLT::MISSING_FEATURE; } @@ -109,12 +109,12 @@ HLT::ErrorCode TrigBHremoval::hltExecute(std::vector<std::vector<HLT::TriggerEle HLT::ErrorCode statusJets = getFeature(jetTE.front(), jets); if (statusJets != HLT::OK) { - if (msgLvl() <= MSG::WARNING) msg() << MSG::WARNING << "Failed to retrieve features (jets)" << endreq; + if (msgLvl() <= MSG::WARNING) msg() << MSG::WARNING << "Failed to retrieve features (jets)" << endmsg; return HLT::NAV_ERROR; } if(jets==0) { - if (msgLvl() <= MSG::WARNING) msg() << MSG::WARNING << "Missing feature (jets)." << endreq; + if (msgLvl() <= MSG::WARNING) msg() << MSG::WARNING << "Missing feature (jets)." << endmsg; return HLT::MISSING_FEATURE; } @@ -126,15 +126,15 @@ HLT::ErrorCode TrigBHremoval::hltExecute(std::vector<std::vector<HLT::TriggerEle std::vector<const CaloCellContainer*> vectorOfCellContainers; if(getFeatures(cellsTE.front(), vectorOfCellContainers, "") != HLT::OK) { - msg() << MSG::WARNING << "Failed to get TrigCells" << endreq; + msg() << MSG::WARNING << "Failed to get TrigCells" << endmsg; return HLT::OK; } - if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "Got vector with " << vectorOfCellContainers.size() << " CellContainers" << endreq; + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "Got vector with " << vectorOfCellContainers.size() << " CellContainers" << endmsg; // if no containers were found, just leave the vector empty and leave if ( vectorOfCellContainers.size() < 1) { - msg() << MSG::ERROR << "No cells to analyse, leaving!" << endreq; + msg() << MSG::ERROR << "No cells to analyse, leaving!" << endmsg; return HLT::OK; } @@ -142,11 +142,11 @@ HLT::ErrorCode TrigBHremoval::hltExecute(std::vector<std::vector<HLT::TriggerEle const CaloCellContainer* theCellCont = vectorOfCellContainers.back(); if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << " Retrieved a Cell Container of Size= " << theCellCont->size() << endreq; + msg() << MSG::DEBUG << " Retrieved a Cell Container of Size= " << theCellCont->size() << endmsg; } if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Found " << jets->size() << " jets, creating corresponding RoIs" << endreq; + msg() << MSG::DEBUG << "Found " << jets->size() << " jets, creating corresponding RoIs" << endmsg; HLT::TriggerElement* initialTE = config()->getNavigation()->getInitialNode(); @@ -171,17 +171,17 @@ HLT::ErrorCode TrigBHremoval::hltExecute(std::vector<std::vector<HLT::TriggerEle /* if (jetEt < m_minJetEt) { if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Jet "<< i << " below the " << m_minJetEt << " GeV threshold; Et " << jetEt << "; skipping this jet." << endreq; + msg() << MSG::DEBUG << "Jet "<< i << " below the " << m_minJetEt << " GeV threshold; Et " << jetEt << "; skipping this jet." << endmsg; continue; } if (fabs(jetEta) > m_maxJetEta) { if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Jet "<< i << " outside the |eta| < 2.5 requirement; Eta = " << jetEta << "; skipping this jet." << endreq; + msg() << MSG::DEBUG << "Jet "<< i << " outside the |eta| < 2.5 requirement; Eta = " << jetEta << "; skipping this jet." << endmsg; continue; } if ( jetRatio < m_minLogRatio) { if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Jet "<< i << " below the " << m_minLogRatio << " threshold for the log-ratio cut; logRatio = " << jetRatio << "; skipping this jet." << endreq; + msg() << MSG::DEBUG << "Jet "<< i << " below the " << m_minLogRatio << " threshold for the log-ratio cut; logRatio = " << jetRatio << "; skipping this jet." << endmsg; continue; } */ @@ -214,7 +214,7 @@ HLT::ErrorCode TrigBHremoval::hltExecute(std::vector<std::vector<HLT::TriggerEle float c = 299.792458;//mm per ns float r = sqrt(x*x + y*y); if((fabs(t - (z-sqrt(z*z + r*r))/c) < 5.0) || (fabs(t - (-z-sqrt(z*z + r*r))/c) < 5.0)){ - msg() << MSG::DEBUG << " cell is tile; cell E = " << (*celliter)->energy() << " cell phi = " << (*celliter)->phi() << " cell eta = " << (*celliter)->eta() << " cell r = " << r << endreq; + msg() << MSG::DEBUG << " cell is tile; cell E = " << (*celliter)->energy() << " cell phi = " << (*celliter)->phi() << " cell eta = " << (*celliter)->eta() << " cell r = " << r << endmsg; if(r<2200){ countCell_layer[0]++;}// layer=0;} else if(r>=2200 && r<2600){ countCell_layer[1]++;}// layer=1;} @@ -232,7 +232,7 @@ HLT::ErrorCode TrigBHremoval::hltExecute(std::vector<std::vector<HLT::TriggerEle if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Jet "<< i << "; Et " << jetEt << "; eta "<< jetEta << "; phi " << jetPhi <<"; logRatio " << jetRatio << "; LoF Cells " << countCaloCell << endreq; + msg() << MSG::DEBUG << "Jet "<< i << "; Et " << jetEt << "; eta "<< jetEta << "; phi " << jetPhi <<"; logRatio " << jetRatio << "; LoF Cells " << countCaloCell << endmsg; // Create an output TE seeded by an empty vector HLT::TriggerElement* outputTE = config()->getNavigation()->addNode( initialTE, output ); @@ -252,7 +252,7 @@ HLT::ErrorCode TrigBHremoval::hltExecute(std::vector<std::vector<HLT::TriggerEle HLT::ErrorCode hltStatus = attachFeature(outputTE, roi, m_jetOutputKey); if ( hltStatus != HLT::OK ) { - msg() << MSG::ERROR << "Failed to attach TrigRoiDescriptor as feature " << *roi << endreq; + msg() << MSG::ERROR << "Failed to attach TrigRoiDescriptor as feature " << *roi << endmsg; return hltStatus; } @@ -273,13 +273,13 @@ HLT::ErrorCode TrigBHremoval::hltExecute(std::vector<std::vector<HLT::TriggerEle trigInfoCellLoF->set("CellLoF", countCaloCell); HLT::ErrorCode hltCellStatus = attachFeature(outputTE, trigInfoCellLoF, "CellLoFInfo"); if (hltCellStatus != HLT::OK) { - msg() << MSG::ERROR << "Failed to attach TrigOperationalInfo (number of calo cells) as feature" << endreq; + msg() << MSG::ERROR << "Failed to attach TrigOperationalInfo (number of calo cells) as feature" << endmsg; return hltCellStatus; } hltStatus = attachFeature(outputTE, jc, m_jetOutputKey); if (hltStatus != HLT::OK) { - msg() << MSG::ERROR << "Failed to attach xAOD::JetContainer (" << m_jetOutputKey << ") as feature jet eta, phi " << jet->eta() << ", " << jet->phi() << endreq; + msg() << MSG::ERROR << "Failed to attach xAOD::JetContainer (" << m_jetOutputKey << ") as feature jet eta, phi " << jet->eta() << ", " << jet->phi() << endmsg; return hltStatus; } } @@ -296,7 +296,7 @@ HLT::ErrorCode TrigBHremoval::hltExecute(std::vector<std::vector<HLT::TriggerEle HLT::ErrorCode TrigBHremoval::hltFinalize() { if ( msgLvl() <= MSG::INFO ) - msg() << MSG::INFO << "in finalize()" << endreq; + msg() << MSG::INFO << "in finalize()" << endmsg; return HLT::OK; } diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/TrigJetSplitter.cxx b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/TrigJetSplitter.cxx index dc486313ef6a868da20b5b6935cfae9f34a7f35c..b4fb8e0c98cea9226a69b51e3497944be2abe95d 100755 --- a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/TrigJetSplitter.cxx +++ b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/TrigJetSplitter.cxx @@ -57,21 +57,21 @@ TrigJetSplitter::TrigJetSplitter(const std::string & name, ISvcLocator* pSvcLoca HLT::ErrorCode TrigJetSplitter::hltInitialize() { if (msgLvl() <= MSG::INFO) - msg() << MSG::INFO << "Initializing TrigJetSplitter, version " << PACKAGE_VERSION << endreq; + msg() << MSG::INFO << "Initializing TrigJetSplitter, version " << PACKAGE_VERSION << endmsg; //* declareProperty overview *// if (msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "declareProperty review:" << endreq; - msg() << MSG::DEBUG << " JetInputKey = " << m_jetInputKey << endreq; - msg() << MSG::DEBUG << " JetOutputKey = " << m_jetOutputKey << endreq; - msg() << MSG::DEBUG << " EtaHalfWidth = " << m_etaHalfWidth << endreq; - msg() << MSG::DEBUG << " PhiHalfWidth = " << m_phiHalfWidth << endreq; - msg() << MSG::DEBUG << " ZHalfWidth = " << m_zHalfWidth << endreq; - msg() << MSG::DEBUG << " MinJetEt = " << m_minJetEt << endreq; - msg() << MSG::DEBUG << " MaxJetEta = " << m_maxJetEta << endreq; - msg() << MSG::DEBUG << " LogRatio = " << m_logRatio << endreq; - msg() << MSG::DEBUG << " PUFixLogRatio = " << m_pufixLogRatio << endreq; - msg() << MSG::DEBUG << " ReversedCut = " << m_reversedCut << endreq; + msg() << MSG::DEBUG << "declareProperty review:" << endmsg; + msg() << MSG::DEBUG << " JetInputKey = " << m_jetInputKey << endmsg; + msg() << MSG::DEBUG << " JetOutputKey = " << m_jetOutputKey << endmsg; + msg() << MSG::DEBUG << " EtaHalfWidth = " << m_etaHalfWidth << endmsg; + msg() << MSG::DEBUG << " PhiHalfWidth = " << m_phiHalfWidth << endmsg; + msg() << MSG::DEBUG << " ZHalfWidth = " << m_zHalfWidth << endmsg; + msg() << MSG::DEBUG << " MinJetEt = " << m_minJetEt << endmsg; + msg() << MSG::DEBUG << " MaxJetEta = " << m_maxJetEta << endmsg; + msg() << MSG::DEBUG << " LogRatio = " << m_logRatio << endmsg; + msg() << MSG::DEBUG << " PUFixLogRatio = " << m_pufixLogRatio << endmsg; + msg() << MSG::DEBUG << " ReversedCut = " << m_reversedCut << endmsg; } return HLT::OK; @@ -89,14 +89,14 @@ TrigJetSplitter::~TrigJetSplitter(){} HLT::ErrorCode TrigJetSplitter::hltExecute(std::vector<std::vector<HLT::TriggerElement*> >& inputTEs, unsigned int output) { - if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "Running TrigJetSplitter::hltExecute" << endreq; + if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "Running TrigJetSplitter::hltExecute" << endmsg; beforeExecMonitors().ignore(); - if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << " inputTEs.size() " << inputTEs.size() << endreq; + if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << " inputTEs.size() " << inputTEs.size() << endmsg; if (inputTEs.size() != 1) { - msg() << MSG::WARNING << "Wrong number of input TEs" << endreq; + msg() << MSG::WARNING << "Wrong number of input TEs" << endmsg; afterExecMonitors().ignore(); return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } @@ -107,10 +107,10 @@ HLT::ErrorCode TrigJetSplitter::hltExecute(std::vector<std::vector<HLT::TriggerE std::vector<HLT::TriggerElement*>& jetTE = inputTEs.at(0); - if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << " jetTE.size() " << jetTE.size() << endreq; + if (msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << " jetTE.size() " << jetTE.size() << endmsg; if (jetTE.size() == 0) { - msg() << MSG::WARNING << "Got an empty inputTE (jets)" << endreq; + msg() << MSG::WARNING << "Got an empty inputTE (jets)" << endmsg; afterExecMonitors().ignore(); return HLT::MISSING_FEATURE; } @@ -119,12 +119,12 @@ HLT::ErrorCode TrigJetSplitter::hltExecute(std::vector<std::vector<HLT::TriggerE HLT::ErrorCode statusJets = getFeature(jetTE.front(), jets); if (statusJets != HLT::OK) { - if (msgLvl() <= MSG::WARNING) msg() << MSG::WARNING << "Failed to retrieve features (jets)" << endreq; + if (msgLvl() <= MSG::WARNING) msg() << MSG::WARNING << "Failed to retrieve features (jets)" << endmsg; return HLT::NAV_ERROR; } if(jets==0) { - if (msgLvl() <= MSG::WARNING) msg() << MSG::WARNING << "Missing feature (jets)." << endreq; + if (msgLvl() <= MSG::WARNING) msg() << MSG::WARNING << "Missing feature (jets)." << endmsg; return HLT::MISSING_FEATURE; } @@ -136,15 +136,15 @@ HLT::ErrorCode TrigJetSplitter::hltExecute(std::vector<std::vector<HLT::TriggerE std::vector<const CaloCellContainer*> vectorOfCellContainers; if(getFeatures(jetTE.front(), vectorOfCellContainers, "") != HLT::OK) { - msg() << MSG::WARNING << "Failed to get TrigCells" << endreq; + msg() << MSG::WARNING << "Failed to get TrigCells" << endmsg; return HLT::OK; } - if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "Got vector with " << vectorOfCellContainers.size() << " CellContainers" << endreq; + if(msgLvl() <= MSG::DEBUG) msg() << MSG::DEBUG << "Got vector with " << vectorOfCellContainers.size() << " CellContainers" << endmsg; // if no containers were found, just leave the vector empty and leave if ( vectorOfCellContainers.size() < 1) { - msg() << MSG::ERROR << "No cells to analyse, leaving!" << endreq; + msg() << MSG::ERROR << "No cells to analyse, leaving!" << endmsg; return HLT::OK; } @@ -152,11 +152,11 @@ HLT::ErrorCode TrigJetSplitter::hltExecute(std::vector<std::vector<HLT::TriggerE const CaloCellContainer* theCellCont = vectorOfCellContainers.back(); if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << " Retrieved a Cell Container of Size= " << theCellCont->size() << endreq; + msg() << MSG::DEBUG << " Retrieved a Cell Container of Size= " << theCellCont->size() << endmsg; } */ if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Found " << jets->size() << " jets, creating corresponding RoIs" << endreq; + msg() << MSG::DEBUG << "Found " << jets->size() << " jets, creating corresponding RoIs" << endmsg; HLT::TriggerElement* initialTE = config()->getNavigation()->getInitialNode(); @@ -181,18 +181,18 @@ HLT::ErrorCode TrigJetSplitter::hltExecute(std::vector<std::vector<HLT::TriggerE if (jetEt < m_minJetEt) { if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Jet "<< i << " below the " << m_minJetEt << " GeV threshold; Et " << jetEt << "; skipping this jet." << endreq; + msg() << MSG::DEBUG << "Jet "<< i << " below the " << m_minJetEt << " GeV threshold; Et " << jetEt << "; skipping this jet." << endmsg; continue; } if (fabs(jetEta) > m_maxJetEta) { if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Jet "<< i << " outside the |eta| < 2.5 requirement; Eta = " << jetEta << "; skipping this jet." << endreq; + msg() << MSG::DEBUG << "Jet "<< i << " outside the |eta| < 2.5 requirement; Eta = " << jetEta << "; skipping this jet." << endmsg; continue; } if(!m_reversedCut) { if ( jetRatio < m_pufixLogRatio) { if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Jet "<< i << " below the " << m_pufixLogRatio << " threshold for the log-ratio cut; logRatio = " << jetRatio << "; skipping this jet." << endreq; + msg() << MSG::DEBUG << "Jet "<< i << " below the " << m_pufixLogRatio << " threshold for the log-ratio cut; logRatio = " << jetRatio << "; skipping this jet." << endmsg; continue; } @@ -200,7 +200,7 @@ HLT::ErrorCode TrigJetSplitter::hltExecute(std::vector<std::vector<HLT::TriggerE if ( jetRatio < m_logRatio ) { if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Jet "<< i << " is below the " << m_logRatio << " threshold for the log-ratio cut and above the " << m_pufixLogRatio << " threshold; logRatio = " << jetRatio << "; performing pileup removal." << endreq; + msg() << MSG::DEBUG << "Jet "<< i << " is below the " << m_logRatio << " threshold for the log-ratio cut and above the " << m_pufixLogRatio << " threshold; logRatio = " << jetRatio << "; performing pileup removal." << endmsg; size_t nClusters = jet->numConstituents(); double clusterPU_sumEEM = 0; double clusterPU_sumE = 0; @@ -258,13 +258,13 @@ HLT::ErrorCode TrigJetSplitter::hltExecute(std::vector<std::vector<HLT::TriggerE if ( pufixLR < m_logRatio) { if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Jet "<< i << " is still below the " << m_logRatio << " threshold for the log-ratio cut; recalculated logRatio = " << pufixLR << "; skipping this jet." << endreq; + msg() << MSG::DEBUG << "Jet "<< i << " is still below the " << m_logRatio << " threshold for the log-ratio cut; recalculated logRatio = " << pufixLR << "; skipping this jet." << endmsg; continue; } if (msgLvl() <= MSG::DEBUG){ - msg() << MSG::DEBUG << "Jet "<< i << " old logRatio: " << jetRatio << " new logRatio: " << pufixLR << endreq; - msg() << MSG::DEBUG << "This is the jet with ET: " << jetEt << " eta: " << jetEta << " phi: " << jetPhi << endreq; + msg() << MSG::DEBUG << "Jet "<< i << " old logRatio: " << jetRatio << " new logRatio: " << pufixLR << endmsg; + msg() << MSG::DEBUG << "This is the jet with ET: " << jetEt << " eta: " << jetEta << " phi: " << jetPhi << endmsg; } } jetRatio = pufixLR; @@ -272,7 +272,7 @@ HLT::ErrorCode TrigJetSplitter::hltExecute(std::vector<std::vector<HLT::TriggerE else { if ( jetRatio > m_logRatio) { if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Jet "<< i << " above the " << m_logRatio << " threshold for the log-ratio cut; logRatio = " << jetRatio << "; skipping this jet." << endreq; + msg() << MSG::DEBUG << "Jet "<< i << " above the " << m_logRatio << " threshold for the log-ratio cut; logRatio = " << jetRatio << "; skipping this jet." << endmsg; continue; } } @@ -302,7 +302,7 @@ HLT::ErrorCode TrigJetSplitter::hltExecute(std::vector<std::vector<HLT::TriggerE float c = 299.792458;//mm per ns float r = sqrt(x*x + y*y); if((fabs(t - (z-sqrt(z*z + r*r))/c) < 5.0) || (fabs(t - (-z-sqrt(z*z + r*r))/c) < 5.0)){ - msg() << MSG::DEBUG << " cell E = " << (*celliter)->energy() << " cell phi = " << (*celliter)->phi() << " cell eta = " << (*celliter)->eta() << " cell r = " << r << endreq; + msg() << MSG::DEBUG << " cell E = " << (*celliter)->energy() << " cell phi = " << (*celliter)->phi() << " cell eta = " << (*celliter)->eta() << " cell r = " << r << endmsg; countCaloCell++; } } @@ -311,7 +311,7 @@ HLT::ErrorCode TrigJetSplitter::hltExecute(std::vector<std::vector<HLT::TriggerE } if (msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << "Jet "<< i << "; Et " << jetEt << "; eta "<< jetEta << "; phi " << jetPhi <<"; logRatio " << jetRatio << "; LoF Cells " << countCaloCell << endreq; + msg() << MSG::DEBUG << "Jet "<< i << "; Et " << jetEt << "; eta "<< jetEta << "; phi " << jetPhi <<"; logRatio " << jetRatio << "; LoF Cells " << countCaloCell << endmsg; */ // Create an output TE seeded by an empty vector @@ -332,7 +332,7 @@ HLT::ErrorCode TrigJetSplitter::hltExecute(std::vector<std::vector<HLT::TriggerE HLT::ErrorCode hltStatus = attachFeature(outputTE, roi, m_jetOutputKey); if ( hltStatus != HLT::OK ) { - msg() << MSG::ERROR << "Failed to attach TrigRoiDescriptor as feature " << *roi << endreq; + msg() << MSG::ERROR << "Failed to attach TrigRoiDescriptor as feature " << *roi << endmsg; return hltStatus; } @@ -353,13 +353,13 @@ HLT::ErrorCode TrigJetSplitter::hltExecute(std::vector<std::vector<HLT::TriggerE trigInfoCellLoF->set("CellLoF", countCaloCell); HLT::ErrorCode hltCellStatus = attachFeature(outputTE, trigInfoCellLoF, "CellLoFInfo"); if (hltCellStatus != HLT::OK) { - msg() << MSG::ERROR << "Failed to attach TrigOperationalInfo (number of calo cells) as feature" << endreq; + msg() << MSG::ERROR << "Failed to attach TrigOperationalInfo (number of calo cells) as feature" << endmsg; return hltCellStatus; } hltStatus = attachFeature(outputTE, jc, m_jetOutputKey); if (hltStatus != HLT::OK) { - msg() << MSG::ERROR << "Failed to attach xAOD::JetContainer (" << m_jetOutputKey << ") as feature jet eta, phi " << jet->eta() << ", " << jet->phi() << endreq; + msg() << MSG::ERROR << "Failed to attach xAOD::JetContainer (" << m_jetOutputKey << ") as feature jet eta, phi " << jet->eta() << ", " << jet->phi() << endmsg; return hltStatus; } } @@ -376,7 +376,7 @@ HLT::ErrorCode TrigJetSplitter::hltExecute(std::vector<std::vector<HLT::TriggerE HLT::ErrorCode TrigJetSplitter::hltFinalize() { if ( msgLvl() <= MSG::INFO ) - msg() << MSG::INFO << "in finalize()" << endreq; + msg() << MSG::INFO << "in finalize()" << endmsg; return HLT::OK; } diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/TrigMuonJetFex.cxx b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/TrigMuonJetFex.cxx index fa88dac1cb2f424b6e3bcaace23e56e832ad1f4f..1ce484fcf87ca517383228828b892b2541b0a507 100644 --- a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/TrigMuonJetFex.cxx +++ b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/TrigMuonJetFex.cxx @@ -41,18 +41,18 @@ HLT::ErrorCode TrigMuonJetFex::hltInitialize() if (m_instance == "L2"){ if (msgLvl() <= MSG::INFO) { - msg() << MSG::INFO << " ***** TrigL2MuonJetFex initialization on L2 ***** " << endreq; + msg() << MSG::INFO << " ***** TrigL2MuonJetFex initialization on L2 ***** " << endmsg; } } if (m_instance == "EF"){ if (msgLvl() <= MSG::INFO) { - msg() << MSG::INFO << " ***** TrigMuonJetFex initialization on EF ***** " << endreq; + msg() << MSG::INFO << " ***** TrigMuonJetFex initialization on EF ***** " << endmsg; } } if(msgLvl() <= MSG::DEBUG) - msg() << MSG::DEBUG << " Initialization completed successfully" << endreq; + msg() << MSG::DEBUG << " Initialization completed successfully" << endmsg; return HLT::OK; } @@ -66,11 +66,11 @@ HLT::ErrorCode TrigMuonJetFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigger if (m_instance == "L2"){ if ( msgLvl() <= MSG::DEBUG ) - msg() << MSG::DEBUG << " ***** Executing TrigMuonJetFex on L2 ***** " << endreq; + msg() << MSG::DEBUG << " ***** Executing TrigMuonJetFex on L2 ***** " << endmsg; if (inputTE.size() != 2) { - msg() << MSG::ERROR << "Number of input TEs is " << inputTE.size() << " and not 2. Configuration problem." << endreq; + msg() << MSG::ERROR << "Number of input TEs is " << inputTE.size() << " and not 2. Configuration problem." << endmsg; return HLT::BAD_JOB_SETUP; } @@ -80,7 +80,7 @@ HLT::ErrorCode TrigMuonJetFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigger if (m_instance == "EF"){ if ( msgLvl() <= MSG::DEBUG ){ - msg() << MSG::DEBUG << " ***** Executing TrigMuonJetFex on EF ***** " << endreq; + msg() << MSG::DEBUG << " ***** Executing TrigMuonJetFex on EF ***** " << endmsg; } } @@ -95,7 +95,7 @@ HLT::ErrorCode TrigMuonJetFex::hltExecute(HLT::TEConstVec& inputTE, HLT::Trigger HLT::ErrorCode TrigMuonJetFex::hltFinalize() { - msg() << MSG::INFO << " ***** Finalizing TrigMuonJetFex ***** " << endreq; + msg() << MSG::INFO << " ***** Finalizing TrigMuonJetFex ***** " << endmsg; return HLT::OK; } diff --git a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/components/TrigL2LongLivedParticles_entries.cxx b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/components/TrigL2LongLivedParticles_entries.cxx index 0d2df6c7f42be0801c6a95b6bebab40e6ab54d1a..c1fd420c55c354de2602d5f65c573fce36675b5e 100755 --- a/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/components/TrigL2LongLivedParticles_entries.cxx +++ b/Trigger/TrigAlgorithms/TrigL2LongLivedParticles/src/components/TrigL2LongLivedParticles_entries.cxx @@ -1,16 +1,19 @@ #include "TrigL2LongLivedParticles/MuonCluster.h" +#include "TrigL2LongLivedParticles/MuonClusterIsolation.h" #include "TrigL2LongLivedParticles/TrigMuonJetFex.h" #include "TrigL2LongLivedParticles/TrigJetSplitter.h" #include "TrigL2LongLivedParticles/TrigBHremoval.h" #include "GaudiKernel/DeclareFactoryEntries.h" DECLARE_ALGORITHM_FACTORY( MuonCluster ) +DECLARE_ALGORITHM_FACTORY( MuonClusterIsolation ) DECLARE_ALGORITHM_FACTORY( TrigMuonJetFex ) DECLARE_ALGORITHM_FACTORY( TrigJetSplitter ) DECLARE_ALGORITHM_FACTORY( TrigBHremoval ) DECLARE_FACTORY_ENTRIES( TrigL2LongLivedParticles ) { DECLARE_ALGORITHM( MuonCluster ) + DECLARE_ALGORITHM( MuonClusterIsolation ) DECLARE_ALGORITHM( TrigMuonJetFex ) DECLARE_ALGORITHM( TrigJetSplitter ) DECLARE_ALGORITHM( TrigBHremoval ) diff --git a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFMonitoring.py b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFMonitoring.py index fb4d0fdec5a14bad1554257af0d7f44047202a2c..3a177b6bd32481acd3cc3eef78b116ce26a41e06 100644 --- a/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFMonitoring.py +++ b/Trigger/TrigAlgorithms/TrigMuonEF/python/TrigMuonEFMonitoring.py @@ -379,9 +379,9 @@ class TrigMuonEFCaloIsolationValidationMonitoring(TrigGenericMonitoringToolConfi self.defineTarget("Validation") self.Histograms += [ defineHistogram('EF_etiso_cone2', type='TH1F', title="Calo Isolation cone 0.2; MuonEF Calo Isolation cone 0.2 [GeV]", xbins=40, xmin=-10, xmax=30) ] - self.Histograms += [ defineHistogram('EF_etiso_cone2_core', type='TH1F', title="Calo Isolation cone 0.2 core; MuonEF Calo Isolation cone 0.2 [GeV] core", + self.Histograms += [ defineHistogram('EF_etiso_cone3', type='TH1F', title="Calo Isolation cone 0.3; MuonEF Calo Isolation cone 0.3 [GeV]", xbins=40, xmin=-10, xmax=30) ] - self.Histograms += [ defineHistogram('EF_etiso_cone2_nocorr', type='TH1F', title="Calo Isolation cone 0.2 nocorr; MuonEF Calo Isolation cone 0.2 [GeV] nocorr", + self.Histograms += [ defineHistogram('EF_etiso_cone4', type='TH1F', title="Calo Isolation cone 0.4; MuonEF Calo Isolation cone 0.4 [GeV]", xbins=40, xmin=-10, xmax=30) ] diff --git a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.cxx b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.cxx index 0ce4699a67fe66317a6fd9dd9c57cb5925a92206..7fe5f43951b39a316a1e5b5f9547ea5bfe1caeae 100644 --- a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.cxx +++ b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.cxx @@ -9,7 +9,6 @@ #include "InDetIdentifier/TRT_ID.h" #include "Identifier/IdentifierHash.h" #include "InDetPrepRawData/TRT_DriftCircleContainer.h" -#include "TrigInDetToolInterfaces/ITrigTRT_DriftCircleProvider.h" #include "TrigCaloEvent/TrigEMCluster.h" #include "xAODTrigRinger/TrigRNNOutput.h" @@ -55,7 +54,6 @@ TrigTRTHTHCounter::TrigTRTHTHCounter(const std::string& name, ISvcLocator* pSvcL m_detStore("DetectorStore", name), m_storeGate("StoreGateSvc", name), m_trtHelper(0), - m_rawDataTool("TrigTRT_DriftCircleProviderTool"), m_phiHalfWidth(0.1), m_etaHalfWidth(0.1), m_doFullScan(false), @@ -69,7 +67,6 @@ TrigTRTHTHCounter::TrigTRTHTHCounter(const std::string& name, ISvcLocator* pSvcL { declareProperty("TRT_DC_ContainerName", m_trtDCContainerName = "TRT_TrigDriftCircles" ); - declareProperty("TrtDataProviderTool", m_rawDataTool, "TrigTRT_DriftCircleProviderTool"); declareProperty("EtaHalfWidth", m_etaHalfWidth); //Used to define subsection of RoI (to retrieve fewer TRT hits) declareProperty("PhiHalfWidth", m_phiHalfWidth); //Used to define subsection of RoI (to retrieve fewer TRT hits) declareProperty("doFullScan", m_doFullScan); //Whether to use all RoI (not implmented) @@ -111,14 +108,6 @@ HLT::ErrorCode TrigTRTHTHCounter::hltInitialize() { return StatusCode::FAILURE; } else ATH_MSG_INFO ( "Retrieved service " << m_trtHelper); - - - // Get TrigTRT_DriftCircleProviderTool - if( m_rawDataTool.retrieve().isFailure() ){ - ATH_MSG_FATAL ( "Failed to retrieve " << m_rawDataTool); - return StatusCode::FAILURE; - } else - ATH_MSG_INFO ( "Retrieved service " << m_rawDataTool); ATH_MSG_INFO ( " TrigTRTHTHCounter initialized successfully"); diff --git a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.h b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.h index 50ce4affa93ae7b050d113eefe48fdfc8a0ffcc1..22145a1f09e63ee81bfb73a43dc8d5d1d23712c8 100644 --- a/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.h +++ b/Trigger/TrigAlgorithms/TrigTRTHighTHitCounter/src/TrigTRTHTHCounter.h @@ -49,7 +49,6 @@ class TrigTRTHTHCounter: public HLT::FexAlgo { - ToolHandle<ITrigTRT_DriftCircleProviderTool> m_rawDataTool; std::vector<int> m_trtDataErrors; /** A pointer to the DriftCircles container */ diff --git a/Trigger/TrigAlgorithms/TrigTauDiscriminant/TrigTauDiscriminant/TrigTauDiscriBuilder.h b/Trigger/TrigAlgorithms/TrigTauDiscriminant/TrigTauDiscriminant/TrigTauDiscriBuilder.h index 9fb7e72279728a1fbe43107744307094b9ae4126..8341cf6f5e54b8ef4925a3977310aa4c5a65fc4d 100755 --- a/Trigger/TrigAlgorithms/TrigTauDiscriminant/TrigTauDiscriminant/TrigTauDiscriBuilder.h +++ b/Trigger/TrigAlgorithms/TrigTauDiscriminant/TrigTauDiscriminant/TrigTauDiscriBuilder.h @@ -27,8 +27,6 @@ namespace HLT { class TriggerElement; } -using namespace std; - class TrigTauDiscriBuilder: public HLT::FexAlgo { public: /** constructor */ @@ -50,7 +48,7 @@ class TrigTauDiscriBuilder: public HLT::FexAlgo { private: /** internal tool store */ - ToolHandleArray<ITauToolBase> tools; + ToolHandleArray<ITauToolBase> m_tools; /** vector of Timers */ std::vector<TrigTimer* > m_mytimers; diff --git a/Trigger/TrigAlgorithms/TrigTauDiscriminant/python/TrigTauDiscriGetter.py b/Trigger/TrigAlgorithms/TrigTauDiscriminant/python/TrigTauDiscriGetter.py index 4c46a58b7f606ac2fc73b1710056947bd8b4711d..874ab3ad152ccc99d307c2351dd908e695e40f67 100644 --- a/Trigger/TrigAlgorithms/TrigTauDiscriminant/python/TrigTauDiscriGetter.py +++ b/Trigger/TrigAlgorithms/TrigTauDiscriminant/python/TrigTauDiscriGetter.py @@ -57,7 +57,7 @@ class TrigTauDiscriGetter(TrigTauDiscriBuilder): jetSigBits = "trigger.sig.bits.jet.BDT.txt") def VarCalculatorSet(self): - from TauDiscriminant.TauDiscriminantConf import TauIDVarCalculator + from tauRecTools.tauRecToolsConf import TauIDVarCalculator tauVarCalc = TauIDVarCalculator() tauVarCalc.inTrigger = True tauVarCalc.calibFolder = 'TrigTauRec/00-11-01/' @@ -93,7 +93,7 @@ class TrigTauDiscriGetter2015(TrigTauDiscriBuilder): jetSigBits = "trigger.sig.bits.jet.BDT.MC15c.ver5.txt") def VarCalculatorSet(self): - from TauDiscriminant.TauDiscriminantConf import TauIDVarCalculator + from tauRecTools.tauRecToolsConf import TauIDVarCalculator tauVarCalc = TauIDVarCalculator() tauVarCalc.inTrigger = True tauVarCalc.calibFolder = 'TrigTauRec/00-11-01/' diff --git a/Trigger/TrigAlgorithms/TrigTauDiscriminant/src/TrigTauDiscriBuilder.cxx b/Trigger/TrigAlgorithms/TrigTauDiscriminant/src/TrigTauDiscriBuilder.cxx index adeaecaaea08c67fdc99be07697afdf2d34bf50c..16242b137cff4cb8b87d168d5117d91d92d5234e 100644 --- a/Trigger/TrigAlgorithms/TrigTauDiscriminant/src/TrigTauDiscriBuilder.cxx +++ b/Trigger/TrigAlgorithms/TrigTauDiscriminant/src/TrigTauDiscriBuilder.cxx @@ -27,9 +27,9 @@ using namespace std; // Invokes base class constructor. TrigTauDiscriBuilder::TrigTauDiscriBuilder(const std::string& name,ISvcLocator* pSvcLocator): HLT::FexAlgo(name, pSvcLocator), - tools(this) + m_tools(this) { - declareProperty("Tools", tools, "List of TrigTauDiscriminantTools"); + declareProperty("Tools", m_tools, "List of TrigTauDiscriminantTools"); declareMonitoredVariable("EF_LLHScore",m_LLHScore); declareMonitoredVariable("EF_BDTScore",m_BDTScore); @@ -43,48 +43,48 @@ TrigTauDiscriBuilder::~TrigTauDiscriBuilder() HLT::ErrorCode TrigTauDiscriBuilder::hltInitialize() { - msg() << MSG::INFO << "TrigTauDiscriBuilder::initialize()" << endreq; + msg() << MSG::INFO << "TrigTauDiscriBuilder::initialize()" << endmsg; /////////////////// // Allocate Tools // //////////////////// // check tool names - if ( tools.begin() == tools.end() ) { - msg() << MSG::ERROR << " no tools given for this algorithm." << endreq; + if ( m_tools.begin() == m_tools.end() ) { + msg() << MSG::ERROR << " no tools given for this algorithm." << endmsg; return HLT::BAD_JOB_SETUP; } // find tools //------------------------------------------------------------------------- - ToolHandleArray<ITauToolBase> ::iterator p_itT = tools.begin(); - ToolHandleArray<ITauToolBase> ::iterator p_itTE = tools.end(); - msg() << MSG::INFO << "List of tools in execution sequence:" << endreq; - msg() << MSG::INFO << "------------------------------------" << endreq; + ToolHandleArray<ITauToolBase> ::iterator p_itT = m_tools.begin(); + ToolHandleArray<ITauToolBase> ::iterator p_itTE = m_tools.end(); + msg() << MSG::INFO << "List of tools in execution sequence:" << endmsg; + msg() << MSG::INFO << "------------------------------------" << endmsg; for(; p_itT != p_itTE; ++p_itT ) { StatusCode p_sc = p_itT->retrieve(); if( p_sc.isFailure() ) { msg() << MSG::WARNING << "Cannot find tool named <"; - msg() << *p_itT << ">" << endreq; + msg() << *p_itT << ">" << endmsg; return HLT::BAD_JOB_SETUP; } else { //add to manager //if( (*p_itT)->prepare(*this->manager).isFailure() ) { - // msg() << MSG::FATAL << "Initialization failed in tool " << p_itT->name() << endreq; + // msg() << MSG::FATAL << "Initialization failed in tool " << p_itT->name() << endmsg; // return HLT::BAD_JOB_SETUP; //} //add to timer //else { msg() << MSG::INFO << "REGTEST "; - msg() <<" add timer for tool "<< ( *p_itT )->type() <<" "<< ( *p_itT )->name() << endreq; + msg() <<" add timer for tool "<< ( *p_itT )->type() <<" "<< ( *p_itT )->name() << endmsg; if( doTiming() ) m_mytimers.push_back(addTimer((*p_itT)->name())) ; //} } } - msg() << MSG::INFO << " " << endreq; - msg() << MSG::INFO << "------------------------------------" << endreq; + msg() << MSG::INFO << " " << endmsg; + msg() << MSG::INFO << "------------------------------------" << endmsg; return HLT::OK; } @@ -92,7 +92,7 @@ HLT::ErrorCode TrigTauDiscriBuilder::hltInitialize() ///////////////////////////////////////////////////////////////// HLT::ErrorCode TrigTauDiscriBuilder::hltFinalize() { - msg() << MSG::DEBUG << "Finalizing TrigTauDiscriBuilder" << endreq; + msg() << MSG::DEBUG << "Finalizing TrigTauDiscriBuilder" << endmsg; return HLT::OK; } @@ -100,7 +100,7 @@ HLT::ErrorCode TrigTauDiscriBuilder::hltFinalize() // ATHENA EXECUTE METHOD: HLT::ErrorCode TrigTauDiscriBuilder::hltExecute(const HLT::TriggerElement* /*inputTE*/, HLT::TriggerElement* outputTE){ - msg() << MSG::DEBUG << "Executing TrigTauDiscriBuilder" << endreq; + msg() << MSG::DEBUG << "Executing TrigTauDiscriBuilder" << endmsg; xAOD::TauJetContainer* tau_container = 0; const xAOD::TauJetContainer* const_tau_container(0); @@ -108,13 +108,13 @@ HLT::ErrorCode TrigTauDiscriBuilder::hltExecute(const HLT::TriggerElement* /*inp tau_container = const_cast<xAOD::TauJetContainer*>(const_tau_container); if (hltStatus!=HLT::OK || ! tau_container) { - msg() << MSG::DEBUG << "No input tau container found!" << endreq; + msg() << MSG::DEBUG << "No input tau container found!" << endmsg; return HLT::OK; } // Update event-based variables //if (!this->manager->updateEvent()) { - // msg() << MSG::WARNING << "Updating event-based variables in TauDetailsManager failed! Do not trust discriminant outputs!" << endreq; + // msg() << MSG::WARNING << "Updating event-based variables in TauDetailsManager failed! Do not trust discriminant outputs!" << endmsg; // return HLT::OK; //} @@ -123,28 +123,28 @@ HLT::ErrorCode TrigTauDiscriBuilder::hltExecute(const HLT::TriggerElement* /*inp // Loop over tau's: for (; tau_it != tau_end; ++tau_it) { //if (!this->manager->update(**tau_it)) { - // msg() << MSG::WARNING << "Updating tau-based variables in TauDetailsManager failed! Do not trust discriminant outputs!" << endreq; + // msg() << MSG::WARNING << "Updating tau-based variables in TauDetailsManager failed! Do not trust discriminant outputs!" << endmsg; // return HLT::OK; //} - //msg() << MSG::VERBOSE << *this->manager << endreq; + //msg() << MSG::VERBOSE << *this->manager << endmsg; //----------------------------------------------------------------- // Process the candidate //----------------------------------------------------------------- - ToolHandleArray<ITauToolBase>::iterator tool_it(this->tools.begin()); - ToolHandleArray<ITauToolBase>::iterator tool_end(this->tools.end()); + ToolHandleArray<ITauToolBase>::iterator tool_it(this->m_tools.begin()); + ToolHandleArray<ITauToolBase>::iterator tool_end(this->m_tools.end()); //----------------------------------------------------------------- // Loop stops when Failure indicated by one of the tools //----------------------------------------------------------------- std::vector<TrigTimer* >::iterator itimer = m_mytimers.begin(); for(; tool_it != tool_end; ++tool_it ) { - msg() << MSG::VERBOSE << "Invoking tool " << tool_it->name() << endreq; + msg() << MSG::VERBOSE << "Invoking tool " << tool_it->name() << endmsg; if ( doTiming() && itimer != m_mytimers.end() ) { (*itimer)->start();} StatusCode sc = (*tool_it)->execute( **tau_it); if( sc.isFailure() ) { - msg() << MSG::FATAL << "Execute failed in tool " << tool_it->name() << endreq; + msg() << MSG::FATAL << "Execute failed in tool " << tool_it->name() << endmsg; return HLT::ERROR; } itimer++; diff --git a/Trigger/TrigConfiguration/TrigConfMuctpi/CMakeLists.txt b/Trigger/TrigConfiguration/TrigConfMuctpi/CMakeLists.txt index 6c13f4aeee42728d9cece3421945f95a75fd5a17..c41d420953840b1fd69ffba460c9d92a2ceac1a4 100644 --- a/Trigger/TrigConfiguration/TrigConfMuctpi/CMakeLists.txt +++ b/Trigger/TrigConfiguration/TrigConfMuctpi/CMakeLists.txt @@ -30,5 +30,5 @@ atlas_add_executable( TrigConfReadWriteMuCTPiGeometry # Install files from the package: atlas_install_python_modules( python/*.py ) atlas_install_scripts( scripts/*.py ) -atlas_install_xmls( data/*.dtd data/*.xml ) +atlas_install_xmls( data/*.dtd ) diff --git a/Trigger/TrigConfiguration/TrigConfMuctpi/cmt/requirements b/Trigger/TrigConfiguration/TrigConfMuctpi/cmt/requirements index d0734c31f6fa50185294ae95f3b611f9047194d8..29d38bcd8288280203b7459dfd6085186c5ff7de 100644 --- a/Trigger/TrigConfiguration/TrigConfMuctpi/cmt/requirements +++ b/Trigger/TrigConfiguration/TrigConfMuctpi/cmt/requirements @@ -22,7 +22,7 @@ macro_append TrigConfReadWriteMuCTPiGeometrylinkopts " $(Boost_linkopts_filesyst # Install the LUTs: -apply_pattern detcommon_link_files kind=XML files="-s=../data *.xml *.dtd" \ +apply_pattern detcommon_link_files kind=XML files="-s=../data *.dtd" \ prefix=XML/TrigConfMuctpi apply_pattern detcommon_link_files kind=scripts files="-s=../scripts *.py" \ diff --git a/Trigger/TrigConfiguration/TrigConfMuctpi/data/README b/Trigger/TrigConfiguration/TrigConfMuctpi/data/README new file mode 100644 index 0000000000000000000000000000000000000000..256fd6c64074dc19fd96154431c7e61ff7c814a2 --- /dev/null +++ b/Trigger/TrigConfiguration/TrigConfMuctpi/data/README @@ -0,0 +1,10 @@ +Muctpi configuration files have been moved to the GroupData area: + * CVMFS: /cvmfs/atlas.cern.ch/repo/sw/database/GroupData/TrigConfMucpti + * P1: /sw/DbData/GroupData + +For details on how to access/uppdate them see: + - https://twiki.cern.ch/twiki/bin/viewauth/AtlasComputing/PathResolver + - https://its.cern.ch/jira/browse/ATR-15657 + +The last version of the files in SVN are in TrigConfMuctpi-00-00-22: +https://svnweb.cern.ch/trac/atlasoff/browser/Trigger/TrigConfiguration/TrigConfMuctpi/tags/TrigConfMuctpi-00-00-22/data diff --git a/Trigger/TrigConfiguration/TrigConfMuctpi/python/XMLReader.py b/Trigger/TrigConfiguration/TrigConfMuctpi/python/XMLReader.py index a330a7dbd8711005308afe843e4ed0ccd00da6f2..0f2fdc950520be0462156aa00fe639c9afe5cf7c 100644 --- a/Trigger/TrigConfiguration/TrigConfMuctpi/python/XMLReader.py +++ b/Trigger/TrigConfiguration/TrigConfMuctpi/python/XMLReader.py @@ -70,4 +70,6 @@ class MioctGeometryXMLReader(TrigXMLDocumentReader): if __name__ == "__main__": - l1menu = L1MenuXMLReader("TrigConfMuctpi/TestMioctGeometry.xml") + from PathResolver import PathResolver + xmlfile = PathResolver.FindCalibFile("TrigConfMuctpi/TestMioctGeometry_2016_05_30_CS_2600573263.xml") + l1menu = L1MenuXMLReader(xmlfile) diff --git a/Trigger/TrigEvent/TrigSteeringEvent/CMakeLists.txt b/Trigger/TrigEvent/TrigSteeringEvent/CMakeLists.txt index 1e6567c728126cec26cce8775e5b1124d944fff7..7e1a315f8355e4f3c052f568fdd52190ed5c42f5 100644 --- a/Trigger/TrigEvent/TrigSteeringEvent/CMakeLists.txt +++ b/Trigger/TrigEvent/TrigSteeringEvent/CMakeLists.txt @@ -1,4 +1,4 @@ -# $Id: CMakeLists.txt 782979 2016-11-08 13:53:37Z smh $ +# $Id: CMakeLists.txt 790888 2016-12-22 22:12:11Z ssnyder $ ################################################################################ # Package: TrigSteeringEvent ################################################################################ @@ -43,6 +43,8 @@ else() Trigger/TrigDataAccess/TrigSerializeCnvSvc Trigger/TrigEvent/TrigNavigation Trigger/TrigT1/TrigT1Interfaces ) + + find_package( tdaq-common ) endif() # External dependencies: diff --git a/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Chain.h b/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Chain.h index 9a4c608a82c462c87b85c20cbf5c69b4fef914a9..09e1eab16522a7535b002384870d7f6d91eab7e3 100644 --- a/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Chain.h +++ b/Trigger/TrigEvent/TrigSteeringEvent/TrigSteeringEvent/Chain.h @@ -45,8 +45,11 @@ class MsgStream; class TrigTimer; + namespace HLT { + static std::string no_config = "no config"; + // taht is for backward compatibility of TDT, once new TDT will be available it can be removed from steering enum ChainStatus { ChainInvalid=0, ConfigOnlyChain, ChainOK }; @@ -88,14 +91,14 @@ namespace HLT { // For Lvl Converters - float prescaleFactor() const { return (m_configChain ? m_configChain->prescale() : -1.); } //!< get prescale factor - float passThroughFactor() const { return (m_configChain ? m_configChain->pass_through() : -1.); } //!< get pass-through factor - unsigned int getChainCounter() const { return m_chain_counter; } //!< return the unique identifier of this Chain (uint) - std::string getChainName() const { return (m_configChain ? m_configChain->chain_name(): "no config"); } //!< return the Chain name (string) - std::string getLowerChainName() const { return (m_configChain ? m_configChain->lower_chain_name(): "no config"); } //!< return the Chain name (string) - int getEBAfterStep() const { return (m_configChain ? m_configChain->EB_after_step() : -1.); } //!< get EB_after_step - bool nextStepAfterEB() const { return ((getChainStep()+1) > getEBAfterStep()) && (getEBAfterStep()>0.); } //!< return whether next step requires EB (-1 means no EB called) - bool isMerged() const { return (m_configChain ? (m_configChain->level()=="HLT") : false);}; //!<< return whether is a merged L2+EF chain + float prescaleFactor() const { return (m_configChain ? m_configChain->prescale() : -1.); } //!< get prescale factor + float passThroughFactor() const { return (m_configChain ? m_configChain->pass_through() : -1.); } //!< get pass-through factor + unsigned int getChainCounter() const { return m_chain_counter; } //!< return the unique identifier of this Chain (uint) + const std::string& getChainName() const { return (m_configChain ? m_configChain->chain_name(): no_config); } //!< return the Chain name (string) + const std::string& getLowerChainName() const { return (m_configChain ? m_configChain->lower_chain_name(): no_config); } //!< return the Chain name (string) + int getEBAfterStep() const { return (m_configChain ? m_configChain->EB_after_step() : -1.); } //!< get EB_after_step + bool nextStepAfterEB() const { return ((getChainStep()+1) > getEBAfterStep()) && (getEBAfterStep()>0.); } //!< return whether next step requires EB (-1 means no EB called) + bool isMerged() const { return (m_configChain ? (m_configChain->level()=="HLT") : false);}; //!<< return whether is a merged L2+EF chain unsigned int getChainHashId() const { return (m_configChain ? m_configChain->chain_hash_id() : 0); } //!< return the Chain name's hash ID HLT::ErrorCode getErrorCode() const { return m_errorCode; } //!< return this Chain's most severe error code (from execution) diff --git a/Trigger/TrigEvent/TrigSteeringEvent/doc/mainpage.h b/Trigger/TrigEvent/TrigSteeringEvent/doc/mainpage.h deleted file mode 100644 index b225ae51b47b1ed874b259261876e308c5a992f6..0000000000000000000000000000000000000000 --- a/Trigger/TrigEvent/TrigSteeringEvent/doc/mainpage.h +++ /dev/null @@ -1,28 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - - -@mainpage TrigSteeringEvent Package - -@section TrigSteeringEventIntro Introduction - -This package contains utilisties used to stream PESA results. - - HLT::HLTResult: - - TriggerDecision: - - LVL1CTP::Lvl1result: - -Here reside also the classe used in the seeding process which holds eta/phi of RoIs: - - TrigRoiDescriptor: - - HLT::ErrorCode: which defines basically possible error codes - -And some other misc helpers: - - MessageSvcProvider: - -Notice little dependency. It is realy a core package. -@htmlinclude used_packages.html - - -*/ diff --git a/Trigger/TrigEvent/TrigSteeringEvent/test/StringSerializer_test.cxx b/Trigger/TrigEvent/TrigSteeringEvent/test/StringSerializer_test.cxx index 6605faba9d09e634707f203580194d160aab67d1..c6be6494e43f1460def04a29f59fefa710e60b6e 100644 --- a/Trigger/TrigEvent/TrigSteeringEvent/test/StringSerializer_test.cxx +++ b/Trigger/TrigEvent/TrigSteeringEvent/test/StringSerializer_test.cxx @@ -21,6 +21,7 @@ int main() { #include <string> #include <vector> +#include <iostream> using namespace std; diff --git a/Trigger/TrigFTK/TrigFTK_Monitoring/src/FtkHltEfficiencyFex.cxx b/Trigger/TrigFTK/TrigFTK_Monitoring/src/FtkHltEfficiencyFex.cxx index c0ba0a98d945c0cd045661f1962bde26cd15a1e4..54ea73a695f8c6cb6c629be94192e8bf0a644ff1 100644 --- a/Trigger/TrigFTK/TrigFTK_Monitoring/src/FtkHltEfficiencyFex.cxx +++ b/Trigger/TrigFTK/TrigFTK_Monitoring/src/FtkHltEfficiencyFex.cxx @@ -159,9 +159,10 @@ HLT::ErrorCode FtkHltEfficiencyFex::hltInitialize() //----------------------------------------------------------------- HLT::ErrorCode FtkHltEfficiencyFex::hltExecute(const HLT::TriggerElement* input, HLT::TriggerElement*) { - ATH_MSG_INFO("FtkHltEfficiencyFex::hltExecute event" << eventCounter++); - m_timer[AlgoTime]->start(); - + ATH_MSG_INFO("FtkHltEfficiencyFex::hltExecute event " << eventCounter++); + if(m_timer[AlgoTime]) m_timer[AlgoTime]->start(); // avoid crash when timing service not available + + //To start monitoring: beforeExecMonitors().ignore(); @@ -187,7 +188,7 @@ HLT::ErrorCode FtkHltEfficiencyFex::hltExecute(const HLT::TriggerElement* input, ); // Get last track collection attached to this ROI (there should only be one) - m_timer[GetHltTracksTime]->start(); + if(m_timer[GetHltTracksTime]) m_timer[GetHltTracksTime]->start(); const xAOD::TrackParticleContainer* HLT_tpcPtr; status = getFeature(input, HLT_tpcPtr); if( status == HLT::OK && HLT_tpcPtr ){ @@ -196,10 +197,10 @@ HLT::ErrorCode FtkHltEfficiencyFex::hltExecute(const HLT::TriggerElement* input, } else ATH_MSG_DEBUG("Failed to get TrackParticleContainers "); - m_timer[GetHltTracksTime]->stop(); + if(m_timer[GetHltTracksTime]) m_timer[GetHltTracksTime]->stop(); // Get FTK tracks in ROI - m_timer[GetFtkTracksTime]->start(); + if(m_timer[GetFtkTracksTime]) m_timer[GetFtkTracksTime]->start(); const xAOD::TrackParticleContainer* FTK_tpcPtr; FTK_tpcPtr = m_FTKDataProviderSvc->getTrackParticlesInRoi(*roiDescriptor, 0); if( FTK_tpcPtr ){ @@ -208,26 +209,28 @@ HLT::ErrorCode FtkHltEfficiencyFex::hltExecute(const HLT::TriggerElement* input, } else ATH_MSG_DEBUG("Failed to get FTK TrackParticleContainer "); - m_timer[GetFtkTracksTime]->stop(); + if(m_timer[GetFtkTracksTime]) m_timer[GetFtkTracksTime]->stop(); ATH_MSG_DEBUG("FTK retrieval time " << m_timer[GetFtkTracksTime]->elapsed()); } // run efficiency analysis - m_timer[EfficiencyToolTime]->start(); + if(m_timer[EfficiencyToolTime]) m_timer[EfficiencyToolTime]->start(); m_efficiencyAnalysis->TrackAnalyisis(m_HLTTrkPtr_vec, m_FTKTrkPtr_vec); - m_timer[EfficiencyToolTime]->stop(); + if(m_timer[EfficiencyToolTime]) m_timer[EfficiencyToolTime]->stop(); // perform regular efficiency analyisis with test and reference tracks swapped // works only if only FTK tracks in ROIs are selected so that there is indeed // 1to1 overlap between HLT and FTK tracks - m_timer[PurityToolTime]->start(); + if(m_timer[PurityToolTime]) m_timer[PurityToolTime]->start(); m_purityAnalysis->TrackAnalyisis(m_FTKTrkPtr_vec, m_HLTTrkPtr_vec, true); - m_timer[PurityToolTime]->stop(); + if(m_timer[PurityToolTime]) m_timer[PurityToolTime]->stop(); //To stop monitoring: afterExecMonitors().ignore(); - m_timer[AlgoTime]->stop(); - ATH_MSG_DEBUG("execution time " << m_timer[AlgoTime]->lastElapsed()); + if(m_timer[AlgoTime]){ + m_timer[AlgoTime]->stop(); + ATH_MSG_DEBUG("execution time " << m_timer[AlgoTime]->lastElapsed()); + } return HLT::OK; } //----------------------------------------------------------------- diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2DielectronMassFex.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2DielectronMassFex.h deleted file mode 100755 index 8ffcc010fbd9701494087435c37d4575e3fd6698..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2DielectronMassFex.h +++ /dev/null @@ -1,124 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/************************************************************************** - ** - ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2DielectronMassFex.h - ** - ** Description: - Hypothesis algorithm: searc for electron pairs with - ** invariant mass in some interval; intended for Z->ee - ** - Modified from TrigL2DimuonMassHypo by C.Schiavi - ** - ** Author: R.Goncalo <r.goncalo@rhul.ac.uk> - ** - ** Created: Aug 13 2006 - ** Modified: Jan 19 2007 Valeria Perez Reale Adapted to New Steering - ** Modified: Apr 28 2007 Tomasz Bold major changes to run with new steering - ** V. Perez Reale added doxygen comments 26/6/07 - ** - **************************************************************************/ - -#ifndef TRIGEGAMMAHYPO_TRIGL2DIELECTRONMASSFEX_H -#define TRIGEGAMMAHYPO_TRIGL2DIELECTRONMASSFEX_H - -// standard stuff -#include <string> -#include <map> -#include <cmath> -// general athena stuff -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/IToolSvc.h" -#include "GaudiKernel/StatusCode.h" -#include "StoreGate/StoreGateSvc.h" -// trigger includes -#include "TrigInterfaces/ComboAlgo.h" - -// trigger EDM -#include "xAODTrigger/TrigComposite.h" -#include "xAODTrigger/TrigCompositeContainer.h" - -#include "xAODTracking/TrackParticleContainer.h" -#include "xAODTrigEgamma/TrigElectron.h" -#include "xAODTrigEgamma/TrigElectronContainer.h" -#include "xAODTrigCalo/TrigEMCluster.h" - -/* class StoreGateSvc; */ -/* class TriggerElement; */ - -/** - * \class TrigL2DielectronMassFex - * \brief TrigL2DielectronMassFex is a Trigger Fex Algorithm that retrieves the L2 TrigElectron - * container - * check charge: track pT is signed according to charge but not electron pT - * check vertex position: two electrons should come from common - * reject combination of electrons if distance squared between perigee of tracks is greater than a value - * (should accept 99% of good combinations) - * apply loose inv mass cuts (upper and lower cut) to the two electrons - * - * (May 2011) - * Add use cluster mode for chains to collect J/psi sample for Tag & Probe Analysis - * Change to attach the calculated invariant mass to outputTE as TrigOperationalInfo - */ - -namespace TrigL2DielectronMassHelpers { - - - bool validElectrons(const xAOD::TrigElectron* electron1, const xAOD::TrigElectron* electron2); - - - enum Vertex { Common, NotCommon, Unapplicable }; - Vertex commonVertex(const xAOD::TrigElectron* electron1, const xAOD::TrigElectron* electron2); - - bool opositeCharge(const xAOD::TrigElectron* electron1, const xAOD::TrigElectron* electron2); - - double invariantMass(const xAOD::TrigElectron* electron1, const xAOD::TrigElectron* electron2, const double electronMass); - double invariantMass(const xAOD::TrigElectron* electron, const xAOD::TrigEMCluster* cluster, const double electromMass); - -} - - -class TrigL2DielectronMassFex: public HLT::ComboAlgo { - -public: - TrigL2DielectronMassFex(const std::string & name, ISvcLocator* pSvcLocator); - ~TrigL2DielectronMassFex(); - - HLT::ErrorCode hltInitialize(); - HLT::ErrorCode hltFinalize(); - HLT::ErrorCode acceptInputs(HLT::TEConstVec& inputTE, bool& pass ); - HLT::ErrorCode hltExecute(HLT::TEConstVec& inputTE, HLT::TriggerElement* outputTE); - -private: - // use cluster mode: Calculate inv. mass from TrigElectron and TrigEMCluster - // This mode will be used in chains to collect sample for Tag & Probe - // In such chains no cut will be apply to probe RoI object therfore - // TrigElectron is not necessary - bool m_useClusterAsProbe; //!< true will use TrigEMCluster as probe object - // Electron mass(use in calculation Mee) - float m_electronMass; //! in MeV - - // container to hold the calculated inariant mass - std::vector<float> m_massCont; - xAOD::TrigCompositeContainer *m_cont; - - // cuts (not used in use cluster mode) - bool m_electronValid; //!< true if electrons have different RoI positions - bool m_sameTrackAlgo; //!< true if tracks come from same track algo - bool m_oppositeCharge; //!< true if electtons have opposite charge - bool m_commonVertex; //!< true if electrons tracks have common vertex - float m_lowerMassCut; //!< lower inv mass cut - float m_upperMassCut; //!< upper inv mass cut - - // to set Accept-All mode: should be done with force-accept when possible - bool m_acceptAll; //!< true will accept all events - - // monitoring - double m_monMassAccepted; - int m_monCut; -}; - - - - -#endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2DielectronMassHypo.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2DielectronMassHypo.h deleted file mode 100755 index 177aa37680a3d8fbf515e5527efd9fac0873985c..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2DielectronMassHypo.h +++ /dev/null @@ -1,86 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/************************************************************************** - ** - ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2DielectronMassHypo.h - ** - ** Description: - Hypothesis algorithm: searc for electron pairs with - ** invariant mass in some interval; intended for Z->ee - ** - Modified from TrigL2DimuonMassHypo by C.Schiavi - ** - ** Author: R.Goncalo <r.goncalo@rhul.ac.uk> - ** - ** Created: Aug 13 2006 - ** Modified: Jan 19 2007 Valeria Perez Reale Adapted to New Steering - ** Modified: Apr 28 2007 Tomasz Bold major changes to run with new steering - ** V. Perez Reale added doxygen comments 26/6/07 - ** - **************************************************************************/ - -#ifndef TRIG_TrigL2DielectronMassHypo_H -#define TRIG_TrigL2DielectronMassHypo_H - -// standard stuff -#include <string> -#include <map> -#include <cmath> -// general athena stuff -#include "GaudiKernel/MsgStream.h" -#include "GaudiKernel/IToolSvc.h" -#include "GaudiKernel/StatusCode.h" -#include "StoreGate/StoreGateSvc.h" -// trigger includes -#include "TrigInterfaces/HypoAlgo.h" -#include "TrigSteeringEvent/TrigRoiDescriptor.h" - -// trigger EDM -//#include "TrigInDetEvent/TrigInDetTrack.h" -//#include "TrigInDetEvent/TrigInDetTrackCollection.h" -//#include "TrigInDetEvent/TrigInDetTrackHelper.h" -#include "xAODTracking/TrackParticleContainer.h" -#include "xAODTrigEgamma/TrigElectron.h" -#include "xAODTrigEgamma/TrigElectronContainer.h" - -/* class StoreGateSvc; */ -/* class TriggerElement; */ - - -/** - * \class TrigL2DielectronMassHypo - * \brief TrigL2DielectronMassHypo is a Trigger Hypo Algorithm that retrieves the coomon vertex and - * inv mass calculated by TrigL2DielectronFex - * Apply inv mass cuts (upper and lower cut) to the two electrons and activates TE if condition is - * satisfied - * - */ - -class TrigL2DielectronMassHypo: public HLT::HypoAlgo { - - public: - TrigL2DielectronMassHypo(const std::string & name, ISvcLocator* pSvcLocator); - ~TrigL2DielectronMassHypo(); - - HLT::ErrorCode hltInitialize(); - HLT::ErrorCode hltFinalize(); - HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE, bool& pass); - - private: - - // cuts - bool m_sameTrackAlgo; //!< true if tracks come from same track algo - bool m_oppositeCharge; //!< true if electtons have opposite charge - bool m_commonVertex; //!< true if electrons tracks have common vertex - bool m_electronValid; - float m_lowerMassCut; //!< lower inv mass cut - float m_upperMassCut; //!< upper inv mass cut - - // to set Accept-All mode: should be done with force-accept when possible - bool m_acceptAll; //!< true will accept all events - // monitoring - double m_monMassAccepted; - int m_monCut; -}; - -#endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronFex.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronFex.h index 6524aeea396d173ee4a56e9c5ab86eb8e238b6eb..33a1364510ab354f996bd941e163017df279eb26 100755 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronFex.h +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronFex.h @@ -17,7 +17,7 @@ ** ** Created: Tue Nov 28 0:56:50 CET 2006 ** Modified: V. Perez Reale added doxygen comments 26/6/07 - ** + ** Modified: R. White optimisation for v7 menu (Run2) 07/02/2017 **************************************************************************/ #ifndef TRIG_TrigL2ElectronFex_H @@ -36,24 +36,11 @@ #include "TrigT1Interfaces/RecEmTauRoI.h" #include "TrigSteeringEvent/TrigRoiDescriptor.h" -// trigger EDM -//#include "TrigInDetEvent/TrigInDetTrack.h" -//#include "TrigInDetEvent/TrigInDetTrackCollection.h" #include "xAODTracking/TrackParticleContainer.h" - -//#include "TrigCaloEvent/TrigEMCluster.h" -//#include "TrigParticle/TrigElectron.h" -//#include "TrigParticle/TrigElectronContainer.h" - #include "xAODTrigCalo/TrigEMCluster.h" #include "xAODTrigEgamma/TrigElectron.h" #include "xAODTrigEgamma/TrigElectronContainer.h" -//#include "TrigCaloEvent/RingerEvent.h" // will be moved to TrigEvent -//#include "TrigCaloEvent/RingerEventContainer.h" // will be moved to TrigEvent - -//class ITrigInDetTrackExtrapolator; -//class IExtrapolateToCaloTool; namespace Trk { class IParticleCaloExtensionTool; } @@ -67,6 +54,12 @@ namespace Trk * The TrigElectron conatiner will then be retrieved by the hypothesis algorithm TrigL2ElectronHypo * that will perform the corresponding L2 electron selection * + * Cleanup / Update for Run2 + * Remove m_calo_algoID; m_trackalgoID -- only 1 type of track + * Remove deta/dphi cluster -- this is checked at L2Calo + * Remove track pt for TRT tracks -- TRT only not used + * Remove m_calotrackdeta/dphiTRT -- not cutting on TRT tracks + * calotrack deta/dphi and eoverp cuts flat (not as function of eta) */ class TrigL2ElectronFex : public HLT::FexAlgo { @@ -80,49 +73,27 @@ class TrigL2ElectronFex : public HLT::FexAlgo { HLT::ErrorCode hltFinalize(); HLT::ErrorCode hltExecute(const HLT::TriggerElement* inputTE, HLT::TriggerElement* outputTE); - - //HLT::ErrorCode acceptInput(const HLT::TriggerElement* inputTE, bool& pass); private: - // Properties: - unsigned int m_trackalgoID; // used to select algorithm producing tracks, 0: all, 1: SiTrack, 2: IDScan, 4: TRTxK, 5: SiTrack+IDScan - unsigned int m_calo_algoID; // used to run from either TrigEMCluster or RingerEvent - - //L1-L2 matching variables - float m_detacluster; - float m_dphicluster; - //tracking cut float m_trackPtthr; - float m_trackPtthrTRT; //Track pt cut on TRT tracks //calo-tracking cuts - std::vector<float> m_etabin; - std::vector<float> m_calotrackdeta; //!< deta between calo and track - std::vector<float> m_calotrackdphi; //!< dphi between calo and track - std::vector<float> m_calotrackdeoverp_low; //!< E/p lower cut between calo and track - std::vector<float> m_calotrackdeoverp_high; //!< E/p upper cut between calo and track - - //TRTSegFinder specific calo-track cuts - std::vector<float> m_calotrackdetaTRT; //!< deta between calo and track - std::vector<float> m_calotrackdphiTRT; //!< dphi between calo and track - + float m_calotrackdeta; //!< deta between calo and track + float m_calotrackdphi; //!< dphi between calo and track + float m_calotrackdeoverp_low; //!< E/p lower cut between calo and track + float m_calotrackdeoverp_high; //!< E/p upper cut between calo and track //radius and Z of calorimeter face float m_RCAL; //!< radious of calorimeter face float m_ZCAL; //!< Z of calorimeter face - // to set Accept-All mode and to be able - // to avoid generating TrigElectrons + // build electrons for all tracks bool m_acceptAll; - // bool m_saveTrigEl; // now needed to transfer information to hypo // for extrapolating TrigInDetTracks to calorimeter surface -// ITrigInDetTrackExtrapolator* m_trackExtrapolator; //!< pointer for extrapolating TrigInDetTracks to calorimeter surface - //ToolHandle<IExtrapolateToCaloTool> m_trackExtrapolator; ToolHandle< Trk::IParticleCaloExtensionTool > m_caloExtensionTool; -// std::string m_trackExtrapolatorName; xAOD::TrigElectronContainer* m_trigElecColl; //!< pointer to TrigElectron container @@ -131,16 +102,17 @@ class TrigL2ElectronFex : public HLT::FexAlgo { ///Static getter methods for monitoring of TrigElectron container static inline double getCaloPt(const xAOD::TrigElectron* aElectron){ - if(!aElectron) return -999.0; return aElectron->pt(); } static inline double getTkPt(const xAOD::TrigElectron* aElectron){ + if(!aElectron) return -999.0; + return (aElectron->trackParticle() ? aElectron->trackParticle()->pt() : -999); + } + + bool extrapolate(const xAOD::TrigEMCluster *, const xAOD::TrackParticle *, double &, double &); - if(!aElectron) return -999.0; - return (aElectron->trackParticle() ? aElectron->trackParticle()->pt() : -999); -} }; diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronHypo.h b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronHypo.h index f085a0739f0f7198b556aad06889e9efd3549fd3..469ce7fb880eeabdeff7a235d9fa9918971d794c 100755 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronHypo.h +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/TrigEgammaHypo/TrigL2ElectronHypo.h @@ -15,7 +15,7 @@ ** ** Created: Sat Mar 1 19:55:56 GMT 2005 ** Modified: V. Perez Reale added doxygen comments 26/6/07 - ** + ** Modified: R. White optimisation for v7 menu (Run2) 07/02/2017 **************************************************************************/ #ifndef TRIG_TrigL2ElectronHypo_H @@ -44,6 +44,12 @@ * \brief TrigL2ElectronHypo is a Trigger Hypo Algorithm that retrieves the L2 TrigElectronContainer * created by TrigL2ElectronFex and then apply a subset of electron selection cuts. A TE will be * set active if the selection cuts are fullfilled. + * Cleanup / Update for Run2 + * Remove m_calo_algoID; m_trackalgoID -- only 1 type of track + * Remove deta/dphi cluster -- this is checked at L2Calo + * Remove track pt for TRT tracks -- TRT only not used + * Remove m_calotrackdeta/dphiTRT -- not cutting on TRT tracks + * calotrack deta/dphi and eoverp cuts flat (not as function of eta) * * */ @@ -61,31 +67,15 @@ class TrigL2ElectronHypo: public HLT::HypoAlgo { private: - // Properties: - unsigned int m_trackalgoID; //!< integer that assigns the tracking algorihtm used - - //tracking cut float m_trackPtthr; //!< pT cut on track //calo-tracking cuts - std::vector<float> m_etabin; - std::vector<float> m_calotrackdeta; //!< deta between calo and track - std::vector<float> m_calotrackdphi; //!< dphi between calo and track - std::vector<float> m_calotrackdeoverp_low; //!< E/p lower cut between calo and track - std::vector<float> m_calotrackdeoverp_high; //!< E/p upper cut between calo and track - - //TRT cuts - std::vector<float> m_trtratio; //!< cut on ratio of NTRHits/NTRStrawHits for IDScan and SiTrack tracks - - //TRTSegFinder cuts - float m_trackPtthrTRT; //!< pT cut on track - std::vector<float> m_etabinTRT; //!< eta bins for TRT cuts - std::vector<float> m_trtratioTRT; //!< cut on ratio of NTRHits/NTRStrawHits for TRTSegFinder tracks - std::vector<float> m_calotrackdetaTRT; //!< deta between calo and track - std::vector<float> m_calotrackdphiTRT; //!< dphi between calo and track - std::vector<float> m_calotrackdeoverp_lowTRT; //!< E/p lower cut between calo and track - std::vector<float> m_calotrackdeoverp_highTRT; //!< E/p upper cut between calo and track + float m_calotrackdeta; //!< deta between calo and track + float m_calotrackdphi; //!< dphi between calo and track + float m_calotrackdeoverp_low; //!< E/p lower cut between calo and track + float m_calotrackdeoverp_high; //!< E/p upper cut between calo and track + float m_trtratio; //!< trt ratio cut // to set Accept-All mode @@ -99,20 +89,15 @@ class TrigL2ElectronHypo: public HLT::HypoAlgo { ///Static getter methods for monitoring of TrigElectron container static inline double getCaloPt(const xAOD::TrigElectron* aElectron){ - if(!aElectron) return -999.0; return aElectron->pt(); } static inline double getTkPt(const xAOD::TrigElectron* aElectron){ + if(!aElectron) return -999.0; + return (aElectron->trackParticle() ? aElectron->trackParticle()->pt() : -999); + } - if(!aElectron) return -999.0; - return (aElectron->trackParticle() ? aElectron->trackParticle()->pt() : -999); -} - - // for extrapolating TrigInDetTracks to calorimeter surface -// ITrigInDetTrackExtrapolator* m_trackExtrapolator; -// std::string m_trackExtrapolatorName; }; #endif diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/doc/mainpage.h b/Trigger/TrigHypothesis/TrigEgammaHypo/doc/mainpage.h deleted file mode 100755 index 91d0faa9805281d5103dd50b9c2f0b8ac6d83f78..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/doc/mainpage.h +++ /dev/null @@ -1,33 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - - -/** - -@mainpage -@author R. Goncalo -@author J. Baines -@author I. Graboska-Bold -@author T. Fonseca-Martin -@author D. Damazio -@author V. Perez-Reale -@author C. SantaMarina -@author P. Urquijo - -@section MyPackageOverview Overview -This package contains the fex and hypo trigger algorithms for the Electron and Photon Slice -It contains 2 algorithm classes: <br/> -Fex - which create a feature extraction object <br/> -Hypo - performs a selection on a feature extraction object created by a fex and creates timing -and monitoring histograms <br/> - -The package also contains the configuration files for the Electron and Photon Slice for all -electron and photon trigger menus. - - -@htmlinclude used_packages.html - - -*/ - diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFCaloHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFCaloHypoConfig.py index f843233ebf8ab0d1e79bb3be59b184899a99020d..cd8e730a8711d6d708a2767b5fa8d7fb6f6aef58 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFCaloHypoConfig.py +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigEFCaloHypoConfig.py @@ -75,7 +75,7 @@ class TrigEFCaloHypo_g_ID (TrigEFCaloHypoBase): def __init__(self, name, threshold, IDinfo): super( TrigEFCaloHypo_g_ID, self ).__init__( name ) self.emEt = float(threshold)*GeV - self.AcceptAll = True + self.AcceptAll = False self.ApplyPhotonIsEM = True self.IsEMrequiredBits = PhotonIsEMBits[IDinfo] self.PhotonSelectorToolName = 'AsgPhotonIsEMSelector/'+PhotonToolName[IDinfo] diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoCutDefs.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoCutDefs.py index f83d144f4a8fa01ebb944d053e034b60f543a08e..3e7f81b8f8dabdf6ac450a09c3939c2acfcc634a 100644 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoCutDefs.py +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2CaloHypoCutDefs.py @@ -20,7 +20,6 @@ class L2CaloCutMaps(): # Cut maps are grouped by Et threshold # Adding vloose working points, same cuts as loose def __init__(self, threshold): - log_trigegL2.info("Configuring L2CaloCuts with threshold %s",threshold) ########################## # Et 5 GeV ########################## @@ -40,7 +39,6 @@ class L2CaloCutMaps(): # self.CAERATIOthr = [0.57, 0.532, 0.342, 0.228, -9999., 0.304, 0.608, 0.722, -9999.] ########################## if(float(threshold) < 12): - log_trigegL2.info("Configuring L2CaloCuts for low Et %s",threshold) self.MapsHADETthr = { 'vloose': [0.2337, 0.20976, 0.1392, 0.1872, 0.1315, 0.3234, 0.384, 0.1901, 0.1901], 'loose': [0.2337, 0.2097, 0.1392, 0.1872, 0.1255, 0.3234, 0.3840, 0.1901, 0.1901], @@ -92,7 +90,6 @@ class L2CaloCutMaps(): # self.CARCOREthr = [0.90, 0.89, 0.89, 0.89, 0.90, 0.89, 0.89, 0.89, 0.89] # self.CAERATIOthr = [0.60, 0.70, 0.70, 0.75, 0.85, 0.90, 0.90, 0.90, 0.90] if(float(threshold) >= 12. and float(threshold) < 22): - log_trigegL2.info("Configuring L2CaloCuts for mid Et %s",threshold) self.MapsHADETthr = { 'vloose': [0.0871, 0.0617, 0.0564, 0.0827, 0.0889, 0.2052, 0.1674, 0.1481, 0.1481], 'loose': [0.08472, 0.05928, 0.054, 0.0803, 0.0829, 0.1932, 0.1590, 0.1384 , 0.1384], @@ -139,7 +136,6 @@ class L2CaloCutMaps(): # self.HADETthr = [0.0275625, 0.0259875, 0.0291375, 0.0228375, 0.0259875, 0.0391125, 0.0359625, 0.0370125, 0.0291375] # self.CARCOREthr = [0.819375, 0.819375, 0.800375, 0.828875, 0.7125, 0.805125, 0.843125, 0.824125, 0.700625] if(float(threshold) >= 22.): - log_trigegL2.info("Configuring L2CaloCuts for high Et %s",threshold) self.MapsHADETthr = { 'vloose': [0.0612, 0.0588, 0.0564, 0.0504, 0.0357, 0.072, 0.0684, 0.0696, 0.0636], 'loose': [0.0588, 0.0564, 0.054, 0.048, 0.0297, 0.06, 0.06, 0.06, 0.054], diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2DielectronMassHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2DielectronMassHypoConfig.py deleted file mode 100755 index a9ac13c6d9973d31ebf5ba2a88bc3bc0816d4e09..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2DielectronMassHypoConfig.py +++ /dev/null @@ -1,195 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2DielectronMassFex, TrigL2DielectronMassHypo -from AthenaCommon.SystemOfUnits import GeV -from TrigEgammaHypo.TrigL2DielectronMassHypoMonitoring import * - -class TrigL2DielectronMassFex_Jpsiee ( TrigL2DielectronMassFex ): - __slots__ = [] - def __init__(self, name="TrigL2DielectronMassFex_Jpsiee"): - super(TrigL2DielectronMassFex_Jpsiee, self).__init__(name) - - # Use Cluster Mode (use TrigEMCluster as Probe) - self.UseClusterAsProbe=True - - # ElectronMass: used in calculation of invariant mass - self.ElectronMass=0.511 - - # AcceptAll flag: if true take events regardless of cuts - self.AcceptAll=False - - # cuts (not used in use cluster mode) - self.OppositeSign=True - self.CommonVertex=True - self.ValidElectron=True - - # require invariant mass within window - self.LowerMassCut=1.0*GeV - self.UpperMassCut=15.0*GeV - - self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Jpsiee() ] - -class TrigL2DielectronMassFex_Upsiee ( TrigL2DielectronMassFex ): - __slots__ = [] - def __init__(self, name="TrigL2DielectronMassFex_Upsiee"): - super(TrigL2DielectronMassFex_Upsiee, self).__init__(name) - - # Use Cluster Mode (use TrigEMCluster as Probe) - self.UseClusterAsProbe=True - - # ElectronMass: used in calculation of invariant mass - self.ElectronMass=0.511 - - # AcceptAll flag: if true take events regardless of cuts - self.AcceptAll=False - - # cuts (not used in use cluster mode) - self.OppositeSign=True - self.CommonVertex=True - self.ValidElectron=True - - # require invariant mass within window - self.LowerMassCut=1.0*GeV - self.UpperMassCut=30.0*GeV - - self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Upsiee() ] - -class TrigL2DielectronMassFex_Zee ( TrigL2DielectronMassFex ): - __slots__ = [] - def __init__(self, name="TrigL2DielectronMassFex_Zee"): - super(TrigL2DielectronMassFex_Zee, self).__init__(name) - - # Use Cluster Mode (use TrigEMCluster as Probe) - self.UseClusterAsProbe=False - - # ElectronMass: used in calculation of invariant mass - self.ElectronMass=0.511 - - # AcceptAll flag: if true take events regardless of cuts - self.AcceptAll=False - - # cuts (not used in use cluster mode) - self.OppositeSign=True - self.CommonVertex=True - self.ValidElectron=True - - # require invariant mass within window - self.LowerMassCut=20.0*GeV - self.UpperMassCut=200.0*GeV - - self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Zee() ] - -class TrigL2DielectronMassHypo_Jpsiee ( TrigL2DielectronMassHypo ): - __slots__ = [] - def __init__(self, name="TrigL2DielectronMassHypo_Jpsiee"): - super(TrigL2DielectronMassHypo_Jpsiee, self).__init__(name) - - # AcceptAll flag: if true take events regardless of cuts - self.AcceptAll=False - - # cuts - self.OppositeSign=True - self.CommonVertex=True - self.ValidElectron=True - - # require invariant mass within window - self.LowerMassCut=1*GeV - self.UpperMassCut=6*GeV - - self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Jpsiee() ] - -class TrigL2DielectronMassHypo_Upsiee ( TrigL2DielectronMassHypo ): - __slots__ = [] - def __init__(self, name="TrigL2DielectronMassHypo_Upsiee"): - super(TrigL2DielectronMassHypo_Upsiee, self).__init__(name) - - # AcceptAll flag: if true take events regardless of cuts - self.AcceptAll=False - - # cuts - self.OppositeSign=True - self.CommonVertex=True - self.ValidElectron=True - - # require invariant mass within window - self.LowerMassCut=6*GeV - self.UpperMassCut=20*GeV - - self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Upsiee() ] - -class TrigL2DielectronMassHypo_Zee ( TrigL2DielectronMassHypo ): - __slots__ = [] - def __init__(self, name="TrigL2DielectronMassHypo_Zee"): - super(TrigL2DielectronMassHypo_Zee, self).__init__(name) - - # AcceptAll flag: if true take events regardless of cuts - self.AcceptAll=False - - # cuts - self.OppositeSign=True - self.CommonVertex=True - self.ValidElectron=True - - # require invariant mass within window - self.LowerMassCut=45.0*GeV - self.UpperMassCut=180.0*GeV - - self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Zee() ] - -class TrigL2DielectronMassHypo_Zeg ( TrigL2DielectronMassHypo ): - __slots__ = [] - def __init__(self, name="TrigL2DielectronMassHypo_Zeg"): - super(TrigL2DielectronMassHypo_Zeg, self).__init__(name) - - # AcceptAll flag: if true take events regardless of cuts - self.AcceptAll=False - - # cuts - self.OppositeSign=False - self.CommonVertex=False - self.ValidElectron=False - - # require invariant mass within window - self.LowerMassCut=45.0*GeV - self.UpperMassCut=100000.0*GeV - - self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Zee() ] - -class TrigL2DielectronMassHypo_Zee2 ( TrigL2DielectronMassHypo ): - __slots__ = [] - def __init__(self, name="TrigL2DielectronMassHypo_Zee2"): - super(TrigL2DielectronMassHypo_Zee2, self).__init__(name) - - # AcceptAll flag: if true take events regardless of cuts - self.AcceptAll=False - - # cuts - self.OppositeSign=True - self.CommonVertex=True - self.ValidElectron=True - - # require invariant mass within window - self.LowerMassCut=30.0*GeV - self.UpperMassCut=140.0*GeV - - self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Zee() ] - -class TrigL2DielectronMassHypo_ZeeTight ( TrigL2DielectronMassHypo ): - __slots__ = [] - def __init__(self, name="TrigL2DielectronMassHypo_ZeeTight"): - super(TrigL2DielectronMassHypo_ZeeTight, self).__init__(name) - - # AcceptAll flag: if true take events regardless of cuts - self.AcceptAll=False - - # cuts - self.OppositeSign=True - self.CommonVertex=True - self.ValidElectron=True - - # require invariant mass within window - self.LowerMassCut=80.0*GeV - self.UpperMassCut=100.0*GeV - - self.AthenaMonTools = [ TrigL2DielectronMassOnlineMonitoring(), TrigL2DielectronMassValidationMonitoring_Zee() ] - diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2DielectronMassHypoMonitoring.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2DielectronMassHypoMonitoring.py deleted file mode 100755 index a71e1840e4edeab2ea44e504a6f8024229a12aeb..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2DielectronMassHypoMonitoring.py +++ /dev/null @@ -1,48 +0,0 @@ -# Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration - -from TrigMonitorBase.TrigGenericMonitoringToolConfig import defineHistogram, TrigGenericMonitoringToolConfig -from AthenaCommon.SystemOfUnits import GeV - -class TrigL2DielectronMassOnlineMonitoring(TrigGenericMonitoringToolConfig): - def __init__ (self, name="TrigL2DielectronMassOnlineMonitoring"): - """ defines hisograms for online """ - super(TrigL2DielectronMassOnlineMonitoring, self).__init__(name) - self.defineTarget("Online") - - self.Histograms = [ defineHistogram('cut', type='TH1F', title="Cut counter", - xbins=7, xmin=-0.5, xmax=6.5, opt="kCumulative") ] - - -class TrigL2DielectronMassValidationMonitoring_Jpsiee(TrigGenericMonitoringToolConfig): - def __init__ (self, name="TrigL2DielectronMassValidationMonitoring_Jpsiee"): - """ defines hisograms for online """ - super(TrigL2DielectronMassValidationMonitoring_Jpsiee, self).__init__(name) - self.defineTarget("Validation") - - self.Histograms += [ defineHistogram('cut', type='TH1F', title="Cut counter", - xbins=7, xmin=-0.5, xmax=6.5, opt="kCumulative") ] - self.Histograms += [ defineHistogram('massOfAccepted', type='TH1F', title="Mass in accepted combinations", - xbins=50, xmin=0.*GeV, xmax=20.*GeV) ] - -class TrigL2DielectronMassValidationMonitoring_Upsiee(TrigGenericMonitoringToolConfig): - def __init__ (self, name="TrigL2DielectronMassValidationMonitoring_Upsiee"): - """ defines hisograms for online """ - super(TrigL2DielectronMassValidationMonitoring_Upsiee, self).__init__(name) - self.defineTarget("Validation") - - self.Histograms += [ defineHistogram('cut', type='TH1F', title="Cut counter", - xbins=7, xmin=-0.5, xmax=6.5, opt="kCumulative") ] - self.Histograms += [ defineHistogram('massOfAccepted', type='TH1F', title="Mass in accepted combinations", - xbins=50, xmin=0.*GeV, xmax=50.*GeV) ] - -class TrigL2DielectronMassValidationMonitoring_Zee(TrigGenericMonitoringToolConfig): - def __init__ (self, name="TrigL2DielectronMassValidationMonitoring_Zee"): - """ defines hisograms for online (to be used in Fex and Hypo)""" - super(TrigL2DielectronMassValidationMonitoring_Zee, self).__init__(name) - self.defineTarget("Validation") - - self.Histograms += [ defineHistogram('cut', type='TH1F', title="Cut counter", - xbins=7, xmin=-0.5, xmax=6.5, opt="kCumulative") ] - self.Histograms += [ defineHistogram('massOfAccepted', type='TH1F', title="Mass in accepted combinations", - xbins=50, xmin=0.0*GeV, xmax=250.0*GeV) ] - diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexConfig.py index 4843a118adb774f423bcdc707ad13d91faae98e9..33d68d4901afef86f76171d414371330b8bb4269 100755 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexConfig.py +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronFexConfig.py @@ -9,11 +9,6 @@ from TrigEgammaHypo.TrigEgammaHypoConf import TrigL2ElectronFex from AthenaCommon.SystemOfUnits import GeV, mm from AthenaCommon.AppMgr import ToolSvc -#from TrackToCalo.ExtrapolateToCaloToolBase import \ -# ExtrapolateToCaloToolFactory -#extrap = ExtrapolateToCaloToolFactory (depth='showerdefault', -# straightLine=False) -#ToolSvc+=extrap # --------------------------------------------------------------- # class for common setups (like monitoring) @@ -29,17 +24,13 @@ class L2ElectronFexBase(TrigL2ElectronFex): self.AthenaMonTools = [ time, validation, online ] - self.EtaBins = [0.0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47] # Tracking cuts self.TrackPt = 1.0 * GeV # Calo-Tracking matching cuts - self.CaloTrackdETA = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5] - self.CaloTrackdPHI = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5] - self.CaloTrackdEoverPLow = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - self.CaloTrackdEoverPHigh = [999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0] - self.dETACLUSTERthr = 0.1 #not used any more - self.dPHICLUSTERthr = 0.1 #not used any more -# self.TrackExtrapolator=extrap + self.CaloTrackdETA = 0.5 + self.CaloTrackdPHI = 0.5 + self.CaloTrackdEoverPLow = 0.0 + self.CaloTrackdEoverPHigh = 999.0 # --------------------------------------------------------------- # TrigL2ElectronFex configurations @@ -52,153 +43,27 @@ class L2ElectronFex_all(L2ElectronFexBase): # AcceptAll flag: if true take events regardless of cuts self.AcceptAll = False - - # Select tracking algorithm - self.TrackAlgoId = 9 # IDscan [1=SiTrack, 4=TRT, 0=use all, 5: SiTrack+IDScan] # Co-ordinates of calorimeter face for extrapolation self.RCalBarrelFace = 1470.0*mm self.ZCalEndcapFace = 3800.0*mm - -class L2ElectronFex_all_L2SW(L2ElectronFex_all): - __slots__ = [] - def __init__(self,name="L2ElectronFex_all_L2SW"): - super(L2ElectronFex_all_L2SW, self).__init__(name) - -#No Cut chains -class L2ElectronFex_all_NoCut(L2ElectronFex_all): - __slots__ = [] - def __init__(self,name="L2ElectronFex_all_NoCut"): - super(L2ElectronFex_all_NoCut, self).__init__(name) - self.AcceptAll = True - class L2ElectronFex_1(L2ElectronFex_all): __slots__ = [] def __init__(self,name="L2ElectronFex_1"): super(L2ElectronFex_1, self).__init__(name) self.AcceptAll = True - -class L2ElectronFex_all_L2SW_NoCut(L2ElectronFex_all): - __slots__ = [] - def __init__(self,name="L2ElectronFex_all_L2SW_NoCut"): - super(L2ElectronFex_all_L2SW_NoCut, self).__init__(name) - self.AcceptAll = True - -class L2ElectronFex_all_Ringer_NoCut(L2ElectronFex_all): - __slots__ = [] - def __init__(self,name="L2ElectronFex_all_Ringer_NoCut"): - super(L2ElectronFex_all_Ringer_NoCut, self).__init__(name) - self.CaloAlgoId = 2 #CaloRinger - self.AcceptAll = True - -#L2 IDScan chains -class L2ElectronFex_IdScan(L2ElectronFex_all): - __slots__ = [] - def __init__(self,name="L2ElectronFex_IdScan"): - super(L2ElectronFex_IdScan, self).__init__(name) - self.TrackAlgoId = 2 # IDscan - -class L2ElectronFex_IdScan_NoCut(L2ElectronFex_IdScan): - __slots__ = [] - def __init__(self,name="L2ElectronFex_IdScan_NoCut"): - super(L2ElectronFex_IdScan_NoCut, self).__init__(name) - self.AcceptAll = True - -#L2 SiTrack chains -class L2ElectronFex_SiTrack(L2ElectronFex_all): - __slots__ = [] - def __init__(self,name="L2ElectronFex_SiTrack"): - super(L2ElectronFex_SiTrack, self).__init__(name) - self.TrackAlgoId = 1 # SiTrack - -class L2ElectronFex_SiTrack_NoCut(L2ElectronFex_SiTrack): - __slots__ = [] - def __init__(self,name="L2ElectronFex_SiTrack_NoCut"): - super(L2ElectronFex_SiTrack_NoCut, self).__init__(name) - self.AcceptAll = True - -#L2 TRTSegFinder chains -class L2ElectronFex_TRTSegFinder(L2ElectronFex_all): - __slots__ = [] - def __init__(self,name="L2ElectronFex_TRTSegFinder"): - super(L2ElectronFex_TRTSegFinder, self).__init__(name) - - # AcceptAll flag: if true take events regardless of cuts - self.AcceptAll = False - # Select tracking algorithm - self.TrackAlgoId = 3 #TRTSegFinder - - # Calo-Tracking matching cuts - self.TrackPtTRT = 1.0 * GeV - self.CaloTrackdETATRT = [999., 999., 999., 999., 999., 999., 999., 999., 999.] - self.CaloTrackdPHITRT = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5] - - -class L2ElectronFex_TRTSegFinder_NoCut(L2ElectronFex_TRTSegFinder): - __slots__ = [] - def __init__(self,name="L2ElectronFex_TRTSegFinder_NoCut"): - super(L2ElectronFex_TRTSegFinder_NoCut, self).__init__(name) - self.AcceptAll = True - -#L2 Use all tracks, EF forward+back tracking for photon conversion studies -class L2ElectronFex_FwdBackTracking(L2ElectronFexBase): +class L2ElectronFex_LowPt(L2ElectronFex_all): __slots__ = [] - def __init__(self,name="L2ElectronFex_FwdBackTracking"): - super(L2ElectronFex_FwdBackTracking, self).__init__(name) - - # AcceptAll flag: if true take events regardless of cuts + def __init__(self,name="L2ElectronFex_LowPt"): + super(L2ElectronFex_1, self).__init__(name) self.AcceptAll = False - - # Select tracking algorithm - self.TrackAlgoId = 0 # Use all tracks - - # Calo-Tracking matching cuts - self.TrackPtTRT = 1.0 * GeV - self.CaloTrackdETATRT = [999., 999., 999., 999., 999., 999., 999., 999., 999.] - self.CaloTrackdPHITRT = [0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5, 0.5] - -# L2Star strategy A,B,C -class L2ElectronFex_L2StarA(L2ElectronFex_all): - __slots__ = [] - def __init__(self,name="L2ElectronFex_L2StarA"): - super(L2ElectronFex_L2StarA, self).__init__(name) - self.TrackAlgoId = 5 # L2Star strategy A -class L2ElectronFex_L2StarB(L2ElectronFex_all): +class L2ElectronFex_HighPt(L2ElectronFex_all): __slots__ = [] - def __init__(self,name="L2ElectronFex_L2StarB"): - super(L2ElectronFex_L2StarB, self).__init__(name) - self.TrackAlgoId = 6 # L2Star strategy B - -class L2ElectronFex_L2StarC(L2ElectronFex_all): - __slots__ = [] - def __init__(self,name="L2ElectronFex_L2StarC"): - super(L2ElectronFex_L2StarC, self).__init__(name) - self.TrackAlgoId = 7 # L2Star strategy C - -class L2ElectronFex_FTK(L2ElectronFex_all): - __slots__ = [] - def __init__(self,name="L2ElectronFex_FTK"): - super(L2ElectronFex_FTK, self).__init__(name) - self.TrackAlgoId = 8 - -class L2ElectronFex_IDComb(L2ElectronFex_FwdBackTracking): - __slots__ = [] - def __init__(self,name="L2ElectronFex_IDComb"): - super(L2ElectronFex_IDComb, self).__init__(name) - - -class L2ElectronFex_FwdBackTracking_NoCut(L2ElectronFex_FwdBackTracking): - __slots__ = [] - def __init__(self,name="L2ElectronFex_FwdBackTracking_NoCut"): - super(L2ElectronFex_FwdBackTracking_NoCut, self).__init__(name) - self.AcceptAll = True - -class L2ElectronFex_Ringer(L2ElectronFex_all): - __slots__ = [] - def __init__(self,name="L2ElectronFex_Ringer"): - super(L2ElectronFex_Ringer, self).__init__(name) - self.CaloAlgoId = 2 # CaloRinger + def __init__(self,name="L2ElectronFex_HighPt"): + super(L2ElectronFex_1, self).__init__(name) + self.AcceptAll = False + self.TrackPt = 2.0 * GeV diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoConfig.py b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoConfig.py index d98079052a89345308624223df25eacd641df694..f76bd5eeaae57989ac2a23399d3891c6a584d502 100755 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoConfig.py +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/python/TrigL2ElectronHypoConfig.py @@ -28,15 +28,9 @@ class L2ElectronHypoBase(TrigL2ElectronHypo): self.AthenaMonTools = [ time, validation, online ] #common attributes - self.EtaBins = [0.0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47] - self.CaloTrackdEoverPLow = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - self.CaloTrackdEoverPHigh = [999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0] - self.TRTRatio = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] - self.EtaBinsTRT = [0.0, 0.6, 0.8, 1.15, 1.37, 1.52, 1.81, 2.01, 2.37, 2.47] - self.CaloTrackdEoverPLowTRT = [0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0, 0.0] - self.CaloTrackdEoverPHighTRT = [999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0, 999.0] - self.TRTRatioTRT = [-999., -999., -999., -999., -999., -999., -999., -999., -999.] - self.CaloTrackdETATRT = [999., 999., 999., 999., 999., 999., 999., 999., 999.] + self.CaloTrackdEoverPLow = 0.0 + self.CaloTrackdEoverPHigh = 999.0 + self.TRTRatio = -999. # --------------------------------------------------------------- @@ -54,26 +48,18 @@ class L2ElectronHypo_e_NoCut(L2ElectronHypoBase): super( L2ElectronHypo_e_NoCut, self).__init__(name) self.AcceptAll = True -# --- No Cut but set the track algorithm -class L2ElectronHypo_e_NoCut_TrkAlgo(L2ElectronHypoBase): - __slots__ = [] - def __init__(self, name, threshold): - super( L2ElectronHypo_e_NoCut, self).__init__(name) - self.AcceptAll = True - # Configurable L2 Electron class via menu # Using cuts based on Et threshold -# Need to be fixed for ID +# Only depends on threshold class L2ElectronHypo_e_ID (L2ElectronHypoBase): __slots__ = [] def __init__(self, name, threshold, IDinfo): super( L2ElectronHypo_e_ID, self ).__init__( name ) self.AcceptAll = False - self.TrackAlgoId = 9 # [0=All, 3=TRT, 5=SiTrack or IdScan, 6, strategyB, 7, strategyC, 9 new Fast Tracking] # cuts self.TrackPt = 1.0 * GeV - self.CaloTrackdETA = [ 0.2 , 0.2 , 0.2 , 0.2 , 0.2 , 0.2 , 0.2 , 0.2 , 0.2 ] - self.CaloTrackdPHI = [ 999., 999., 999., 999., 999., 999., 999., 999., 999.] + self.CaloTrackdETA = 0.2 + self.CaloTrackdPHI = 999. if(float(threshold) < 15): self.TrackPt = 1.0 * GeV elif (float(threshold) >= 15 and float(threshold) < 20): @@ -82,41 +68,11 @@ class L2ElectronHypo_e_ID (L2ElectronHypoBase): self.TrackPt = 3.0 * GeV elif (float(threshold) >= 50): self.TrackPt = 5.0 * GeV - self.CaloTrackdETA = [ 999., 999., 999., 999., 999., 999., 999., 999., 999.] - self.CaloTrackdPHI = [ 999., 999., 999., 999., 999., 999., 999., 999., 999.] + self.CaloTrackdETA = 999. + self.CaloTrackdPHI = 999. else: raise RuntimeError('No threshold: Default cut configured') -# Configurable L2 Track Algorithm -class L2ElectronHypo_e_ID_L2TrkAlg (L2ElectronHypo_e_ID): - __slots__ = [] - def __init__(self, name, threshold, IDinfo, L2IDAlg): - super( L2ElectronHypo_e_ID_L2TrkAlg, self ).__init__( name, threshold, IDinfo ) - # Here we need to set the TrackAlgoID from the menu name - if L2IDAlg == 'TRT': - self.TrackAlgoId = 3 - elif L2IDAlg == 'L2StarA': - self.TrackAlgoId = 5 - elif L2IDAlg == 'L2StarB': - self.TrackAlgoId = 6 - elif L2IDAlg == 'L2StarC': - self.TrackAlgoId = 7 - elif L2IDAlg == 'FTK': - self.TrackAlgoId = 8 - else: - self.TrackAlgoId = 9 # [0=All, 3=TRT, 5=SiTrack or IdScan, 6=L2StarB, 7=L2StarC, 8=FTK, 9=Fast] - -# TRT has different cuts -class L2ElectronHypo_e_ID_TRT (L2ElectronHypo_e_ID): - __slots__ = [] - def __init__(self, name, threshold, IDinfo): - super( L2ElectronHypo_e_ID_TRT, self ).__init__( name, threshold, IDinfo ) - # Here we need to set the TrackAlgoID from the menu name - self.TrackAlgoId = 3 # [0=All, 3=TRT, 5=SiTrack or IdScan, 6=L2StarB, 7=L2StarC] - # cuts - self.TrackPtTRT = 1.0 * GeV - self.CaloTrackdPHITRT = [0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3, 0.3] - # --------------------------------------------------------------- # NoCut @@ -127,10 +83,9 @@ class L2ElectronHypo_1(L2ElectronHypoBase): # AcceptTrigIDCaloHypoAll flag: if true take events regardless of cuts self.AcceptAll = True - self.TrackAlgoId = 9 # [0=All, 3=TRT, 5=SiTrack or IdScan] # cuts self.TrackPt = 2.0 * GeV - self.CaloTrackdETA = [0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1, 0.1] - self.CaloTrackdPHI = [ 999., 999., 999., 999., 999., 999., 999., 999., 999.] + self.CaloTrackdETA = 0.1 + self.CaloTrackdPHI = 999. diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2DielectronMassFex.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2DielectronMassFex.cxx deleted file mode 100755 index 38df62ebb1a5952f0b68acc01d9ccacbcefece8e..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2DielectronMassFex.cxx +++ /dev/null @@ -1,461 +0,0 @@ -// -*- C++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/************************************************************************** - ** - ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2DielectronMassFex.h - ** - ** Description: - Hypothesis algorithm: searc for electron pairs with - ** invariant mass in some interval; intended for Z->ee - ** - Modified from TrigL2DimuonMassFex by C.Schiavi - ** - ** Author: R.Goncalo <r.goncalo@rhul.ac.uk> - ** - ** Created: Aug 13 2006 - ** Modified: Jan 19 2007 Valeria Perez Reale Adapted to New Steering - ** Modified: Apr 28 2007 Tomasz Bold major changes to run with new steering - ** Modified: May 25 2011 Toyonobu Okuyama major change to attach the calculated - ** invariant mass to outputTE as TrigOperationalInfo - ** Modified: Apr 2016 use TrigComposite - **************************************************************************/ - -#include "TrigSteeringEvent/TrigRoiDescriptor.h" -#include "xAODTrigger/TrigPassBits.h" - -#include "TrigEgammaHypo/TrigL2DielectronMassFex.h" -#include "CxxUtils/sincos.h" - -#include <math.h> -#include <cstdio> - -TrigL2DielectronMassFex::TrigL2DielectronMassFex(const std::string & name, ISvcLocator* pSvcLocator) - : HLT::ComboAlgo(name, pSvcLocator) { - - // use cluster mode - declareProperty("UseClusterAsProbe", m_useClusterAsProbe=true); - - // electron mass definition - declareProperty("ElectronMass", m_electronMass=0.511); - - // Read cuts - declareProperty("AcceptAll", m_acceptAll); - declareProperty("SameTrackAlgo",m_sameTrackAlgo=true); - declareProperty("OppositeSign", m_oppositeCharge=true); - declareProperty("CommonVertex", m_commonVertex=true); - declareProperty("ValidElectron",m_electronValid=true); - declareProperty("LowerMassCut", m_lowerMassCut=1000.0);//! for J/psi - declareProperty("UpperMassCut", m_upperMassCut=15000.0);//! for J/psi - - // monitoring - declareMonitoredVariable("massOfAccepted", m_monMassAccepted); - declareMonitoredVariable("cut", m_monCut); - m_cont=nullptr; -} - -TrigL2DielectronMassFex::~TrigL2DielectronMassFex() -{ } - -HLT::ErrorCode TrigL2DielectronMassFex::hltInitialize() -{ - - ATH_MSG_DEBUG("Initialization:"); - - ATH_MSG_DEBUG("Initialization completed successfully:"); - ATH_MSG_DEBUG("AcceptAll = " - << (m_acceptAll==true ? "True" : "False")); - ATH_MSG_DEBUG("UseClusterAsProbe = " - << (m_useClusterAsProbe==true ? "True" : "False")); - ATH_MSG_DEBUG("ElectronMass = " << m_electronMass); - ATH_MSG_DEBUG("ValidElectron = " - << (m_electronValid==true ? "True" : "False")); - ATH_MSG_DEBUG("SameTrackAlgo = " - << (m_sameTrackAlgo==true ? "True" : "False")); - ATH_MSG_DEBUG("OppositeCharge = " - << (m_oppositeCharge==true ? "True" : "False")); - ATH_MSG_DEBUG("CommonVertex = " - << (m_commonVertex==true ? "True" : "False")); - ATH_MSG_DEBUG("LowerMassCut = " << m_lowerMassCut); - ATH_MSG_DEBUG("UpperMassCut = " << m_upperMassCut); - - return HLT::OK; -} - - -HLT::ErrorCode TrigL2DielectronMassFex::hltFinalize() -{ - ATH_MSG_INFO("in finalize()"); - - return HLT::OK; -} - - -HLT::ErrorCode TrigL2DielectronMassFex::acceptInputs(HLT::TEConstVec& inputTE, bool& pass ) { - m_massCont.clear(); - m_monMassAccepted = -1.; - m_monCut=0; - // sanity checks - ATH_MSG_DEBUG("Running TrigL2DielectronMassFex::acceptInputs"); - - if ( inputTE.size() != 2 ) { - ATH_MSG_ERROR( "Got diferent than 2 number of input TEs: " << inputTE.size() << " job badly configured"); - return HLT::BAD_JOB_SETUP; - } - - // Accept-All mode: temporary patch; should be done with force-accept - if (m_acceptAll) { - ATH_MSG_DEBUG("AcceptAll property is set: taking all events"); - pass = true; - return HLT::OK; - } - else { - ATH_MSG_DEBUG("AcceptAll property not set: applying selection"); - } - - // this are 2 TEs which we eventually will combine - const HLT::TriggerElement* te1 = inputTE[0]; - const HLT::TriggerElement* te2 = inputTE[1]; - - // for debugging purpose look into RoIDescriptors - if ( msgLvl() <= MSG::DEBUG ){ - const TrigRoiDescriptor* roiDescriptor1 = 0; - const TrigRoiDescriptor* roiDescriptor2 = 0; - if ( getFeature(te1, roiDescriptor1) != HLT::OK || getFeature(te2, roiDescriptor2) != HLT::OK ) - ATH_MSG_WARNING("No RoIDescriptors for this Trigger Elements! "); - else - ATH_MSG_DEBUG("Trying to combine 2 RoIs: " << *roiDescriptor1 << " & " << *roiDescriptor2); - } - - // retrieve TrigElectronContainers(orTrigEMCluster) from this TE - const xAOD::TrigElectronContainer* electronContainer1(0); - const xAOD::TrigElectronContainer* electronContainer2(0); - const xAOD::TrigEMCluster* cluster2(0);//! index "2" means this container is used for probe - if( m_useClusterAsProbe) { - if ( getFeature(te1, electronContainer1) != HLT::OK || getFeature(te2, cluster2) != HLT::OK || - electronContainer1 == 0 || cluster2 == 0 ) { - ATH_MSG_WARNING("Failed to get TrigElectron or TrigEMCluster collections"); - return HLT::MISSING_FEATURE; - } - } else if ( getFeature(te1, electronContainer1) != HLT::OK || getFeature(te2, electronContainer2) != HLT::OK || - electronContainer1 == 0 || electronContainer2 == 0 ) { - ATH_MSG_WARNING("Failed to get TrigElectron collections"); - return HLT::MISSING_FEATURE; - } - - const xAOD::TrigPassBits* bits(0); - HLT::ErrorCode status = getFeature(te1, bits, "passbits"); - if (status != HLT::OK) { - ATH_MSG_WARNING(" Failed to get TrigPassBits "); - return HLT::MISSING_FEATURE; - } - - pass=false; - - // now we have 2 bunches of electrons and we need to find out whether they can form topological combination - // loop ver all combinations - xAOD::TrigElectronContainer::const_iterator electron1; - xAOD::TrigElectronContainer::const_iterator electron2; - - - if( m_useClusterAsProbe ) { - // Use Cluster Mode (TrigElectron - TrigEMCluster) - //================================================== - for ( electron1 = electronContainer1->begin(); electron1 != electronContainer1->end(); ++electron1 ) { - - if(!bits->isPassing((*electron1),electronContainer1)){ - ATH_MSG_VERBOSE("Electron found not passing Hypo object"); - continue; - } - ATH_MSG_DEBUG("New combination:"); - ATH_MSG_DEBUG("1st TrigElectron " - << ") RoI id="<< (*electron1)->roiWord() - << "; pt=" << (*electron1)->pt() - << "; eta=" << (*electron1)->eta() - << "; phi=" << (*electron1)->phi()); - ATH_MSG_DEBUG("2nd CaloCluster " - //<< ") RoI id="<< *roiDescriptor2 - << "; Et=" << cluster2->et() - << "; eta=" << cluster2->eta() - << "; phi=" << cluster2->phi()); - - m_monCut = 5; - // evaluate mass - double mass = TrigL2DielectronMassHelpers::invariantMass((*electron1), cluster2, m_electronMass); - - // apply cut on mass - if(mass<m_lowerMassCut || mass>m_upperMassCut) { - ATH_MSG_VERBOSE("Combination failed mass cut: " - << mass << " not in [" << m_lowerMassCut << "," - << m_upperMassCut << "]"); - continue; - } else { - // good combination found - pass = true; - m_monCut = 6; - m_monMassAccepted = mass; - m_massCont.push_back(mass); - ATH_MSG_VERBOSE("Good combination found! Mee="<< mass << " MeV"); - - } - } - } else { - // Normal Mode (TrigElectron - TrigElectron) - //================================================== - for ( electron1 = electronContainer1->begin(); electron1 != electronContainer1->end(); ++electron1 ) { - for ( electron2 = electronContainer2->begin(); electron2 != electronContainer2->end(); ++electron2 ) { - m_monCut = 1; - // selection is done here - // - // debug dump (both electrons have tracks now) - - ATH_MSG_VERBOSE("New combination:"); - ATH_MSG_VERBOSE("1st TrigElectron " - << ") RoI id="<< (*electron1)->roiWord() - << "; pt=" << (*electron1)->pt() - << "; eta=" << (*electron1)->eta() - << "; trkEta= " << (*electron1)->trackParticle()->eta() - << "; phi=" << (*electron1)->phi()); - ATH_MSG_VERBOSE("2nd TrigElectron " - << ") RoI id="<< (*electron2)->roiWord() - << "; pt=" << (*electron2)->pt() - << "; eta=" << (*electron2)->eta() - << "; trkEta= " << (*electron1)->trackParticle()->eta() - << "; phi=" << (*electron2)->phi()); - - m_monCut = 2; - //Ensure the tag electron passes hypo - if(!bits->isPassing((*electron1),electronContainer1)){ - ATH_MSG_VERBOSE("Electron found not passing Hypo object"); - continue; - } - - - m_monCut = 3; - // check charge: track pT is signed according to charge but not electron pT - // should study how well charge can actually be estimated for high-pT tracks... - if( m_oppositeCharge ) { - - // note: track charge can be zero (unknown) so must use > and not >= - if ( ! TrigL2DielectronMassHelpers::opositeCharge(*electron1, *electron2) ) { - ATH_MSG_VERBOSE("Combination failed opposite charge cut"); - continue; - } else { - ATH_MSG_VERBOSE("Combination passed opposite charge cut"); - } - } - m_monCut = 4; - - - // check vertex position: two electrons should come from common - // vertex check only Z of vertex, and only ef Z error is not zero - // take track z at perigee as estimate of vertex z, since lateral - // coordinates are small this should be done better with a vertexing - // algorithm... - // Remove call since code disabled - m_monCut = 5; - // evaluate mass - double mass = TrigL2DielectronMassHelpers::invariantMass((*electron1),(*electron2), m_electronMass); - - // apply cut on mass - if(mass<m_lowerMassCut || mass>m_upperMassCut) { - ATH_MSG_VERBOSE("Combination failed mass cut: " - << mass << " not in [" << m_lowerMassCut << "," - << m_upperMassCut << "]"); - continue; - } else { - // good combination found - pass = true; - m_monCut = 6; - m_monMassAccepted = mass; - m_massCont.push_back(mass); - ATH_MSG_VERBOSE("Good combination found! Mee="<< mass << " MeV"); - - } - } // electrons2 container loop end - } // electrons1 container loop end - } - - // set output TriggerElement true if good combination - ATH_MSG_DEBUG("pass = " << pass); - return HLT::OK; -} - -HLT::ErrorCode TrigL2DielectronMassFex::hltExecute(HLT::TEConstVec& /*inputTE*/, HLT::TriggerElement* outputTE){ - ATH_MSG_DEBUG("N mass accepted : " << m_massCont.size()); - m_cont=new xAOD::TrigCompositeContainer(); - xAOD::TrigCompositeAuxContainer contaux; - m_cont->setStore(&contaux); - for(const auto &mass:m_massCont) { - xAOD::TrigComposite *comp=new xAOD::TrigComposite();; - m_cont->push_back(comp); - comp->setName("L2Dielectron"); - comp->setDetail("Mee",mass); - } - attachFeature(outputTE,m_cont,"L2DielectronInfo"); - ATH_MSG_DEBUG("attached feature"); - - return HLT::OK; -} - - -bool TrigL2DielectronMassHelpers::validElectrons(const xAOD::TrigElectron* /*electron1*/, - const xAOD::TrigElectron* /*electron2*/) { - -/* - if ( !(electron1->isValid() && electron2->isValid()) ) - return false; -*/ - return true; -} - -TrigL2DielectronMassHelpers::Vertex TrigL2DielectronMassHelpers::commonVertex(const xAOD::TrigElectron* /*electron1*/, - const xAOD::TrigElectron* /*electron2*/) { - - -#ifdef DONTDO - double trk_e1_z0error = electron1->err_Zvtx(); - double trk_e2_z0error = electron2->err_Zvtx(); - - if ( trk_e1_z0error > 0 && trk_e2_z0error > 0 ) { - double z0_distance = fabs(electron1->Zvtx() - - electron2->Zvtx()); - - double z0_error = sqrt(trk_e1_z0error * trk_e1_z0error - + trk_e2_z0error * trk_e2_z0error); - - // reject combination if distance squared between perigee of - // tracks is greater than sqrt(6)*error = 2.45*error: this - // should accept 99% of good combinations (common vertex) - // Note: I changed 2.45 to 3 to be conservative => efficiency is - // now 99.7% - if (z0_distance > 3*z0_error) { - return NotCommon; - - } else { - return Common; - } - } -#endif - return Unapplicable; -} - - -bool TrigL2DielectronMassHelpers::opositeCharge(const xAOD::TrigElectron* electron1, - const xAOD::TrigElectron* electron2) { - if ( electron1->charge() * electron2->charge() > 0 ) - return false; - return true; -} - -double TrigL2DielectronMassHelpers::invariantMass(const xAOD::TrigElectron* electron1, - const xAOD::TrigElectron* electron2, - const double electronMass) { - - // get parameters: not electron pT no longer signed - double eta1 = electron1->eta(); - double eta2 = electron2->eta(); - - double Pt1 = electron1->pt() ; // IMPORTANT: pt() is the 4-momentum base class method and - double Pt2 = electron2->pt() ; // it returns the cluster pT; the track pT is given by Pt() - - double phi1 = electron1->phi(); - double phi2 = electron2->phi(); - - double theta1 = 2*atan2((double)exp(-eta1),1.); - double theta2 = 2*atan2((double)exp(-eta2),1.); - double P1 = fabs(Pt1)/sin(theta1); - double P2 = fabs(Pt2)/sin(theta2); - - double p1[3],p2[3]; - - // Replace the following by sincos which calculates the sin and cos - // of the same angle 40% faster (fwinkl) -#ifndef __APPLE__ - sincos(phi1,&p1[1],&p1[0]); - p1[0] *= Pt1; - p1[1] *= Pt1; -#else - CxxUtils::sincos scphi1(phi1); - p1[0] = Pt1*scphi1.cs; - p1[1] = Pt1*scphi1.sn; -#endif - -#ifndef __APPLE__ - sincos(phi2,&p2[1],&p2[0]); - p2[0] *= Pt2; - p2[1] *= Pt2; -#else - CxxUtils::sincos scphi2(phi2); - p2[0] = Pt2*scphi2.cs; - p2[1] = Pt2*scphi2.sn; -#endif - - p1[2] = P1*cos(theta1); - p2[2] = P2*cos(theta2); - - // evaluate mass - double Ptot1 = sqrt(std::pow(p1[0],2)+std::pow(p1[1],2)+std::pow(p1[2],2)); - double Ptot2 = sqrt(std::pow(p2[0],2)+std::pow(p2[1],2)+std::pow(p2[2],2)); - double e1 = sqrt(electronMass + Ptot1*Ptot1); - double e2 = sqrt(electronMass + Ptot2*Ptot2); - double mass = sqrt(2*e1*e2 - 2*p1[0]*p2[0] - 2*p1[1]*p2[1] - 2*p1[2]*p2[2]); - - return mass; -} - -double TrigL2DielectronMassHelpers::invariantMass(const xAOD::TrigElectron* electron, - const xAOD::TrigEMCluster* cluster, - const double electronMass) { - // get parameters: not electron pT no longer signed - double eta1 = electron->eta(); - double eta2 = cluster->eta(); - - double Pt1 = electron->pt(); // IMPORTANT: pt() is the 4-momentum base class method and - double Pt2 = cluster->et(); // it returns the cluster pT; the track pT is given by Pt() - - double phi1 = electron->phi(); - double phi2 = cluster->phi(); - - double theta1 = 2*atan2((double)exp(-eta1),1.); - double theta2 = 2*atan2((double)exp(-eta2),1.); - double P1 = fabs(Pt1)/sin(theta1); - double P2 = fabs(Pt2)/sin(theta2); - - double p1[3],p2[3]; - - // Replace the following by sincos which calculates the sin and cos - // of the same angle 40% faster (fwinkl) -#ifndef __APPLE__ - sincos(phi1,&p1[1],&p1[0]); - p1[0] *= Pt1; - p1[1] *= Pt1; -#else - CxxUtils::sincos scphi1(phi1); - p1[0] = Pt1*scphi1.cs; - p1[1] = Pt1*scphi1.sn; -#endif - -#ifndef __APPLE__ - sincos(phi2,&p2[1],&p2[0]); - p2[0] *= Pt2; - p2[1] *= Pt2; -#else - CxxUtils::sincos scphi2(phi2); - p2[0] = Pt2*scphi2.cs; - p2[1] = Pt2*scphi2.sn; -#endif - - p1[2] = P1*cos(theta1); - p2[2] = P2*cos(theta2); - - // evaluate mass - double Ptot1 = sqrt(std::pow(p1[0],2)+std::pow(p1[1],2)+std::pow(p1[2],2)); - double Ptot2 = sqrt(std::pow(p2[0],2)+std::pow(p2[1],2)+std::pow(p2[2],2)); - double e1 = sqrt(electronMass + Ptot1*Ptot1); - double e2 = sqrt(electronMass + Ptot2*Ptot2); - double mass = sqrt(2*e1*e2 - 2*p1[0]*p2[0] - 2*p1[1]*p2[1] - 2*p1[2]*p2[2]); - - return mass; -} diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2DielectronMassHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2DielectronMassHypo.cxx deleted file mode 100755 index 73be14a0cdd09762c0146073b09796dbda329746..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2DielectronMassHypo.cxx +++ /dev/null @@ -1,132 +0,0 @@ -// -*- C++ -*- - -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/************************************************************************** - ** - ** File: Trigger/TrigHypothesis/TrigEgammaHypo/TrigL2DielectronMassHypo.h - ** - ** Description: - Hypothesis algorithm: searc for electron pairs with - ** invariant mass in some interval; intended for Z->ee - ** - Modified from TrigL2DimuonMassHypo by C.Schiavi - ** - ** Author: R.Goncalo <r.goncalo@rhul.ac.uk> - ** - ** Created: Aug 13 2006 - ** Modified: Jan 19 2007 Valeria Perez Reale Adapted to New Steering - ** Modified: Apr 28 2007 Tomasz Bold major changes to run with new steering - ** Modified: May 2011 major changes to use TrigOperatioanlInfo - ** Modified: Apr 2016 use TrigComposite - **************************************************************************/ - -#include "TrigEgammaHypo/TrigL2DielectronMassFex.h" -#include "TrigEgammaHypo/TrigL2DielectronMassHypo.h" -#include "xAODTrigger/TrigComposite.h" -#include "xAODTrigger/TrigCompositeContainer.h" - -class ISvcLocator; - -TrigL2DielectronMassHypo::TrigL2DielectronMassHypo(const std::string & name, ISvcLocator* pSvcLocator): - HLT::HypoAlgo(name, pSvcLocator) -{ - - // Read cuts - declareProperty("AcceptAll", m_acceptAll); - declareProperty("SameTrackAlgo",m_sameTrackAlgo=true); - declareProperty("OppositeSign", m_oppositeCharge=true); - declareProperty("CommonVertex", m_commonVertex=true); - declareProperty("ValidElectron",m_electronValid=true); - declareProperty("LowerMassCut", m_lowerMassCut=1000.0); - declareProperty("UpperMassCut", m_upperMassCut=6000.0); - - // monitoring - declareMonitoredVariable("massOfAccepted", m_monMassAccepted); - declareMonitoredVariable("cut", m_monCut); - -} - -TrigL2DielectronMassHypo::~TrigL2DielectronMassHypo() -{ } - -HLT::ErrorCode TrigL2DielectronMassHypo::hltInitialize() -{ - - ATH_MSG_INFO("Initialization:"); - - ATH_MSG_DEBUG("Initialization completed successfully:"); - ATH_MSG_DEBUG("AcceptAll = " - << (m_acceptAll==true ? "True" : "False")); - ATH_MSG_DEBUG("ValidElectron = " - << (m_electronValid==true ? "True" : "False")); - ATH_MSG_DEBUG("SameTrackAlgo = " - << (m_sameTrackAlgo==true ? "True" : "False")); - ATH_MSG_DEBUG("OppositeCharge = " - << (m_oppositeCharge==true ? "True" : "False")); - ATH_MSG_DEBUG("CommonVertex = " - << (m_commonVertex==true ? "True" : "False")); - ATH_MSG_DEBUG("LowerMassCut = " << m_lowerMassCut); - ATH_MSG_DEBUG("UpperMassCut = " << m_upperMassCut); - - return HLT::OK; -} - - -HLT::ErrorCode TrigL2DielectronMassHypo::hltFinalize() -{ - ATH_MSG_INFO("in finalize()"); - return HLT::OK; -} - -HLT::ErrorCode TrigL2DielectronMassHypo::hltExecute(const HLT::TriggerElement* outputTE, bool& pass) { - pass=false; - m_monCut = 0; - - std::vector<const xAOD::TrigCompositeContainer*> vms; - if (getFeatures(outputTE, vms) != HLT::OK) { - ATH_MSG_WARNING("Failed to get TrigCompositeContainer"); - return HLT::MISSING_FEATURE; - } else { - ATH_MSG_DEBUG("Number of TrigCompositeContainers " << vms.size()); - } - m_monCut = 1; - - const xAOD::TrigCompositeContainer *cont=vms.back(); - if(!cont){ - ATH_MSG_ERROR("REGTEST: Retrieval of TrigCompositeContainer from vector failed"); - return HLT::OK; - } - else ATH_MSG_DEBUG("REGTEST: Number of TrigComposites " << cont->size()); - - float mass=-999.; - for(const auto &comp:*cont){ - if(comp->name()!="L2Dielectron"){ - ATH_MSG_WARNING("REGTEST: Not L2Dielectron TrigComposite"); - continue; - } - if(!comp->getDetail("Mee",mass)){ - ATH_MSG_ERROR("REGTEST: Cannot retrieve Mee"); - return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); - } - m_monCut = 2; - // apply cut on mass - if(mass<m_lowerMassCut || mass>m_upperMassCut) { - ATH_MSG_VERBOSE("Combination failed mass cut: " - << mass << " not in [" << m_lowerMassCut << "," << m_upperMassCut << "]"); - } else { - // good combination found - pass = true; - m_monCut = 3; - m_monMassAccepted = mass; - ATH_MSG_VERBOSE("Combination passed mass cut: " - << m_lowerMassCut << " < " << mass << " < " - << m_upperMassCut); - ATH_MSG_VERBOSE("Good combination found! Mee=" - << mass << " MeV"); - } - } // End of loop over TrigComposites in L2DielectronInfo - - ATH_MSG_DEBUG("pass = " << pass); - return HLT::OK; -} diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFex.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFex.cxx index 98a10201da59c488feea3008ff57118ea584a368..6f88adc5328612b34490dba9111135d5d1362fd1 100755 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFex.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronFex.cxx @@ -20,13 +20,10 @@ ** N.Berger Dec.06 - migrate to new steering (RG) **************************************************************************/ -//#include "TrigInDetToolInterfaces/ITrigInDetTrackExtrapolator.h" -//#include "RecoToolInterfaces/IExtrapolateToCaloTool.h" #include "RecoToolInterfaces/IParticleCaloExtensionTool.h" #include "TrkCaloExtension/CaloExtensionHelpers.h" #include "TrigEgammaHypo/TrigL2ElectronFex.h" #include "xAODTrigCalo/TrigEMClusterContainer.h" - class ISvcLocator; template <class SRC> @@ -42,24 +39,15 @@ TrigL2ElectronFex::TrigL2ElectronFex(const std::string & name, ISvcLocator* pSvc { // Read cuts - should probably get these from an xml file declareProperty( "AcceptAll", m_acceptAll = false ); - declareProperty( "EtaBins", m_etabin ); declareProperty( "TrackPt", m_trackPtthr = 5.0*CLHEP::GeV ); declareProperty( "CaloTrackdETA", m_calotrackdeta ); declareProperty( "CaloTrackdPHI", m_calotrackdphi ); declareProperty( "CaloTrackdEoverPLow", m_calotrackdeoverp_low ); declareProperty( "CaloTrackdEoverPHigh", m_calotrackdeoverp_high ); - declareProperty( "TrackAlgoId", m_trackalgoID = 0 ); - declareProperty( "CaloAlgoId", m_calo_algoID = 1 ); // 0=all (N/A); 1=T2Calo; 2=CaloRinger - declareProperty( "dETACLUSTERthr", m_detacluster = 0.1 ); - declareProperty( "dPHICLUSTERthr", m_dphicluster = 0.1 ); declareProperty( "RCalBarrelFace", m_RCAL = 1470.0*CLHEP::mm ); declareProperty( "ZCalEndcapFace", m_ZCAL = 3800.0*CLHEP::mm ); declareProperty( "ParticleCaloExtensionTool", m_caloExtensionTool); - declareProperty( "TrackPtTRT", m_trackPtthrTRT = 5.0*CLHEP::GeV ); - declareProperty( "CaloTrackdETATRT", m_calotrackdetaTRT ); - declareProperty( "CaloTrackdPHITRT", m_calotrackdphiTRT ); - declareMonitoredCollection("PtCalo",*dvec_cast(&m_trigElecColl),&TrigL2ElectronFex::getCaloPt); declareMonitoredCollection("PtTrack",*dvec_cast(&m_trigElecColl),&TrigL2ElectronFex::getTkPt); declareMonitoredCollection("CaloTrackdEta",*dvec_cast(&m_trigElecColl),&xAOD::TrigElectron::trkClusDeta); @@ -92,15 +80,10 @@ HLT::ErrorCode TrigL2ElectronFex::hltInitialize() ATH_MSG_DEBUG( "AcceptAll = "<< (m_acceptAll==true ? "True" : "False")); ATH_MSG_DEBUG("TrackPt = " << m_trackPtthr); - ATH_MSG_DEBUG("EtaBins = " << m_etabin); ATH_MSG_DEBUG("CaloTrackdETA = " << m_calotrackdeta); ATH_MSG_DEBUG("CaloTrackdPHI = " << m_calotrackdphi); ATH_MSG_DEBUG("CaloTrackdEoverPLow = " << m_calotrackdeoverp_low); ATH_MSG_DEBUG("CaloTrackdEoverPHigh = " << m_calotrackdeoverp_high); - ATH_MSG_DEBUG("TrackAlgoId = " << m_trackalgoID); - ATH_MSG_DEBUG("CaloAlgoId = " << m_calo_algoID); - ATH_MSG_DEBUG("dETACLUSTERthr = " << m_detacluster); - ATH_MSG_DEBUG("dPHICLUSTERthr = " << m_dphicluster); return HLT::OK; } @@ -166,14 +149,6 @@ HLT::ErrorCode TrigL2ElectronFex::hltExecute(const HLT::TriggerElement* inputTE, << ": Eta = " << roiDescriptor->eta() << ", Phi = " << roiDescriptor->phi()); - // fill local variables for RoI reference position - double etaRef = roiDescriptor->eta(); - double phiRef = roiDescriptor->phi(); - - // CaloAlgoId now isn't used anymore, as TrigCaloRinger also dumps a TrigEMCluster - // It is kept for backward compability. - // Eventually it can be passed to the next algos for information?! - float calo_eta(999), calo_phi(999), calo_et(-1); // the ElementLink pointing to a TrigEMCluster needs to be declared in this scope ElementLink<xAOD::TrigEMClusterContainer> el_t2calo_clus; @@ -192,43 +167,6 @@ HLT::ErrorCode TrigL2ElectronFex::hltExecute(const HLT::TriggerElement* inputTE, return HLT::MISSING_FEATURE; } - - // figure out what eta bin this cluster is in - float absEta = fabs(calo_eta); - int etaBin = 0; - - if(m_etabin.size()<2 ) { - ATH_MSG_WARNING("etaBin not configured correctly"); - return HLT::OK;//eta bins not configured correctly - } - - for (unsigned int iBin = 0; iBin < (m_etabin.size()-1); iBin++ ) - if ( absEta > m_etabin[iBin] && absEta < m_etabin[iBin+1] ) etaBin = iBin; - - ATH_MSG_DEBUG("eta bin used for cuts: " << etaBin); - - - // calculate eta and phi distances (deal with angle diferences > Pi) - float dPhi = calo_phi - phiRef; - dPhi = ( fabs(dPhi) < M_PI ? dPhi : 2*M_PI - dPhi ); - - float dEta = fabs( etaRef - calo_eta ); - - - // Following code was previously commented out - // VD already cutting on TriL2CaloHypo - // Accept only L2 em clusters which are "close" to the one provided by L1 - - ATH_MSG_DEBUG("Not cutting on dEta=" << dEta << " or dPhi=" << dPhi); - - //if ( dEta > m_detacluster || dPhi > m_dphicluster ) { - // if ( msgLvl() <= MSG::DEBUG ) { - // msg() << MSG::DEBUG << "Cluster doesn't match RoI! Leaving." << endmsg; - // } - // return HLT::OK; - //} - - // Transverse em energy ATH_MSG_DEBUG("Cluster: ET=" << calo_et); ATH_MSG_DEBUG("searching a matching track: loop over tracks"); @@ -238,12 +176,27 @@ HLT::ErrorCode TrigL2ElectronFex::hltExecute(const HLT::TriggerElement* inputTE, stat = getFeaturesLinks< xAOD::TrackParticleContainer, xAOD::TrackParticleContainer > (inputTE, v_inputTracks, ""); if ( stat != HLT::OK){ - ATH_MSG_WARNING("Failed to retrieve track collection"); + ATH_MSG_WARNING("Failed to retrieve track EL collection"); return HLT::MISSING_FEATURE; } ATH_MSG_DEBUG("Got vector of " << v_inputTracks.size() << " InDetTrackCollections"); + std::vector<const xAOD::TrackParticleContainer*> vectorTrackParticleContainer; + stat = getFeatures(inputTE, vectorTrackParticleContainer); + if (stat != HLT::OK){ + ATH_MSG_WARNING("Failed to retrieve track collection"); + return HLT::MISSING_FEATURE; + } + if (vectorTrackParticleContainer.size() < 1){ + ATH_MSG_ERROR("No track collection, vector < 1"); + return HLT::MISSING_FEATURE; + } + const xAOD::TrackParticleContainer *tracks = vectorTrackParticleContainer.back(); + if(!tracks){ + ATH_MSG_WARNING("Track collection is null"); + return HLT::MISSING_FEATURE; + } CaloExtensionHelpers::LayersToSelect layersToSelect; layersToSelect.insert(CaloSampling::CaloSample::EMB2); @@ -260,120 +213,81 @@ HLT::ErrorCode TrigL2ElectronFex::hltExecute(const HLT::TriggerElement* inputTE, ATH_MSG_VERBOSE(" eta = " << fabs((trkIter)->eta())); ATH_MSG_VERBOSE(" z0 = " << fabs((trkIter)->z0())); - // algorithm ID - int algoId = 0; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::FastTrackFinderSeed] ) algoId=9; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyA] ) algoId=5; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyB] ) algoId=6; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyC] ) algoId=7; - - // ======== Following to be checked ============== // - // do not try track/cluster match if produced by wrong algo (0=all algos) - // Following code needs to be checked for rel21 - // Is it required to check for track algorithm ID? - if (m_trackalgoID == 0 || (unsigned int)algoId == m_trackalgoID || m_acceptAll || - (m_trackalgoID == 5 && (unsigned int)algoId <= 2 )) { - // =============================== ============== // - - ATH_MSG_VERBOSE("good track AlgoId"); - - //Use SiTrack/IDScan cuts or TRT cuts - std::vector<float> temp_calotrackdeta; - std::vector<float> temp_calotrackdphi; - float temp_trackPtthr; - temp_calotrackdeta = m_calotrackdeta; - temp_calotrackdphi = m_calotrackdphi; - temp_trackPtthr = m_trackPtthr; - - // ======== Following to be checked ============== // - // The following should be checked at initialize or before loop - // throw a warning/error and quit chain due to misconfiguration - // - //ignore tracks that don't have cuts - if(temp_calotrackdeta.size()<1 || temp_calotrackdphi.size()<1 ){ - ATH_MSG_DEBUG("Track type does not have corresponding cut configuration"); + // ============================================= // + // Pt cut + float trkPt = fabs((trkIter)->pt()); + float etoverpt = fabs(calo_et/trkPt); + double etaAtCalo=999.; + double phiAtCalo=999.; + if(m_acceptAll){ + if(!extrapolate(*el_t2calo_clus,trkIter,etaAtCalo,phiAtCalo)){ + ATH_MSG_VERBOSE("extrapolator failed"); + continue; + } + else{ + ATH_MSG_DEBUG("REGTEST: TrigElectron: cluster = " << + el_t2calo_clus.getStorableObjectPointer() << " index = " << el_t2calo_clus.index() << + " track = " << trkIter << " eta = " << etaAtCalo << " phi = " << phiAtCalo); + xAOD::TrigElectron* trigElec = new xAOD::TrigElectron(); + m_trigElecColl->push_back(trigElec); + trigElec->init( initialRoI->roiWord(), + etaAtCalo, phiAtCalo, etoverpt, + el_t2calo_clus, + trkLink); + } + } + else { + ATH_MSG_VERBOSE("Apply cuts"); + if(trkPt < m_trackPtthr){ + ATH_MSG_VERBOSE("Failed track pt cut"); continue; } - //ignore incorrect cut configurations - if(temp_calotrackdeta.size()!=(m_etabin.size()-1) || temp_calotrackdphi.size()!=(m_etabin.size()-1) ){ - ATH_MSG_DEBUG("Track type has inconsistent cut configuration"); + if (etoverpt < m_calotrackdeoverp_low){ + ATH_MSG_VERBOSE("failed low cut on ET/PT"); continue; } - // ============================================= // - // Pt cut - float trkPt = fabs((trkIter)->pt()); - if (trkPt > temp_trackPtthr || m_acceptAll) { - ATH_MSG_VERBOSE("passed pT cut"); - - // match in ET/PT - float etoverpt = fabs(calo_et/trkPt); - if (etoverpt > m_calotrackdeoverp_low[etaBin] || m_acceptAll) { - ATH_MSG_VERBOSE("passed low cut on ET/PT"); - - if (etoverpt < m_calotrackdeoverp_high[etaBin] || m_acceptAll) { - ATH_MSG_VERBOSE("passed high cut on ET/PT"); - - // extrapolate track using tool - // get calo extension - const Trk::CaloExtension* caloExtension = 0; - bool useCaching = false; - - if( !m_caloExtensionTool->caloExtension(*trkIter,caloExtension,useCaching) || caloExtension->caloLayerIntersections().empty() ) { - ATH_MSG_VERBOSE("extrapolator failed 1"); - m_extrapolator_failed++; - continue; - } - // extract eta/phi in EM2 - CaloExtensionHelpers::EtaPhiPerLayerVector intersections; - CaloExtensionHelpers::midPointEtaPhiPerLayerVector( *caloExtension, intersections, &layersToSelect ); - if( intersections.empty() ) { - ATH_MSG_VERBOSE("extrapolator failed 2"); - m_extrapolator_failed++; - continue; - } - // pick the correct sample in case of ambiguity - std::tuple<CaloSampling::CaloSample, double, double> etaPhiTuple = intersections.front(); - if( intersections.size() == 2 ) - if ( (*el_t2calo_clus)->energy(CaloSampling::CaloSample::EME2) > (*el_t2calo_clus)->energy(CaloSampling::CaloSample::EMB2) ) - etaPhiTuple=intersections.back(); - double etaAtCalo = std::get<1>(etaPhiTuple); - double phiAtCalo = std::get<2>(etaPhiTuple); - - // all ok: do track-matching cuts - ATH_MSG_VERBOSE("extrapolated eta/phi=" << etaAtCalo << "/" << phiAtCalo); - - // match in eta - float dEtaCalo = fabs(etaAtCalo - calo_eta); - if ( dEtaCalo < temp_calotrackdeta[etaBin] || m_acceptAll) { - ATH_MSG_VERBOSE("passed eta match cut"); - - // match in phi: deal with differences larger than Pi - float dPhiCalo = fabs(phiAtCalo - calo_phi); - dPhiCalo = ( dPhiCalo < M_PI ? dPhiCalo : 2*M_PI - dPhiCalo ); - if ( dPhiCalo < temp_calotrackdphi[etaBin] || m_acceptAll) { - ATH_MSG_VERBOSE("passed phi match cut"); - // all cuts passed - result = true; - /** Create a TrigElectron corresponding to this candidate - assume cluster quantities give better estimate of transverse energy - (probably a safe assumption for large pT) and that track parameters - at perigee give better estimates of angular quantities */ - - ATH_MSG_DEBUG("REGTEST: TrigElectron: cluster = " << - el_t2calo_clus.getStorableObjectPointer() << " index = " << el_t2calo_clus.index() << - " track = " << trkIter << " eta = " << etaAtCalo << " phi = " << phiAtCalo); - xAOD::TrigElectron* trigElec = new xAOD::TrigElectron(); - m_trigElecColl->push_back(trigElec); - trigElec->init( initialRoI->roiWord(), - etaAtCalo, phiAtCalo, etoverpt, - el_t2calo_clus, - trkLink); - } // dphi - } // deta - } //eoverPhi - } //eoverPlow - } //tmp track pt - } // track type + if (etoverpt > m_calotrackdeoverp_high){ + ATH_MSG_VERBOSE("failed high cut on ET/PT"); + continue; + } + if(!extrapolate(*el_t2calo_clus,trkIter,etaAtCalo,phiAtCalo)){ + ATH_MSG_VERBOSE("extrapolator failed 1"); + m_extrapolator_failed++; + continue; + } + // all ok: do track-matching cuts + ATH_MSG_VERBOSE("extrapolated eta/phi=" << etaAtCalo << "/" << phiAtCalo); + // match in eta + float dEtaCalo = fabs(etaAtCalo - calo_eta); + if ( dEtaCalo > m_calotrackdeta){ + ATH_MSG_VERBOSE("failed eta match cut"); + continue; + } + + // match in phi: deal with differences larger than Pi + float dPhiCalo = fabs(phiAtCalo - calo_phi); + dPhiCalo = ( dPhiCalo < M_PI ? dPhiCalo : 2*M_PI - dPhiCalo ); + if ( dPhiCalo > m_calotrackdphi) { + ATH_MSG_VERBOSE("failed phi match cut"); + continue; + } + // all cuts passed + result = true; + /** Create a TrigElectron corresponding to this candidate + assume cluster quantities give better estimate of transverse energy + (probably a safe assumption for large pT) and that track parameters + at perigee give better estimates of angular quantities */ + + ATH_MSG_DEBUG("REGTEST: TrigElectron: cluster = " << + el_t2calo_clus.getStorableObjectPointer() << " index = " << el_t2calo_clus.index() << + " track = " << trkIter << " eta = " << etaAtCalo << " phi = " << phiAtCalo); + xAOD::TrigElectron* trigElec = new xAOD::TrigElectron(); + m_trigElecColl->push_back(trigElec); + trigElec->init( initialRoI->roiWord(), + etaAtCalo, phiAtCalo, etoverpt, + el_t2calo_clus, + trkLink); + } } // set output TriggerElement unless acceptAll is set @@ -399,3 +313,36 @@ HLT::ErrorCode TrigL2ElectronFex::hltExecute(const HLT::TriggerElement* inputTE, m_trigElecColl = nullptr; return HLT::OK; } + +bool TrigL2ElectronFex::extrapolate(const xAOD::TrigEMCluster *clus, const xAOD::TrackParticle *trk, double &etaAtCalo, double &phiAtCalo){ + CaloExtensionHelpers::LayersToSelect layersToSelect; + layersToSelect.insert(CaloSampling::CaloSample::EMB2); + layersToSelect.insert(CaloSampling::CaloSample::EME2); + // extrapolate track using tool + // get calo extension + const Trk::CaloExtension* caloExtension = 0; + bool useCaching = false; + + if( !m_caloExtensionTool->caloExtension(*trk,caloExtension,useCaching) || caloExtension->caloLayerIntersections().empty() ) { + ATH_MSG_VERBOSE("extrapolator failed 1"); + m_extrapolator_failed++; + return false; + } + // extract eta/phi in EM2 + CaloExtensionHelpers::EtaPhiPerLayerVector intersections; + CaloExtensionHelpers::midPointEtaPhiPerLayerVector( *caloExtension, intersections, &layersToSelect ); + if( intersections.empty() ) { + ATH_MSG_VERBOSE("extrapolator failed 2"); + m_extrapolator_failed++; + return false; + } + // pick the correct sample in case of ambiguity + std::tuple<CaloSampling::CaloSample, double, double> etaPhiTuple = intersections.front(); + if( intersections.size() == 2 ) + if ( clus->energy(CaloSampling::CaloSample::EME2) > clus->energy(CaloSampling::CaloSample::EMB2) ) + etaPhiTuple=intersections.back(); + etaAtCalo = std::get<1>(etaPhiTuple); + phiAtCalo = std::get<2>(etaPhiTuple); + + return true; +} diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypo.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypo.cxx index e30ed11a4edc24389dcce4dd3fb887d1e4ca0b6d..a4435a684bf63801f7ac86199601dae0092c188b 100755 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypo.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/TrigL2ElectronHypo.cxx @@ -18,6 +18,7 @@ ** Modified: RG 18 Mar 06 - fix to always generate TrigElectrons ** - use key2keyStore for collection names ** N.Berger Dec.06 - migrate to new steering (RG) + ** Modified: R. White Feb 17 - cleanup and remove eta dependence **************************************************************************/ #include "TrigEgammaHypo/TrigL2ElectronHypo.h" @@ -34,23 +35,12 @@ TrigL2ElectronHypo::TrigL2ElectronHypo(const std::string & name, ISvcLocator* pS HLT::HypoAlgo(name, pSvcLocator) { declareProperty( "AcceptAll", m_acceptAll = true ); - declareProperty( "TrackAlgoId", m_trackalgoID = 0 ); - - declareProperty( "EtaBins", m_etabin ); declareProperty( "TrackPt", m_trackPtthr = 5.0*CLHEP::GeV ); declareProperty( "CaloTrackdETA", m_calotrackdeta ); //loose cut declareProperty( "CaloTrackdPHI", m_calotrackdphi ); //loose cut declareProperty( "CaloTrackdEoverPLow", m_calotrackdeoverp_low ); declareProperty( "CaloTrackdEoverPHigh", m_calotrackdeoverp_high ); - declareProperty( "TRTRatio", m_trtratio ); - - declareProperty( "EtaBinsTRT", m_etabinTRT ); - declareProperty( "TrackPtTRT", m_trackPtthrTRT = 5.0*CLHEP::GeV ); - declareProperty( "CaloTrackdETATRT", m_calotrackdetaTRT ); //loose cut - declareProperty( "CaloTrackdPHITRT", m_calotrackdphiTRT ); //loose cut - declareProperty( "TRTRatioTRT", m_trtratioTRT ); - declareProperty( "CaloTrackdEoverPLowTRT", m_calotrackdeoverp_lowTRT ); - declareProperty( "CaloTrackdEoverPHighTRT", m_calotrackdeoverp_highTRT ); + declareProperty( "TRTRatio", m_trtratio); declareMonitoredVariable("CutCounter",m_cutCounter); declareMonitoredCollection("PtCalo",*dvec_cast(&m_egamma_container),&TrigL2ElectronHypo::getCaloPt); @@ -63,11 +53,9 @@ TrigL2ElectronHypo::TrigL2ElectronHypo(const std::string & name, ISvcLocator* pS m_egamma_container = nullptr; } - TrigL2ElectronHypo::~TrigL2ElectronHypo() { } - HLT::ErrorCode TrigL2ElectronHypo::hltInitialize() { ATH_MSG_DEBUG("Initialization:" ); @@ -75,220 +63,154 @@ HLT::ErrorCode TrigL2ElectronHypo::hltInitialize() ATH_MSG_DEBUG("Initialization completed successfully:" ); ATH_MSG_DEBUG("AcceptAll = " << (m_acceptAll==true ? "True" : "False") ); - ATH_MSG_DEBUG("EtaBins = " << m_etabin ); ATH_MSG_DEBUG("TrackPt = " << m_trackPtthr ); ATH_MSG_DEBUG("CaloTrackdETA = " << m_calotrackdeta ); ATH_MSG_DEBUG("CaloTrackdPHI = " << m_calotrackdphi ); ATH_MSG_DEBUG("CaloTrackdEoverPLow = " << m_calotrackdeoverp_low ); ATH_MSG_DEBUG("CaloTrackdEoverPHigh = " << m_calotrackdeoverp_high); - ATH_MSG_DEBUG("TrackAlgoId = " << m_trackalgoID ); - ATH_MSG_DEBUG("TRTRatio = " << m_trtratio ); - - ATH_MSG_DEBUG("EtaBinsTRT = " << m_etabinTRT ); - ATH_MSG_DEBUG("TrackPtTRT = " << m_trackPtthrTRT ); - ATH_MSG_DEBUG("CaloTrackdETATRT = " << m_calotrackdetaTRT ); - ATH_MSG_DEBUG("CaloTrackdPHITRT = " << m_calotrackdphiTRT ); - ATH_MSG_DEBUG("CaloTrackdEoverPLowTRT = " << m_calotrackdeoverp_lowTRT ); - ATH_MSG_DEBUG("CaloTrackdEoverPHighTRT = " << m_calotrackdeoverp_highTRT); - ATH_MSG_DEBUG("TRTRatioTRT = " << m_trtratioTRT ); - + ATH_MSG_DEBUG("TRTRatio = " << m_trtratio); return HLT::OK; } - HLT::ErrorCode TrigL2ElectronHypo::hltFinalize() { ATH_MSG_INFO("in finalize()" ); - - return HLT::OK; + return HLT::OK; } HLT::ErrorCode TrigL2ElectronHypo::hltExecute(const HLT::TriggerElement* outputTE, bool& pass) { - // initialize monitoring counter - m_cutCounter=-1; - m_egamma_container = 0; - - bool hasInput=false; - bool hasContainer=false; - // Accept-All mode - // Allows algorithm to run - if (m_acceptAll) { - pass = true; - ATH_MSG_DEBUG("AcceptAll property is set: taking all events"); - } else { - pass = false; - ATH_MSG_DEBUG("AcceptAll property not set: applying selection"); - } - - // get RoI descriptor - const TrigRoiDescriptor* roiDescriptor = 0; - if (getFeature(outputTE, roiDescriptor) != HLT::OK) roiDescriptor = 0; - - if ( !roiDescriptor ) { - ATH_MSG_WARNING("No RoI for this Trigger Element! " ); - - return HLT::NAV_ERROR; - } - - ATH_MSG_DEBUG("Using outputTE("<< outputTE <<")->getId(): " << outputTE->getId() - << "; RoI = " << *roiDescriptor); - - - // get TrigElectrons from the steering - const xAOD::TrigElectronContainer* trigElecColl = 0; - HLT::ErrorCode stat = getFeature(outputTE, trigElecColl, "L2ElectronFex"); - - if ( stat != HLT::OK || trigElecColl == 0) { - if ( msgLvl() <= MSG::DEBUG) { - ATH_MSG_DEBUG("Failed to get TrigElectron collection" ); + // initialize monitoring counter + m_cutCounter=-1; + m_egamma_container = 0; + + bool hasInput=false; + bool hasContainer=false; + // Accept-All mode + // Allows algorithm to run + if (m_acceptAll) { + pass = true; + ATH_MSG_DEBUG("AcceptAll property is set: taking all events"); + } else { + pass = false; + ATH_MSG_DEBUG("AcceptAll property not set: applying selection"); } - return HLT::OK; - } - - hasInput=true; - ATH_MSG_DEBUG("Got collection with " << trigElecColl->size() - << " TrigElectrons" ); - - - // if no electrons were found, just leave TrigElectronColl. empty and leave - if ( trigElecColl->size() == 0 ) { - ATH_MSG_DEBUG("No electrons to analyse, leaving!" ); - hasContainer=false; - } - else - hasContainer=true; - // initialize counter after all error conditions checked - m_egamma_container = trigElecColl; - m_cutCounter=0; - bool pTcaloCut=false; - bool dEtaCaloCut=false; - bool dPhiCaloCut=false; - bool eTOverPtCut_lo=false; - bool eTOverPtCut_hi=false; - bool TRTRatioCut=false; - - // generate TrigPassBits mask to flag which TrigElectrons pass hypo cuts - std::unique_ptr<xAOD::TrigPassBits> xBits = xAOD::makeTrigPassBits<xAOD::TrigElectronContainer>(trigElecColl); - - // Now loop over electrons, see if at least one passes all cuts - xAOD::TrigElectronContainer::const_iterator elecIter, elecEnd=trigElecColl->end(); - for (elecIter = trigElecColl->begin(); elecIter != elecEnd; ++elecIter) { - - if(m_acceptAll){ - xBits->markPassing((*elecIter),trigElecColl,true); - continue; - } - const xAOD::TrackParticle* trkIter = (*elecIter)-> trackParticle(); - if (trkIter==NULL) continue; // disconsider candidates without track - int algoId = 0; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::FastTrackFinderSeed] ) algoId=9; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyA] ) algoId=5; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyB] ) algoId=6; - if ( trkIter->patternRecoInfo()[xAOD::TrackPatternRecoInfo::strategyC] ) algoId=7; - ATH_MSG_DEBUG("Trackalgo: "<< algoId ); - // do not try track/cluster match if produced by wrong algo (0=all algos) - if (m_trackalgoID == 0 || (unsigned int)algoId == m_trackalgoID || m_acceptAll || - (m_trackalgoID == 5 && (unsigned int)algoId <= 2 )) { - - // Retrieve all quantities - float absEta = fabs((*elecIter)->caloEta()); - float dPhiCalo = (*elecIter)->trkClusDphi(); - float dEtaCalo = (*elecIter)->trkClusDeta(); - float pTcalo = (*elecIter)->pt(); - float eTOverPt = (*elecIter)->etOverPt(); - // int trackIndx = (*elecIter)->trackIndx(); - float NTRHits = (float)((*elecIter)->nTRTHits()); - float NStrawHits = (float)((*elecIter)->nTRTHiThresholdHits()); - float TRTHitRatio = NStrawHits==0 ? 1e10 : NTRHits/NStrawHits; - - // figure out what eta bin this cluster is in - //Separate binning for IDScan/SiTrack and TRTSegFinder tracks - std::vector<float> temp_etabin; - std::vector<float> temp_calotrackdeta; - std::vector<float> temp_calotrackdphi; - std::vector<float> temp_calotrackdeoverp_low; - std::vector<float> temp_calotrackdeoverp_high; - float temp_trackPtthr = m_trackPtthr; - std::vector<float> temp_trtratio; - temp_etabin = m_etabin; - temp_calotrackdeta = m_calotrackdeta; - temp_calotrackdphi = m_calotrackdphi; - temp_calotrackdeoverp_low = m_calotrackdeoverp_low; - temp_calotrackdeoverp_high = m_calotrackdeoverp_high; - temp_trackPtthr = m_trackPtthr; - temp_trtratio = m_trtratio; + // get RoI descriptor + const TrigRoiDescriptor* roiDescriptor = 0; + if (getFeature(outputTE, roiDescriptor) != HLT::OK) roiDescriptor = 0; - //ignore if cuts/binning not configured - int etaBin = 0; - if(temp_etabin.size()<2 || temp_calotrackdeta.size()<1 || temp_calotrackdphi.size()<1 - || temp_calotrackdeoverp_low.size()<1 || temp_calotrackdeoverp_high.size()<1 || temp_trtratio.size()<1) { - ATH_MSG_DEBUG("Track type "<< algoId<<" does not have corresponding cut configuration" ); - continue;//eta bins and cuts not defined for this track type, ignore track + if ( !roiDescriptor ) { + ATH_MSG_WARNING("No RoI for this Trigger Element! " ); + return HLT::NAV_ERROR; } - - //ignore misconfigured cuts - if(temp_calotrackdeta.size()!= (temp_etabin.size()-1)|| temp_calotrackdphi.size()!= (temp_etabin.size()-1) - || temp_calotrackdeoverp_low.size()!= (temp_etabin.size()-1)|| temp_calotrackdeoverp_high.size()!= (temp_etabin.size()-1) - || temp_trtratio.size()!= (temp_etabin.size()-1)){ - if ( msgLvl() <= MSG::DEBUG ) ATH_MSG_DEBUG("Track type has inconsistent cut configuration" ); - continue; - } - - //## + ATH_MSG_DEBUG("Using outputTE("<< outputTE <<")->getId(): " << outputTE->getId() + << "; RoI = " << *roiDescriptor); - for (std::size_t iBin = 0; iBin < (temp_etabin.size()-1); iBin++ ) - if ( absEta > temp_etabin[iBin] && absEta < temp_etabin[iBin+1] ) etaBin = iBin; - + // get TrigElectrons from the steering + const xAOD::TrigElectronContainer* trigElecColl = 0; + HLT::ErrorCode stat = getFeature(outputTE, trigElecColl, "L2ElectronFex"); - //## - - - ATH_MSG_DEBUG("absEta = " << absEta << " ==> etaBin = " << etaBin ); - ATH_MSG_DEBUG("pT (Calo) = " << pTcalo ); - ATH_MSG_DEBUG("dEtaCalo = " << dEtaCalo << ", cut = " << temp_calotrackdeta[etaBin] ); - ATH_MSG_DEBUG("dPhiCalo = " << dPhiCalo << ", cut = " << temp_calotrackdphi[etaBin] ); - ATH_MSG_DEBUG("eTOverPt = " << eTOverPt << ", cuts = [" - << temp_calotrackdeoverp_low[etaBin] << ", " << temp_calotrackdeoverp_high[etaBin] << "]" ); - - // apply cuts - - if (pTcalo > temp_trackPtthr) { - pTcaloCut=true; - if (dEtaCalo < temp_calotrackdeta[etaBin]) { - dEtaCaloCut=true; - if (dPhiCalo < temp_calotrackdphi[etaBin]) { - dPhiCaloCut=true; - if(eTOverPt > temp_calotrackdeoverp_low[etaBin] ) { - eTOverPtCut_lo = true; - if ( eTOverPt < temp_calotrackdeoverp_high[etaBin] ) { - eTOverPtCut_hi = true; - if (TRTHitRatio > temp_trtratio[etaBin]){ - TRTRatioCut = true; - - // TrigElectron passed all cuts: set flags - pass = true; - xBits->markPassing((*elecIter),trigElecColl,true); + if ( stat != HLT::OK || trigElecColl == 0) { + if ( msgLvl() <= MSG::DEBUG) { + ATH_MSG_DEBUG("Failed to get TrigElectron collection" ); + } + return HLT::OK; + } - ATH_MSG_DEBUG("Event accepted !" ); + hasInput=true; + ATH_MSG_DEBUG("Got collection with " << trigElecColl->size() + << " TrigElectrons" ); - } - } - } - } - } - } + // if no electrons were found, just leave TrigElectronColl. empty and leave + if ( trigElecColl->size() == 0 ) { + ATH_MSG_DEBUG("No electrons to analyse, leaving!" ); + hasContainer=false; } - } // end of loop over electrons - - m_cutCounter=hasInput+hasContainer+pTcaloCut+dEtaCaloCut+dPhiCaloCut+eTOverPtCut_lo+eTOverPtCut_hi+TRTRatioCut; - // store TrigPassBits result - if(attachFeature(outputTE, xBits.release(),"passbits") != HLT::OK) - ATH_MSG_ERROR("Could not store TrigPassBits! "); + else { + hasContainer=true; + } + // initialize counter after all error conditions checked + m_egamma_container = trigElecColl; + m_cutCounter=0; + bool pTcaloCut=false; + bool dEtaCaloCut=false; + bool dPhiCaloCut=false; + bool eTOverPtCut_lo=false; + bool eTOverPtCut_hi=false; + bool TRTRatioCut=false; + + // generate TrigPassBits mask to flag which TrigElectrons pass hypo cuts + std::unique_ptr<xAOD::TrigPassBits> xBits = xAOD::makeTrigPassBits<xAOD::TrigElectronContainer>(trigElecColl); + + // Now loop over electrons, see if at least one passes all cuts + xAOD::TrigElectronContainer::const_iterator elecIter, elecEnd=trigElecColl->end(); + for (elecIter = trigElecColl->begin(); elecIter != elecEnd; ++elecIter) { + + if(m_acceptAll){ + xBits->markPassing((*elecIter),trigElecColl,true); + continue; + } + const xAOD::TrackParticle* trkIter = (*elecIter)-> trackParticle(); + if (trkIter==NULL) continue; // disconsider candidates without track + + // Retrieve all quantities + float dPhiCalo = (*elecIter)->trkClusDphi(); + float dEtaCalo = (*elecIter)->trkClusDeta(); + float pTcalo = (*elecIter)->pt(); + float eTOverPt = (*elecIter)->etOverPt(); + // int trackIndx = (*elecIter)->trackIndx(); + float NTRHits = (float)((*elecIter)->nTRTHits()); + float NStrawHits = (float)((*elecIter)->nTRTHiThresholdHits()); + float TRTHitRatio = NStrawHits==0 ? 1e10 : NTRHits/NStrawHits; + + // apply cuts + + if (pTcalo < m_trackPtthr){ + ATH_MSG_VERBOSE("Fails pt cut"); + continue; + } + pTcaloCut=true; + if (dEtaCalo > m_calotrackdeta) { + ATH_MSG_VERBOSE("Fails dEta cut"); + continue; + } + dEtaCaloCut=true; + if (dPhiCalo > m_calotrackdphi) { + ATH_MSG_VERBOSE("Fails dPhi cut"); + continue; + } + dPhiCaloCut=true; + if(eTOverPt < m_calotrackdeoverp_low ) { + ATH_MSG_VERBOSE("Fails eoverp low cut"); + continue; + } + eTOverPtCut_lo = true; + if ( eTOverPt > m_calotrackdeoverp_high ) { + ATH_MSG_VERBOSE("Fails eoverp high cut"); + continue; + } + eTOverPtCut_hi = true; + if (TRTHitRatio < m_trtratio){ + ATH_MSG_VERBOSE("Fails TRT cut"); + continue; + } + TRTRatioCut = true; + + // TrigElectron passed all cuts: set flags + pass = true; + xBits->markPassing((*elecIter),trigElecColl,true); + + ATH_MSG_DEBUG("Event accepted !" ); + } // end of loop over electrons + + m_cutCounter=hasInput+hasContainer+pTcaloCut+dEtaCaloCut+dPhiCaloCut+eTOverPtCut_lo+eTOverPtCut_hi+TRTRatioCut; + // store TrigPassBits result + if(attachFeature(outputTE, xBits.release(),"passbits") != HLT::OK) + ATH_MSG_ERROR("Could not store TrigPassBits! "); - return HLT::OK; + return HLT::OK; } diff --git a/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx b/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx index f6adf9ebfb3286a4e42fd68065dfdeda685b18b2..55203c33d3dad7fc282247958743e61846772f9f 100755 --- a/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx +++ b/Trigger/TrigHypothesis/TrigEgammaHypo/src/components/TrigEgammaHypo_entries.cxx @@ -3,8 +3,6 @@ #include "TrigEgammaHypo/TrigL2ElectronHypo.h" #include "TrigEgammaHypo/TrigL2PhotonFex.h" #include "TrigEgammaHypo/TrigL2PhotonHypo.h" -#include "TrigEgammaHypo/TrigL2DielectronMassHypo.h" -#include "TrigEgammaHypo/TrigL2DielectronMassFex.h" #include "TrigEgammaHypo/TrigEFDielectronMassHypo.h" #include "TrigEgammaHypo/TrigEFDielectronMassFex.h" #include "TrigEgammaHypo/TrigEFMtAllTE.h" @@ -24,8 +22,6 @@ DECLARE_ALGORITHM_FACTORY( TrigL2ElectronFex ) DECLARE_ALGORITHM_FACTORY( TrigL2ElectronHypo ) DECLARE_ALGORITHM_FACTORY( TrigL2PhotonFex ) DECLARE_ALGORITHM_FACTORY( TrigL2PhotonHypo ) -DECLARE_ALGORITHM_FACTORY( TrigL2DielectronMassHypo ) -DECLARE_ALGORITHM_FACTORY( TrigL2DielectronMassFex ) DECLARE_ALGORITHM_FACTORY( TrigEFDielectronMassHypo ) DECLARE_ALGORITHM_FACTORY( TrigEFDielectronMassFex ) DECLARE_ALGORITHM_FACTORY( TrigEFMtAllTE ) @@ -42,8 +38,6 @@ DECLARE_FACTORY_ENTRIES( TrigEgammaHypo ) { DECLARE_ALGORITHM( TrigL2ElectronHypo ) DECLARE_ALGORITHM( TrigL2PhotonFex ) DECLARE_ALGORITHM( TrigL2PhotonHypo ) - DECLARE_ALGORITHM( TrigL2DielectronMassHypo ) - DECLARE_ALGORITHM( TrigL2DielectronMassFex ) DECLARE_ALGORITHM( TrigEFDielectronMassHypo ) DECLARE_ALGORITHM( TrigEFDielectronMassFex ) DECLARE_ALGORITHM( TrigEFMtAllTE ) diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/MuonClusterHypo.h b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/MuonClusterHypo.h index e8855e90bf0e2b5ac398ddad334695140db6c7ed..674abc2cb847b90560c6c8f77aa1e929850dc58c 100755 --- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/MuonClusterHypo.h +++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/MuonClusterHypo.h @@ -51,21 +51,16 @@ class MuonClusterHypo: public HLT::HypoAlgo { /** Min number of RoIs in the cluster. */ IntegerProperty m_nRoIEndCap; IntegerProperty m_nRoIBarrel; - /** Eta of the cluster. */ - DoubleProperty m_nEta; - /** Number of Jets with Log(H/E)<0.5 in the cluster. */ - IntegerProperty m_nJet; - /** Number of tracks in ID */ - IntegerProperty m_nTrk; + /** Eta cut between barrel and endcap */ + DoubleProperty m_etaMax; + /** Maximum allowed cluster eta */ + DoubleProperty m_etaMid; - /** Numbers of Roi in cluster */ - int mCluNum; - /** Number of Jet with Log(h/e)<0.5 **/ - int mNumJet; - /** Cut on Tracks */ - int mNumTrk; + + /** Numbers of Roi in cluster */ + int mCluNum; // Other members: diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/MuonClusterIsolationHypo.h b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/MuonClusterIsolationHypo.h new file mode 100755 index 0000000000000000000000000000000000000000..5f9a2bacd1cf68c248c255a98fdc565bef15e3d8 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/TrigLongLivedParticlesHypo/MuonClusterIsolationHypo.h @@ -0,0 +1,82 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// ******************************************************************** +// +// NAME: MuonClusterIsolationHypo.h +// PACKAGE: Trigger/TrigHypotheis/TrigMuonHypo +// +// AUTHORS: S. Giagu <stefano.giagu@cern.ch> +// A.Policicchio <antonio.policicchio@cern.ch> +// +// PURPOSE: LVL2 Muon Cluster Hypothesis Algorithm: V1.0 +// ******************************************************************** + +#ifndef TRIG_MUCLUISOHYPO_H +#define TRIG_MUCLUISOHYPO_H + +#include <string> +#include "TrigInterfaces/HypoAlgo.h" + +class StoreGateSvc; + +/* + * \class MuonClusterHypo + * \brief MuonClusterIsolationHypo is a Trigger Hypo Algorithm that retrieves the L1 Muon RoIs and then + * requires that these L1 RoIs form a cluster with number of RoI larger than 3, with no Jets with Log(H/E)<0.5 in the cluster cone and no SITRACKs around the cluster direction. + * A TE will be set active if the selection cuts are fullfilled. +*/ + +class MuonClusterIsolationHypo: public HLT::HypoAlgo { + enum { MaxNumberTools = 20 }; + public: + /** Constructor. */ + MuonClusterIsolationHypo(const std::string & name, ISvcLocator* pSvcLocator); + /** Destructor. */ + ~MuonClusterIsolationHypo(); + + /** HLT method to initialize. */ + HLT::ErrorCode hltInitialize(); + /** HLT method to execute. */ + HLT::ErrorCode hltExecute(const HLT::TriggerElement* outputTE, bool& pass); + /** HLT method to finalize. */ + HLT::ErrorCode hltFinalize(); + + private: + + // Properties + /** Accept all events flag. */ + BooleanProperty m_acceptAll; + /*do isolation*/ + BooleanProperty m_doIsolation; + /** Min number of RoIs in the cluster. */ + IntegerProperty m_nRoIEndCap; + IntegerProperty m_nRoIBarrel; + /** Eta of the cluster. */ + DoubleProperty m_etaMid; + DoubleProperty m_etaMax; + /** Number of Jets with Log(H/E)<0.5 in the cluster. */ + IntegerProperty m_nJet; + /** Number of tracks in ID */ + IntegerProperty m_nTrk; + + + + /** Numbers of Roi in cluster */ + int mCluNum; + /** Number of Jet with Log(h/e)<0.5 **/ + int mNumJet; + /** Cut on Tracks */ + int mNumTrk; + + + // Other members: + StoreGateSvc* m_storeGate; + + /** Cut counter. */ + int m_cutCounter; + +}; +#endif + diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/doc/mainpage.h b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/doc/mainpage.h deleted file mode 100644 index 427f364a71ff287b2cea26ba9d299badf9b13cd6..0000000000000000000000000000000000000000 --- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/doc/mainpage.h +++ /dev/null @@ -1,36 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - -@mainpage -@author Stefano Giagu, Antonio Policicchio - -@section TrigLongLivedParticlesHypoOverview Overview -This package contains LVL2 Hypotesis algorithms for Long-Lived -neutral particle triggers: MuonClusterHypo, TrigL2HVJetHypo and TrigMuonJetHypo. -The MuonClusterHypo applies cuts on the TrigMuonClusterFeature written by the MuonCluster Fex. -The TrigMuonJetHypo is a simply pass=true algorithm for TrigMuonJetFex. -The TrigL2HVJetHypo(Trk) is a modified version of the standard LVL2 jet hypothesis algorithm. -The LVL2 jet has to be a jet without connecting tracks to the interaction point. -In order to accomplish this request the -algorithm computes the number -of tracks with a Pt > 1 GeV in a region etaxphi 0.2x0.2 -around the jet direction. Moreover the jet has to be the non-standard value for Log(Ehad/Eem)>1. - -@ref used_TrigLongLivedParticlesHypo - -@ref requirements_TrigLongLivedParticlesHypo - -*/ - -/** -@page used_TrigLongLivedParticlesHypo Used Packages -@htmlinclude used_packages.html -*/ - -/** -@page requirements_TrigLongLivedParticlesHypo Requirements -@include requirements -*/ diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigLongLivedParticlesHypoConfig.py b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigLongLivedParticlesHypoConfig.py index e4303deacc7a7f10fd241341af508a52924b1e04..6f45055af6dbc6f3414c57dc7d04df4ed9a9afcb 100755 --- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigLongLivedParticlesHypoConfig.py +++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/python/TrigLongLivedParticlesHypoConfig.py @@ -19,8 +19,6 @@ def getCaloRatioHypoInstance( instance, threshold, logratio, dotrackiso): else: name=instance+"_"+str(threshold)+"GeV_reversed_notrackiso" - print "AACC name "+name - return CaloRatioHypo( threshold=threshold, logratio=logratio, dotrackiso=dotrackiso, @@ -29,28 +27,41 @@ def getCaloRatioHypoInstance( instance, threshold, logratio, dotrackiso): class MuonClusterHypoConfig (MuonClusterHypo): __slots__ = [] - def __init__(self, name, maxEta, numJet, numTrk): + def __init__(self, name, maxEta, midEta): + super( MuonClusterHypoConfig, self ).__init__( name ) + # AcceptAll flag: if true take events regardless of cuts + self.AcceptAll = False + self.nRoIEndCap = 4 + self.nRoIBarrel = 3 + self.maxEta = maxEta + self.midEta = midEta + +class MuonClusterIsolationHypoConfig (MuonClusterIsolationHypo): + __slots__ = [] + def __init__(self, name, maxEta, midEta, numJet, numTrk, doIsolation): + super( MuonClusterIsolationHypoConfig, self ).__init__( name ) + from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoMonitoring import MuonClusterHypoOnlineMonitoring,MuonClusterHypoValidationMonitoring,MuonClusterHypoCosmicMonitoring validation = MuonClusterHypoValidationMonitoring() online = MuonClusterHypoOnlineMonitoring() cosmic = MuonClusterHypoCosmicMonitoring() from TrigTimeMonitor.TrigTimeHistToolConfig import TrigTimeHistToolConfig - time = TrigTimeHistToolConfig("MuonClusterHypo_Time") + time = TrigTimeHistToolConfig("MuonClusterIsolationHypo_Time") self.AthenaMonTools = [ validation, online, time, cosmic] # AcceptAll flag: if true take events regardless of cuts self.AcceptAll = False - self.nRoIEndCap = 4 - self.nRoIBarrel = 3 - self.nEta = maxEta + self.nRoIEndCap = 4 + self.nRoIBarrel = 3 + self.maxEta = maxEta + self.midEta = midEta self.nJet = numJet self.nTrk = numTrk - - + self.doIsolation = doIsolation class L2HVJetHypoAllCutsBase (TrigL2HVJetHypoAllCuts): __slots__ = [] diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterHypo.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterHypo.cxx index bb2dcda795f334b87bdb86a52a0932d2e14528c0..7b3a51b9ccf86f9b8d70e5c7efc52f69d99213d6 100755 --- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterHypo.cxx +++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterHypo.cxx @@ -18,28 +18,23 @@ class ISvcLocator; MuonClusterHypo::MuonClusterHypo(const std::string & name, ISvcLocator* pSvcLocator): - HLT::HypoAlgo(name, pSvcLocator){ - - //default monitored values are unphysical - //events failing cuts will show up in monitoring with these values - //note that the "cut" for background trigger is nJet,nTrk ==-1, but - //the actual number of jets and tracks in dR cone is monitored - - mCluNum = 0; - mNumJet = -1; - mNumTrk = -1; - - declareMonitoredVariable("NumClu", mCluNum); - declareMonitoredVariable("NumJet", mNumJet); - declareMonitoredVariable("NumTrk", mNumTrk); - - - declareProperty("AcceptAll", m_acceptAll=false); - declareProperty("nRoIEndCap", m_nRoIEndCap=4); - declareProperty("nRoIBarrel", m_nRoIBarrel=3); - declareProperty("nEta", m_nEta=1.0); - declareProperty("nJet", m_nJet=0); - declareProperty("nTrk", m_nTrk=0); + HLT::HypoAlgo(name, pSvcLocator){ + + //default monitored values are unphysical + //events failing cuts will show up in monitoring with these values + //note that the "cut" for background trigger is nJet,nTrk ==-1, but + //the actual number of jets and tracks in dR cone is monitored + + mCluNum = 3; + + declareMonitoredVariable("NumClu", mCluNum); + + declareProperty("AcceptAll", m_acceptAll=false); + declareProperty("nRoIEndCap", m_nRoIEndCap=4); + declareProperty("nRoIBarrel", m_nRoIBarrel=3); + declareProperty("maxEta", m_etaMax=2.5); + declareProperty("midEta", m_etaMid=1.0); + } MuonClusterHypo::~MuonClusterHypo(){ @@ -47,210 +42,151 @@ MuonClusterHypo::~MuonClusterHypo(){ HLT::ErrorCode MuonClusterHypo::hltInitialize(){ - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "in initialize()" << endreq; - } - - if(m_acceptAll) { - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG - << "Accepting all the events with no cuts!" - << endreq; - } - } else { if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG - << "Selecting muon RoI clusters with |eta|< " << m_nEta << ", number of RoIs >= " << m_nRoIBarrel << " if in Barrel and >= " <<m_nRoIEndCap << " if in EndCap " - << " and " << m_nJet << " Jets with Log(H/E)<=0.5 and " << m_nTrk << " Tracks in ID within isolation cone" - << endreq; + msg() << MSG::DEBUG << "in initialize()" << endmsg; + + if(m_acceptAll) { + msg() << MSG::DEBUG << "Accepting all the events with no cuts!" << endmsg; + } else { + msg() << MSG::DEBUG << "Selecting barrel muon RoI clusters with |eta|< " << m_etaMid << " and >= " << m_nRoIBarrel << " RoIs" << endmsg; + msg() << MSG::DEBUG << "and endcap muon RoI clusters with |eta| > : " << m_etaMid << "and >= " <<m_nRoIEndCap << " RoIs" << endmsg; + } + msg() << MSG::DEBUG << "Initialization completed successfully" << endmsg; } - } - - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG - << "Initialization completed successfully" - << endreq; - } - - return HLT::OK; + + return HLT::OK; } HLT::ErrorCode MuonClusterHypo::hltFinalize(){ - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "in finalize()" << endreq; - } + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "in finalize()" << endmsg; + } - return HLT::OK; + return HLT::OK; } HLT::ErrorCode MuonClusterHypo::hltExecute(const HLT::TriggerElement* outputTE, bool& pass){ - // Retrieve store. - m_storeGate = store(); + // Retrieve store. + m_storeGate = store(); - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "in execute()" << endreq; - } - - m_cutCounter = -1; - - if(m_acceptAll) { - pass = true; if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG - << "Accept property is set: taking all the events" - << endreq; + msg() << MSG::DEBUG << "in execute()" << endmsg; } - return HLT::OK; - } else { - - bool result = true; //set result to true in case of errors for safety - - // Some debug output: - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "outputTE->ID(): " << outputTE->getId() << endreq; - } - - // Get the TrigCompositeContainer linked to the outputTE - // it contains the Muon RoI Cluster information - - const xAOD::TrigCompositeContainer *compCont(0); - HLT::ErrorCode status = getFeature(outputTE, compCont); - if(status != HLT::OK){ - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "no TrigCompositeContainer feature found" << endreq; - } - return status; - } else { + m_cutCounter = -1; + + if(m_acceptAll) { + pass = true; + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG + << "Accept property is set: taking all the events" + << endmsg; + } + return HLT::OK; + + } else { + + bool result = true; //set result to true in case of errors for safety + + // Some debug output: if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "TrigCompositeContainer feature retrieved" << endreq; + msg() << MSG::DEBUG << "outputTE->ID(): " << outputTE->getId() << endmsg; } - } - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "Found " << compCont->size() << " TrigComposite objects" << endreq; - } - int numberRoI = 0; - int numberJet = 0; - int numberTrk = 0; - float etaClust = -99; - float phiClust = -99; - - bool foundMuonRoICluster = false; - - for(const xAOD::TrigComposite * compObj : *compCont) { - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "TrigComposite ptr = " << (void*)compObj << endreq; - } - for(const string & collName : compObj->linkColNames()) { - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << " link to collection " << collName << endreq; - } - } - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG << "Found object named Cluster : " << (compObj->name()== "Cluster" ? "yes":"no") << endreq; - } - if(compObj->name() == "Cluster" ) { - foundMuonRoICluster = true; - //if we can't access all the variables necessary for the trigger hypothesis, - //return MISSING_FEATURE, because it means the variables are missing - if(!compObj->getDetail("nRoIs", numberRoI)) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } - if(!compObj->getDetail("nJets", numberJet)) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } - if(!compObj->getDetail("nTrks", numberTrk)) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } - if(!compObj->getDetail("ClusterEta", etaClust)) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } - if(!compObj->getDetail("ClusterPhi", phiClust)) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } - - /*ATH_MSG_DEBUG("Cluster has " << numberRoI << " muon RoIs, at eta=" << etaClust - << " and phi=" << phiClust << " and matches " << numberJet << " Jets with Log(H/E)" - << " and " << numberTrk << " tracks in ID");*/ - } - } - - if( !foundMuonRoICluster ) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE);} - - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG - << "Cluster has " << numberRoI << " muon RoIs, at eta=" << etaClust - << " and phi=" << phiClust << " and matches " << numberJet << " Jets with Log(H/E) <= 0.5 " - << " and " << numberTrk << " tracks in ID" << endreq; - } - - // Cut on number of RoIs in the cluster - if(fabs(etaClust)<=m_nEta) { - - //background trigger has cut of to m_nJet == -1, so bypass jet and track cuts if background trigger - if((numberJet==m_nJet && m_nJet!=-1) || (m_nJet==-1)) { - - if((numberTrk==m_nTrk && m_nTrk!=-1) || (m_nTrk==-1)) { - - if(fabs(etaClust)<=1.0 && numberRoI >= m_nRoIBarrel) { - - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG - << "Cluster passes barrel selection cuts of > " << m_nRoIBarrel << " RoIs and " - << m_nJet << " Jets with Log(H/E)<=0.5 and " << m_nTrk << " tracks in ID... event accepted" - << endreq; - } - - // monitored variables - mCluNum = numberRoI; - mNumJet = numberJet; - mNumTrk = numberTrk; //set these equal to actual cluster parameters - result = true; - - } else if((fabs(etaClust)>=1.0 && fabs(etaClust)<=2.5) && numberRoI >= m_nRoIEndCap) { - - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG - << "Cluster passes endcap selection cuts of > " << m_nRoIEndCap << " RoIs and " - << m_nJet << " Jets with Log(H/E)<=0.5 and " << m_nTrk << " tracks in ID... event accepted" - << endreq; - } - - // monitored variables - mCluNum = numberRoI; - mNumJet = numberJet; - mNumTrk = numberTrk; //set these equal to actual cluster parameters - result = true; - - } else { - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG - << "Cluster does not satisfy all the conditions... event not accepted" - << endreq; - } - result = false; - } - } else { - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG - << "Cluster does not satisfy all the conditions... event not accepted" - << endreq; - } - result = false; - } - } else { - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG - << "Cluster does not satisfy all the conditions... event not accepted" - << endreq; - } - result = false; - } - } else { - if(msgLvl() <= MSG::DEBUG) { - msg() << MSG::DEBUG - << "Cluster does not satisfy all the conditions... event not accepted" - << endreq; - } - result = false; - } - - //Store result - pass = result; - - return HLT::OK; - } + + // Get the TrigCompositeContainer linked to the outputTE + // it contains the Muon RoI Cluster information + + const xAOD::TrigCompositeContainer *compCont(0); + HLT::ErrorCode status = getFeature(outputTE, compCont); + if(status != HLT::OK){ + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "no TrigCompositeContainer feature found" << endmsg; + } + return status; + } else { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "TrigCompositeContainer feature retrieved" << endmsg; + } + } + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Found " << compCont->size() << " TrigComposite objects" << endmsg; + } + int numberRoI = 0; + float etaClust = -99; + float phiClust = -99; + + bool foundMuonRoICluster = false; + + for(const xAOD::TrigComposite * compObj : *compCont) { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "TrigComposite ptr = " << (void*)compObj << endmsg; + } + for(const string & collName : compObj->linkColNames()) { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << " link to collection " << collName << endmsg; + } + } + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Found object named Cluster : " << (compObj->name()== "Cluster" ? "yes":"no") << endmsg; + } + if(compObj->name() == "Cluster" ) { + foundMuonRoICluster = true; + //if we can't access all the variables necessary for the trigger hypothesis, + //return MISSING_FEATURE, because it means the variables are missing + if(!compObj->getDetail("nRoIs", numberRoI)) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } + if(!compObj->getDetail("ClusterEta", etaClust)) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } + if(!compObj->getDetail("ClusterPhi", phiClust)) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } + } + } + + if( !foundMuonRoICluster ) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE);} + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Cluster has " << numberRoI << " muon RoIs, at (eta, phi) = (" << etaClust << ", " << phiClust << ")" << endmsg; + } + + // Cut on number of RoIs in the cluster + if(fabs(etaClust)<=m_etaMax) { + + if(fabs(etaClust)< m_etaMid && numberRoI >= m_nRoIBarrel) { + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Cluster passes barrel selection > " << m_nRoIBarrel << " RoIs" << endmsg; + } + + // monitored variables + mCluNum = numberRoI; + result = true; + + } else if((fabs(etaClust)>= m_etaMid && fabs(etaClust)<= m_etaMax) && numberRoI >= m_nRoIEndCap) { + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Cluster passes endcap selection > " << m_nRoIEndCap << " RoIs" << endmsg; + } + + // monitored variables + mCluNum = numberRoI; + result = true; + + } else { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Cluster does not satisfy all the conditions... event not accepted" << endmsg; + } + result = false; + } + } else { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Cluster does not satisfy all the conditions... event not accepted" << endmsg; + } + result = false; + } + + //Store result + pass = result; + + return HLT::OK; + } } diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterIsolationHypo.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterIsolationHypo.cxx new file mode 100755 index 0000000000000000000000000000000000000000..fa47153b6e541547fde0c01c4c52e4f5cf5f3398 --- /dev/null +++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/MuonClusterIsolationHypo.cxx @@ -0,0 +1,264 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// +// MuonClusterIsolationHypo +// (see header for history/etc..) +// +#include "GaudiKernel/MsgStream.h" +#include "GaudiKernel/StatusCode.h" + +#include "TrigLongLivedParticlesHypo/MuonClusterIsolationHypo.h" +#include "xAODTrigger/TrigComposite.h" +#include "xAODTrigger/TrigCompositeContainer.h" + +#include "CLHEP/Units/SystemOfUnits.h" + +class ISvcLocator; + +MuonClusterIsolationHypo::MuonClusterIsolationHypo(const std::string & name, ISvcLocator* pSvcLocator): + HLT::HypoAlgo(name, pSvcLocator){ + + //default monitored values are unphysical + //events failing cuts will show up in monitoring with these values + //note that the "cut" for background trigger is nJet,nTrk ==-1, but + //the actual number of jets and tracks in dR cone is monitored + + mCluNum = 0; + mNumJet = -1; + mNumTrk = -1; + + declareMonitoredVariable("NumClu", mCluNum); + declareMonitoredVariable("NumJet", mNumJet); + declareMonitoredVariable("NumTrk", mNumTrk); + + declareProperty("AcceptAll", m_acceptAll=false); + declareProperty("doIsolation", m_doIsolation=false); + declareProperty("nRoIEndCap", m_nRoIEndCap=4); + declareProperty("nRoIBarrel", m_nRoIBarrel=3); + declareProperty("midEta", m_etaMid=1.0); + declareProperty("maxEta", m_etaMax=2.5); + declareProperty("nJet", m_nJet=0); + declareProperty("nTrk", m_nTrk=0); +} + +MuonClusterIsolationHypo::~MuonClusterIsolationHypo(){ +} + +HLT::ErrorCode MuonClusterIsolationHypo::hltInitialize(){ + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "in initialize()" << endmsg; + } + + if(m_acceptAll) { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG + << "Accepting all the events with no cuts!" + << endmsg; + } + } else { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG + << "Selecting muon RoI clusters with |eta|< " << m_etaMax << ", number of RoIs >= " << m_nRoIBarrel << " if in Barrel and >= " <<m_nRoIEndCap << " if in EndCap " + << " and " << m_nJet << " Jets with Log(H/E)<=0.5 and " << m_nTrk << " Tracks in ID within isolation cone" + << endmsg; + } + } + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG + << "Initialization completed successfully" + << endmsg; + } + + return HLT::OK; +} + +HLT::ErrorCode MuonClusterIsolationHypo::hltFinalize(){ + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "in finalize()" << endmsg; + } + + return HLT::OK; + +} + +HLT::ErrorCode MuonClusterIsolationHypo::hltExecute(const HLT::TriggerElement* outputTE, bool& pass){ + + // Retrieve store. + m_storeGate = store(); + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "in execute()" << endmsg; + } + + m_cutCounter = -1; + + if(m_acceptAll) { + pass = true; + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG + << "Accept property is set: taking all the events" + << endmsg; + } + return HLT::OK; + + } else { + + bool result = true; //set result to true in case of errors for safety + + // Some debug output: + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "outputTE->ID(): " << outputTE->getId() << endmsg; + } + + // Get the TrigCompositeContainer linked to the outputTE + // it contains the Muon RoI Cluster information + + const xAOD::TrigCompositeContainer *compCont(0); + HLT::ErrorCode status = getFeature(outputTE, compCont); + if(status != HLT::OK){ + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "no TrigCompositeContainer feature found" << endmsg; + } + return status; + } else { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "TrigCompositeContainer feature retrieved" << endmsg; + } + } + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Found " << compCont->size() << " TrigComposite objects" << endmsg; + } + int numberRoI = 0; + int numberJet = 0; + int numberTrk = 0; + float etaClust = -99; + float phiClust = -99; + + bool foundMuonRoICluster = false; + + for(const xAOD::TrigComposite * compObj : *compCont) { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "TrigComposite ptr = " << (void*)compObj << endmsg; + } + for(const string & collName : compObj->linkColNames()) { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << " link to collection " << collName << endmsg; + } + } + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Found object named Cluster : " << (compObj->name()== "Cluster" ? "yes":"no") << endmsg; + } + if(compObj->name() == "Cluster" ) { + foundMuonRoICluster = true; + //if we can't access all the variables necessary for the trigger hypothesis, + //return MISSING_FEATURE, because it means the variables are missing + if(!compObj->getDetail("nRoIs", numberRoI)) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } + if(!compObj->getDetail("nJets", numberJet)) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } + if(!compObj->getDetail("nTrks", numberTrk)) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } + if(!compObj->getDetail("ClusterEta", etaClust)) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } + if(!compObj->getDetail("ClusterPhi", phiClust)) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE); } + } + } + + if( !foundMuonRoICluster ) { return HLT::ErrorCode(HLT::Action::ABORT_CHAIN, HLT::Reason::MISSING_FEATURE);} + + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG + << "Cluster has " << numberRoI << " muon RoIs, at eta=" << etaClust + << " and phi=" << phiClust << " and matches " << numberJet << " Jets with Log(H/E) <= 0.5 " + << " and " << numberTrk << " tracks in ID" << endmsg; + } + + // Cut on number of RoIs in the cluster + if(fabs(etaClust)<=m_etaMax) { + + if(fabs(etaClust)< m_etaMid && numberRoI >= m_nRoIBarrel) { + + //background trigger has doIsolation = False, so bypass jet and track cuts if background trigger + if(m_doIsolation){ + if( numberJet == m_nJet && numberTrk == m_nTrk ) { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG + << "Cluster passes barrel selection cuts of > " << m_nRoIBarrel << " RoIs and " << m_nJet << " Jets with Log(H/E)<=0.5 and " << m_nTrk << " tracks in ID... event accepted" + << endmsg; + } + // monitored variables + mCluNum = numberRoI; + mNumJet = numberJet; + mNumTrk = numberTrk; //set these equal to actual cluster parameters + result = true; + } else { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Cluster does not satisfy all the conditions... event not accepted" << endmsg; + } + result = false; + } + } else { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Cluster passes noiso barrel selection cuts of > " << m_nRoIBarrel << " RoIs... event accepted" << endmsg; + } + // monitored variables + mCluNum = numberRoI; + mNumJet = numberJet; + mNumTrk = numberTrk; //set these equal to actual cluster parameters + result = true; + } + } else if((fabs(etaClust)>=m_etaMid && fabs(etaClust)<=m_etaMax) && numberRoI >= m_nRoIEndCap) { + if(m_doIsolation){ + if(numberJet == m_nJet && numberTrk == m_nTrk){ + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG + << "Cluster passes endcap selection cuts of > " << m_nRoIEndCap << " RoIs and " + << m_nJet << " Jets with Log(H/E)<=0.5 and " << m_nTrk << " tracks in ID... event accepted" + << endmsg; + } + + // monitored variables + mCluNum = numberRoI; + mNumJet = numberJet; + mNumTrk = numberTrk; //set these equal to actual cluster parameters + result = true; + } else { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Cluster does not satisfy all the conditions... event not accepted" << endmsg; + } + result = false; + } + } else { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG << "Cluster passes noiso endcap selection cuts of > " << m_nRoIEndCap << " RoIs... event accepted" << endmsg; + } + // monitored variables + mCluNum = numberRoI; + mNumJet = numberJet; + mNumTrk = numberTrk; //set these equal to actual cluster parameters + result = true; + } + } else { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG + << "Cluster does not satisfy all the conditions... event not accepted" + << endmsg; + } + result = false; + } + } else { + if(msgLvl() <= MSG::DEBUG) { + msg() << MSG::DEBUG + << "Cluster does not satisfy all the conditions... event not accepted" + << endmsg; + } + result = false; + } + + //Store result + pass = result; + + return HLT::OK; + } +} diff --git a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/components/TrigLongLivedParticlesHypo_entries.cxx b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/components/TrigLongLivedParticlesHypo_entries.cxx index c825dabad2043df4251728485f0b88d54718adec..efcbc5fd4302dff936f6642a5914ff5089f8d6f4 100755 --- a/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/components/TrigLongLivedParticlesHypo_entries.cxx +++ b/Trigger/TrigHypothesis/TrigLongLivedParticlesHypo/src/components/TrigLongLivedParticlesHypo_entries.cxx @@ -2,6 +2,7 @@ #include "TrigLongLivedParticlesHypo/TrigL2HVJetHypo.h" #include "TrigLongLivedParticlesHypo/TrigL2HVJetHypoTrk.h" #include "TrigLongLivedParticlesHypo/MuonClusterHypo.h" +#include "TrigLongLivedParticlesHypo/MuonClusterIsolationHypo.h" #include "TrigLongLivedParticlesHypo/TrigLoFRemovalHypo.h" #include "TrigLongLivedParticlesHypo/TrigNewLoFHypo.h" #include "TrigLongLivedParticlesHypo/TrigCaloRatioHypo.h" @@ -13,6 +14,7 @@ DECLARE_ALGORITHM_FACTORY( TrigL2HVJetHypoAllCuts ) DECLARE_ALGORITHM_FACTORY( TrigL2HVJetHypo ) DECLARE_ALGORITHM_FACTORY( TrigL2HVJetHypoTrk ) DECLARE_ALGORITHM_FACTORY( MuonClusterHypo ) +DECLARE_ALGORITHM_FACTORY( MuonClusterIsolationHypo ) DECLARE_ALGORITHM_FACTORY( TrigLoFRemovalHypo ) DECLARE_ALGORITHM_FACTORY( TrigNewLoFHypo ) DECLARE_ALGORITHM_FACTORY( TrigCaloRatioHypo ) @@ -22,6 +24,7 @@ DECLARE_FACTORY_ENTRIES( TrigLongLivedParticlesHypo ) { DECLARE_ALGORITHM( TrigL2HVJetHypo ) DECLARE_ALGORITHM( TrigL2HVJetHypoTrk ) DECLARE_ALGORITHM( MuonClusterHypo ) + DECLARE_ALGORITHM( MuonClusterIsolationHypo ) DECLARE_ALGORITHM( TrigLoFRemovalHypo ) DECLARE_ALGORITHM( TrigNewLoFHypo ) DECLARE_ALGORITHM( TrigCaloRatioHypo ) diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoConfig.py b/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoConfig.py index 1b51fc356d6153c450e76d9745170eab342eadc1..7e49560f71e834edb49cd46795133271fd6994e0 100755 --- a/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoConfig.py +++ b/Trigger/TrigHypothesis/TrigMuonHypo/python/TrigMuonHypoConfig.py @@ -14,6 +14,7 @@ ToolSvc += MuonBackExtrapolatorForMisalignedDet() trigMuonEFSAThresholds = { '0GeV' : [ [0,9.9], [ 0.100 ] ], '2GeV' : [ [0,9.9], [ 2.000 ] ], + '3GeV' : [ [0,9.9], [ 3.000 ] ], '4GeV' : [ [0,1.05,1.5,2.0,9.9], [ 3.0, 2.5, 2.5, 2.5] ], '4GeV_barrelOnly' : [ [0,1.05,1.5,2.0,9.9], [ 3.0,1000.0,1000.0,1000.0]], '5GeV' : [ [0,1.05,1.5,2.0,9.9], [ 4.6, 3.3, 4.0, 4.5] ], @@ -46,6 +47,7 @@ trigMuonEFSAThresholds = { efCombinerThresholds = { '2GeV' : [ [0,9.9], [2.000] ], + '3GeV' : [ [0,9.9], [3.000] ], '4GeV' : [ [0,1.05,1.5,2.0,9.9], [ 3.93, 3.91, 3.88, 3.88] ], '5GeV' : [ [0,1.05,1.5,2.0,9.9], [ 4.91, 4.86, 4.84, 4.83] ], '6GeV' : [ [0,1.05,1.5,2.0,9.9], [ 5.88, 5.81, 5.78, 5.76] ], @@ -77,6 +79,7 @@ efCombinerThresholds = { '100GeV' : [ [0,1.05,1.5,2.0,9.9], [ 90.00, 90.00, 90.00, 90.00] ], # original + 2015 tuning '2GeV_v15a' : [ [0,9.9], [2.000] ], + '3GeV_v15a' : [ [0,9.9], [3.000] ], '4GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.94, 3.91, 3.77, 3.72] ], '5GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 4.91, 4.86, 4.84, 4.83] ], '6GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 5.92, 5.86, 5.70, 5.64] ], @@ -113,6 +116,7 @@ efCombinerThresholds = { efCaloTagThresholds = { '0GeV' : [ [0,9.9], [ 0.1, 0.1, 0.1, 0.1 ] ], '2GeV' : [ [0,9.9], [ 2.0, 2.0, 2.0, 2.0 ] ], + '3GeV' : [ [0,9.9], [ 3.0, 3.0, 3.0, 3.0 ] ], '4GeV' : [ [0,1.05,1.5,2.0,9.9], [ 4.0, 4.0, 4.0, 4.0 ] ], '5GeV' : [ [0,1.05,1.5,2.0,9.9], [ 5.0, 5.0, 5.0, 5.0 ] ], '6GeV' : [ [0,1.05,1.5,2.0,9.9], [ 6.0, 6.0, 6.0, 6.0 ] ], @@ -140,6 +144,7 @@ efCaloTagThresholds = { muCombThresholds = { '2GeV' : [ [0,9.9], [ 2.000] ], + '3GeV' : [ [0,9.9], [ 3.000] ], '4GeV' : [ [0,1.05,1.5,2.0,9.9], [ 3.0, 2.5, 2.5, 2.5] ], '5GeV' : [ [0,1.05,1.5,2.0,9.9], [ 4.9, 4.8, 4.8, 4.8] ], '6GeV' : [ [0,1.05,1.5,2.0,9.9], [ 5.8, 5.8, 5.8, 5.6] ], @@ -174,6 +179,7 @@ muCombThresholds = { '100GeV' : [ [0,1.05,1.5,2.0,9.9], [ 70.0, 70.0, 70.0, 70.0] ], # original + 2015 tuning '2GeV_v15a' : [ [0,9.9], [ 2.000] ], + '3GeV_v15a' : [ [0,9.9], [ 3.000] ], '4GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 3.86, 3.77, 3.69, 3.70] ], '5GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 4.9, 4.8, 4.8, 4.8] ], '6GeV_v15a' : [ [0,1.05,1.5,2.0,9.9], [ 5.87, 5.79, 5.70, 5.62] ], @@ -214,6 +220,7 @@ muFastThresholds = { # # original + 2010 tuning '2GeV' : [ [0,9.9], [ 2.000] ], + '3GeV' : [ [0,9.9], [ 3.000] ], '4GeV' : [ [0,1.05,1.5,2.0,9.9], [ 3.0, 2.5, 2.5, 2.5] ], '4GeV_V2' : [ [0,1.05,1.5,2.0,9.9], [ 3.0, 1.8, 2.0, 2.5] ], '5GeV' : [ [0,1.05,1.5,2.0,9.9], [ 4.6, 3.3, 4.0, 4.5] ], @@ -295,6 +302,7 @@ muFastThresholdsForECWeakBRegion = { # # original + 2010 tuning '2GeV' : [ 2.0, 2.0 ], + '3GeV' : [ 3.0, 3.0 ], '4GeV' : [ 2.5, 2.5 ], '4GeV_V2' : [ 1.8, 2.0 ], '5GeV' : [ 3.3, 4.0 ], @@ -401,7 +409,7 @@ class MufastHypoConfig(MufastHypo) : print 'MufastHypoConfig: No special thresholds for EC weak Bfield regions for',threshold print 'MufastHypoConfig: -> Copy EC1 for region A, EC2 for region B' spThres = values[0][1] - if threshold == '2GeV': + if threshold == '2GeV' or threshold == '3GeV': self.PtThresholdForECWeakBRegionA = spThres[0] * GeV self.PtThresholdForECWeakBRegionB = spThres[0] * GeV else: @@ -1278,6 +1286,15 @@ trigMuonEFTrkIsoThresholds = { 'RelEFOnlyVarTightWide' : [-1.0 , 0.07 ] #ivarmedium } + + +trigMuonEFCaloIsoThresholds = { + + 'Rel' : [ 0.3, 0.3, 0.3 ], + 'AbsCalo' : [ 5200.0, 4800.0, 4000.0], + + } + """ Class for hypothesis cuts on EF track isolation algorithm. arg[0] = Muon @@ -1285,6 +1302,7 @@ arg[1] = working point See trigMuonEFTrkIsoThresholds for available working points Put passthrough in arg[1] for passthrough """ + class TrigMuonEFTrackIsolationHypoConfig(TrigMuonEFTrackIsolationHypo) : __slots__ = [] @@ -1333,6 +1351,13 @@ class TrigMuonEFTrackIsolationHypoConfig(TrigMuonEFTrackIsolationHypo) : self.AthenaMonTools = [ validation, online ] +""" +Class for hypothesis cuts on EF calo isolation algorithm. +arg[0] = Muon +arg[1]-arg[3] = working point (eta dependent) +Put passthrough in arg[1] for passthrough +""" + class TrigMuonEFCaloIsolationHypoConfig(TrigMuonEFCaloIsolationHypo) : __slots__ = [] @@ -1347,7 +1372,7 @@ class TrigMuonEFCaloIsolationHypoConfig(TrigMuonEFCaloIsolationHypo) : super( TrigMuonEFCaloIsolationHypoConfig, self ).__init__( name ) try: - #cuts = trigMuonEFCaloIsoThresholds[ args[1] ] + cuts = trigMuonEFCaloIsoThresholds[ args[1] ] # If configured with passthrough, set AcceptAll flag on self.AcceptAll = False @@ -1358,10 +1383,10 @@ class TrigMuonEFCaloIsolationHypoConfig(TrigMuonEFCaloIsolationHypo) : #Default cuts (more than 95% eff on Z->mumu) tuned on 2011 run 178044 data <beta>~6 #These probably should be updated! - self.CaloConeSize = 1; - self.MaxCaloIso_1 = 5200.0 - self.MaxCaloIso_2 = 4800.0 - self.MaxCaloIso_3 = 4000.0 + self.CaloConeSize = 2; + self.MaxCaloIso_1 = cuts[0] + self.MaxCaloIso_2 = cuts[1] + self.MaxCaloIso_3 = cuts[2] if 'Rel' in args[1] : self.DoAbsCut = False diff --git a/Trigger/TrigHypothesis/TrigMuonHypo/src/TrigMuonEFCaloIsolationHypo.cxx b/Trigger/TrigHypothesis/TrigMuonHypo/src/TrigMuonEFCaloIsolationHypo.cxx index 41cef874d53f6756be26dad3b6f8410bc7fd70b3..4fb090e9d98d5a12415f52a0ec974e08f5d1ad9d 100644 --- a/Trigger/TrigHypothesis/TrigMuonHypo/src/TrigMuonEFCaloIsolationHypo.cxx +++ b/Trigger/TrigHypothesis/TrigMuonHypo/src/TrigMuonEFCaloIsolationHypo.cxx @@ -58,7 +58,7 @@ HLT::ErrorCode TrigMuonEFCaloIsolationHypo::hltInitialize() { ATH_MSG_INFO("Calo based isolation activated"); ATH_MSG_INFO( (m_abscut ? "Absolute" : "Relative") << " isolation cut for calo selected"); ATH_MSG_INFO("Calorimetric cone size selected: " << m_CaloConeSize); - + ATH_MSG_INFO("MaxCaloIso_1/2/3 = "<<m_MaxCaloIso_1<<"/"<<m_MaxCaloIso_2<<"/"<<m_MaxCaloIso_3); if (m_MaxCaloIso_1 < 0.0 && m_MaxCaloIso_2 < 0.0 && m_MaxCaloIso_3 < 0.0) { ATH_MSG_FATAL("Configured to apply cuts, but not cut was specified"); return HLT::BAD_JOB_SETUP; diff --git a/Trigger/TrigMonitoring/TrigCostMonitor/TrigCostMonitor/TrigNtRobsTool.h b/Trigger/TrigMonitoring/TrigCostMonitor/TrigCostMonitor/TrigNtRobsTool.h index 34f91dec8e605d9f948d5e97d8376e22a20cbb00..f1b3645742ccd933dafb1c2adc723fe2621f07a5 100644 --- a/Trigger/TrigMonitoring/TrigCostMonitor/TrigCostMonitor/TrigNtRobsTool.h +++ b/Trigger/TrigMonitoring/TrigCostMonitor/TrigCostMonitor/TrigNtRobsTool.h @@ -60,7 +60,7 @@ namespace Trig // Tool variables TrigMonConfig *m_config; - std::map<std::string, uint32_t> m_algNameToIDMap; //Algorithm Name to ID caching + std::unordered_map<std::string, uint32_t> m_algNameToIDMap; //Algorithm Name to ID caching std::set<uint32_t> m_algIds; }; } diff --git a/Trigger/TrigMonitoring/TrigCostMonitor/src/TrigNtRobsTool.cxx b/Trigger/TrigMonitoring/TrigCostMonitor/src/TrigNtRobsTool.cxx index 32384fc3a9849b0cf606e4a261de447263ae88bb..989db89818035d9d7c1b8ba4f39a201cc308f86a 100644 --- a/Trigger/TrigMonitoring/TrigCostMonitor/src/TrigNtRobsTool.cxx +++ b/Trigger/TrigMonitoring/TrigCostMonitor/src/TrigNtRobsTool.cxx @@ -150,7 +150,7 @@ for(unsigned int i = 0; i < m_config->size<TrigConfSeq>(); ++i) { } } } - std::map<std::string, uint32_t>::const_iterator algFinder = m_algNameToIDMap.find(rob->requestor_name); + auto algFinder = m_algNameToIDMap.find(rob->requestor_name); if (algFinder != m_algNameToIDMap.end() ){ alg_id = algFinder->second; diff --git a/Trigger/TrigMonitoring/TrigJetMonitoring/src/HLTJetMonTool.cxx b/Trigger/TrigMonitoring/TrigJetMonitoring/src/HLTJetMonTool.cxx index bc9854769f76852055772f13900f42b318ce1b4e..8a556873330bd079026596bfe4eac76e3a92e957 100755 --- a/Trigger/TrigMonitoring/TrigJetMonitoring/src/HLTJetMonTool.cxx +++ b/Trigger/TrigMonitoring/TrigJetMonitoring/src/HLTJetMonTool.cxx @@ -2748,12 +2748,14 @@ bool HLTJetMonTool::isLeadingJet(const xAOD::Jet *jet, const xAOD::JetContainer } - for(unsigned int i=0; i<v_ofjets.size(); ++i) { - njets=njets+1; - if (Jetn==1 && jet->pt() >= v_ofjets[i] && fabs(jet->eta())>=EtaLow && fabs(jet->eta())<=EtaHigh){ //Select leading if jetn=1 - nleading=nleading+1; - } else if (Jetn>1 && jet->pt()==v_ofjets[Jetn-1] && v_ofjets.size()>=static_cast<size_t>(Jetn)){ // select nth Jet in case jetn != 1 - found_jetn=true; + if (v_ofjets.size()>=static_cast<size_t>(Jetn)) { + for(unsigned int i=0; i<v_ofjets.size(); ++i) { + njets=njets+1; + if (Jetn==1 && jet->pt() >= v_ofjets[i] && fabs(jet->eta())>=EtaLow && fabs(jet->eta())<=EtaHigh){ //Select leading if jetn=1 + nleading=nleading+1; + } else if (Jetn>1 && jet->pt()==v_ofjets[Jetn-1] ){ // select nth Jet in case jetn != 1 + found_jetn=true; + } } } diff --git a/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py b/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py index 70bd2013886c74c3441a64475f186884d3a97f82..d41bb8bc99174862389527ef5089277bb1d17b1e 100644 --- a/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py +++ b/Trigger/TrigMonitoring/TrigSteerMonitor/python/TrigSteerMonitorConfig.py @@ -3,22 +3,13 @@ from TrigSteerMonitor.TrigSteerMonitorConf import * -class TrigChainMoniConfigValidation(TrigChainMoni): - """ Chains monitoring """ - __slots__ = [ ] - def __init__(self,name="TrigChainMoniValidation"): - super(TrigChainMoniConfigValidation, self).__init__(name) - self.LBNHistoryDepth=0 - - def target(self): - return [ "Validation" ] - class TrigErrorMonConfigValidation(TrigErrorMon): """ HLT Error Code monitoring """ __slots__ = [ ] def __init__(self,name="TrigErrorMonValidation"): super(TrigErrorMonConfigValidation, self).__init__(name) self.LBNHistoryDepth=0 + def target(self): return [ "Validation" ] @@ -29,6 +20,7 @@ class TrigRoIMoniConfigValidation(TrigRoIMoni): super(TrigRoIMoniConfigValidation, self).__init__(name) self.LBNHistoryDepth=0 self.ThreshMultiMax=18 + def target(self): return [ "Validation" ] @@ -39,32 +31,29 @@ class TrigSignatureMoniConfigValidation(TrigSignatureMoni): super(TrigSignatureMoniConfigValidation, self).__init__(name) self.LBNHistoryDepth=0 - def target(self): return [ "Validation" ] -class TrigTEMoniConfigValidation(TrigTEMoni): +class TrigTEMoniConfig(TrigTEMoni): """ TriggerElement monitoring """ __slots__ = [ ] - def __init__(self,name="TrigTEMoniValidation"): - super(TrigTEMoniConfigValidation, self).__init__(name) + def __init__(self,name="TrigTEMoni"): + super(TrigTEMoniConfig, self).__init__(name) self.LBNHistoryDepth=0 def target(self): return [ "Validation" ] -# online - -class TrigChainMoniConfigOnline(TrigChainMoni): +class TrigChainMoniConfig(TrigChainMoni): """ Chains monitoring """ __slots__ = [ ] - def __init__(self,name="TrigChainMoniOnline"): - super(TrigChainMoniConfigOnline, self).__init__(name) + def __init__(self,name="TrigChainMoni"): + super(TrigChainMoniConfig, self).__init__(name) self.LBNHistoryDepth=0 def target(self): - return [ "Online", "Cosmic" ] + return [ "Online", "Validation" ] class TrigErrorMonitor(TrigErrorMon): """ HLT Error Code monitoring """ @@ -75,7 +64,7 @@ class TrigErrorMonitor(TrigErrorMon): self.expertMode=False def target(self): - return [ "Online", "Cosmic", "Validation" ] + return [ "Online", "Validation" ] class TrigErrorExpertMonitor(TrigErrorMon): """ HLT Error Code monitoring for experts (all errorcodes) """ @@ -86,7 +75,7 @@ class TrigErrorExpertMonitor(TrigErrorMon): self.expertMode=True def target(self): - return [ "Online", "Cosmic", "Validation" ] + return [ "Online", "Validation" ] class TrigRoIMoniConfigOnline(TrigRoIMoni): """ RoI monitoring """ @@ -96,10 +85,8 @@ class TrigRoIMoniConfigOnline(TrigRoIMoni): self.LBNHistoryDepth=2 self.ThreshMultiMax=30 - - def target(self): - return [ "Online", "Cosmic" ] + return [ "Online" ] class TrigSignatureMoniConfigOnline(TrigSignatureMoni): """ Signature monitoring """ @@ -109,17 +96,7 @@ class TrigSignatureMoniConfigOnline(TrigSignatureMoni): self.LBNHistoryDepth=5 def target(self): - return [ "Online", "Cosmic" ] - -class TrigTEMoniConfigOnline(TrigTEMoni): - """ TriggerElement monitoring """ - __slots__ = [ ] - def __init__(self,name="TrigTEMoniOnline"): - super(TrigTEMoniConfigOnline, self).__init__(name) - self.LBNHistoryDepth=0 - - def target(self): - return [ "Online", "Cosmic" ] + return [ "Online" ] class TrigRateMoniConfig20s(TrigRateMoni): """ Rates monitor for online use only """ @@ -136,7 +113,7 @@ class TrigRateMoniConfig20s(TrigRateMoni): ] def target(self): - return [ "Online", "Cosmic" ] + return [ "Online" ] class TrigOpMonitor(TrigOpMoni): @@ -145,7 +122,7 @@ class TrigOpMonitor(TrigOpMoni): super(TrigOpMonitor, self).__init__(name) def target(self): - return [ "Online", "Cosmic" ] + return [ "Online", "Validation" ] class TrigMemMonitor(TrigMemMoni): """ Memory monitor """ @@ -175,18 +152,14 @@ class TrigCorMonitor(TrigCorMoni): super(TrigCorMonitor, self).__init__(name) def target(self): - return [ "Online", "Cosmic" ] + return [ "Online", "Validation" ] -TrigSteerMonitorToolList = [ TrigChainMoniConfigValidation(), - TrigErrorMonitor(), +TrigSteerMonitorToolList = [ TrigErrorMonitor(), TrigErrorExpertMonitor(), - TrigRoIMoniConfigValidation(), - TrigSignatureMoniConfigValidation(), - TrigTEMoniConfigValidation(), - TrigChainMoniConfigOnline(), - TrigRoIMoniConfigOnline(), - TrigSignatureMoniConfigOnline(), - TrigTEMoniConfigOnline(), + TrigRoIMoniConfigValidation(), TrigRoIMoniConfigOnline(), + TrigSignatureMoniConfigValidation(), TrigSignatureMoniConfigOnline(), + TrigTEMoniConfig(), + TrigChainMoniConfig(), TrigOpMonitor(), TrigMemMonitor(), TrigROBMoniConfig(), diff --git a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigCorMoni.cxx b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigCorMoni.cxx index c3e8edd9b7c4278644da8c4bf8015d0ffabab710..e16ae118aa668d76284f156c028344b025a2025d 100644 --- a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigCorMoni.cxx +++ b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigCorMoni.cxx @@ -154,9 +154,9 @@ StatusCode TrigCorMoni::bookHists() // //default binning - char ctpid[11]; + char ctpid[20]; for (int ibin=1;ibin<=m_rejectL1->GetXaxis()->GetNbins(); ibin++) { - sprintf(ctpid,"CTPID-%d",ibin); + snprintf(ctpid,sizeof(ctpid),"CTPID-%d",ibin); m_rejectL1->GetXaxis()->SetBinLabel(ibin, ctpid); m_streamL1->GetXaxis()->SetBinLabel(ibin, ctpid); m_acceptL1->GetXaxis()->SetBinLabel(ibin, ctpid); diff --git a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigSignatureMoni.cxx b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigSignatureMoni.cxx index 2b8e4e35855dc8fc514598b3fb13ec50ab96e224..783b82b9df3a9d62e4abee1f2c5f14bd967ea1ac 100644 --- a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigSignatureMoni.cxx +++ b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigSignatureMoni.cxx @@ -192,7 +192,8 @@ TrigSignatureMoni::~TrigSignatureMoni() BinBlock::PrepareToBook(); } -void findChainsInStreams(std::map<std::string, TH1I*>& histograms, const std::vector<const HLT::SteeringChain*>& config, const std::string& level) +void findChainsInStreams(std::map<std::string, TH1I*>& histograms, + const std::vector<const HLT::SteeringChain*>& config, const std::string& level) { std::map<std::string, std::vector<std::string> > stream_to_chains; @@ -201,12 +202,12 @@ void findChainsInStreams(std::map<std::string, TH1I*>& histograms, const std::ve stream_to_chains[stream.getStream()].push_back(chain->getChainName()); } } - std::map<std::string, std::vector<std::string> >::const_iterator p; - for ( p = stream_to_chains.begin(); p != stream_to_chains.end(); ++p ) { + for ( auto& p : stream_to_chains ) { - TH1I* h = histograms[p->first] = new TH1I(("ChainsInStream_"+p->first).c_str(), ("Chains in " +level + "stream "+p->first).c_str(), p->second.size(), 0, p->second.size()); + TH1I* h = histograms[p.first] = new TH1I(("ChainsInStream_"+p.first).c_str(), ("Chains in " +level + "stream "+p.first).c_str(), p.second.size(), 0, p.second.size()); int bin = 1; - for ( const std::string& label : p->second) { + std::sort(p.second.begin(), p.second.end()); // sort alphabetically + for ( const std::string& label : p.second) { h->GetXaxis()->SetBinLabel(bin, label.c_str()); ++bin; } @@ -403,7 +404,6 @@ StatusCode TrigSignatureMoni::bookHistograms( bool/* isNewEventsBlock*/, bool /* findChainsInStreams(m_chainsInStream, configuredChains, m_trigLvl); for ( const auto& s : m_chainsInStream ) { // (string,TH1I*) - s.second->GetXaxis()->LabelsOption("a"); if ( expertHistograms.regHist(s.second).isFailure()) { ATH_MSG_WARNING("Failed to book stream histogram"); } diff --git a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigTEMoni.cxx b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigTEMoni.cxx index 53a92ea1c38fca441ea73628d5245c504a269f26..391981a17767717316885a35792363ea21fbd773 100644 --- a/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigTEMoni.cxx +++ b/Trigger/TrigMonitoring/TrigSteerMonitor/src/TrigTEMoni.cxx @@ -69,8 +69,6 @@ StatusCode TrigTEMoni::bookHists() StatusCode TrigTEMoni::bookHistograms( bool/* isNewEventsBlock*/, bool /*isNewLumiBlock*/, bool /*isNewRun*/ ) { std::string tmpstring; - TString htit; - TString hname; TrigMonGroup expertHistograms( this, m_parentAlg->name(), expert ); //reset private members @@ -220,40 +218,36 @@ StatusCode TrigTEMoni::bookHistograms( bool/* isNewEventsBlock*/, bool /*isNewLu if ( expertHistograms.regHist( m_numberOfallTEsHist2d ).isFailure()) msg() << MSG::WARNING << "Can't book Trig histogram " << name << endmsg; - if(m_trigLvl != "EF"){ - /* - histo for number of input TEs from LVL1 - */ - name = "NumberOfLvl1TEs"; - - title = "LVL1-TEs abundance in (L1 threshods counts)"+ m_trigLvl; + /* + histo for number of input TEs from LVL1 + */ + name = "NumberOfLvl1TEs"; + title = "LVL1-TEs abundance in (L1 threshods counts)"+ m_trigLvl; - if(bin_number_lvl1>0){ - m_numberOflvl1TEsHist =new TH1I(name.c_str(),title.c_str(), bin_number_lvl1,0.5, bin_number_lvl1+0.5 ); - }else{ - m_numberOflvl1TEsHist =new TH1I(name.c_str(),title.c_str(), 1,-0.5,0.5 ); - } + if(bin_number_lvl1>0){ + m_numberOflvl1TEsHist =new TH1I(name.c_str(),title.c_str(), bin_number_lvl1,0.5, bin_number_lvl1+0.5 ); + }else{ + m_numberOflvl1TEsHist =new TH1I(name.c_str(),title.c_str(), 1,-0.5,0.5 ); + } - if ( expertHistograms.regHist( m_numberOflvl1TEsHist ).isFailure()) - msg() << MSG::WARNING << "Can't book Trig histogram " << name << endmsg; + if ( expertHistograms.regHist( m_numberOflvl1TEsHist ).isFailure()) + msg() << MSG::WARNING << "Can't book Trig histogram " << name << endmsg; - /* - 2dhisto for number of input TEs from LVL1 - */ - name = "NumberOfLvl1TEsPerEvent"; - title = "LVL1-TEs abundance per event in (threshold multiplicities)"+ m_trigLvl; + /* + 2dhisto for number of input TEs from LVL1 + */ + name = "NumberOfLvl1TEsPerEvent"; + title = "LVL1-TEs abundance per event in (threshold multiplicities)"+ m_trigLvl; - if(bin_number_lvl1>0){ - m_numberOflvl1TEsHist2d = new TH2I(name.c_str(), title.c_str(), bin_number_lvl1,0.5, bin_number_lvl1+0.5, 20,-0.5,19.5 ); - }else{ - m_numberOflvl1TEsHist2d = new TH2I(name.c_str(), title.c_str(), 1,-0.5, 0.5, 20,-0.5,19.5 ); - } - if ( expertHistograms.regHist( m_numberOflvl1TEsHist2d ).isFailure()) - msg() << MSG::WARNING << "Can't book Trig histogram " << name << endmsg; + if(bin_number_lvl1>0){ + m_numberOflvl1TEsHist2d = new TH2I(name.c_str(), title.c_str(), bin_number_lvl1,0.5, bin_number_lvl1+0.5, 20,-0.5,19.5 ); + }else{ + m_numberOflvl1TEsHist2d = new TH2I(name.c_str(), title.c_str(), 1,-0.5, 0.5, 20,-0.5,19.5 ); + } + if ( expertHistograms.regHist( m_numberOflvl1TEsHist2d ).isFailure()) + msg() << MSG::WARNING << "Can't book Trig histogram " << name << endmsg; - }//"EF" - //naming the histogram bins according to TE label int tmpbin=0; @@ -269,63 +263,39 @@ StatusCode TrigTEMoni::bookHistograms( bool/* isNewEventsBlock*/, bool /*isNewLu } - if(m_trigLvl!="EF"){// LVL1 TES only for L2 and HLT - tmpbin=0; - for ( unsigned int type : m_configuredlvl1TETypes ) { - TrigConf::HLTTriggerElement::getLabel (type,tmpstring); - tmpbin++; - - m_numberOflvl1TEsHist->GetXaxis()->SetBinLabel(tmpbin,tmpstring.c_str()); - m_numberOflvl1TEsHist2d->GetXaxis()->SetBinLabel(tmpbin,tmpstring.c_str()); + tmpbin=0; + for ( unsigned int type : m_configuredlvl1TETypes ) { + TrigConf::HLTTriggerElement::getLabel (type,tmpstring); + tmpbin++; - }//for ...m_configuredlvl1TETypes.begin - } + m_numberOflvl1TEsHist->GetXaxis()->SetBinLabel(tmpbin,tmpstring.c_str()); + m_numberOflvl1TEsHist2d->GetXaxis()->SetBinLabel(tmpbin,tmpstring.c_str()); + } return StatusCode::SUCCESS; } StatusCode TrigTEMoni::fillHists() -{ - - - if( ( !m_numberOfTEsHist || !m_numberOfallTEsHist || !m_numberOfTEsHist2d || - !m_numberOfallTEsHist2d ) - || ( (m_trigLvl != "EF") && ( !m_numberOflvl1TEsHist2d || //!( m_numberOfalllvl1TEsHist2d>0)|| - !m_numberOflvl1TEsHist ) - //|| !( m_numberOfalllvl1TEsHist>0) - ) ){ - msg()<<MSG::WARNING<<" pointers to runsummary histograms not ok, dont Fill ! "<<endmsg; - return StatusCode::FAILURE; - } - - +{ for ( unsigned int type : m_configuredTETypes ) { - - m_numberOfTEsHist->Fill( m_labels[type], - m_parentAlg->getAlgoConfig()->getNavigation()->countAllOfType(type,true)); - - m_numberOfallTEsHist->Fill( m_labels[type], - m_parentAlg->getAlgoConfig()->getNavigation()->countAllOfType(type,false)); + int c = m_parentAlg->getAlgoConfig()->getNavigation()->countAllOfType(type,true); + int cAll = m_parentAlg->getAlgoConfig()->getNavigation()->countAllOfType(type,false); + + m_numberOfTEsHist->Fill( m_labels[type], c); + m_numberOfallTEsHist->Fill( m_labels[type], cAll); + //2dhistos - m_numberOfTEsHist2d->Fill( m_labels[type], - m_parentAlg->getAlgoConfig()->getNavigation()->countAllOfType(type,true)); - - m_numberOfallTEsHist2d->Fill( m_labels[type], - m_parentAlg->getAlgoConfig()->getNavigation()->countAllOfType(type,false)); + m_numberOfTEsHist2d->Fill( m_labels[type], c); + m_numberOfallTEsHist2d->Fill( m_labels[type], cAll); } - if(m_trigLvl != "EF"){ - for ( unsigned int type : m_configuredlvl1TETypes ) { - - m_numberOflvl1TEsHist->Fill( m_lvl1labels[type], - m_parentAlg->getAlgoConfig()->getNavigation()->countAllOfType(type,true)); - - //2d histos - m_numberOflvl1TEsHist2d->Fill( m_lvl1labels[type], - m_parentAlg->getAlgoConfig()->getNavigation()->countAllOfType(type,true)); - - } + for ( unsigned int type : m_configuredlvl1TETypes ) { + int c = m_parentAlg->getAlgoConfig()->getNavigation()->countAllOfType(type,true); + m_numberOflvl1TEsHist->Fill( m_lvl1labels[type], c); + + //2d histos + m_numberOflvl1TEsHist2d->Fill( m_lvl1labels[type], c); } return StatusCode::SUCCESS; } diff --git a/Trigger/TrigSteer/TrigSteering/CMakeLists.txt b/Trigger/TrigSteer/TrigSteering/CMakeLists.txt index f02ec80a235c56fa04802a3cc78b583748592677..e164edf04274fe51e692442d3d51efa867aa877e 100644 --- a/Trigger/TrigSteer/TrigSteering/CMakeLists.txt +++ b/Trigger/TrigSteer/TrigSteering/CMakeLists.txt @@ -30,7 +30,6 @@ atlas_depends_on_subdirs( PUBLIC Trigger/TrigTools/TrigTimeAlgs PRIVATE AtlasTest/TestTools - Control/CxxUtils Event/ByteStreamCnvSvcBase Event/xAOD/xAODTrigger Trigger/TrigConfiguration/TrigConfL1Data @@ -60,24 +59,24 @@ atlas_add_library( TrigSteeringLib PRIVATE_INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} PRIVATE_DEFINITIONS ${CLHEP_DEFINITIONS} LINK_LIBRARIES AthenaBaseComps AthenaKernel DataModel EventInfo xAODEventInfo GaudiKernel TrigConfBase TrigConfHLTData TrigSteeringEvent L1TopoAlgorithms L1TopoCoreSim L1TopoEvent TrigT1CaloToolInterfaces TrigT1Result AthenaMonitoringLib StoreGateLib SGtests TrigROBDataProviderSvcLib L1TopoSimulationLib TrigT1CaloEventLib TrigTimeAlgsLib ByteStreamCnvSvcBaseLib TrigSerializeResultLib TrigNavigationLib TrigMonitorBaseLib TrigInterfacesLib - PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} TestTools CxxUtils xAODTrigger TrigConfL1Data TrigStorageDefinitions L1TopoCommon L1TopoConfig TrigT1Interfaces ) + PRIVATE_LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} TestTools xAODTrigger TrigConfL1Data TrigStorageDefinitions L1TopoCommon L1TopoConfig TrigT1Interfaces ) atlas_add_component( TrigSteering src/components/*.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthenaMonitoringLib DataModel StoreGateLib SGtests EventInfo xAODEventInfo GaudiKernel TrigConfBase TrigConfHLTData TrigROBDataProviderSvcLib TrigSteeringEvent L1TopoAlgorithms L1TopoCoreSim L1TopoEvent L1TopoSimulationLib TrigT1CaloEventLib TrigT1CaloToolInterfaces TrigT1Result TrigTimeAlgsLib TestTools CxxUtils ByteStreamCnvSvcBaseLib xAODTrigger TrigConfL1Data TrigSerializeResultLib TrigNavigationLib TrigStorageDefinitions TrigMonitorBaseLib TrigInterfacesLib L1TopoCommon L1TopoConfig TrigT1Interfaces TrigSteeringLib ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthenaMonitoringLib DataModel StoreGateLib SGtests EventInfo xAODEventInfo GaudiKernel TrigConfBase TrigConfHLTData TrigROBDataProviderSvcLib TrigSteeringEvent L1TopoAlgorithms L1TopoCoreSim L1TopoEvent L1TopoSimulationLib TrigT1CaloEventLib TrigT1CaloToolInterfaces TrigT1Result TrigTimeAlgsLib TestTools ByteStreamCnvSvcBaseLib xAODTrigger TrigConfL1Data TrigSerializeResultLib TrigNavigationLib TrigStorageDefinitions TrigMonitorBaseLib TrigInterfacesLib L1TopoCommon L1TopoConfig TrigT1Interfaces TrigSteeringLib ) atlas_add_dictionary( TrigSteeringDict TrigSteering/TrigSteeringDict.h TrigSteering/selection.xml INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthenaMonitoringLib DataModel StoreGateLib SGtests EventInfo xAODEventInfo GaudiKernel TrigConfBase TrigConfHLTData TrigROBDataProviderSvcLib TrigSteeringEvent L1TopoAlgorithms L1TopoCoreSim L1TopoEvent L1TopoSimulationLib TrigT1CaloEventLib TrigT1CaloToolInterfaces TrigT1Result TrigTimeAlgsLib TestTools CxxUtils ByteStreamCnvSvcBaseLib xAODTrigger TrigConfL1Data TrigSerializeResultLib TrigNavigationLib TrigStorageDefinitions TrigMonitorBaseLib TrigInterfacesLib L1TopoCommon L1TopoConfig TrigT1Interfaces TrigSteeringLib ) + LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthenaMonitoringLib DataModel StoreGateLib SGtests EventInfo xAODEventInfo GaudiKernel TrigConfBase TrigConfHLTData TrigROBDataProviderSvcLib TrigSteeringEvent L1TopoAlgorithms L1TopoCoreSim L1TopoEvent L1TopoSimulationLib TrigT1CaloEventLib TrigT1CaloToolInterfaces TrigT1Result TrigTimeAlgsLib TestTools ByteStreamCnvSvcBaseLib xAODTrigger TrigConfL1Data TrigSerializeResultLib TrigNavigationLib TrigStorageDefinitions TrigMonitorBaseLib TrigInterfacesLib L1TopoCommon L1TopoConfig TrigT1Interfaces TrigSteeringLib ) atlas_add_test( Signature_test SOURCES test/Signature_test.cxx INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} ${Boost_INCLUDE_DIRS} ${TDAQ-COMMON_INCLUDE_DIRS} ${CLHEP_INCLUDE_DIRS} - LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthenaMonitoringLib DataModel StoreGateLib SGtests EventInfo xAODEventInfo GaudiKernel TrigConfBase TrigConfHLTData TrigROBDataProviderSvcLib TrigSteeringEvent L1TopoAlgorithms L1TopoCoreSim L1TopoEvent L1TopoSimulationLib TrigT1CaloEventLib TrigT1CaloToolInterfaces TrigT1Result TrigTimeAlgsLib TestTools CxxUtils ByteStreamCnvSvcBaseLib xAODTrigger TrigConfL1Data TrigSerializeResultLib TrigNavigationLib TrigStorageDefinitions TrigMonitorBaseLib TrigInterfacesLib L1TopoCommon L1TopoConfig TrigT1Interfaces TrigSteeringLib + LINK_LIBRARIES ${ROOT_LIBRARIES} ${Boost_LIBRARIES} ${TDAQ-COMMON_LIBRARIES} ${CLHEP_LIBRARIES} AthenaBaseComps AthenaKernel AthenaMonitoringLib DataModel StoreGateLib SGtests EventInfo xAODEventInfo GaudiKernel TrigConfBase TrigConfHLTData TrigROBDataProviderSvcLib TrigSteeringEvent L1TopoAlgorithms L1TopoCoreSim L1TopoEvent L1TopoSimulationLib TrigT1CaloEventLib TrigT1CaloToolInterfaces TrigT1Result TrigTimeAlgsLib TestTools ByteStreamCnvSvcBaseLib xAODTrigger TrigConfL1Data TrigSerializeResultLib TrigNavigationLib TrigStorageDefinitions TrigMonitorBaseLib TrigInterfacesLib L1TopoCommon L1TopoConfig TrigT1Interfaces TrigSteeringLib EXTRA_PATTERNS ".*" ) # Install files from the package: diff --git a/Trigger/TrigSteer/TrigSteering/TrigSteering/TrigSteer.h b/Trigger/TrigSteer/TrigSteering/TrigSteering/TrigSteer.h index 965c0ad9338b1bf5968b875f83ddb17e5eb35b8b..eb1951e7c4d65d5acaaf46358fe6d55f53812a55 100755 --- a/Trigger/TrigSteer/TrigSteering/TrigSteering/TrigSteer.h +++ b/Trigger/TrigSteer/TrigSteering/TrigSteering/TrigSteer.h @@ -218,6 +218,7 @@ namespace HLT { bool m_enableRobRequestPreparation; //!< directive to enable ROB request preparation step bool m_doL1TopoSimulation; //!< Turns on L1Topo Simulation int m_topoOutputLevel{TrigConf::MSGTC::WARNING}; // property to set the outputlevel of the topo algorithms + bool m_topoUseBitwise; //!< property to set 'UseBitwise' of TopoSteering bool m_enableRerun; //!< directive to enable rerun on prescaled chains int m_stepForEB; //!< step of the EB in the merged L2EF system int m_strategyEB; //!< directive to decide the EB strategy in the merged L2EF system diff --git a/Trigger/TrigSteer/TrigSteering/cmt/requirements b/Trigger/TrigSteer/TrigSteering/cmt/requirements index 4eb8a0ab7f0b9632dff5431210f3f91a6be74aa8..408334b5d2b45210982781ff9faa9a66d7ad2beb 100755 --- a/Trigger/TrigSteer/TrigSteering/cmt/requirements +++ b/Trigger/TrigSteer/TrigSteering/cmt/requirements @@ -39,7 +39,6 @@ use AtlasCLHEP AtlasCLHEP-* External use AtlasROOT AtlasROOT-* External use AtlasReflex AtlasReflex-* External use ByteStreamCnvSvcBase ByteStreamCnvSvcBase-* Event -use CxxUtils CxxUtils-* Control use DataCollection DataCollection-* External use TestTools TestTools-* AtlasTest use TrigConfL1Data TrigConfL1Data-* Trigger/TrigConfiguration diff --git a/Trigger/TrigSteer/TrigSteering/doc/mainpage.h b/Trigger/TrigSteer/TrigSteering/doc/mainpage.h deleted file mode 100755 index 74c785a8047e2f88cbe75da86c91cb3103e60acd..0000000000000000000000000000000000000000 --- a/Trigger/TrigSteer/TrigSteering/doc/mainpage.h +++ /dev/null @@ -1,51 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** -@mainpage TrigSteering Package - - -New classes: -@author Till.Eifert@cern.ch -@author Nicolas.Berger@cern.ch -@author Tomasz.Bold@cern.ch - -@section TrigSteeringIntro Introduction - -This package is used for the High Level Trigger (HLT), both -in the Level 2 (L2) and Event Filter (EF). -It provides one Gaudi TopAlgorithm (StepController) that runs all other -sub algorithms. -This package provides: tools to convert the results from previous trigger -levels; the actual controlling unit, which is responsible for -managing (scheduling) the execution of all HLT PESA -algorithms. - - - -@section TrigSteeringOverview Class Overview - The TrigSteering package contains of following classes: - - - HLT::TrigSteer : Gaudi TopAlgorithm, controlling all other sub algorithms - - HLT::Chain : representing one chain of signatures - - HLT::Signature : representing one signature - - HLT::Sequence : one sequence = PESA algorithm(s), input type(s), output type - - HLT::LvlXConverter : various tools to do the trigger level conversion - - Scaler : various classes which provide scaler engines for both: pass-throughs and prescales - -@ref used_TrigSteering - -@ref requirements_TrigSteering - -*/ - -/** -@page used_TrigSteering Used Packages -@htmlinclude used_packages.html -*/ - -/** -@page requirements_TrigSteering Requirements -@include requirements -*/ diff --git a/Trigger/TrigSteer/TrigSteering/src/Lvl1ResultAccessTool.cxx b/Trigger/TrigSteer/TrigSteering/src/Lvl1ResultAccessTool.cxx index 7aafd0e5e35fa63fd34f465bd90f28c855bb315c..2f7f428789d6cd1c012e179bcd34ad9201435863 100755 --- a/Trigger/TrigSteer/TrigSteering/src/Lvl1ResultAccessTool.cxx +++ b/Trigger/TrigSteer/TrigSteering/src/Lvl1ResultAccessTool.cxx @@ -1010,12 +1010,12 @@ std::bitset<3> Lvl1ResultAccessTool::lvl1EMTauJetOverflow(const ROIB::RoIBResult msg() << "EM RoI multiplicities by crate,module: "; for (const auto& i : em) msg() << "(" << i.first.first << "," << i.first.second << "):" << i.second << " "; - msg() << endreq << "Tau RoI multiplicities by crate,module: "; + msg() << endmsg << "Tau RoI multiplicities by crate,module: "; for (const auto& i : tau) msg() << "(" << i.first.first << "," << i.first.second << "):" << i.second << " "; - msg() << endreq << "Jet RoI multiplicities by crate,module: "; + msg() << endmsg << "Jet RoI multiplicities by crate,module: "; for (const auto& i : jet) msg() << "(" << i.first.first << "," << i.first.second << "):" << i.second << " "; - msg() << endreq; + msg() << endmsg; } return overflow; diff --git a/Trigger/TrigSteer/TrigSteering/src/OptimalExecutionOrderStrategy.cxx b/Trigger/TrigSteer/TrigSteering/src/OptimalExecutionOrderStrategy.cxx index 2b350c54759773c39b401d7900bd38c276bde2f8..b393012ae0601303b0a745e27470322ade75a658 100644 --- a/Trigger/TrigSteer/TrigSteering/src/OptimalExecutionOrderStrategy.cxx +++ b/Trigger/TrigSteer/TrigSteering/src/OptimalExecutionOrderStrategy.cxx @@ -33,18 +33,18 @@ std::set<std::string> getL1ThresholdsOfChain(const HLT::SteeringChain* chain, Tr bool Bag::insert(const HLT::SteeringChain* chain) { - if ( matching.find(chain) != matching.end() ) { - content.push_back(chain); + if ( m_matching.find(chain) != m_matching.end() ) { + m_content.push_back(chain); return true; } return false; } void Bag::flush(std::vector<HLT::SteeringChain*>& chains) { - for(const HLT::SteeringChain* ch : content) { + for(const HLT::SteeringChain* ch : m_content) { chains.push_back(const_cast<HLT::SteeringChain*>(ch)); } - content.clear(); + m_content.clear(); } @@ -55,7 +55,7 @@ public: BagForAll() {} virtual bool prepare(const HLT::SteeringChain* ) { return true; } virtual bool insert(const HLT::SteeringChain* chain) { - content.push_back(chain); + m_content.push_back(chain); return true; } @@ -68,7 +68,7 @@ public: bool prepare(const HLT::SteeringChain* chain) { std::set<std::string> thresholds = getL1ThresholdsOfChain(chain, m_config); if ( thresholds.find(m_th) != thresholds.end() ) { - matching.insert(chain); + m_matching.insert(chain); //std::cout << "in this bag we like: " << chain->getChainName() << std::endl; return true; } @@ -87,7 +87,7 @@ public: //if (chain->getChainName() == m_chname ) { boost::cmatch what; if ( boost::regex_match(chain->getChainName().c_str(), what, m_chname) ) { - matching.insert(chain); + m_matching.insert(chain); return true; } return false; diff --git a/Trigger/TrigSteer/TrigSteering/src/OptimalExecutionOrderStrategy.h b/Trigger/TrigSteer/TrigSteering/src/OptimalExecutionOrderStrategy.h index 4916d10f05e5b84f92ff276e73faeea2843718df..e1c88eec7f4c8939496c879520410a34ddba28c1 100644 --- a/Trigger/TrigSteer/TrigSteering/src/OptimalExecutionOrderStrategy.h +++ b/Trigger/TrigSteer/TrigSteering/src/OptimalExecutionOrderStrategy.h @@ -26,9 +26,9 @@ namespace HLT { virtual bool insert(const HLT::SteeringChain* ); void flush(std::vector<HLT::SteeringChain*>& chains); protected: - std::vector<const HLT::SteeringChain*> content; + std::vector<const HLT::SteeringChain*> m_content; - std::set<const HLT::SteeringChain*> matching; + std::set<const HLT::SteeringChain*> m_matching; }; /** diff --git a/Trigger/TrigSteer/TrigSteering/src/RandomScaler.cxx b/Trigger/TrigSteer/TrigSteering/src/RandomScaler.cxx index c09170a668278c1f40ac3b1a112b0dbc7373d507..0f21726b396124949f3ce51c8488cde6d03e9178 100755 --- a/Trigger/TrigSteer/TrigSteering/src/RandomScaler.cxx +++ b/Trigger/TrigSteer/TrigSteering/src/RandomScaler.cxx @@ -25,7 +25,26 @@ #include "EventInfo/EventInfo.h" #include "EventInfo/EventID.h" #include "EventInfo/EventIncident.h" -#include "CxxUtils/hashtable.h" + +namespace { + + +struct Fnv_hash4 +{ + static std::uint32_t + hash(const char* first, std::size_t length) + { + std::uint32_t result = static_cast<std::uint32_t>(2166136261UL); + for (; length > 0; --length) + { + result ^= (std::uint32_t)*first++; + result *= 16777619UL; + } + return result; + } +}; + +} //anonymous namespace const short DEFAULT_LUXURY(2); @@ -52,13 +71,13 @@ StatusCode HLT::RandomScaler::initialize() ServiceHandle<IAtRndmGenSvc> rngSvc("AtRanluxGenSvc",name()); if ( rngSvc.retrieve().isFailure() ) { - msg() << MSG::ERROR << "Could not initialize Random Number Service" << endreq; + msg() << MSG::ERROR << "Could not initialize Random Number Service" << endmsg; return StatusCode::FAILURE; } m_engine = dynamic_cast<CLHEP::Ranlux64Engine*>(rngSvc->GetEngine(name())); if (m_engine==0) { - msg() << MSG::ERROR << "Random number engine not of type Ranlux64Engine" << endreq; + msg() << MSG::ERROR << "Random number engine not of type Ranlux64Engine" << endmsg; return StatusCode::FAILURE; } @@ -73,15 +92,15 @@ StatusCode HLT::RandomScaler::initialize() if (m_eventSeed) { ServiceHandle<IIncidentSvc> incSvc("IncidentSvc",name()); if (incSvc.retrieve().isFailure()) { - msg() << MSG::ERROR << "Cannot retrieve IncidentSvc" << endreq; + msg() << MSG::ERROR << "Cannot retrieve IncidentSvc" << endmsg; return StatusCode::FAILURE; } incSvc->addListener(this, IncidentType::BeginEvent); msg() << MSG::INFO << "Re-seeding RNG on every event from time stamp and fixed seed " - << m_seed << " with luxury level " << m_engine->getLuxury() << endreq; + << m_seed << " with luxury level " << m_engine->getLuxury() << endmsg; } else { - msg() << MSG::INFO << "Using random seed = " << m_seed << endreq; + msg() << MSG::INFO << "Using random seed = " << m_seed << endmsg; } return StatusCode::SUCCESS; @@ -95,7 +114,7 @@ void HLT::RandomScaler::handle(const Incident& inc) const EventIncident* eventInc = dynamic_cast<const EventIncident*>(&inc); if (eventInc) event = &eventInc->eventInfo(); else { - msg() << MSG::ERROR << "Cannot retrieve EventInfo object from BeginEvent incident." << endreq; + msg() << MSG::ERROR << "Cannot retrieve EventInfo object from BeginEvent incident." << endmsg; return; } @@ -105,10 +124,10 @@ void HLT::RandomScaler::handle(const Incident& inc) /* Generate hash-based seed from event quantities. * Ranlux64 only supports signed 32bit seeds ('long' on i686) */ - int32_t seed = static_cast<int32_t>(SG::Fnv_hash<4>::hash((char*)m_seedInput, sizeof(long)*N_SEED_INPUTS)); + int32_t seed = static_cast<int32_t>(Fnv_hash4::hash((char*)m_seedInput, sizeof(long)*N_SEED_INPUTS)); if (msgLvl(MSG::VERBOSE)) { - msg() << MSG::VERBOSE << "Setting random number seed = " << seed << endreq; + msg() << MSG::VERBOSE << "Setting random number seed = " << seed << endmsg; } m_engine->setSeed(seed, /*seed lux*/ DEFAULT_LUXURY); // seed luxury level is separate from RNG luxury level } @@ -125,12 +144,12 @@ void HLT::RandomScaler::setSeedFromDataflow() IntegerProperty seed; if ( seed.assign(*p) ) { m_seed = seed; - msg() << MSG::INFO << "Using application-specific random seed = " << m_seed << endreq; + msg() << MSG::INFO << "Using application-specific random seed = " << m_seed << endmsg; } - else msg() << MSG::WARNING << "Could not set Property 'seed' from DataFlowConfig.DF_RandomSeed" << endreq; + else msg() << MSG::WARNING << "Could not set Property 'seed' from DataFlowConfig.DF_RandomSeed" << endmsg; } } - else msg() << MSG::WARNING << "Could not retrieve JobOptionsSvc to read random seed. Using default value." << endreq; + else msg() << MSG::WARNING << "Could not retrieve JobOptionsSvc to read random seed. Using default value." << endmsg; } @@ -141,7 +160,7 @@ bool HLT::RandomScaler::decision(float factor) return (factor*rand < 1); } else { - msg() << MSG::ERROR << "Engine not initialized! Returning false" << endreq; + msg() << MSG::ERROR << "Engine not initialized! Returning false" << endmsg; return false; } } diff --git a/Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx b/Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx index f1e9e76f68054226b50bb93fde905e6db945011e..89e192d9d51821ccfe4463a63a30c411c200fac5 100755 --- a/Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx +++ b/Trigger/TrigSteer/TrigSteering/src/ResultBuilder.cxx @@ -352,7 +352,6 @@ ErrorCode ResultBuilder::fillTriggerInfo(const std::vector<SteeringChain*>& acti StreamTagCollectionHelperMap::iterator strIt; // std::vector<int> es_chain_counters; // chain_counters of chains which sent the event to the express stream - int chid; if ( m_uniqueStreams.size() == 0 ) { // it means no debug stream // list of all StreamTags @@ -398,7 +397,7 @@ ErrorCode ResultBuilder::fillTriggerInfo(const std::vector<SteeringChain*>& acti // ATH_MSG_VERBOSE("Set expressOPI to 1 for: " << chain->getChainName()); // } if (streamInfo && chain_stream.getType() == "express") { - chid = chain->getChainCounter(); + //chid = chain->getChainCounter(); streamInfo->setDetail(chain->getChainName(), chain_stream.prescaleFactor()); // es_chain_counters.push_back(chid); ATH_MSG_VERBOSE("Set express stream prescale to 1 for: " << chain->getChainName()); @@ -505,7 +504,7 @@ ErrorCode ResultBuilder::fillTriggerInfo(const std::vector<SteeringChain*>& acti it != triggerTypeBits.end(); ++it ) { msg() << MSG::DEBUG << " 0x" << MSG::hex << *it; } - msg() << MSG::DEBUG << MSG::dec << endreq; + msg() << MSG::DEBUG << MSG::dec << endmsg; } diff --git a/Trigger/TrigSteer/TrigSteering/src/ScalerSvc.cxx b/Trigger/TrigSteer/TrigSteering/src/ScalerSvc.cxx index 5045400dddd7ba4eebeac9b6cfbc7f83795d7f67..6b1c28eb386b9252b7d80291717cf377400e3541 100755 --- a/Trigger/TrigSteer/TrigSteering/src/ScalerSvc.cxx +++ b/Trigger/TrigSteer/TrigSteering/src/ScalerSvc.cxx @@ -95,7 +95,7 @@ bool HLT::ScalerSvc::registerType( IScalerFactory* factory, const std::string& t // This is a static method. No access to msg() member. MsgStream log(Athena::getMessageSvc(), "HLT::ScalerSvc"); log << MSG::INFO << "A factory was already registered for type" - << type << ", replacing with this one." << endreq; + << type << ", replacing with this one." << endmsg; delete findFact->second; retVal = false; diff --git a/Trigger/TrigSteer/TrigSteering/src/Sequence.cxx b/Trigger/TrigSteer/TrigSteering/src/Sequence.cxx index 7556876f96b6280b9167e946a7d2ffe24da5fc48..aaac242b6b76a69f2c9f6fa1fa7a606ab0c61ad7 100755 --- a/Trigger/TrigSteer/TrigSteering/src/Sequence.cxx +++ b/Trigger/TrigSteer/TrigSteering/src/Sequence.cxx @@ -66,41 +66,41 @@ Sequence::Sequence(std::vector<unsigned int> inputTypes, if ( config->getDoTiming() ) { ServiceHandle<ITrigTimerSvc> timerSvc("TrigTimerSvc/TrigTimerSvc", "tr"); if ( timerSvc.retrieve().isFailure() ) { - m_config->getMsgStream() << MSG::WARNING << "Requested timing measurements but can't retrieve TrigTimerSvc for sequence" << endreq; + m_config->getMsgStream() << MSG::WARNING << "Requested timing measurements but can't retrieve TrigTimerSvc for sequence" << endmsg; } std::string telabel; if ( TrigConf::HLTTriggerElement::getLabel(outputType, telabel) ) { const AlgTool *ntool = dynamic_cast<AlgTool*>(m_config->getNavigation()); if ( !ntool ) { - m_config->getMsgStream() << MSG::WARNING << "Navigation tool not available" << endreq; + m_config->getMsgStream() << MSG::WARNING << "Navigation tool not available" << endmsg; return; } const Algorithm* parentAlg = dynamic_cast<const Algorithm*>(ntool->parent()); // this is the way to get parent alg name (TrigSteer_L2/EF) ugh we need better way. if ( !parentAlg ) { - m_config->getMsgStream() << MSG::WARNING << "No parent algorithm for the sequence" << endreq; + m_config->getMsgStream() << MSG::WARNING << "No parent algorithm for the sequence" << endmsg; return; } std::string name( parentAlg->name()+":sequence_" + telabel ); m_timer = timerSvc->addItem(name); // TrigSteer is hardcoded but we can find it via alg->parentAlg()->name() which should be steering instance name; - m_config->getMsgStream() << MSG::DEBUG << "Booked timer: " << name << endreq; + m_config->getMsgStream() << MSG::DEBUG << "Booked timer: " << name << endmsg; } else - m_config->getMsgStream() << MSG::WARNING << "Can not find TE label for id: " << outputType << endreq; + m_config->getMsgStream() << MSG::WARNING << "Can not find TE label for id: " << outputType << endmsg; } // Get TrigROBDataProvider_RTT for data pre-fetch test - ServiceHandle<IROBDataProviderSvc> m_robDataProvider("ROBDataProviderSvc/ROBDataProviderSvc","TrigSteer_HLT"); - if( m_robDataProvider.retrieve().isFailure() ) { - m_config->getMsgStream() << MSG::ERROR << "can't get ROBDataProviderSvc" << endreq; + ServiceHandle<IROBDataProviderSvc> robDataProvider("ROBDataProviderSvc/ROBDataProviderSvc","TrigSteer_HLT"); + if( robDataProvider.retrieve().isFailure() ) { + m_config->getMsgStream() << MSG::ERROR << "can't get ROBDataProviderSvc" << endmsg; } else{ - m_trigROBDataProvider = SmartIF<ITrigROBDataProviderSvc_RTT>( &*m_robDataProvider ); + m_trigROBDataProvider = SmartIF<ITrigROBDataProviderSvc_RTT>( &*robDataProvider ); if (m_trigROBDataProvider.isValid()) { if (m_config && m_config->getMsgLvl() <= MSG::DEBUG) - m_config->getMsgStream() << MSG::DEBUG << "A ROBDataProviderSvc implementing the trig interface ITrigROBDataProviderSvc_RTT was found."<< endreq; + m_config->getMsgStream() << MSG::DEBUG << "A ROBDataProviderSvc implementing the trig interface ITrigROBDataProviderSvc_RTT was found."<< endmsg; } } return; @@ -116,18 +116,18 @@ bool Sequence::reset() { if ( m_firstAlgo ) { if (m_config->getMsgLvl() <= MSG::VERBOSE) - m_config->getMsgStream() << MSG::VERBOSE << "Sequence about to do reset() of 1st algo: " << m_firstAlgo->name()<< endreq; + m_config->getMsgStream() << MSG::VERBOSE << "Sequence about to do reset() of 1st algo: " << m_firstAlgo->name()<< endmsg; if ( !m_firstAlgo->reset() ) { - m_config->getMsgStream() << MSG::WARNING << "Sequence reset() of 1st algo problematic " << m_firstAlgo->name()<< endreq; + m_config->getMsgStream() << MSG::WARNING << "Sequence reset() of 1st algo problematic " << m_firstAlgo->name()<< endmsg; return false; } } for (unsigned int i = 0; i < m_nextAlgos.size(); i++) { if (m_config->getMsgLvl() <=MSG::VERBOSE) - m_config->getMsgStream() << MSG::VERBOSE << "Sequence about to do reset() of next algo: " << m_nextAlgos[i]->name() << endreq; + m_config->getMsgStream() << MSG::VERBOSE << "Sequence about to do reset() of next algo: " << m_nextAlgos[i]->name() << endmsg; if ( !m_nextAlgos[i]->reset() ) { - m_config->getMsgStream() << MSG::WARNING << "Sequence reset() of next algo problematic " << m_nextAlgos[i]->name() << endreq; + m_config->getMsgStream() << MSG::WARNING << "Sequence reset() of next algo problematic " << m_nextAlgos[i]->name() << endmsg; return false; } } @@ -225,13 +225,13 @@ HLT::ErrorCode Sequence::execute() if (m_alreadyExecuted) { if (m_config->getMsgLvl() <=MSG::DEBUG) { m_config->getMsgStream() << MSG::DEBUG << "Sequence already executed! -> doing nothing" - << endreq; + << endmsg; m_config->getMsgStream() << MSG::DEBUG << "Sequence: inputTEs = "; for (std::vector< unsigned int >::const_iterator it = m_inputTeTypes.begin(); it != m_inputTeTypes.end(); ++it) { m_config->getMsgStream() << MSG::DEBUG << (*it) << ", "; } - m_config->getMsgStream() << MSG::DEBUG << " outputTE = " << m_outputTeType << " firstAlgo = " << m_firstAlgo->name() << endreq; + m_config->getMsgStream() << MSG::DEBUG << " outputTE = " << m_outputTeType << " firstAlgo = " << m_firstAlgo->name() << endmsg; } return m_execErrorCode; } @@ -270,7 +270,7 @@ HLT::ErrorCode Sequence::execute() if (m_config->getMsgLvl() <=MSG::DEBUG) m_config->getMsgStream() << MSG::DEBUG << "Sequence executing, producing output type = " - << m_outputTeType << endreq; + << m_outputTeType << endmsg; // Execute the algorithms. @@ -280,7 +280,7 @@ HLT::ErrorCode Sequence::execute() try { if (m_config->getMsgLvl() <=MSG::DEBUG) m_config->getMsgStream() << MSG::DEBUG << "Executing first algo " - << m_firstAlgo->name() << endreq; + << m_firstAlgo->name() << endmsg; ErrorCode ec = m_firstAlgo->createAndProcessTEs( m_inputTeTypes, m_outputTeType, m_outputTEs, m_topoStartFrom); @@ -288,19 +288,19 @@ HLT::ErrorCode Sequence::execute() if (m_config->getMsgLvl() <=MSG::DEBUG) m_config->getMsgStream() << MSG::DEBUG << "Sequence '" << te_label - << "': EC from firstalgo->createAndProcessTEs(..) = " << HLT::strErrorCode( m_execErrorCode ) << endreq; + << "': EC from firstalgo->createAndProcessTEs(..) = " << HLT::strErrorCode( m_execErrorCode ) << endmsg; if ( m_execErrorCode.action() > HLT::Action::CONTINUE ) { m_config->getMsgStream() << MSG::WARNING << "Sequence '" << te_label << "' got error back while executing first algorithm '" << m_firstAlgo->name() << "':" - << HLT::strErrorCode( m_execErrorCode ) << endreq; + << HLT::strErrorCode( m_execErrorCode ) << endmsg; } // Check if event timeout was reached if ( Athena::Timeout::instance().reached() ) { if (m_config->getMsgLvl() <= MSG::DEBUG) - m_config->getMsgStream() << MSG::DEBUG << "Timeout reached executing algo " << m_firstAlgo->name() << endreq; + m_config->getMsgStream() << MSG::DEBUG << "Timeout reached executing algo " << m_firstAlgo->name() << endmsg; return m_execErrorCode = HLT::ErrorCode(HLT::Action::ABORT_EVENT, HLT::Reason::TIMEOUT); } @@ -315,31 +315,31 @@ HLT::ErrorCode Sequence::execute() if (activeOutputTEsInternal() == 0) { if (m_config->getMsgLvl() <=MSG::DEBUG) m_config->getMsgStream() << MSG::DEBUG << "No more valid TEs ==> exiting sequence before " - << m_nextAlgos[j]->name() << endreq; + << m_nextAlgos[j]->name() << endmsg; return m_execErrorCode; } if (m_config->getMsgLvl() <= MSG::DEBUG) m_config->getMsgStream() << MSG::DEBUG << "Executing next algo " - << m_nextAlgos[j]->name() << endreq; + << m_nextAlgos[j]->name() << endmsg; ErrorCode ec = m_nextAlgos[j]->processTEs(m_outputTEs); m_execErrorCode = m_execErrorCode > ec ? m_execErrorCode : ec; if (m_config->getMsgLvl() <=MSG::DEBUG) m_config->getMsgStream() << MSG::DEBUG << "Sequence " - << " EC from algo->processTEs(..) = " << HLT::strErrorCode( m_execErrorCode ) << endreq; + << " EC from algo->processTEs(..) = " << HLT::strErrorCode( m_execErrorCode ) << endmsg; if ( ec.action() > HLT::Action::CONTINUE ) { m_config->getMsgStream() << MSG::WARNING << "Sequence got error back while executing algorithm: " - << m_nextAlgos[j]->name() << " " << HLT::strErrorCode( m_execErrorCode ) << endreq; + << m_nextAlgos[j]->name() << " " << HLT::strErrorCode( m_execErrorCode ) << endmsg; } // Check if event timeout was reached if ( Athena::Timeout::instance().reached() ) { if (m_config->getMsgLvl() <= MSG::DEBUG) - m_config->getMsgStream() << MSG::DEBUG << "Timeout reached executing algo " << m_nextAlgos[j]->name() << endreq; + m_config->getMsgStream() << MSG::DEBUG << "Timeout reached executing algo " << m_nextAlgos[j]->name() << endmsg; return m_execErrorCode = HLT::ErrorCode(HLT::Action::ABORT_EVENT, HLT::Reason::TIMEOUT); } @@ -372,13 +372,13 @@ HLT::ErrorCode Sequence::prepareRobRequests() TrigConf::HLTTriggerElement::getLabel(m_outputTeType, telabel); m_config->getMsgStream() << MSG::DEBUG << "Sequence: prepareRobRequests for '" << telabel << "' already executed! -> doing nothing" - << endreq; + << endmsg; m_config->getMsgStream() << MSG::DEBUG << "Sequence: inputTEs = "; for (std::vector< unsigned int >::const_iterator it = m_inputTeTypes.begin(); it != m_inputTeTypes.end(); ++it) { m_config->getMsgStream() << MSG::DEBUG << (*it) << ", "; } - m_config->getMsgStream() << MSG::DEBUG << " outputTE = " << m_outputTeType << " firstAlgo = " << m_firstAlgo->name() << endreq; + m_config->getMsgStream() << MSG::DEBUG << " outputTE = " << m_outputTeType << " firstAlgo = " << m_firstAlgo->name() << endmsg; } // and just return the result return m_prepRobReqErrorCode; @@ -401,7 +401,7 @@ HLT::ErrorCode Sequence::prepareRobRequests() if (m_config->getMsgLvl() <=MSG::DEBUG) { std::string telabel; TrigConf::HLTTriggerElement::getLabel(m_outputTeType, telabel); - m_config->getMsgStream() << MSG::DEBUG << "Sequence " << telabel << " has input sequence at this step, calling prepareRobRequest for those" << endreq; + m_config->getMsgStream() << MSG::DEBUG << "Sequence " << telabel << " has input sequence at this step, calling prepareRobRequest for those" << endmsg; } // call prepareRobRequests() for all input Sequences for ( std::vector< HLT::Sequence* >::const_iterator seq = m_previousSequences.begin(); @@ -428,7 +428,7 @@ HLT::ErrorCode Sequence::prepareRobRequests() if (m_config->getMsgLvl() <=MSG::DEBUG) { std::string telabel; TrigConf::HLTTriggerElement::getLabel(m_outputTeType, telabel); - m_config->getMsgStream() << MSG::DEBUG << "Sequence " << telabel << ": preparing ROB requests for all fex-type of the " << m_nextAlgos.size()+1 << " algos of this sequence" << endreq; + m_config->getMsgStream() << MSG::DEBUG << "Sequence " << telabel << ": preparing ROB requests for all fex-type of the " << m_nextAlgos.size()+1 << " algos of this sequence" << endmsg; } @@ -463,7 +463,7 @@ HLT::ErrorCode Sequence::prepareRobRequests() if (m_config->getMsgLvl() <=MSG::DEBUG){ std::string teName; TrigConf::HLTTriggerElement::getLabel(m_outputTeType, teName); - m_config->getMsgStream() << MSG::DEBUG << " calling processRobRequests of TECreateAlgo '" << te_create_alg->name() << "' with outputTE = " << teName << endreq; + m_config->getMsgStream() << MSG::DEBUG << " calling processRobRequests of TECreateAlgo '" << te_create_alg->name() << "' with outputTE = " << teName << endmsg; } //test of the pre-fetching: clear the pre-fetching list @@ -477,25 +477,25 @@ HLT::ErrorCode Sequence::prepareRobRequests() if (m_config->getMsgLvl() <=MSG::DEBUG) m_config->getMsgStream() << MSG::DEBUG << "EC from algo->processRobRequests(..) = " - << HLT::strErrorCode( m_prepRobReqErrorCode ) << endreq; + << HLT::strErrorCode( m_prepRobReqErrorCode ) << endmsg; if ( m_prepRobReqErrorCode.action() > HLT::Action::CONTINUE ) m_config->getMsgStream() << MSG::WARNING << "Sequence got error back while executing algo->processRobRequests(..): " - << te_create_alg->name() << " " << HLT::strErrorCode( m_prepRobReqErrorCode ) << endreq; + << te_create_alg->name() << " " << HLT::strErrorCode( m_prepRobReqErrorCode ) << endmsg; //test of the pretching: fill the pre-fetching list if (do_prefetching_test){ std::string pref_name = alg->name() + "_pref"; - if (m_config->getMsgLvl() <=MSG::INFO) m_config->getMsgStream() << MSG::INFO <<"Forcing trigROBDataProvider_RTT.addROBData: Algorithm "<< te_create_alg->name() <<" scheduled "<<m_config->robRequestInfo()->requestScheduledRobIDs().size() <<" ROBs"<<endreq; + if (m_config->getMsgLvl() <=MSG::INFO) m_config->getMsgStream() << MSG::INFO <<"Forcing trigROBDataProvider_RTT.addROBData: Algorithm "<< te_create_alg->name() <<" scheduled "<<m_config->robRequestInfo()->requestScheduledRobIDs().size() <<" ROBs"<<endmsg; m_trigROBDataProvider->addROBData(m_config->robRequestInfo()->requestScheduledRobIDs(),pref_name); } // Check if event timeout was reached if ( Athena::Timeout::instance().reached() ) { if (m_config->getMsgLvl() <= MSG::DEBUG) - m_config->getMsgStream() << MSG::DEBUG << "Timeout reached executing algo->processRobRequests(..) " << m_nextAlgos[j]->name() << endreq; + m_config->getMsgStream() << MSG::DEBUG << "Timeout reached executing algo->processRobRequests(..) " << m_nextAlgos[j]->name() << endmsg; return m_prepRobReqErrorCode = HLT::ErrorCode(HLT::Action::ABORT_EVENT, HLT::Reason::TIMEOUT); } diff --git a/Trigger/TrigSteer/TrigSteering/src/Signature.cxx b/Trigger/TrigSteer/TrigSteering/src/Signature.cxx index 13185dbd4de0a4941271b6544bbf37250a5c15ba..11e288bdcc2c7f872e95f00dcb4f00add3fd5ce0 100755 --- a/Trigger/TrigSteer/TrigSteering/src/Signature.cxx +++ b/Trigger/TrigSteer/TrigSteering/src/Signature.cxx @@ -53,7 +53,7 @@ Signature::Signature( const TrigConf::HLTSignature* configSig, // Debug output if (m_config->getMsgLvl() <=MSG::DEBUG) { m_config->getMsgStream() << MSG::DEBUG << "Signature " - << configSig->label() << ": constructor" << endreq; + << configSig->label() << ": constructor" << endmsg; } // Copy the TE information over from the configSig; transform the "vector of TEs" @@ -79,14 +79,14 @@ Signature::Signature( const TrigConf::HLTSignature* configSig, if (!seq) { m_config->getMsgStream() << MSG::FATAL << "Signature: (TE = " << configTE->name() << ") : Could not find matching sequence for output TE." - << endreq; + << endmsg; m_requiredTEs.clear(); return; } else { addItem(multiplicity[id], seq); if (m_config->getMsgLvl() <=MSG::DEBUG) { m_config->getMsgStream() << MSG::DEBUG << "Made part of signature: " << configSig->label() << " TE = " << id - << " (" << configTE->name() << ") x " << multiplicity[id] << endreq; + << " (" << configTE->name() << ") x " << multiplicity[id] << endmsg; } } } @@ -125,7 +125,7 @@ HLT::ErrorCode Signature::execute( bool& pass ) if (m_config->getMsgLvl() <= MSG::DEBUG) { m_config->getMsgStream() << MSG::DEBUG << "Signature " << m_configSig->label() - << ": executing" << endreq; + << ": executing" << endmsg; } // collect operational information: create new TrigOperationalInfo @@ -148,7 +148,7 @@ HLT::ErrorCode Signature::execute( bool& pass ) if (m_config->getMsgLvl() <= MSG::DEBUG) m_config->getMsgStream() << MSG::DEBUG << "Signature " << m_configSig->label() - << " EC from sequence execution = " << HLT::strErrorCode(ec) << endreq; + << " EC from sequence execution = " << HLT::strErrorCode(ec) << endmsg; // Debug output if (m_config->getMsgLvl() <= MSG::DEBUG) { @@ -157,9 +157,9 @@ HLT::ErrorCode Signature::execute( bool& pass ) << " active TEs, require " << m_requiredTEs[i].multiplicity; if (m_requiredTEs[i].sequence->activeOutputTEs() < static_cast<int>(m_requiredTEs[i].multiplicity)) - m_config->getMsgStream() << MSG::DEBUG << " -> failed!" << endreq; + m_config->getMsgStream() << MSG::DEBUG << " -> failed!" << endmsg; else - m_config->getMsgStream() << MSG::DEBUG << " -> satisfied!" << endreq; + m_config->getMsgStream() << MSG::DEBUG << " -> satisfied!" << endmsg; } retCode = retCode > ec ? retCode : ec; @@ -180,9 +180,9 @@ HLT::ErrorCode Signature::execute( bool& pass ) // Debug output if (m_config->getMsgLvl() <= MSG::DEBUG) { if (pass) - m_config->getMsgStream() << MSG::DEBUG << "Signature: done, satisfied" << endreq; + m_config->getMsgStream() << MSG::DEBUG << "Signature: done, satisfied" << endmsg; else - m_config->getMsgStream() << MSG::DEBUG << "Signature: done, failed: TEs do not come from different RoIs!" << endreq; + m_config->getMsgStream() << MSG::DEBUG << "Signature: done, failed: TEs do not come from different RoIs!" << endmsg; } @@ -197,7 +197,7 @@ HLT::ErrorCode Signature::prepareRobRequests() if (m_config->getMsgLvl() <= MSG::DEBUG) { m_config->getMsgStream() << MSG::DEBUG << "Signature " << m_configSig->label() - << ": preparing ROB requests for first sequence of each final output TE" << endreq; + << ": preparing ROB requests for first sequence of each final output TE" << endmsg; } HLT::ErrorCode retCode = HLT::OK; // largest error code @@ -207,12 +207,12 @@ HLT::ErrorCode Signature::prepareRobRequests() if (m_config->getMsgLvl() <= MSG::DEBUG) { m_config->getMsgStream() << MSG::DEBUG << "Signature " << m_configSig->label() - << " has " << m_requiredTEs.size() << " sequence(s):" << endreq; + << " has " << m_requiredTEs.size() << " sequence(s):" << endmsg; std::string telabel; for (unsigned int i = 0; i < m_requiredTEs.size(); ++i) { TrigConf::HLTTriggerElement::getLabel(m_requiredTEs[i].sequence->outputTEType(), telabel); - m_config->getMsgStream() << MSG::DEBUG << " " << telabel << endreq; + m_config->getMsgStream() << MSG::DEBUG << " " << telabel << endmsg; } } for (unsigned int i = 0; i < m_requiredTEs.size(); ++i) { @@ -224,7 +224,7 @@ HLT::ErrorCode Signature::prepareRobRequests() // Debug output if (m_config->getMsgLvl() <= MSG::DEBUG) m_config->getMsgStream() << MSG::DEBUG << "In signature " << m_configSig->label() - << ": EC from sequence prepareRobRequests = " << HLT::strErrorCode(ec) << endreq; + << ": EC from sequence prepareRobRequests = " << HLT::strErrorCode(ec) << endmsg; retCode = retCode > ec ? retCode : ec; } @@ -479,7 +479,7 @@ bool Signature::addIfNoOverlap(const TriggerElement* te, << m_configSig->label() << ": found overlap between TEs: " << (*iterTEs) << " and " << te - << endreq; + << endmsg; } return false; } diff --git a/Trigger/TrigSteer/TrigSteering/src/SteeringChain.cxx b/Trigger/TrigSteer/TrigSteering/src/SteeringChain.cxx index ddec453aac60a739e7a7f43b589599226016df5b..28facadea11a37addd75dadf5d24e09edcbf80bd 100644 --- a/Trigger/TrigSteer/TrigSteering/src/SteeringChain.cxx +++ b/Trigger/TrigSteer/TrigSteering/src/SteeringChain.cxx @@ -58,19 +58,19 @@ SteeringChain::SteeringChain( const TrigConf::HLTChain* configChain, ISequencePr } if (!configChain) { - m_config->getMsgStream() << MSG::ERROR << "Chain::Chain HLTChain is 0!" << endreq; + m_config->getMsgStream() << MSG::ERROR << "Chain::Chain HLTChain is 0!" << endmsg; return; } if (!seqs) { - m_config->getMsgStream() << MSG::ERROR << "Chain::Chain ISequenceProvider is 0!" << endreq; + m_config->getMsgStream() << MSG::ERROR << "Chain::Chain ISequenceProvider is 0!" << endmsg; return; } if (m_config->getMsgLvl() <=MSG::DEBUG) { m_config->getMsgStream() << MSG::DEBUG << "Chain " - << configChain->chain_name() << ": constructor" << endreq; + << configChain->chain_name() << ": constructor" << endmsg; } if (!fillFromConfigChain(seqs, scalerSvc)) return; @@ -85,12 +85,12 @@ SteeringChain::SteeringChain( const TrigConf::HLTChain* configChain, ISequencePr if (m_configChain->groups().size() < 1) { m_config->getMsgStream() << MSG::WARNING << "Chain " << configChain->chain_name() - << ": has no group associated with it." << endreq; + << ": has no group associated with it." << endmsg; } if (m_streamTags.size() < 1) { m_config->getMsgStream() << MSG::ERROR << "Chain " << configChain->chain_name() - << ": no stream associated to this Chain => abort!" << endreq; + << ": no stream associated to this Chain => abort!" << endmsg; return; } // make sure the maximum number of steps is fitting into our 8 bits: @@ -98,7 +98,7 @@ SteeringChain::SteeringChain( const TrigConf::HLTChain* configChain, ISequencePr m_config->getMsgStream() << MSG::ERROR << "Chain " << configChain->chain_name() << ": has maximum step (="<< m_signatures.size() <<") does not fit into our 8 bits for serialization => abort!" - << endreq; + << endmsg; return; } @@ -107,7 +107,7 @@ SteeringChain::SteeringChain( const TrigConf::HLTChain* configChain, ISequencePr m_config->getMsgStream() << MSG::ERROR << "Chain " << configChain->chain_name() << ": chain_counter (="<< m_chain_counter <<") does not fit into our 13 bits for serialization => abort!" - << endreq; + << endmsg; return; } @@ -118,22 +118,22 @@ SteeringChain::SteeringChain( const TrigConf::HLTChain* configChain, ISequencePr if ( config->getDoTiming() ) { ServiceHandle<ITrigTimerSvc> timerSvc("TrigTimerSvc/TrigTimerSvc", "tr"); if ( timerSvc.retrieve().isFailure() ) { - m_config->getMsgStream() << MSG::WARNING << "Requested timing measurements but can't retrieve TrigTimerSvc for chain" << endreq; + m_config->getMsgStream() << MSG::WARNING << "Requested timing measurements but can't retrieve TrigTimerSvc for chain" << endmsg; } AlgTool *ntool = dynamic_cast<AlgTool*>(m_config->getNavigation()); if ( !ntool ) { - m_config->getMsgStream() << MSG::WARNING << "Navigation tool not available" << endreq; + m_config->getMsgStream() << MSG::WARNING << "Navigation tool not available" << endmsg; return; } const Algorithm* parentAlg = dynamic_cast<const Algorithm*>(ntool->parent()); // this is the way to get parent alg name (TrigSteer_L2/EF) ugh we need better way. if ( !parentAlg ) { - m_config->getMsgStream() << MSG::WARNING << "Parent alg not available" << endreq; + m_config->getMsgStream() << MSG::WARNING << "Parent alg not available" << endmsg; return; } std::string name = parentAlg->name()+":Chain_"+configChain->chain_name(); m_timer = timerSvc->addItem(name); - m_config->getMsgStream() << MSG::DEBUG << "Booked timer: " << name << endreq; + m_config->getMsgStream() << MSG::DEBUG << "Booked timer: " << name << endmsg; } setStatus(HLT::ChainOK); @@ -162,7 +162,7 @@ SteeringChain::fillFromConfigChain( ISequenceProvider* seqs, // in case there is no signature, we must never activate this Chain! -> see setActive() if (getConfigChain()->signatureList().size() == 0) { m_config->getMsgStream() << MSG::DEBUG << "Chain: no signatures found for this chain!! " - << endreq; + << endmsg; } // We assume here that the HLTSignatures have reasonable signature_counters (e.g. not all the same)! @@ -173,7 +173,7 @@ SteeringChain::fillFromConfigChain( ISequenceProvider* seqs, if (m_config->getMsgLvl() <=MSG::DEBUG) { m_config->getMsgStream() << MSG::DEBUG << "Chain: creating new Signature: " - << sig->label() << endreq; + << sig->label() << endmsg; } unsigned int pos = sig->signature_counter() - 1; // - 1 : signature_counters start with 1, vector pos with 0 !! @@ -187,7 +187,7 @@ SteeringChain::fillFromConfigChain( ISequenceProvider* seqs, // if we don't have the ScalerSvc (because this Chain is created from a TrigConf::HLTChain if ( !scalerSvc ) { if (m_config->getMsgLvl() <=MSG::DEBUG) { - m_config->getMsgStream() << MSG::DEBUG << "ScalerSvc is NULL!" << endreq; + m_config->getMsgStream() << MSG::DEBUG << "ScalerSvc is NULL!" << endmsg; } } @@ -202,7 +202,7 @@ SteeringChain::fillFromConfigChain( ISequenceProvider* seqs, it != streams.end(); ++it) { // make sure the TrigConf streamTag pointer is not NULL: if ( !(*it) ) { - m_config->getMsgStream() << MSG::ERROR << "Chain: TrigConf::HLTStreamTag pointer NULL!" << endreq; + m_config->getMsgStream() << MSG::ERROR << "Chain: TrigConf::HLTStreamTag pointer NULL!" << endmsg; return false; } m_streamTags.push_back( StreamTag( *it, scalerSvc ) ); @@ -211,13 +211,13 @@ SteeringChain::fillFromConfigChain( ISequenceProvider* seqs, if ((*it)->type() == "calibration" ) { m_calibrationROBs = new PartialEventBuildingInfo(); m_scouting = new ScoutingInfo(); - m_config->getMsgStream() << MSG::VERBOSE << "Chain " << getChainName() << " has the storage for the ROBs for PEB and data scouting" << endreq; + m_config->getMsgStream() << MSG::VERBOSE << "Chain " << getChainName() << " has the storage for the ROBs for PEB and data scouting" << endmsg; } // if the stream type is "monitoring" prepare ROBs storage if ((*it)->type() == "monitoring" ) { m_calibrationROBs = new PartialEventBuildingInfo(); - m_config->getMsgStream() << MSG::VERBOSE << "Chain " << getChainName() << " has the storage for the ROBs for PEB" << endreq; + m_config->getMsgStream() << MSG::VERBOSE << "Chain " << getChainName() << " has the storage for the ROBs for PEB" << endmsg; } } @@ -249,7 +249,7 @@ HLT::ErrorCode SteeringChain::executeStep() { << getChainCounter() << " (id " << m_configChain->chain_name() << ") " << " step " << m_currentStep << " out of " << m_signatures.size() - << endreq; + << endmsg; } @@ -268,7 +268,7 @@ HLT::ErrorCode SteeringChain::executeStep() { if ( m_signatures[m_currentStep] == 0) { if (m_config->getMsgLvl() <=MSG::DEBUG) { m_config->getMsgStream() << MSG::DEBUG << "skipping this step (no signature to satisfy)" - << endreq; + << endmsg; } } else { @@ -278,7 +278,7 @@ HLT::ErrorCode SteeringChain::executeStep() { // m_config->getMsgStream() << MSG::DEBUG << "Chain " << m_configChain->chain_name() // << " EC from signature execution = " << HLT::strErrorCode(ec) << " at step " - // << m_currentStep << endreq; + // << m_currentStep << endmsg; m_errorCode = m_errorCode > ec ? m_errorCode : ec; // If some error occurred, end here: if (ec.action() > HLT::Action::CONTINUE ) { @@ -286,7 +286,7 @@ HLT::ErrorCode SteeringChain::executeStep() { if (m_config->getMsgLvl() <= MSG::WARNING) { m_config->getMsgStream() << MSG::WARNING << "Chain " << getChainName() << " aborting with error code " << strErrorCode(ec) << " at step " - << m_currentStep << endreq; + << m_currentStep << endmsg; } //m_errorCode = m_errorCode > ec ? m_errorCode : ec; @@ -296,7 +296,7 @@ HLT::ErrorCode SteeringChain::executeStep() { if (m_config->getMsgLvl() <= MSG::DEBUG) { m_config->getMsgStream() << MSG::DEBUG << "Chain " << getChainName() << " continues with error code " << strErrorCode(ec) << " at step " - << m_currentStep << endreq; + << m_currentStep << endmsg; } } @@ -304,7 +304,7 @@ HLT::ErrorCode SteeringChain::executeStep() { if ( !m_active ) { if (m_config->getMsgLvl() <= MSG::DEBUG) m_config->getMsgStream() << MSG::DEBUG << "Chain " << getChainName() - << " failed at step " << m_currentStep << endreq; + << " failed at step " << m_currentStep << endmsg; return m_errorCode; } } @@ -321,7 +321,7 @@ HLT::ErrorCode SteeringChain::executeStep() { // some debug output if (m_config->getMsgLvl() <= MSG::DEBUG) { m_config->getMsgStream() << MSG::DEBUG << "Chain " << getChainName() - << " finished successfully" << endreq; + << " finished successfully" << endmsg; } return m_errorCode; } @@ -341,7 +341,7 @@ HLT::ErrorCode SteeringChain::prepareStepRobRequests() { // nothing to do, only debug output if (m_config->getMsgLvl() <= MSG::DEBUG) { m_config->getMsgStream() << MSG::DEBUG << "skipping step " << m_currentStep << " (no signature to satisfy)" - << endreq; + << endmsg; } } else { @@ -357,7 +357,7 @@ HLT::ErrorCode SteeringChain::prepareStepRobRequests() { if (m_config->getMsgLvl() <= MSG::WARNING) { m_config->getMsgStream() << MSG::WARNING << "Chain " << getChainName() << " aborting with error code " << strErrorCode(ec) << " at step " - << m_currentStep << endreq; + << m_currentStep << endmsg; } m_active = false; return m_errorCode; @@ -368,7 +368,7 @@ HLT::ErrorCode SteeringChain::prepareStepRobRequests() { if (m_config->getMsgLvl() <= MSG::DEBUG) m_config->getMsgStream() << MSG::DEBUG << "Chain " << getChainName() << " continues with error code " << strErrorCode(ec) << " at step " - << m_currentStep << endreq; + << m_currentStep << endmsg; } @@ -446,7 +446,7 @@ void SteeringChain::setPrescaleState() { if ( prescaleFactor() < -0.1 ) m_config->getMsgStream() << MSG::ERROR << "Chain: : " << getChainName() - << " arrived to scaler service with prescale value < 0, this is not suported anymore" << endreq; + << " arrived to scaler service with prescale value < 0, this is not suported anymore" << endmsg; if ( prescaleFactor() < 0.1 && prescaleFactor() > -0.1 ) { // treat zero m_prescaled = true; @@ -535,7 +535,7 @@ bool SteeringChain::canAddSignature(unsigned int pos) { if (m_signatures[pos] != 0) { m_config->getMsgStream() << MSG::ERROR << "Chain: 2 or more signatures have the same signature_counter: " - << pos << " --> ignore this Signature! " << endreq; + << pos << " --> ignore this Signature! " << endmsg; return false; } diff --git a/Trigger/TrigSteer/TrigSteering/src/TopoSequence.cxx b/Trigger/TrigSteer/TrigSteering/src/TopoSequence.cxx index b288ccd9eed0d7187e997a9aac36b6f716d2fdce..4280f7fa1cb61ea29b4ff21a1c01f27fd06f107c 100755 --- a/Trigger/TrigSteer/TrigSteering/src/TopoSequence.cxx +++ b/Trigger/TrigSteer/TrigSteering/src/TopoSequence.cxx @@ -13,7 +13,7 @@ * @author Ingrid Deigaard <ingrid.deigaard@cern.ch> Nikhef, NL * * File and Version Information: - * $Id: TopoSequence.cxx 701807 2015-10-20 16:50:54Z fwinkl $ + * $Id: TopoSequence.cxx 780626 2016-10-27 01:00:33Z ssnyder $ **********************************************************************************/ #include <iostream> @@ -67,7 +67,7 @@ TopoSequence::TopoSequence(HLT::AlgoConfig* config, unsigned int outputType,TCS: TrigConf::HLTTriggerElement::getLabel(outputType, m_name); if (m_config->getMsgLvl() <=MSG::DEBUG) - m_config->getMsgStream() << MSG::DEBUG << "Constructing TopoSequence '" << m_name << "'" << endreq; + m_config->getMsgStream() << MSG::DEBUG << "Constructing TopoSequence '" << m_name << "'" << endmsg; } @@ -76,12 +76,12 @@ TopoSequence::TopoSequence(HLT::AlgoConfig* config, unsigned int outputType,TCS: TriggerElement * TopoSequence::getTEFromRoiWord(uint32_t roiWord) const { if(m_roiWord2TEMapping == nullptr ) { - m_config->getMsgStream() << MSG::WARNING << "In TopoSequence '" << m_name << "' no roiWord to TE mapping available " << endreq; + m_config->getMsgStream() << MSG::WARNING << "In TopoSequence '" << m_name << "' no roiWord to TE mapping available " << endmsg; return nullptr; } auto te = m_roiWord2TEMapping->find(roiWord); if(te == m_roiWord2TEMapping->end()) { - m_config->getMsgStream() << MSG::WARNING << "In TopoSequence '" << m_name << "' could not find a TriggerElement for ROI " << roiWord << endreq; + m_config->getMsgStream() << MSG::WARNING << "In TopoSequence '" << m_name << "' could not find a TriggerElement for ROI " << roiWord << endmsg; return nullptr; } @@ -100,7 +100,7 @@ TopoSequence::execute() if (m_alreadyExecuted){ if (m_config->getMsgLvl() <=MSG::DEBUG) - m_config->getMsgStream() << MSG::DEBUG << "TopoSequence already executed -> doing nothing" << endreq; + m_config->getMsgStream() << MSG::DEBUG << "TopoSequence already executed -> doing nothing" << endmsg; return m_execErrorCode; } @@ -108,7 +108,7 @@ TopoSequence::execute() m_execErrorCode = OK; if (m_config->getMsgLvl() <=MSG::DEBUG) - m_config->getMsgStream() << MSG::DEBUG << "Executing TopoSequence '" << m_name << "'" << endreq; + m_config->getMsgStream() << MSG::DEBUG << "Executing TopoSequence '" << m_name << "'" << endmsg; // execute the topo trigger m_topoSteer->executeTrigger(m_name); @@ -121,12 +121,12 @@ TopoSequence::execute() const TCS::TOBArray* topoOutput = m_topoSteer->simulationResult().triggerOutput(m_name); if (m_config->getMsgLvl() <=MSG::DEBUG) - m_config->getMsgStream() << MSG::DEBUG << "TopoSequence '" << m_name << "' successfully executed topo alg. Output size " << topoOutput->size() << endreq; + m_config->getMsgStream() << MSG::DEBUG << "TopoSequence '" << m_name << "' successfully executed topo alg. Output size " << topoOutput->size() << endmsg; // get initial leaf in Navigation // HLT::TriggerElement* initialTE = m_config->getNavigation()->getInitialNode(); - // m_config->getMsgStream() << MSG::DEBUG << "initial Navigation node created" << endreq; + // m_config->getMsgStream() << MSG::DEBUG << "initial Navigation node created" << endmsg; // create the TEs (one per topo output and activate them) @@ -158,13 +158,13 @@ TopoSequence::execute() const TCS::CompositeTOB * comptob = dynamic_cast<const TCS::CompositeTOB*>(tob); if(comptob == nullptr) { - m_config->getMsgStream() << MSG::ERROR << "Output of topo trigger '" << m_name << "' is not a CompositeTOB" << endreq; + m_config->getMsgStream() << MSG::ERROR << "Output of topo trigger '" << m_name << "' is not a CompositeTOB" << endmsg; m_execErrorCode = HLT::FATAL; continue; } if (m_config->getMsgLvl() <=MSG::DEBUG) - m_config->getMsgStream() << MSG::DEBUG << "TopoSequence '" << m_name << "' Combination has size " << comptob->components().size() << ":" << endreq; + m_config->getMsgStream() << MSG::DEBUG << "TopoSequence '" << m_name << "' Combination has size " << comptob->components().size() << ":" << endmsg; // FOR EACH COMPOSITE TOB DO: @@ -187,11 +187,11 @@ TopoSequence::execute() if (m_config->getMsgLvl() <=MSG::DEBUG) { string parentTEName(""); TrigConf::HLTTriggerElement::getLabel(findTE->second->getId(), parentTEName); - m_config->getMsgStream() << MSG::DEBUG << "TopoSequence '" << m_name << "' roiWord " << roiWord << ", parent TE " << findTE->second << ", id = " << findTE->second->getId() << " (" << parentTEName << ")" << endreq; + m_config->getMsgStream() << MSG::DEBUG << "TopoSequence '" << m_name << "' roiWord " << roiWord << ", parent TE " << findTE->second << ", id = " << findTE->second->getId() << " (" << parentTEName << ")" << endmsg; } componentTEs.push_back( findTE->second ); } else { - m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "'. No TriggerElement found for roiWord " << roiWord << endreq; + m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "'. No TriggerElement found for roiWord " << roiWord << endmsg; } } @@ -229,7 +229,7 @@ TopoSequence::execute() // std::cout << "MARK C" << std::endl; // if (m_config && m_config->getMsgLvl() <=MSG::DEBUG) { -// m_config->getMsgStream() << MSG::DEBUG << "TopoSequence " << m_name << " [" << x++ << "] : generic tob energy of type " << TCS::inputTypeAsString(tob->tobType()) << " ["<<tob->tobType()<<"]: " << tob->Et() << ", eta: " << tob->eta() << ", phi: " << tob->phi() << endreq; +// m_config->getMsgStream() << MSG::DEBUG << "TopoSequence " << m_name << " [" << x++ << "] : generic tob energy of type " << TCS::inputTypeAsString(tob->tobType()) << " ["<<tob->tobType()<<"]: " << tob->Et() << ", eta: " << tob->eta() << ", phi: " << tob->phi() << endmsg; // } // std::cout << "MARK D" << std::endl; @@ -245,25 +245,25 @@ TopoSequence::execute() // // attach to navigation // if( ! m_config->getNavigation()->attachFeature( outputTE, roi, HLT::Navigation::ObjectToStoreGate, sgkey, "L1TopoEM" ) ) { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to attach xAOD::EmTauRoI to navigation" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to attach xAOD::EmTauRoI to navigation" << endmsg; // } // ElementLink<xAOD::EmTauRoIContainer> link; // if( m_config->getNavigation()->getRecentFeatureLink<xAOD::EmTauRoIContainer,xAOD::EmTauRoI>( outputTE, link, "L1TopoEM") ) { // if(link.cptr() != nullptr) { // if (m_config && m_config->getMsgLvl() <=MSG::DEBUG) { // const xAOD::EmTauRoI * linkedROI = * link.cptr(); -// m_config->getMsgStream() << MSG::DEBUG << "EmTauRoI from EL with et = " << linkedROI->emClus() << ", eta = " << linkedROI->eta() << ", phi = " << linkedROI->phi() << endreq; +// m_config->getMsgStream() << MSG::DEBUG << "EmTauRoI from EL with et = " << linkedROI->emClus() << ", eta = " << linkedROI->eta() << ", phi = " << linkedROI->phi() << endmsg; // } // // attaching to TrigComposite // std::string name( "EM" + boost::lexical_cast<std::string,unsigned int>(emCount++) ); // composite->setObjectLink( name, link ); // } else { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': retrieved ElementLink<xAOD::EmTauRoiContainer> for composite component (em) with empty link ptr" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': retrieved ElementLink<xAOD::EmTauRoiContainer> for composite component (em) with empty link ptr" << endmsg; // } // } else { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to retrieve ElementLink<xAOD::EmTauRoiContainer> for composite component (em)" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to retrieve ElementLink<xAOD::EmTauRoiContainer> for composite component (em)" << endmsg; // } // } @@ -280,25 +280,25 @@ TopoSequence::execute() // // attach to navigation // if( ! m_config->getNavigation()->attachFeature( outputTE, roi, HLT::Navigation::ObjectToStoreGate, sgkey, "L1TopoTau" ) ) { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to attach xAOD::EmTauRoI to navigation" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to attach xAOD::EmTauRoI to navigation" << endmsg; // } // ElementLink<xAOD::EmTauRoIContainer> link; // if( m_config->getNavigation()->getRecentFeatureLink<xAOD::EmTauRoIContainer,xAOD::EmTauRoI>( outputTE, link, "L1TopoTau") ) { // if(link.cptr() != nullptr) { // if (m_config && m_config->getMsgLvl() <=MSG::DEBUG) { // const xAOD::EmTauRoI * linkedROI = * link.cptr(); -// m_config->getMsgStream() << MSG::DEBUG << "EmTauRoI from EL with et = " << linkedROI->emClus() << ", eta = " << linkedROI->eta() << ", phi = " << linkedROI->phi() << endreq; +// m_config->getMsgStream() << MSG::DEBUG << "EmTauRoI from EL with et = " << linkedROI->emClus() << ", eta = " << linkedROI->eta() << ", phi = " << linkedROI->phi() << endmsg; // } // // attaching to TrigComposite // std::string name( "TAU" + boost::lexical_cast<std::string,unsigned int>(tauCount++) ); // composite->setObjectLink( name, link ); // } else { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': retrieved ElementLink<xAOD::EmTauRoiContainer> for composite component (tau) with empty link ptr" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': retrieved ElementLink<xAOD::EmTauRoiContainer> for composite component (tau) with empty link ptr" << endmsg; // } // } else { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to retrieve ElementLink<xAOD::EmTauRoiContainer> for composite component (tau)" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to retrieve ElementLink<xAOD::EmTauRoiContainer> for composite component (tau)" << endmsg; // } // } @@ -314,25 +314,25 @@ TopoSequence::execute() // // attach to navigation // if( ! m_config->getNavigation()->attachFeature( outputTE, roi, HLT::Navigation::ObjectToStoreGate, sgkey, "L1TopoMuon" ) ) { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to attach xAOD::MuonRoI to navigation" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to attach xAOD::MuonRoI to navigation" << endmsg; // } // ElementLink<xAOD::MuonRoIContainer> link; // if( m_config->getNavigation()->getRecentFeatureLink<xAOD::MuonRoIContainer,xAOD::MuonRoI>( outputTE, link, "L1TopoMuon") ) { // if(link.cptr() != nullptr) { // if (m_config && m_config->getMsgLvl() <=MSG::DEBUG) { // const xAOD::MuonRoI * linkedROI = * link.cptr(); -// m_config->getMsgStream() << MSG::DEBUG << "MuonRoI from EL with et = " << linkedROI->thrValue() << ", eta = " << linkedROI->eta() << ", phi = " << linkedROI->phi() << endreq; +// m_config->getMsgStream() << MSG::DEBUG << "MuonRoI from EL with et = " << linkedROI->thrValue() << ", eta = " << linkedROI->eta() << ", phi = " << linkedROI->phi() << endmsg; // } // // attaching to TrigComposite // std::string name( "MUON" + boost::lexical_cast<std::string,unsigned int>(muonCount++) ); // composite->setObjectLink( name, link ); // } else { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': retrieved ElementLink<xAOD::MuonRoiContainer> for composite component with empty link ptr" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': retrieved ElementLink<xAOD::MuonRoiContainer> for composite component with empty link ptr" << endmsg; // } // } else { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to retrieve ElementLink<xAOD::MuonRoiContainer> for composite component" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to retrieve ElementLink<xAOD::MuonRoiContainer> for composite component" << endmsg; // } // } @@ -350,25 +350,25 @@ TopoSequence::execute() // // attach to navigation // if( ! m_config->getNavigation()->attachFeature( outputTE, roi, HLT::Navigation::ObjectToStoreGate, sgkey, "L1TopoJet" ) ) { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to attach xAOD::JetRoI to navigation" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to attach xAOD::JetRoI to navigation" << endmsg; // } // ElementLink<xAOD::JetRoIContainer> link; // if( m_config->getNavigation()->getRecentFeatureLink<xAOD::JetRoIContainer,xAOD::JetRoI>( outputTE, link, "L1TopoJet") ) { // if(link.cptr() != nullptr) { // if (m_config && m_config->getMsgLvl() <=MSG::DEBUG) { // const xAOD::JetRoI * linkedROI = * link.cptr(); -// m_config->getMsgStream() << MSG::DEBUG << "JetRoI from EL with Et8x8 = " << linkedROI->et8x8() << ", Et4x4 = " << linkedROI->et4x4() << ", eta = " << linkedROI->eta() << ", phi = " << linkedROI->phi() << endreq; +// m_config->getMsgStream() << MSG::DEBUG << "JetRoI from EL with Et8x8 = " << linkedROI->et8x8() << ", Et4x4 = " << linkedROI->et4x4() << ", eta = " << linkedROI->eta() << ", phi = " << linkedROI->phi() << endmsg; // } // // attaching to TrigComposite // std::string name( "JET" + boost::lexical_cast<std::string,unsigned int>(jetCount++) ); // composite->setObjectLink( name, link ); // } else { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': retrieved ElementLink<xAOD::JetRoiContainer> for composite component with empty link ptr" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': retrieved ElementLink<xAOD::JetRoiContainer> for composite component with empty link ptr" << endmsg; // } // } else { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to retrieve ElementLink<xAOD::JetRoiContainer> for composite component" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to retrieve ElementLink<xAOD::JetRoiContainer> for composite component" << endmsg; // } // } @@ -389,7 +389,7 @@ TopoSequence::execute() // // attach to navigation // if( ! m_config->getNavigation()->attachFeature( outputTE, met, HLT::Navigation::ObjectToStoreGate, sgkey, "L1TopoMET" ) ) { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to attach xAOD::JetRoI to navigation" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to attach xAOD::JetRoI to navigation" << endmsg; // } // ElementLink<xAOD::TrigCompositeContainer> link; // if( m_config->getNavigation()->getRecentFeatureLink<xAOD::TrigCompositeContainer,xAOD::TrigComposite>( outputTE, link, "L1TopoMET") ) { @@ -400,18 +400,18 @@ TopoSequence::execute() // linkedROI->getDetail("Et",et); // linkedROI->getDetail("Ex",ex); // linkedROI->getDetail("Ey",ey); -// m_config->getMsgStream() << MSG::INFO << "TrigComposite " << linkedROI->name() << " from EL with et = " << et << ", Ex = " << ex << ", Ey = " << ey << endreq; +// m_config->getMsgStream() << MSG::INFO << "TrigComposite " << linkedROI->name() << " from EL with et = " << et << ", Ex = " << ex << ", Ey = " << ey << endmsg; // } // // attaching to TrigComposite // std::string name( "EnergySum" ); // composite->setObjectLink( name, link ); // } else { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': retrieved ElementLink<xAOD::TrigCompositeContainer> for composite component with empty link ptr" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': retrieved ElementLink<xAOD::TrigCompositeContainer> for composite component with empty link ptr" << endmsg; // } // } else { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to retrieve ElementLink<xAOD::TrigCompositeRoiContainer> for composite component" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed to retrieve ElementLink<xAOD::TrigCompositeRoiContainer> for composite component" << endmsg; // } // } @@ -425,7 +425,7 @@ TopoSequence::execute() // // add the composite to the collection // if( ! m_config->getNavigation()->attachFeature( outputTE, compCont, HLT::Navigation::ObjectToStoreGate, sgkey, "L1TopoComposite" ) ) { // if (m_config) -// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed attaching TrigCompositeContainer to SG" << endreq; +// m_config->getMsgStream() << MSG::ERROR << "TopoSequence '" << m_name << "': failed attaching TrigCompositeContainer to SG" << endmsg; // } // std::cout << "MARK K" << std::endl; diff --git a/Trigger/TrigSteer/TrigSteering/src/TrigSteer.cxx b/Trigger/TrigSteer/TrigSteering/src/TrigSteer.cxx index 28e71dde98e98b5fb62864afd2f1c76bd263067c..bdad0a41a3bc4d4898f2b727fbb4f288dd94fea6 100755 --- a/Trigger/TrigSteer/TrigSteering/src/TrigSteer.cxx +++ b/Trigger/TrigSteer/TrigSteering/src/TrigSteer.cxx @@ -140,6 +140,7 @@ TrigSteer::TrigSteer(const std::string& name, ISvcLocator* pSvcLocator) declareProperty("TopoOutputLevel", m_topoOutputLevel, "OutputLevel for L1Topo algorithms" ); declareProperty("EventInfoAccessTool", m_EventInfoTool,"Tool to update the EventInfo at the end of the execution"); declareProperty("AuditChains", m_auditChains=false, "Call auditor hooks for chain execution"); + declareProperty("TopoUseBitwise", m_topoUseBitwise=false, "Whether L1Topo simulation should use the bitwise implementation of the algorithms" ); } @@ -159,7 +160,7 @@ StatusCode TrigSteer::initialize() CHECK( m_robDataProvider.retrieve()); // Setup the HLT ROB Data Provider Service when configured - if ( &*m_robDataProvider ) { + if ( m_robDataProvider.isValid() ) { m_trigROBDataProvider = SmartIF<ITrigROBDataProviderSvc>( &*m_robDataProvider ); if (m_trigROBDataProvider.isValid()) { ATH_MSG_INFO(" A ROBDataProviderSvc implementing the HLT interface ITrigROBDataProviderSvc was found."); @@ -260,7 +261,7 @@ StatusCode TrigSteer::initialize() m_topoSteer = new TCS::TopoSteering(); m_topoSteer->setMsgLevel( TrigConf::MSGTC::Level(m_topoOutputLevel) ); m_topoSteer->setAlgMsgLevel( TrigConf::MSGTC::Level(m_topoOutputLevel) ); - + m_topoSteer->setUseBitwise(m_topoUseBitwise); try { m_topoSteer->setupFromConfiguration(*topomenu); } @@ -542,10 +543,10 @@ StatusCode TrigSteer::execute() // DEBUG output: print all activated HLT Chains if (msgLvl(MSG::DEBUG)) { - msg() << "Working with "<< m_activeChains.size() <<" active chains in this level: " << endreq; + msg() << "Working with "<< m_activeChains.size() <<" active chains in this level: " << endmsg; for (std::vector<HLT::SteeringChain*>::iterator iterChain = m_activeChains.begin(); iterChain != m_activeChains.end(); ++iterChain) { - msg() << "Active: " << *(*iterChain) << " lower_chain: " << (*iterChain)->getLowerChainName() <<" EB after step: "<<(*iterChain)->getEBAfterStep() << endreq; + msg() << "Active: " << *(*iterChain) << " lower_chain: " << (*iterChain)->getLowerChainName() <<" EB after step: "<<(*iterChain)->getEBAfterStep() << endmsg; } } @@ -701,8 +702,8 @@ StatusCode TrigSteer::execute() if (msgLvl(MSG::DEBUG)) { msg() << "\n ///////////////////////////////////////////////\n"; msg() << " ///////// Event processing finished ///////// \n"; - msg() << " ///////////////////////////////////////////////" << endreq; - msg() << "Most severe error: " << strErrorCode(m_config->getHltStatus()) << endreq; + msg() << " ///////////////////////////////////////////////" << endmsg; + msg() << "Most severe error: " << strErrorCode(m_config->getHltStatus()) << endmsg; } if ( !canContinueJob() ) { @@ -815,9 +816,10 @@ void TrigSteer::runChains(bool secondPass) { if (msgLvl(MSG::DEBUG)) { msg() << "\n /////////////////////////////////////////////////\n"; msg() << " ///////// Executing next Step " << step << " (" << (secondPass ? "second pass" : "first pass") << ")\n"; - msg() << " /////////////////////////////////////////////////" << endreq; + msg() << " /////////////////////////////////////////////////" << endmsg; } + chainsStillActive = false; // Prepare ROB requests: @@ -837,9 +839,10 @@ void TrigSteer::runChains(bool secondPass) { if ( ! (*iterChain)->runInSecondPass()) continue; } - if (m_auditChains) auditorSvc()->before(IAuditor::Execute,(*iterChain)->getChainName()); + const std::string& chainName = (*iterChain)->getChainName(); + if (m_auditChains) auditorSvc()->before(IAuditor::Execute,chainName); // In case we crash, CoreDumpSvc will print this info - m_coreDumpSvc->setCoreDumpInfo("Current trigger chain",(*iterChain)->getChainName()); + m_coreDumpSvc->setCoreDumpInfo("Current trigger chain",chainName); // execute step HLT::ErrorCode chainCode = (*iterChain)->executeStep(); @@ -848,7 +851,7 @@ void TrigSteer::runChains(bool secondPass) { HLT::SteeringInternalReason::ALGO_ERROR); m_config->setHltStatus( chainCode > m_config->getHltStatus() ? chainCode : m_config->getHltStatus() ); // keep ErrorCode in m_config always up to date - /* std::cout <<"TrigSteer::runChains(): step "<<step<<" chain "<< (*iterChain)->getChainName() + /* std::cout <<"TrigSteer::runChains(): step "<<step<<" chain "<< chainName << " EBAfterStep="<<(*iterChain)->getEBAfterStep() << " isActive="<< (*iterChain)->isActive() << " passed="<<(*iterChain)->chainPassed() @@ -859,11 +862,10 @@ void TrigSteer::runChains(bool secondPass) { <<" ->requestScheduledRobIDs().size()="<<getAlgoConfig()->robRequestInfo()->requestScheduledRobIDs().size() <<" HLT status="<<m_config->getHltStatus() << " chaincode="<<chainCode <<std::endl; */ - if (m_config->getMsgLvl() <=MSG::DEBUG) - ATH_MSG_DEBUG("Executed chain: " << **iterChain << " in " << (secondPass ? "second pass" : "first pass") ); + ATH_MSG_DEBUG("Executed chain: " << **iterChain << " in " << (secondPass ? "second pass" : "first pass") ); if ( !canContinueEvent(chainCode) ) { - ATH_MSG_WARNING("Chain " << (*iterChain)->getChainName() + ATH_MSG_WARNING("Chain " << chainName << " returned HLT::ErrorCode = " << strErrorCode(chainCode) << " :" << " any further execution in this event is stopped!"); noError = false; @@ -889,7 +891,7 @@ void TrigSteer::runChains(bool secondPass) { issueEventBuildingRequest(step); } } - if (m_auditChains) auditorSvc()->after(IAuditor::Execute,(*iterChain)->getChainName()); + if (m_auditChains) auditorSvc()->after(IAuditor::Execute,chainName); chainsStillActive = (*iterChain)->isActive() || chainsStillActive; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/L1TopoCoreSim/TopoSteering.h b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/L1TopoCoreSim/TopoSteering.h index 8e3e6d5382d61e3d94db8c5d2e924e36fe17b21d..bfb9d7865099bcc233e0bd4bf1c06bde080eb45f 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/L1TopoCoreSim/TopoSteering.h +++ b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/L1TopoCoreSim/TopoSteering.h @@ -54,7 +54,9 @@ namespace TCS { // @brief: build the execution structure and parameterspace from // the configuration StatusCode setupFromConfiguration(const TXC::L1TopoMenu& menu); - + + void setUseBitwise(bool useBitwise) { m_useBitwise = useBitwise; } + // @brief: call the initialize function of the algorithms // will be called after the parameters are set and before the event loop starts StatusCode initializeAlgorithms(); @@ -108,6 +110,7 @@ namespace TCS { private: + bool m_useBitwise{false}; // Using bitwise algorithms? Disabled by default. Needs a menu global flag. TopoInputEvent m_inputEvent; // the input event diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoASCIIReader.cxx b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoASCIIReader.cxx index b5b7427dc4fce924682b68c1750ad206c941e84c..cfbc1e1c3cd71d1888d362a90e7a7f361ae288c5 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoASCIIReader.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoASCIIReader.cxx @@ -57,9 +57,9 @@ bool TCS::TopoASCIIReader::getNextEvent() { if(currentLine == "<end_file>" || currentLine == "</file>") return false; if(currentLine == "<end_event>" || currentLine == "</event>") break; - if(currentLine == "<cluster>" || currentLine == "<jet>" || currentLine == "<muon>" || currentLine == "<lateMuon>" || currentLine == "<muonNextBC>" || currentLine == "<tau>" || currentLine == "<met>") type = currentLine; - if(currentLine == "</cluster>" || currentLine == "</jet>" || currentLine == "</muon>" || currentLine == "</lateMuon>" || currentLine == "</muonNextBC>" || currentLine == "</tau>" || currentLine == "</met>") { type = ""; continue; } - if(currentLine == "<begin_file>" || currentLine == "<file>" || currentLine == "<begin_event>" || currentLine == "<event>" || currentLine == "<cluster>" || currentLine == "<jet>" || currentLine == "<muon>" || currentLine == "<lateMuon>" || currentLine == "<muonNextBC>" || currentLine == "<tau>" || currentLine == "<met>") continue; + if(currentLine == "<cluster>" || currentLine == "<jet>" || currentLine == "<muon>" || currentLine == "<lateMuon>" || currentLine == "<muonNextBC>" || currentLine == "<tau>" || currentLine == "<met>" || currentLine == "<info>") type = currentLine; + if(currentLine == "</cluster>" || currentLine == "</jet>" || currentLine == "</muon>" || currentLine == "</lateMuon>" || currentLine == "</muonNextBC>" || currentLine == "</tau>" || currentLine == "</met>" || currentLine == "</info>") { type = ""; continue; } + if(currentLine == "<begin_file>" || currentLine == "<file>" || currentLine == "<begin_event>" || currentLine == "<event>" || currentLine == "<cluster>" || currentLine == "<jet>" || currentLine == "<muon>" || currentLine == "<lateMuon>" || currentLine == "<muonNextBC>" || currentLine == "<tau>" || currentLine == "<met>" || currentLine == "<info>") continue; // use stream iterators to copy the stream to a vector as whitespace separated strings std::stringstream ss(currentLine); @@ -129,6 +129,12 @@ bool TCS::TopoASCIIReader::getNextEvent() { int et = atoi(results.at(2).c_str()); TCS::MetTOB met( ex, ey, et ); m_event->setMET( met ); + } else if(type == "<info>") { + uint32_t runNo = atol(results.at(0).c_str()); + uint32_t evtNo = atol(results.at(1).c_str()); + uint32_t lumiB = atol(results.at(2).c_str()); + uint32_t BCID = atol(results.at(3).c_str()); + m_event->setEventInfo(runNo, evtNo, lumiB, BCID); } else { TCS_EXCEPTION( "TOB for this event is of unknown type " << type<<": '"<<currentLine<<"'"); diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteering.cxx b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteering.cxx index 4b2f6d5ccdb8f1966f8f5a3b8b46b222ae75686c..e21d43faeb14401bf1f313f05d41e1b9cdf6481a 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteering.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/Root/TopoSteering.cxx @@ -13,9 +13,9 @@ #include "L1TopoEvent/GenericTOB.h" #include "L1TopoConfig/L1TopoMenu.h" +#include "L1TopoConfig/L1TopoConfigGlobal.h" #include "L1TopoConfig/LayoutConstraints.h" - #include "L1TopoCoreSim/TopoSteering.h" #include "L1TopoCoreSim/Connector.h" #include "L1TopoCoreSim/InputConnector.h" @@ -47,6 +47,10 @@ TopoSteering::~TopoSteering() { StatusCode TopoSteering::setupFromConfiguration(const TXC::L1TopoMenu& menu) { + + if(m_useBitwise){ TRG_MSG_INFO("Will be using bitwise implementation of algorithms");} + else{TRG_MSG_INFO("Will NOT be using bitwise implementation of algorithms");} + StatusCode sc = m_structure.setupFromMenu( menu ); @@ -125,7 +129,10 @@ TopoSteering::saveHist() { StatusCode TopoSteering::executeEvent() { + TRG_MSG_INFO("L1 TopoSteering: start executing event " << m_evtCounter << "-----------------------------------"); + + if( ! structure().isConfigured() ) { TRG_MSG_INFO("L1Topo Steering has not been configured, can't run"); TCS_EXCEPTION("L1Topo Steering has not been configured, can't run"); @@ -304,7 +311,8 @@ TopoSteering::executeSortingAlgorithm(TCS::SortingAlg *alg, const InputTOBArray * input = inputConnector->outputData(); - alg->sort(*input, *sortedOutput); + if(m_useBitwise) alg->sortBitCorrect(*input, *sortedOutput); + else alg->sort(*input, *sortedOutput); return StatusCode::SUCCESS; } @@ -317,7 +325,7 @@ TopoSteering::executeDecisionAlgorithm(TCS::DecisionAlg *alg, const std::vector<TCS::TOBArray *> & output, TCS::Decision & decision) { - TRG_MSG_DEBUG(" ... executing decision alg '" << alg->fullname() << "'"); + TRG_MSG_INFO(" ... executing decision alg '" << alg->fullname() << "'"); if(inputConnectors.size()<1) { TCS_EXCEPTION("L1Topo Steering: Decision algorithm expects at least 1 input array but got 0"); @@ -338,9 +346,12 @@ TopoSteering::executeDecisionAlgorithm(TCS::DecisionAlg *alg, } alg->reset(); - - alg->process( input, output, decision ); - + + + if(m_useBitwise) alg->processBitCorrect( input, output, decision); + else alg->process( input, output, decision ); + //TRG_MSG_ALWAYS("[XS1234sz]L1Topo Steering alg " << alg->name() << " has decision " << decision.decision()); + return StatusCode::SUCCESS; } diff --git a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx index c771708ef2aa198fb74f0850d7550276d691e8eb..00267704854ed35ec27c95044b291526f5f57bdf 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoCoreSim/src/test/TopoStandAlone.cxx @@ -74,6 +74,7 @@ int run(int argc, const char* argv[]) { // instantiate steering TCS::TopoSteering steering; + steering.setUseBitwise(false); steering.setupFromConfiguration(XMLParser.takeMenu()); steering.setMsgLevel( msgLvl ); diff --git a/Trigger/TrigT1/L1Topo/L1TopoEvent/L1TopoEvent/TopoInputEvent.h b/Trigger/TrigT1/L1Topo/L1TopoEvent/L1TopoEvent/TopoInputEvent.h index 6f93e6e32eca07337ebf8eaf450b31b9507c3fd5..89bae990bd5499c91edd3fae83f37ff9b16f53c6 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoEvent/L1TopoEvent/TopoInputEvent.h +++ b/Trigger/TrigT1/L1Topo/L1TopoEvent/L1TopoEvent/TopoInputEvent.h @@ -47,6 +47,10 @@ namespace TCS { const MuonNextBCTOBArray & muonsNextBC() const { return m_muonsNextBC; } const JetTOBArray & jets() const { return m_jets; } const MetTOB & met() const { return m_met[0]; } + uint32_t run_number() const { return m_runNo; } + uint32_t event_number() const { return m_evtNo; } + uint32_t lumi_block() const { return m_lumiB; } + uint32_t bunch_crossing_id() const { return m_BCID; } StatusCode addCluster(const ClusterTOB & cluster); StatusCode addTau(const ClusterTOB & tau); @@ -55,6 +59,7 @@ namespace TCS { StatusCode addMuonNextBC(const MuonNextBCTOB & muon); StatusCode addJet(const JetTOB & jet); StatusCode setMET(const MetTOB & met); + StatusCode setEventInfo(const uint32_t runNo, const uint32_t evtNo, const uint32_t lumiB, const uint32_t BCID); // access all inputs by type const InputTOBArray * inputTOBs(TCS::inputTOBType_t) const; @@ -83,6 +88,7 @@ namespace TCS { LateMuonTOBArray m_lateMuons; MuonNextBCTOBArray m_muonsNextBC; MetTOBArray m_met; // will have size 1 + uint32_t m_runNo, m_evtNo, m_lumiB, m_BCID; bool m_dumpEnabled { false }; std::string m_inputDumpFile { "" }; diff --git a/Trigger/TrigT1/L1Topo/L1TopoEvent/Root/TopoInputEvent.cxx b/Trigger/TrigT1/L1Topo/L1TopoEvent/Root/TopoInputEvent.cxx index d5aa47771ac0874bed4c5546398a1728598f458c..3ab307a3e4316869a44e5a43e21b42d82ac9cb5f 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoEvent/Root/TopoInputEvent.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoEvent/Root/TopoInputEvent.cxx @@ -23,7 +23,8 @@ TopoInputEvent::TopoInputEvent(const string & clusterName, m_muons(muonName,32), m_lateMuons(lateMuonName,32), m_muonsNextBC(muonNextBCName,32), - m_met(metName,1) + m_met(metName,1), + m_runNo(0), m_evtNo(0), m_lumiB(0), m_BCID(0) { setMET(MetTOB(0,0,0)); // default MET } @@ -66,6 +67,14 @@ StatusCode TopoInputEvent::setMET(const TCS::MetTOB & met) { return StatusCode::SUCCESS; } +StatusCode TopoInputEvent::setEventInfo(const uint32_t runNo, const uint32_t evtNo, const uint32_t lumiB, const uint32_t BCID) { + m_runNo = runNo; + m_evtNo = evtNo; + m_lumiB = lumiB; + m_BCID = BCID; + return StatusCode::SUCCESS; +} + // access to data for the steering const InputTOBArray * TopoInputEvent::inputTOBs(inputTOBType_t tobType) const { @@ -94,6 +103,10 @@ TCS::TopoInputEvent::clear() { m_lateMuons.clear(); m_muonsNextBC.clear(); m_met.clear(); + m_runNo = 0; + m_evtNo = 0; + m_lumiB = 0; + m_BCID = 0; setMET(MetTOB(0,0,0)); // default MET @@ -149,6 +162,9 @@ TopoInputEvent::dump() { file << met->Ex() << " " << met->Ey() << " " << met->Et() << endl; } file << "</met>" << endl; + file << "<info>" << endl; + file << m_runNo << " " << m_evtNo << " " << m_lumiB << " " << m_BCID << endl; + file << "</info>" << endl; file << "</event>" << endl; file.close(); } @@ -183,6 +199,7 @@ std::ostream & operator<<(std::ostream &o, const TCS::TopoInputEvent &evt) { o << " #latemuons : " << evt.lateMuons().size() << " (capacity: " << evt.lateMuons().capacity() << ")" << endl; o << " #muonsNextBC : " << evt.muonsNextBC().size() << " (capacity: " << evt.muonsNextBC().capacity() << ")" << endl; o << " #met : " << evt.m_met.size() << " (capacity: " << evt.m_met.capacity() << ")" << endl; + o << " #info : runNo, evtNo, lumiBlock and BCID" << endl; o << "Details:" << endl; o << "Cluster input vector (" << evt.clusters().name() << "):" << endl << evt.clusters(); @@ -192,6 +209,7 @@ std::ostream & operator<<(std::ostream &o, const TCS::TopoInputEvent &evt) { o << "LateMuon input vector (" << evt.lateMuons().name() << "):" << endl << evt.lateMuons(); o << "MuonNextBC input vector (" << evt.muonsNextBC().name() << "):" << endl << evt.muonsNextBC(); o << "MET input (" << evt.m_met.name() << "):" << endl << evt.m_met; + o << "Event info: " << evt.run_number() << " " << evt.event_number() << " " << evt.lumi_block() << " " << evt.bunch_crossing_id(); return o; } @@ -225,6 +243,8 @@ TopoInputEvent::print() const { for(auto * x : muonsNextBC()) TRG_MSG_DEBUG(" " << *x); TRG_MSG_DEBUG("MET input (" << m_met.name() << "):");// << endl << m_met; for(auto * x : m_met) TRG_MSG_DEBUG(" " << *x); + TRG_MSG_DEBUG("Event info:"); + TRG_MSG_DEBUG(" runNo: " << run_number() << " evtNo: " << event_number() << " lumiBlock: " << lumi_block() << " BCID: " << bunch_crossing_id()); } diff --git a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h index a01277d677ba0c2d52f01cbf1d67d3e9d4e9e543..36b6e9b0f15b518b1ec5c80787a8efb7245457e8 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h +++ b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/DecisionAlg.h @@ -30,8 +30,11 @@ namespace TCS { const std::vector<TCS::TOBArray *> & output, Decision & decison ) = 0; - unsigned int numberOutputBits() const { return m_numberOutputBits; } + virtual TCS::StatusCode processBitCorrect( const std::vector<TCS::TOBArray const *> & input, + const std::vector<TCS::TOBArray *> & output, + Decision & decison ) = 0; + unsigned int numberOutputBits() const { return m_numberOutputBits; } void setNumberOutputBits(unsigned int numberOutputBits) { m_numberOutputBits = numberOutputBits; } private: diff --git a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/SortingAlg.h b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/SortingAlg.h index 469cb774bc613abeaaa4f665e01734db1dddb050..265ec70d97747390b7000e6f60d0aeb57a3ce6c8 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/SortingAlg.h +++ b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/L1TopoInterfaces/SortingAlg.h @@ -23,6 +23,7 @@ namespace TCS { virtual ~SortingAlg(); virtual TCS::StatusCode sort(const InputTOBArray & input, TOBArray & output) = 0; + virtual TCS::StatusCode sortBitCorrect(const InputTOBArray & input, TOBArray & output); protected: diff --git a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx index 0796abbd88f9d9c0056dfbc1235e08c540773a8d..ef5b8ed89e9eb1819509f78d6c7c1bac6c3d4aca 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/DecisionAlg.cxx @@ -11,3 +11,12 @@ TCS::DecisionAlg::doReset() { } TCS::DecisionAlg::~DecisionAlg() {} + +TCS::StatusCode +TCS::DecisionAlg::processBitCorrect( const std::vector<TCS::TOBArray const *> & input, + const std::vector<TCS::TOBArray *> & output, + Decision & decision ) +{ + return process(input,output,decision); +} + diff --git a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/SortingAlg.cxx b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/SortingAlg.cxx index ef6cfda63c13f65ef28aa8f7726c95f22042ba46..a2e54339f9f150b445a54f15fd83303bb84dcafc 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/SortingAlg.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoInterfaces/Root/SortingAlg.cxx @@ -11,4 +11,9 @@ TCS::SortingAlg::doReset() { return StatusCode::SUCCESS; } +TCS::StatusCode TCS::SortingAlg::sortBitCorrect(const InputTOBArray & input, TOBArray & output) +{ + return sort(input, output); +} + TCS::SortingAlg::~SortingAlg() {} diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/CMakeLists.txt b/Trigger/TrigT1/L1Topo/L1TopoSimulation/CMakeLists.txt index 9f78ce69218a07e447556952821ddcce0b98ca7b..e29fffd24168d62159e4252f2dc93a3afb12b643 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/CMakeLists.txt +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/CMakeLists.txt @@ -1,4 +1,4 @@ -# $Id: CMakeLists.txt 777073 2016-10-07 11:51:55Z krasznaa $ +# $Id: CMakeLists.txt 780947 2016-10-28 10:01:38Z salderwe $ ################################################################################ # Package: L1TopoSimulation ################################################################################ @@ -11,6 +11,7 @@ atlas_depends_on_subdirs( PRIVATE Control/AthenaBaseComps Control/AthenaMonitoring + Event/EventInfo GaudiKernel Trigger/TrigConfiguration/TrigConfBase Trigger/TrigConfiguration/TrigConfInterfaces @@ -43,7 +44,7 @@ atlas_add_component( L1TopoSimulation INCLUDE_DIRS ${ROOT_INCLUDE_DIRS} LINK_LIBRARIES ${ROOT_LIBRARIES} AthenaMonitoringLib TrigInterfacesLib TrigT1CaloEventLib TrigT1CaloUtilsLib - AthenaBaseComps GaudiKernel TrigConfBase TrigConfL1Data L1TopoConfig + AthenaBaseComps EventInfo GaudiKernel TrigConfBase TrigConfL1Data L1TopoConfig L1TopoCoreSim L1TopoEvent L1TopoInterfaces L1TopoAlgorithms TrigT1Interfaces TrigT1Result TrigConfInterfaces ) diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/cmt/requirements b/Trigger/TrigT1/L1Topo/L1TopoSimulation/cmt/requirements index d0ec989752733bd43027230e011a9ebc56eb2295..6a69e2d065c7436dae837bc992c4ef7687466802 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/cmt/requirements +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/cmt/requirements @@ -22,6 +22,7 @@ use L1TopoEvent L1TopoEvent-* Trigger/TrigT1/L use TrigT1CaloEvent TrigT1CaloEvent-* Trigger/TrigT1 use TrigT1CaloUtils TrigT1CaloUtils-* Trigger/TrigT1 use TrigT1Interfaces TrigT1Interfaces-* Trigger/TrigT1 +use EventInfo EventInfo-* Event end_private diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1Simulation.py b/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1Simulation.py index 017296b5f555b2ba25f83914c02145194165dd2b..644b306b39c97017e06daa0aa3bee2acee6e856d 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1Simulation.py +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/share/L1Simulation.py @@ -87,6 +87,7 @@ top.L1TopoSimulation.TopoOutputLevel=DEBUG top.L1TopoSimulation.TopoSteeringOutputLevel=DEBUG top.L1TopoSimulation.EnableInputDump = True top.L1TopoSimulation.InputDumpFile = "inputdump.txt" +top.L1TopoSimulation.UseBitwise = False # new calo sim top.CPCMX.OutputLevel = VERBOSE diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.cxx index fdf5514fc0dc6b3c45c5e4de6ae094041bd63794..9517acaf3dc4daa42097ca1d400570f4d4e15154 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.cxx @@ -77,6 +77,7 @@ L1TopoSimulation::L1TopoSimulation(const std::string &name, ISvcLocator *pSvcLoc declareProperty( "AthenaMonTools", m_monitors, "List of monitoring tools to be run with this instance, if incorrect then tool is silently skipped."); declareProperty( "MonHistBaseDir", m_histBaseDir = "L1TopoAlgorithms", "Base directory for monitoring histograms will be /EXPERT/<MonHistBaseDir>" ); declareProperty( "EnableInputDump", m_enableInputDump, "Boolean to enable writing of input data for standalone running"); + declareProperty( "UseBitwise", m_enableBitwise, "Boolean to enable the bitwise version of software algorithms"); declareProperty( "InputDumpFile", m_inputDumpFile, "File name for dumping input data"); declareProperty( "TopoCTPLocation", m_topoCTPLocation = LVL1::DEFAULT_L1TopoCTPLocation, "StoreGate key of topo decision output for CTP" ); declareProperty( "TopoOutputLevel", m_topoOutputLevel, "OutputLevel for L1Topo algorithms" ); @@ -133,6 +134,7 @@ L1TopoSimulation::initialize() { return StatusCode::FAILURE; } + m_topoSteering->setUseBitwise(m_enableBitwise); std::cout << "Calling m_topoSteering->setupFromConfiguration(*menu)" << endl; try { m_topoSteering->setupFromConfiguration(*menu); @@ -229,6 +231,11 @@ L1TopoSimulation::execute() { // fill the L1Topo Input Event TCS::TopoInputEvent & inputEvent = m_topoSteering->inputEvent(); + // Event Info + const EventInfo *evt; + CHECK(evtStore()->retrieve(evt)); + inputEvent.setEventInfo(evt->event_ID()->run_number(),evt->event_ID()->event_number(),evt->event_ID()->lumi_block(),evt->event_ID()->bunch_crossing_id()); + // EM TAU CHECK(m_emtauInputProvider->fillTopoInputEvent(inputEvent)); diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.h b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.h index c655914caa7ffcf335aa27b1a99cbc86c7454b94..15f49a8de49a84aff9320c1d0288829657561a04 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.h +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulation/src/L1TopoSimulation.h @@ -10,6 +10,8 @@ #include "AthenaBaseComps/AthAlgorithm.h" #include "TrigInterfaces/IMonitoredAlgo.h" +#include "EventInfo/EventInfo.h" +#include "EventInfo/EventID.h" #include "GaudiKernel/ServiceHandle.h" #include "GaudiKernel/ToolHandle.h" @@ -74,6 +76,8 @@ namespace LVL1 { //! @} BooleanProperty m_enableInputDump { false }; // for enabling input dumping + BooleanProperty m_enableBitwise { false }; // for enabling bitwise algorithms + StringProperty m_inputDumpFile { "inputdump.txt" }; // input dump file StringProperty m_topoCTPLocation { "" }; // input dump file int m_topoOutputLevel{TrigConf::MSGTC::WARNING}; // property to set the outputlevel of the topo algorithms diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/CMakeLists.txt b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/CMakeLists.txt index fd077515957f3e86a2b58076ba2ed61aa64a7059..9b4b2857567cb17a446d2707b0445711d3a49566 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/CMakeLists.txt +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/CMakeLists.txt @@ -5,6 +5,10 @@ # Declare the package name: atlas_subdir( L1TopoSimulationUtils ) +# Trigger dependencies +atlas_depends_on_subdirs( PUBLIC + Trigger/TrigT1/L1Topo/L1TopoEvent ) + # External dependencies: find_package( Boost COMPONENTS filesystem thread system ) @@ -15,3 +19,6 @@ atlas_add_library( L1TopoSimulationUtils INCLUDE_DIRS ${Boost_INCLUDE_DIRS} LINK_LIBRARIES ${Boost_LIBRARIES} ) + + + diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Kinematics.h b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Kinematics.h new file mode 100644 index 0000000000000000000000000000000000000000..ba4ce5ab0720b0b1cadd687d4d51cd4821d3616e --- /dev/null +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/L1TopoSimulationUtils/Kinematics.h @@ -0,0 +1,31 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +// Kinematics.h +// Pepijn Bakker, Oct 21 + + +#ifndef TSU_Kinematics +#define TSU_Kinematics + +//the file 'requirements' in cmt can get you this L1TopoEvent +#include "L1TopoEvent/GenericTOB.h" +#include <iostream> +#include <vector> + +namespace TSU { + struct Kinematics { + static unsigned int calcDeltaPhiBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); + static unsigned int calcInvMassBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); + static unsigned int calcDeltaR2BW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); + + static unsigned int calcDeltaPhi(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); + static unsigned int calcDeltaEta(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); + static unsigned int calcInvMass(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); + static unsigned int calcDeltaR2(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2); + }; + +} // end of namespace TSU + +#endif diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Hyperbolic.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Hyperbolic.cxx index ae26f601fa7866f7497f552df94b8bdbb22631f3..ea316a166a79f2294570d3a7320b4b19e6dcd790 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Hyperbolic.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Hyperbolic.cxx @@ -10,7 +10,7 @@ **********************************/ #include "L1TopoSimulationUtils/Hyperbolic.h" - +//extra comment // 11 integer bit(s) + 7decimal bit(s); (79 entries) const std::vector<std::string> TSU::Hyperbolic::Cosh = { "000000000010000000", // value = 1.0, argument value = 0.0 diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx index a774e0b9214ea99082a52b27a127c0c5d37b3b3d..de7e8d91fa9af86ce3d56839ffee0bacd638bc1d 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/KFLUT.cxx @@ -68,7 +68,7 @@ double TCS::KFLUT::getcorrKF(int iet,int jeta){ void TCS::KFLUT::fillLUT(){ - etalimits = {0,0.2,0.4,0.6,0.8,1.,1.2,1.4,1.6,1.8,2.,2.2,2.45,2.65,2.95,3.9}; + etalimits = {-0.10,0.10,0.30,0.50,0.70,0.90,1.10,1.30,1.50,1.70,1.90,2.10,2.33,2.55,2.80,3.42}; etlimits = {8,16,32,64,128,1024}; vector<double> v0 {-0.12,-0.09,-0.09,-0.05,0.03,0.08,0.14,0.36,0.29,0.04,0.06,0.04,-0.02,-0.09,-0.18,-0.31}; diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx new file mode 100644 index 0000000000000000000000000000000000000000..a2f88202f14ca0d4ed1c4d05c3ab5f46a2aa32f0 --- /dev/null +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/Root/Kinematics.cxx @@ -0,0 +1,91 @@ +/* + Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration +*/ + +#include <cmath> +#include <string> +#include <iostream> +#include <sstream> +#include <vector> + +#include "L1TopoSimulationUtils/Kinematics.h" +#include "L1TopoSimulationUtils/Hyperbolic.h" +#include "L1TopoSimulationUtils/L1TopoDataTypes.h" +#include "L1TopoSimulationUtils/Trigo.h" +#include "L1TopoEvent/GenericTOB.h" + +// + +using namespace std; + +unsigned int TSU::Kinematics::calcDeltaPhiBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2){ + int dphiB = abs( tob1->phi() - tob2->phi() ); + if(dphiB>64) + dphiB = dphiB - 64; + if(dphiB>32) + dphiB = 64 - dphiB; + + return dphiB ; +} + +unsigned int TSU::Kinematics::calcInvMassBW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2){ + + auto bit_cosheta = TSU::L1TopoDataTypes<19,7>(TSU::Hyperbolic::Cosh.at(abs(tob1->eta() - tob2->eta()))); + auto bit_cosphi = TSU::L1TopoDataTypes<9,7>(TSU::Trigo::Cos.at(abs(tob1->phi() - tob2->phi()))); + TSU::L1TopoDataTypes<11,0> bit_Et1(tob1->Et()); + TSU::L1TopoDataTypes<11,0> bit_Et2(tob2->Et()); + auto bit_invmass2 = 2*bit_Et1*bit_Et2*(bit_cosheta - bit_cosphi); + return int(bit_invmass2) ; +} + +unsigned int TSU::Kinematics::calcDeltaR2BW(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { + int detaB = abs( tob1->eta() - tob2->eta() ); + int dphiB = abs( tob1->phi() - tob2->phi() ); + if(dphiB>64) //Probably same error here as in DeltaPhiBW. Check + dphiB = dphiB - 64; + if(dphiB>32) + dphiB = 64 - dphiB; + + unsigned int bit_dr2 = dphiB*dphiB + detaB*detaB; + return bit_dr2; +} + + + +/*------------------------------------------ NON-BITWISE --------------------------------------------------*/ + +unsigned int TSU::Kinematics::calcDeltaPhi(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { + double dphi = fabs( tob1->phiDouble() - tob2->phiDouble() ); + if(dphi>M_PI) + dphi = 2*M_PI - dphi; + + return round( 10 * dphi ); +} + +unsigned int TSU::Kinematics::calcDeltaEta(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { + double deta = fabs( tob1->eta() - tob2->eta() ); + return deta; +} + +unsigned int TSU::Kinematics::calcInvMass(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { + double deta = fabs( tob1->etaDouble() - tob2->etaDouble() ); + double dphi = fabs( tob1->phiDouble() - tob2->phiDouble() ); + if(dphi>M_PI) + dphi = 2*M_PI - dphi; + + double cosheta = cosh ( deta); + double cosphi = cos ( dphi); + double invmass2 = 2*tob1->Et()*tob2->Et()*(cosheta - cosphi); + return round( invmass2 ); +} + +unsigned int TSU::Kinematics::calcDeltaR2(const TCS::GenericTOB* tob1, const TCS::GenericTOB* tob2) { + double deta = ( tob1->etaDouble() - tob2->etaDouble() ); + double dphi = fabs( tob1->phiDouble() - tob2->phiDouble() ); + if(dphi>M_PI) + dphi = 2*M_PI - dphi; + + + return round ( 100 * ((dphi)*(dphi) + (deta)*(deta) )) ; +} + diff --git a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/cmt/requirements b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/cmt/requirements index 7731b316a21531e04497389ed6edd3bf5578da72..747a50885c3d91d2d297bb5114543705e79e203c 100644 --- a/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/cmt/requirements +++ b/Trigger/TrigT1/L1Topo/L1TopoSimulationUtils/cmt/requirements @@ -5,6 +5,8 @@ package L1TopoSimulationUtils use DetCommonPolicy * use Boost * LCG_Interfaces +# Trigger dependencies +use L1TopoEvent * Trigger/TrigT1/L1Topo # CMT package configuration apply_pattern detcommon_shared_generic_library files=../Root/*.cxx diff --git a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/MuCTPIL1TopoCandidate.h b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/MuCTPIL1TopoCandidate.h index 70aca40a5bb6a5382ee1c7d73bf2fcdd80d9a529..f81052427ff788a8f3b65c488a3752cefb9f42f9 100644 --- a/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/MuCTPIL1TopoCandidate.h +++ b/Trigger/TrigT1/TrigT1Interfaces/TrigT1Interfaces/MuCTPIL1TopoCandidate.h @@ -48,6 +48,9 @@ namespace LVL1 { // set the RoI word (done at a differnt stage of the simulation, hence the separate function void setRoiWord( unsigned int roi); + //setter to set second candidate in Mioct pt to 3 (i.e. 11) in case of > 2 candidates (OverFlow) + void setptL1TopoCodeToOvFl() { m_ptL1TopoCode=3; } + // getter functions std::string getSectorName() const { return m_sectorName; } unsigned int getRoiID() const { return m_roiID; } diff --git a/Trigger/TrigT1/TrigT1Interfaces/doc/mainpage.h b/Trigger/TrigT1/TrigT1Interfaces/doc/mainpage.h deleted file mode 100644 index 8737e6139d6d37eef92f7e7f2365eb4a6d2bb45e..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Interfaces/doc/mainpage.h +++ /dev/null @@ -1,23 +0,0 @@ -/** - @mainpage TrigT1Interfaces package - - @author E. Moyse <Edward.Moyse@cern.ch> - @author Thomas Schoerner-Sadenius <thomas.schoerner@cern.ch> - @author Wolfgang Ehrenfeld <wolfgang.ehrenfeld@desy.de> - @author Alan Watson <Alan.Watson@cern.ch> - @author Tadashi Maeno <Tadashi.Maeno@cern.ch> - @author Attila Krasznahorkay Jr. <Attila.Krasznahorkay@cern.ch> - - @section TrigT1IntOverview Overview - - This package holds a large number of classes used together by various parts - of the LVL1 trigger simulation, and also by the High Level Trigger. Since - there are a lot of classes in the package, with the most diverse functionality, - a general overview of them is not given here. See their individual documentation - for more details. - - @htmlinclude used_packages.html - - @include requirements - -*/ diff --git a/Trigger/TrigT1/TrigT1Muctpi/doc/mainpage.h b/Trigger/TrigT1/TrigT1Muctpi/doc/mainpage.h deleted file mode 100644 index 46ec4d0a3cbef57007620affa503953e3982b2c4..0000000000000000000000000000000000000000 --- a/Trigger/TrigT1/TrigT1Muctpi/doc/mainpage.h +++ /dev/null @@ -1,43 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - @mainpage TrigT1Muctpi Package - - @author Attila Kraznahorkay Jr. <Attila.Krasznahorkay@cern.ch> - @author Thorsten Wengler <Thorsten.Wengler@cern.ch> - - @section TrigT1MuctpiIntro Introduction - - This package holds the simulation code of the Muon to CTP Interface (MuCTPI). - This hardware is responsible for collecting the muon candidates reconstructed by - the RPC and TGC sector logics, count their multiplicity in 6 different thresholds - considering overlaps between the trigger sectors, and send the multiplicity - result to the CTP. It also supplies information on the LVL1 muon candidates - to the RoI Builder and the DAQ system. - - @section TrigT1MuctpiOverview Class Overview - - The package contains the following algorithms: - - - LVL1MUCTPI::L1Muctpi : The main MuCTPI simulation algorithm. - - CBNTAA_ReadMuCTPI_RDO : Algorithm that saves MuCTPI variables in a CBNTAA ntuple. - - CBNTAA_ReadMuCTPI_RIO : Algorithm that saves "extended" MuCTPI variables in a CBNTAA ntuple. - - CBNTAA_MuctpiRoI : Algorithm saving eta-phi coordinates for muon RoIs to CBNTAA ntuple. - - LVL1MUCTPI::L1MuctpiPatGen : Algorithm generating random input for the MuCTPI simulation. For testing only. - - LVL1MUCTPI::L1MuctpiTestReadResults : Algorithm "testing" the output of the MuCTPI simulation. - - The actual hardware simulation uses a lot of classes. Those can all be found in the "Classes" tab. - - */ - -/** - @page used_TrigT1Muctpi Used Packages - @htmlinclude used_packages.html -*/ - -/** - @page requirements_TrigT1Muctpi Requirements - @include requirements -*/ diff --git a/Trigger/TrigT1/TrigT1Muctpi/python/TrigT1MuctpiConfig.py b/Trigger/TrigT1/TrigT1Muctpi/python/TrigT1MuctpiConfig.py index 1fa0391b34acc3abe6be19f8aa6f626bb5c4862d..f3bc5b50b8ae47bb4b3ba8ca1f48548226021aa5 100644 --- a/Trigger/TrigT1/TrigT1Muctpi/python/TrigT1MuctpiConfig.py +++ b/Trigger/TrigT1/TrigT1Muctpi/python/TrigT1MuctpiConfig.py @@ -1,6 +1,6 @@ # Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -# $Id: TrigT1MuctpiConfig.py 726107 2016-02-25 11:04:42Z wengler $ +# $Id: TrigT1MuctpiConfig.py 794528 2017-01-30 12:36:33Z fwinkl $ # Local (generated) configurable(s): from TrigT1Muctpi.TrigT1MuctpiConf import LVL1MUCTPI__L1Muctpi @@ -54,7 +54,7 @@ class DefaultL1Muctpi( LVL1MUCTPI__L1Muctpi ): pass # Set properties for NIM outputs ot L1Topo conversion from RoI to eta/phi - self.GeometryXMLFile = "TrigConfMuctpi/TestMioctGeometry.xml" + self.GeometryXMLFile = "TrigConfMuctpi/TestMioctGeometry_2016_05_30_CS_2600573263.xml" # Turn on the NIM output creation by default: self.DoNIMOutput = True @@ -200,7 +200,7 @@ class DefaultL1MuctpiTool( LVL1MUCTPI__L1MuctpiTool ): pass # Set properties for NIM outputs ot L1Topo conversion from RoI to eta/phi - self.GeometryXMLFile = "TrigConfMuctpi/TestMioctGeometry.xml" + self.GeometryXMLFile = "TrigConfMuctpi/TestMioctGeometry_2016_05_30_CS_2600573263.xml" # Turn on the NIM output creation by default: self.DoNIMOutput = True diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx index e7b6714cf655774fc846cdc02362769cc6e4dc58..96cc88d22a96d9848d8fc026d36ac085bf8ccfcf 100644 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx +++ b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1Muctpi.cxx @@ -2,7 +2,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: L1Muctpi.cxx 726107 2016-02-25 11:04:42Z wengler $ +// $Id: L1Muctpi.cxx 794528 2017-01-30 12:36:33Z fwinkl $ // STL include(s): #include <iostream> @@ -152,7 +152,7 @@ namespace LVL1MUCTPI { } ATH_MSG_INFO( "XML LUT file defined in jobO: " << m_lutXMLFile << " with a RunPeriod=" << m_runPeriod ); - const std::string fullFileName = PathResolverFindXMLFile( m_lutXMLFile ); + const std::string fullFileName = PathResolverFindCalibFile( m_lutXMLFile ); ATH_MSG_DEBUG( "Full path to XML LUT file: " << fullFileName ); CHECK( m_theMuctpi->initializeLUTOverlapStrategy( fullFileName, m_flagMode, m_dumpLut, m_runPeriod ) ); @@ -171,7 +171,7 @@ namespace LVL1MUCTPI { // ATH_MSG_INFO( "Geometry XML file defined in jobO: " << m_geometryXMLFile ); - const std::string fullGeometryFileName = PathResolverFindXMLFile( m_geometryXMLFile ); + const std::string fullGeometryFileName = PathResolverFindCalibFile( m_geometryXMLFile ); ATH_MSG_INFO( "Full path to Geometry XML file: " << fullGeometryFileName ); m_theMuctpi->setupL1TopoConverter(fullGeometryFileName); @@ -197,8 +197,8 @@ namespace LVL1MUCTPI { ATH_MSG_INFO( "XML multiplicity file defined in jobO: " << m_multiplicityXMLFile ); const std::string packagePrefix = "TrigT1Muctpi/"; - const std::string fullFileName = PathResolverFindXMLFile( packagePrefix + - m_multiplicityXMLFile ); + const std::string fullFileName = PathResolverFindCalibFile( packagePrefix + + m_multiplicityXMLFile ); ATH_MSG_DEBUG( " Full path to XML file: " << fullFileName ); m_theMuctpi->initializeXMLMultStrategy( fullFileName ); diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx index 196b2074ce4533dfd4943bd6d8a8cd731ae42deb..7087bd7bc3f9e1bb1029eb9f951b618e2b698903 100644 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx +++ b/Trigger/TrigT1/TrigT1Muctpi/src/Algorithms/L1MuctpiTool.cxx @@ -2,7 +2,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: L1MuctpiTool.cxx 733326 2016-04-01 11:39:10Z wengler $ +// $Id: L1MuctpiTool.cxx 794528 2017-01-30 12:36:33Z fwinkl $ // STL include(s): #include <iostream> @@ -169,7 +169,7 @@ namespace LVL1MUCTPI { } ATH_MSG_INFO( "XML LUT file defined in jobO: " << m_lutXMLFile << " with a RunPeriod=" << m_runPeriod ); - const std::string fullFileName = PathResolverFindXMLFile( m_lutXMLFile ); + const std::string fullFileName = PathResolverFindCalibFile( m_lutXMLFile ); ATH_MSG_DEBUG( "Full path to XML LUT file: " << fullFileName ); CHECK( m_theMuctpi->initializeLUTOverlapStrategy( fullFileName, m_flagMode, m_dumpLut, m_runPeriod ) ); @@ -188,7 +188,7 @@ namespace LVL1MUCTPI { // ATH_MSG_INFO( "Geometry XML file defined in jobO: " << m_geometryXMLFile ); - const std::string fullGeometryFileName = PathResolverFindXMLFile( m_geometryXMLFile ); + const std::string fullGeometryFileName = PathResolverFindCalibFile( m_geometryXMLFile ); ATH_MSG_INFO( "Full path to Geometry XML file: " << fullGeometryFileName ); m_theMuctpi->setupL1TopoConverter(fullGeometryFileName); @@ -212,10 +212,10 @@ namespace LVL1MUCTPI { m_theMuctpi->setMultiplicityStrategy( XML ); ATH_MSG_INFO( "XML multiplicity file defined in jobO: " - << m_multiplicityXMLFile ); + << m_multiplicityXMLFile ); const std::string packagePrefix = "TrigT1Muctpi/"; - const std::string fullFileName = PathResolverFindXMLFile( packagePrefix + - m_multiplicityXMLFile ); + const std::string fullFileName = PathResolverFindCalibFile( packagePrefix + + m_multiplicityXMLFile ); ATH_MSG_DEBUG( " Full path to XML file: " << fullFileName ); m_theMuctpi->initializeXMLMultStrategy( fullFileName ); diff --git a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.cxx b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.cxx index 4e48c6d56c186e62d021096fd9e850c0e3d4b4bd..ce3f86b9b22b29f6b81eea221b745d532213bac7 100644 --- a/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.cxx +++ b/Trigger/TrigT1/TrigT1Muctpi/src/Mioct/MioctModule.cxx @@ -2,7 +2,7 @@ Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration */ -// $Id: MioctModule.cxx 787150 2016-11-29 17:31:35Z smh $ +// $Id: MioctModule.cxx 795106 2017-02-02 11:21:27Z wengler $ // STL include(s): #include <sstream> @@ -16,12 +16,12 @@ //*********************************************************************** // -// Version : $Revision: 787150 $ +// Version : $Revision: 795106 $ // // Description : // // Author : $Author: krasznaa $ -// Date : $Date: 2016-11-29 18:31:35 +0100 (Tue, 29 Nov 2016) $ +// Date : $Date: 2017-02-02 12:21:27 +0100 (Thu, 02 Feb 2017) $ // // // @@ -155,8 +155,14 @@ namespace LVL1MUCTPI { // limit to 2 candidates per MIOCT as in the hardware - if (candList.size() > 2) candList.erase(candList.begin(), candList.end()-2); - + if (candList.size() > 2) { + candList.erase(candList.begin(), candList.end()-2); + // set second candidate pt to 3 (i.e. 11) to indicate overflow - note sorting is in ascending order, + // so last element in vector is highest pt, i.e. first element in vector of two after cutoff is + // second candidate + candList.at(0).setptL1TopoCodeToOvFl(); + } + result.setCandidates(candList); return result; diff --git a/Trigger/TrigValidation/TrigEgammaValidation/test/TrigEgammaValidation_TestConfiguration.xml b/Trigger/TrigValidation/TrigEgammaValidation/test/TrigEgammaValidation_TestConfiguration.xml index 83e98d88cb76fe92e1fb4bc7c5b5cff5db251446..8bf91b6e3adf2c1d0a93f9329e0454bcb7319c6f 100755 --- a/Trigger/TrigValidation/TrigEgammaValidation/test/TrigEgammaValidation_TestConfiguration.xml +++ b/Trigger/TrigValidation/TrigEgammaValidation/test/TrigEgammaValidation_TestConfiguration.xml @@ -2,19 +2,7 @@ <!DOCTYPE unifiedTestConfiguration SYSTEM "http://www.hep.ucl.ac.uk/atlas/AtlasTesting/DTD/unifiedTestConfiguration.dtd"> <unifiedTestConfiguration> - <atn> - <TEST name="HelloWorld" type="athena" suite="Examples"> - <options_atn>AthExHelloWorld/HelloWorld_ATN.py</options_atn> - <timelimit>2</timelimit> - <author> Giuseppe Lerner </author> - <mailto> giuseppe.lerner@cern.ch </mailto> - <expectations> - <errorMessage>FAILURE (ERROR)</errorMessage> - <successMessage>FATAL A FATAL</successMessage> - <returnValue>0</returnValue> - </expectations> - </TEST> - </atn> + <atn/> <kv/> <rtt xmlns="http://www.hep.ucl.ac.uk/atlas/AtlasTesting/rtt"> @@ -37,10 +25,10 @@ <chainElement> <jobTransform userJobId="RDOtoAOD_MC_transform_Zee_25ns_pileup"> - <doc> RDOtoAOD_MC_transform Physics_pp_v5 menu Zee events 25ns pileup </doc> + <doc> RDOtoAOD_MC_transform MC_pp_v7 menu Zee events 25ns pileup </doc> <jobTransformJobName> RDOtoAOD_MC_transform_Zee_25ns_pileup </jobTransformJobName> <jobTransformCmd> - athena.py -c 'from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf;acf.EvtMax.set_Value_and_Lock(1000);acf.FilesInput=["root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/egamma/sampleA/valid3.147406.PowhegPythia8_AZNLO_Zee.recon.RDO.e3099_s2578_r6596_tid05293003_00/RDO.05293003._000176.pool.root.1"];acf.PoolAODOutput="AOD.Zee.25ns.pileup.pool.root";menu="MC_pp_v6"' TrigEgammaValidation/testAthenaTrigRDOtoAOD_RTT.py + athena.py -c 'from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf;acf.EvtMax.set_Value_and_Lock(1000);acf.FilesInput=["root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/egamma/sampleA/valid3.147406.PowhegPythia8_AZNLO_Zee.recon.RDO.e3099_s2578_r6596_tid05293003_00/RDO.05293003._000176.pool.root.1"];acf.PoolAODOutput="AOD.Zee.25ns.pileup.pool.root";menu="MC_pp_v7"' TrigEgammaValidation/testAthenaTrigRDOtoAOD_RTT.py </jobTransformCmd> <group>HelloWorld</group> <queue>long</queue> @@ -94,10 +82,10 @@ <chainElement> <jobTransform userJobId="RDOtoAOD_MC_transform_ggH125_25ns_pileup"> - <doc> RDOtoAOD_MC_transform Physics_pp_v5 menu ggH125 events 25ns pileup </doc> + <doc> RDOtoAOD_MC_transform MC_pp_v7 menu ggH125 events 25ns pileup </doc> <jobTransformJobName> RDOtoAOD_MC_transform_ggH125_25ns_pileup </jobTransformJobName> <jobTransformCmd> - athena.py -c 'from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf;acf.EvtMax.set_Value_and_Lock(1000);acf.FilesInput=["root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/egamma/sampleA/valid3.160009.PowhegPythia8_AU2CT10_ggH125_gamgam.recon.RDO.e3458_s2578_r6596_tid05293048_00/RDO.05293048._000184.pool.root.1"];acf.PoolAODOutput="AOD.ggH125.25ns.pileup.pool.root";menu="MC_pp_v6"' TrigEgammaValidation/testAthenaTrigRDOtoAOD_RTT.py + athena.py -c 'from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf;acf.EvtMax.set_Value_and_Lock(1000);acf.FilesInput=["root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/egamma/sampleA/valid3.160009.PowhegPythia8_AU2CT10_ggH125_gamgam.recon.RDO.e3458_s2578_r6596_tid05293048_00/RDO.05293048._000184.pool.root.1"];acf.PoolAODOutput="AOD.ggH125.25ns.pileup.pool.root";menu="MC_pp_v7"' TrigEgammaValidation/testAthenaTrigRDOtoAOD_RTT.py </jobTransformCmd> <group>HelloWorld</group> <queue>long</queue> @@ -152,10 +140,10 @@ <chainElement> <jobTransform userJobId="RDOtoAOD_MC_transform_dijet_JZ7W_25ns_pileup"> - <doc> RDOtoAOD_MC_transform Physics_pp_v5 menu dijet_JZ7W events 25ns pileup </doc> + <doc> RDOtoAOD_MC_transform MC_pp_v7 menu dijet_JZ7W events 25ns pileup </doc> <jobTransformJobName> RDOtoAOD_MC_transform_dijet_JZ7W_25ns_pileup </jobTransformJobName> <jobTransformCmd> - athena.py -c 'from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf;acf.EvtMax.set_Value_and_Lock(1000);acf.FilesInput=["root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/egamma/sampleA/valid3.147917.Pythia8_AU2CT10_jetjet_JZ7W.recon.RDO.e3099_s2578_r6596_tid05293007_00/RDO.05293007._000001.pool.root.1"];acf.PoolAODOutput="AOD.dijet.JZ7W.25ns.pileup.pool.root";menu="MC_pp_v6"' TrigEgammaValidation/testAthenaTrigRDOtoAOD_RTT.py + athena.py -c 'from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf;acf.EvtMax.set_Value_and_Lock(1000);acf.FilesInput=["root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/egamma/sampleA/valid3.147917.Pythia8_AU2CT10_jetjet_JZ7W.recon.RDO.e3099_s2578_r6596_tid05293007_00/RDO.05293007._000001.pool.root.1"];acf.PoolAODOutput="AOD.dijet.JZ7W.25ns.pileup.pool.root";menu="MC_pp_v7"' TrigEgammaValidation/testAthenaTrigRDOtoAOD_RTT.py </jobTransformCmd> <group>HelloWorld</group> <queue>long</queue> @@ -211,10 +199,10 @@ <chainElement> <jobTransform userJobId="RDOtoAOD_MC_transform_dijet_JZ3W_25ns_pileup"> - <doc> RDOtoAOD_MC_transform Physics_pp_v5 menu dijet_JZ3W events 25ns pileup </doc> + <doc> RDOtoAOD_MC_transform MC_pp_v7 menu dijet_JZ3W events 25ns pileup </doc> <jobTransformJobName> RDOtoAOD_MC_transform_dijet_JZ3W_25ns_pileup </jobTransformJobName> <jobTransformCmd> - athena.py -c 'from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf;acf.EvtMax.set_Value_and_Lock(1000);acf.FilesInput=["root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/egamma/sampleA/valid3.147913.Pythia8_AU2CT10_jetjet_JZ3W.recon.RDO.e3099_s2578_r6596_tid05292983_00/RDO.05292983._000115.pool.root.1"];acf.PoolAODOutput="AOD.dijet.JZ3W.25ns.pileup.pool.root";menu="MC_pp_v6"' TrigEgammaValidation/testAthenaTrigRDOtoAOD_RTT.py + athena.py -c 'from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf;acf.EvtMax.set_Value_and_Lock(1000);acf.FilesInput=["root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/egamma/sampleA/valid3.147913.Pythia8_AU2CT10_jetjet_JZ3W.recon.RDO.e3099_s2578_r6596_tid05292983_00/RDO.05292983._000115.pool.root.1"];acf.PoolAODOutput="AOD.dijet.JZ3W.25ns.pileup.pool.root";menu="MC_pp_v7"' TrigEgammaValidation/testAthenaTrigRDOtoAOD_RTT.py </jobTransformCmd> <group>HelloWorld</group> <queue>long</queue> @@ -267,10 +255,10 @@ <chainElement> <jobTransform userJobId="RDOtoAOD_MC_transform_ppToJpsie3e3_mc15_13TeV"> - <doc> RDOtoAOD_MC_transform Physics_pp_v5 menu pp to Jpsi e3e3 </doc> + <doc> RDOtoAOD_MC_transform MC_pp_v7 menu pp to Jpsi e3e3 </doc> <jobTransformJobName> RDOtoAOD_MC_transform_ppToJpsie3e3 </jobTransformJobName> <jobTransformCmd> - athena.py -c 'from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf;acf.EvtMax.set_Value_and_Lock(1000);acf.FilesInput=["root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/egamma/sampleA/mc15_13TeV.129190.Pythia8_AU2CTEQ6L1_ppToJpsie3e3.recon.RDO.e3802_s2608_s2183_r6790_tid05594966_00/RDO.05594966._000001.pool.root.1"];acf.PoolAODOutput="AOD.ppToJpsie3e3.pool.root";menu="MC_pp_v6"' TrigEgammaValidation/testAthenaTrigRDOtoAOD_RTT.py + athena.py -c 'from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf;acf.EvtMax.set_Value_and_Lock(1000);acf.FilesInput=["root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/egamma/sampleA/mc15_13TeV.129190.Pythia8_AU2CTEQ6L1_ppToJpsie3e3.recon.RDO.e3802_s2608_s2183_r6790_tid05594966_00/RDO.05594966._000001.pool.root.1"];acf.PoolAODOutput="AOD.ppToJpsie3e3.pool.root";menu="MC_pp_v7"' TrigEgammaValidation/testAthenaTrigRDOtoAOD_RTT.py </jobTransformCmd> <group>HelloWorld</group> <queue>long</queue> @@ -323,10 +311,10 @@ <chainElement> <jobTransform userJobId="RDOtoAOD_MC_transform_Ggammagamma_mc15_13TeV"> - <doc> RDOtoAOD_MC_transform Physics_pp_v5 menu Ggammagamma </doc> + <doc> RDOtoAOD_MC_transform MC_pp_v7 menu Ggammagamma </doc> <jobTransformJobName> RDOtoAOD_MC_transform_Ggammagamma </jobTransformJobName> <jobTransformCmd> - athena.py -c 'from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf;acf.EvtMax.set_Value_and_Lock(1000);acf.FilesInput=["root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/egamma/sampleA/mc15_13TeV.129190.Pythia8_AU2CTEQ6L1_ppToJpsie3e3.recon.RDO.e3802_s2608_s2183_r6790_tid05594966_00/RDO.05594966._000001.pool.root.1"];acf.PoolAODOutput="AOD.Ggammagamma.pool.root";menu="MC_pp_v6"' TrigEgammaValidation/testAthenaTrigRDOtoAOD_RTT.py + athena.py -c 'from AthenaCommon.AthenaCommonFlags import athenaCommonFlags as acf;acf.EvtMax.set_Value_and_Lock(1000);acf.FilesInput=["root://eosatlas//eos/atlas/atlascerngroupdisk/trig-daq/egamma/sampleA/mc15_13TeV.129190.Pythia8_AU2CTEQ6L1_ppToJpsie3e3.recon.RDO.e3802_s2608_s2183_r6790_tid05594966_00/RDO.05594966._000001.pool.root.1"];acf.PoolAODOutput="AOD.Ggammagamma.pool.root";menu="MC_pp_v7"' TrigEgammaValidation/testAthenaTrigRDOtoAOD_RTT.py </jobTransformCmd> <group>HelloWorld</group> <queue>long</queue> diff --git a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py index be834e82dcae4cccb678e3d9491dd0a7b54bd8a8..539e83b9cac0a26fe88f4a0b1722997903885071 100644 --- a/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py +++ b/Trigger/TriggerCommon/TrigEDMConfig/python/TriggerEDM.py @@ -1604,7 +1604,10 @@ def getTriggerEDMList(key, runVersion): run can be: '1 (Run1)', '2 (Run2)' """ if runVersion == 2: - return getTriggerObjList(key,[TriggerHLTList, TriggerResultsList]) + if 'SLIM' in key: + return getTriggerEDMSlimList(key) + else: + return getTriggerObjList(key,[TriggerHLTList, TriggerResultsList]) else: return getTriggerObjList(key,[TriggerL2List,TriggerEFList, TriggerResultsRun1List]) diff --git a/Trigger/TriggerCommon/TriggerMenu/doc/mainpage.h b/Trigger/TriggerCommon/TriggerMenu/doc/mainpage.h deleted file mode 100644 index ac29b96d0d853a93ca1317e39e95507f5b06b20a..0000000000000000000000000000000000000000 --- a/Trigger/TriggerCommon/TriggerMenu/doc/mainpage.h +++ /dev/null @@ -1,31 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - - - -@mainpage - -@section TrigerMenuPythonIntro Introduction - -This package contains only python code which is used to dynamically -generate XML configuration of trigger which are used by HLT::TrigSteer to schedule HLT selection. - -There are 3 types of files here:<br/> -1) flags - which are diffing possible in generation process switches i.e. python::EgammaSliceFlags.py<br/> - This flags contain set of common switches defined in python::CommonSliceFlags.py and set of functions - to operate on them defined in CommonSliceHelper.py<br/> -2) generation classes - which is python code specialized for generation of HLT chains and sequences definition<br/> - The helper objects for it are defined in TrigConfigSvc in python::TriggerPythonConfig.py module. - There are 2 types of generation: simple chains i.e. python::Electron.py and chains composition i.e. - python::MultiElectron.py<br/> -3) generic script for generation - python::GenerateManu.py which drives all the generation. <br/> - It is used by Trigger Getter modules defined in TriggerJobOpts package. - -@htmlinclude used_packages.html - -@include requirements - -*/ diff --git a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CalibDef.py b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CalibDef.py index 4ad25cff2fe43c5079c64d1dfd073a2c80d897c4..4a2c7eb12cfbbb8f1806954d1a3b12daa4acc231 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CalibDef.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/calibcosmicmon/CalibDef.py @@ -20,7 +20,7 @@ from TrigDetCalib.TrigDetCalibConfig import (LArL2ROBListWriter, TileROBSelector, CSCSubDetListWriter, L2ROBListWriter) - +from TriggerMenu.commonUtils.makeCaloSequences import (getFullScanCaloSequences) ########################################################################### # Helper classes ########################################################################### @@ -313,13 +313,8 @@ class L2EFChain_CalibTemplate(L2EFChainDef): # LarNoiseBurst chains ########################################################################### def setupLarNoiseBurstChains(self): - - from TrigGenericAlgs.TrigGenericAlgsConf import PESA__DummyUnseededAllTEAlgo as DummyAlgo - theDummyRoiCreator = DummyAlgo('RoiCreator') - - from TrigCaloRec.TrigCaloRecConfig import TrigCaloCellMaker_jet_fullcalo - theTrigCaloCellMaker_jet_fullcalo = TrigCaloCellMaker_jet_fullcalo("CellMakerFullCalo_topo", doNoise=0, AbsE=True, doPers=True) - + + fullScanSeqMap = getFullScanCaloSequences() from TrigCaloHypo.TrigCaloHypoConfig import EFCaloHypoNoiseConfig if "loose" in self.chainPart['addInfo']: @@ -330,12 +325,12 @@ class L2EFChain_CalibTemplate(L2EFChainDef): theCaloHypo = EFCaloHypoNoiseConfig() - self.L2sequenceList += [['', [theDummyRoiCreator], 'EF_full']] - self.EFsequenceList += [[['EF_full'], [theTrigCaloCellMaker_jet_fullcalo ], 'EF_full_noise']] - self.EFsequenceList += [[['EF_full_noise'],[theCaloHypo], 'jet_hypo']] + self.EFsequenceList += [['',fullScanSeqMap['EF_full'],'EF_full']] + self.EFsequenceList += [[['EF_full'],fullScanSeqMap['EF_full_cell'],'EF_full_cell']] + self.EFsequenceList += [[['EF_full_cell'],[theCaloHypo], 'jet_hypo']] self.L2signatureList += [ [['EF_full']] ] - self.EFsignatureList += [ [['EF_full_noise']] ] + self.EFsignatureList += [ [['EF_full_cell']] ] self.EFsignatureList += [ [['jet_hypo']] ] antiktsize = 0 @@ -343,7 +338,7 @@ class L2EFChain_CalibTemplate(L2EFChainDef): suffix = "_loose" if "loose" in self.chainPart['addInfo'] else "" self.TErenamingDict = { - 'EF_full_noise' : mergeRemovingOverlap('HLT_full__cluster__', 'jr_antikt'+str(antiktsize)+'tc_had' ), + 'EF_full_cell' : mergeRemovingOverlap('HLT_full__cluster__', 'jr_antikt'+str(antiktsize)+'tc_had' ), 'jet_hypo' : mergeRemovingOverlap('HLT_full__cluster__', 'jr_antikt'+str(antiktsize)+'tc_had_noiseHypo'+suffix ), } diff --git a/Trigger/TriggerCommon/TriggerMenu/python/commonUtils/makeCaloSequences.py b/Trigger/TriggerCommon/TriggerMenu/python/commonUtils/makeCaloSequences.py index f2953d9e38c8a8d90072d6c763752b99b696bd6f..fcbbd68174a5607d92010ed4fceb36cf569415e8 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/commonUtils/makeCaloSequences.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/commonUtils/makeCaloSequences.py @@ -2,7 +2,7 @@ import sys import os - +import collections # stop noise from imports - output to /dev/null oldout = sys.stdout @@ -15,8 +15,8 @@ sys.stderr = f try: from TriggerMenu.commonUtils.LeptonIsoEDConfig import TrigHLTEnergyDensityCentral, TrigHLTEnergyDensityForward - from TrigGenericAlgs.TrigGenericAlgsConf import \ - PESA__DummyUnseededAllTEAlgo as DummyAlgo + from TrigGenericAlgs.TrigGenericAlgsConf import (PESA__DummyCombineAlgo, + PESA__DummyUnseededAllTEAlgo as DummyAlgo) from TrigCaloRec.TrigCaloRecConfig import (TrigCaloCellMaker_jet_fullcalo, TrigCaloClusterMaker_topo) @@ -80,6 +80,35 @@ def fullScanTopoClusterSequence(): return SequenceSpecifier(te_in, te_out, alglist).generate() +def getFullScanCaloSequences(): + ''' + Common utility to configure full scan calo algorithms. + To profit from caching, the sequence needs to be broken in steps. + Therefore, this function provides a map where the keys are the + outputTE names that are used amongst clients (and easily accesible to remap dict) + In addition, provide the ED algorithm for isolation chains + For isolation chains, these need to also add to sequence + the dummy merger, to merge full scan back to RoI sequence (not available here) + ''' + caloSeqMap = collections.OrderedDict() + theDummyRoiCreator=DummyAlgo('RoiCreator') + cellMaker=TrigCaloCellMaker_jet_fullcalo('TriggerCaloCellMaker_FS', + doNoise=0, + AbsE=True, + doPers=True) + topoMaker=TrigCaloClusterMaker_topo('TopoCaloClusterMaker_topo_FS', + doMoments=True, + doLC=True) + ed_alg_list = [TrigHLTEnergyDensityCentral("TrigHLTEnergyDensityCentral"), + TrigHLTEnergyDensityForward("TrigHLTEnergyDensityForward")] + + caloSeqMap['EF_full']=[theDummyRoiCreator] + caloSeqMap['EF_full_cell']=[cellMaker] + caloSeqMap['EF_FSTopoClusters']=[topoMaker] + caloSeqMap['EF_FSTopoClustersED'] = ed_alg_list + + return caloSeqMap + def getFullScanTopoClusterEDSequences(): theFullScanTopoClusterSequence = fullScanTopoClusterSequence() theEnergyDensitySequence = EnergyDensitySequence(theFullScanTopoClusterSequence[-1]) diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaDef.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaDef.py index c6c32da393eed156dd79ae230fd0935487266b3b..edd98d22a65bfd9f7972c1ff333db4047aa7c92c 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaDef.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaDef.py @@ -52,16 +52,9 @@ See _gensequence in both classes: from AthenaCommon.Logging import logging logging.getLogger().info("Importing %s",__name__) log = logging.getLogger("TriggerMenu.egamma.EgammaDef") -log.debug('Egamma imports') + # Imports for HLT ID -from TrigFastTrackFinder.TrigFastTrackFinder_Config import TrigFastTrackFinder_eGamma as TrigFastTrackFinder_Electron from TrigInDetConf.TrigInDetSequence import TrigInDetSequence -from InDetTrigRecExample.EFInDetConfig import TrigEFIDSequence -from InDetTrigRecExample.EFInDetConfig import TrigEFIDInsideOut_Electron -# Following is Run1 -- can be omitted -from TrigL2SiTrackFinder.TrigL2SiTrackFinder_Config import (TrigL2SiTrackFinder_eGammaA, - TrigL2SiTrackFinder_eGammaB, - TrigL2SiTrackFinder_eGammaC) # Imports for HLT Calo # Note that Egamma now configures slw algorithm (TrigEgammaRec) @@ -69,29 +62,12 @@ from TrigT2CaloEgamma.TrigT2CaloEgammaConfig import (T2CaloEgamma_eGamma, T2CaloEgamma_Ringer) from TrigCaloRec.TrigCaloRecConfig import (TrigCaloCellMaker_eGamma, - TrigCaloTowerMaker_eGamma, - TrigCaloCellMaker_eGamma_cells, - TrigCaloCellMaker_jet_fullcalo, - TrigCaloClusterMaker_topo - ) -from TrigEgammaRec.TrigEgammaToolFactories import TrigCaloClusterMaker_slw - -from TriggerMenu.commonUtils.makeCaloSequences import (fullScanTopoClusterSequence, - EgammaSlwClusterSequence, - EnergyDensitySequence, - getFullScanTopoClusterEDSequences - ) - -from TrigGenericAlgs.TrigGenericAlgsConf import (PESA__DummyCombineAlgo, - PESA__DummyUnseededAllTEAlgo as DummyAlgo) - + TrigCaloTowerMaker_eGamma) +from TrigEgammaRec.TrigEgammaToolFactories import TrigCaloClusterMaker_slw # FEX for Egamma -from TrigEgammaHypo.TrigL2ElectronFexConfig import (L2ElectronFex_1, - L2ElectronFex_L2StarA, - L2ElectronFex_L2StarB, - L2ElectronFex_L2StarC) +from TrigEgammaHypo.TrigL2ElectronFexConfig import L2ElectronFex_1 from TrigEgammaHypo.TrigL2PhotonFexConfig import L2PhotonFex_1 from TrigEgammaRec.TrigEgammaRecConfig import TrigEgammaRec @@ -101,22 +77,10 @@ from TrigEgammaHypo.TrigEFCaloCalibFexConfig import (TrigEFCaloCalibFex_Electron from TrigMultiVarHypo.TrigL2CaloRingerHypoConfig import (TrigL2CaloRingerFexHypo_e_ID, TrigL2CaloRingerFexHypo_e_NoCut, TrigL2CaloRingerFexHypo_e_EtCut, - TrigL2CaloRingerFexHypo_g_EtCut, - TrigL2CaloRingerFexHypo_g_ID, - TrigL2CaloRingerFexHypo_g_NoCut) - -from TrigMultiVarHypo.TrigL2CaloRingerHypoConfig import (TrigL2CaloRingerFex, - TrigL2CaloRingerFex_Empty, - TrigL2CaloRingerHypo_e_ID, - TrigL2CaloRingerHypo_g_ID, - TrigL2CaloRingerHypo_NoCut, - TrigL2CaloRingerHypo_EtCut) + TrigL2CaloRingerFexHypo_g_EtCut) # EF Calo -from TrigHIHypo.UE import (theUEMaker, - theFSCellMaker, - theTrigCaloCellMaker_eGamma, - theElectronUEMonitoring) +from TrigHIHypo.UE import theTrigCaloCellMaker_eGamma as theTrigCaloCellMaker_eGammaHI # Hypos for Egamma from TrigEgammaHypo.TrigL2CaloHypoConfig import (L2CaloHypo_EtCut, @@ -127,12 +91,10 @@ from TrigEgammaHypo.TrigL2CaloHypoConfig import (L2CaloHypo_EtCut, ) from TrigEgammaHypo.TrigL2PhotonHypoConfig import (L2PhotonHypo_g_EtCut, - L2PhotonHypo_g_ID, - L2PhotonHypo_g_NoCut - ) + L2PhotonHypo_g_ID, + L2PhotonHypo_g_NoCut) from TrigEgammaHypo.TrigL2ElectronHypoConfig import (L2ElectronHypo_e_ID, - L2ElectronHypo_e_ID_L2TrkAlg, L2ElectronHypo_e_NoCut) from TrigEgammaHypo.TrigEFCaloHypoConfig import (TrigEFCaloHypo_All, @@ -145,8 +107,6 @@ from TrigEgammaHypo.TrigEFTrackHypoConfig import (EFTrackHypo_e, EFTrackHypo_e_NoCut) from TrigEgammaHypo.TrigEFElectronHypoConfig import (TrigEFElectronHypo_e_ID, - TrigEFElectronHypo_e_ID_EtIsEM, - TrigEFElectronHypo_e_ID_EtIsEM_Iso, TrigEFElectronHypo_e_ID_HI, TrigEFElectronHypo_e_Iso, TrigEFElectronHypo_e_LH, @@ -155,16 +115,12 @@ from TrigEgammaHypo.TrigEFElectronHypoConfig import (TrigEFElectronHypo_e_ID, TrigEFElectronHypo_e_WTP) from TrigEgammaHypo.TrigEFPhotonHypoConfig import (EFPhotonHypo_g_EtCut, - EFPhotonHypo_g_ID_CaloOnly, - EFPhotonHypo_g_NoCut, - EFPhotonHypo_g_ID_CaloOnly_Iso - ) - -from TrigHIHypo.UE import theUEMaker, theFSCellMaker, theTrigCaloCellMaker_eGamma as theTrigCaloCellMaker_eGammaHI + EFPhotonHypo_g_ID_CaloOnly, + EFPhotonHypo_g_NoCut, + EFPhotonHypo_g_ID_CaloOnly_Iso) -from TriggerMenu.egamma.EgammaCleanMonitoring import * -from TriggerMenu.menu.CleanMonitoring import * -log.debug("Imports complete") +from TriggerMenu.egamma.EgammaCleanMonitoring import EgammaChainsToKeepMonitoring +from TriggerMenu.menu.CleanMonitoring import KeepMonitoring, DisableMonitoringButValAndTime # Helper utilities def print_attributes(obj): @@ -204,7 +160,6 @@ class EgammaFexBuilder(object): self._fast_track = [] self._precise_track = [] - self.logger = logging.getLogger('EgammaDef.EgammaFexBuilder') self._fast_calo_egamma = T2CaloEgamma_eGamma() self._fast_calo_ringer = T2CaloEgamma_Ringer() @@ -214,8 +169,8 @@ class EgammaFexBuilder(object): self._egamma_rec_conv = TrigEgammaRec.copy(name = "TrigEgammaRec_Conv_eGamma", doConversions = True,doPrint=False)() self._egamma_rec_noid = TrigEgammaRec.copy(name = "TrigEgammaRec_NoIDEF_eGamma",doTrackMatching = False,doTrackIsolation = False,doPrint=False)() self._egamma_rec_iso = TrigEgammaRec.copy(name = "TrigEgammaRec_Iso_eGamma",PhotonContainerName="egamma_Iso_Photons", - doTrackMatching = False,doTrackIsolation = False, - doCaloTopoIsolation=True,doPrint=False)() + doTrackMatching = False,doTrackIsolation = False, + doCaloTopoIsolation=True,doPrint=False)() self._cell_maker = TrigCaloCellMaker_eGamma() self._tower_maker = TrigCaloTowerMaker_eGamma() self._tower_maker_ion = TrigCaloTowerMaker_eGamma("TrigCaloTowerMaker_eGamma_heavyIon") @@ -227,22 +182,24 @@ class EgammaFexBuilder(object): [self._fast_track, self._precise_track] = TrigInDetSequence("Electron", "electron", "IDTrig").getSequence() self._gensequence = {'fastcalo':self._get_fastcalo, - 'fastrec':self._get_fastrec, - 'fastringer':self._get_fastringer, - 'fasttrack':self._get_fasttrack, - 'precisecalo':self._get_precisecalo, - 'precisecalocalib':self._get_precisecalocalib, - 'precisetrack':self._get_precisetrack, - 'trackrec':self._get_trackrec, - 'preciserec':self._get_preciserec - } + 'fastcalorec':self._get_fastringer, + 'fastcalohypo':self._get_fastcalohypo, + 'fastringer':self._get_fastringer, + 'fastringerhypo':self._get_fastringerhypo, + 'fastrec':self._get_fastrec, + 'fasttrack':self._get_fasttrack, + 'precisecalo':self._get_precisecalo, + 'precisecalocalib':self._get_precisecalocalib, + 'precisetrack':self._get_precisetrack, + 'trackrec':self._get_trackrec, + 'preciserec':self._get_preciserec} EgammaFexBuilder.inst_count += 1 if(EgammaFexBuilder.inst_count > 1): - self.logger.error('EgammaFexBuilder multiple instances %s' % EgammaFexBuilder.inst_count) + log.error('EgammaFexBuilder multiple instances %s' % EgammaFexBuilder.inst_count) - self.logger.debug('EgammaFexBuilder init complete') + log.debug('EgammaFexBuilder init complete') def __str__(self): descr = '' @@ -250,9 +207,9 @@ class EgammaFexBuilder(object): def get_sequences(self,chainDict): ''' Retrieve the correct reco algorithms and sequences for given chain type ''' - chain_part = chainDict['chainParts'] seq = {} for key in self._gensequence: + log.debug('Fex %s'%key) seq[key] = self._gensequence[key](chainDict) return update_map(seq) @@ -268,27 +225,33 @@ class EgammaFexBuilder(object): seq = [self._fast_calo_ringer] else: seq = [self._fast_calo_egamma] - self.logger.debug('fastcalo %s',seq) + log.debug('fastcalo %s',seq) return seq + def _get_fastcalohypo(self,chainDict): + return [] + + def _get_fastringerhypo(self,chainDict): + return [] + def _get_fastringer(self,chainDict): seq = [self._fast_calo_ringer] - self.logger.debug('fastringer %s',seq) + log.debug('fastringer %s',seq) return seq def _get_fasttrack(self,chainDict): seq = self._fast_track - self.logger.debug('fasttrack %s',seq) + log.debug('fasttrack %s',seq) return seq def _get_precisetrack(self,chainDict): seq = self._precise_track - self.logger.debug('precisetrack %s',seq) + log.debug('precisetrack %s',seq) return seq def _get_trackrec(self,chainDict): seq = self._fast_track + self._precise_track - self.logger.debug('hlttrack %s',seq) + log.debug('hlttrack %s',seq) return seq def _get_fastrec(self,chainDict): @@ -299,8 +262,8 @@ class EgammaFexBuilder(object): elif(chain_part['trigType'] == 'g'): seq = [self._fast_photon] else: - logger.error('Trigger type not known, cannot configured fastrec') - self.logger.debug('fastrec %s',seq) + log.error('Trigger type not known, cannot configured fastrec') + log.debug('fastrec %s',seq) return seq def _get_precisecalo(self,chainDict): @@ -316,7 +279,7 @@ class EgammaFexBuilder(object): else: seq = [self._cell_maker,self._tower_maker,self._cluster_maker] - self.logger.debug('precisecalo %s',seq) + log.debug('precisecalo %s',seq) return seq def _get_precisecalocalib(self,chainDict): @@ -327,8 +290,8 @@ class EgammaFexBuilder(object): elif(chain_part['trigType'] == 'g'): seq = [self._photon_calib] else: - logger.error('Trigger type not known, cannot configured precisecalocalib') - self.logger.debug('precisecalocalib %s',seq) + log.error('Trigger type not known, cannot configured precisecalocalib') + log.debug('precisecalocalib %s',seq) return seq def _get_preciserec(self,chainDict): @@ -339,15 +302,15 @@ class EgammaFexBuilder(object): elif(chain_part['trigType'] == 'g'): seq = [self._get_photonrec(chainDict)] else: - logger.error('Trigger type not known, cannot configured preciserec') - self.logger.debug('preciserec %s',seq) + log.error('Trigger type not known, cannot configured preciserec') + log.debug('preciserec %s',seq) return seq def _get_photonrec(self,chainDict): chain_part = chainDict['chainParts'] do_conv = False do_iso = False - self.logger.debug('Photon preciserec') + log.debug('Photon preciserec') if 'addInfo' in chain_part: if 'conv' in chain_part['addInfo']: do_conv = True @@ -356,13 +319,13 @@ class EgammaFexBuilder(object): do_iso = True if do_iso: - self.logger.debug('Photon isolation') + log.debug('Photon isolation') return self._egamma_rec_iso elif do_conv: - self.logger.debug('Photon conversions') + log.debug('Photon conversions') return self._egamma_rec_conv else: - self.logger.debug('Photon default rec') + log.debug('Photon default rec') return self._egamma_rec_noid class EgammaHypoBuilder(object): @@ -385,46 +348,47 @@ class EgammaHypoBuilder(object): ''' Properties of chain required to configure the hypos ''' self._properties = {'threshold':0, - 'IDinfo':'', - 'isoInfo':'', - 'lhInfo':'', - 'etcut':False, - 'perf':False, - 'ringer':False, - 'g':False, - 'e':False, - 'hiptrt':False, - 'ion':False, - 'trkcut':False, - 'idperf':False} + 'IDinfo':'', + 'isoInfo':'', + 'lhInfo':'', + 'etcut':False, + 'perf':False, + 'ringer':False, + 'g':False, + 'e':False, + 'hiptrt':False, + 'ion':False, + 'trkcut':False, + 'idperf':False} self._chain_part = {} - self.logger = logging.getLogger('EgammaDef.EgammaHypoBuilder') ''' Restructure code to return the hypo algorithm for each step this works well for fex sequences ''' self._gensequence = {'fastcalo':self._get_fastcalo, - 'fastrec':self._get_fastrec, - 'fastringer':self._get_fastringer, - 'fasttrack':self._get_fasttrack, - 'precisecalo':self._get_precisecalo, - 'precisecalocalib':self._get_precisecalocalib, - 'precisetrack':self._get_precisetrack, - 'trackrec':self._get_trackrec, - 'preciserec':self._get_preciserec - } + 'fastcalorec':self._get_fastcalorec, + 'fastcalohypo':self._get_fastcalo, + 'fastringer':self._get_fastringer, + 'fastringerhypo':self._get_fastringer, + 'fastrec':self._get_fastrec, + 'fasttrack':self._get_fasttrack, + 'precisecalo':self._get_precisecalo, + 'precisecalocalib':self._get_precisecalocalib, + 'precisetrack':self._get_precisetrack, + 'trackrec':self._get_trackrec, + 'preciserec':self._get_preciserec} self._chain_part = chainDict['chainParts'] self._set_properties() self._set_base_name() self._set_algo_suffix() - self.logger.debug('chainPart %s',self._chain_part) - self.logger.debug('properties %s',self._properties) - self.logger.debug('Name %s, suffix %s' % (self._base_name,self._algo_suffix)) - self.logger.debug('init complete') + log.debug('chainPart %s',self._chain_part) + log.debug('properties %s',self._properties) + log.debug('Name %s, suffix %s' % (self._base_name,self._algo_suffix)) + log.debug('init complete') def __str__(self): descr='' @@ -437,6 +401,7 @@ class EgammaHypoBuilder(object): ''' sequences = {} for key in self._gensequence: + log.debug('Hypo %s'%key) sequences[key] = self._gensequence[key]() # Remove key for algos not defined return update_map(sequences) @@ -450,14 +415,14 @@ class EgammaHypoBuilder(object): def _set_algo_suffix(self): suffix = self._base_name parts = [self._properties['IDinfo'], - self._properties['lhInfo'], - self._properties['isoInfo']] - + self._properties['lhInfo'], + self._properties['isoInfo']] + for item in parts: if item: suffix = suffix + "_" + item - self.logger.debug('Chain Suffix %s' % suffix) + log.debug('Chain Suffix %s' % suffix) self._algo_suffix = suffix def _set_properties(self): @@ -480,22 +445,30 @@ class EgammaHypoBuilder(object): elif val in self._properties: self._properties[val] = True else: - self.logger.debug("Property not required") + log.debug("Property not required") - self.logger.debug("Chain Properties Gotcha %s", self._properties) + log.debug("Chain Properties Gotcha %s", self._properties) def _get_fastcalo(self): seq = [] + #if 'ringer' in self._properties: + # if self._properties['ringer']: + # seq = self._get_fastringer() if self._properties['e']: seq = [self._get_fastcalo_electron()] elif self._properties['g']: seq = [self._get_fastcalo_photon()] else: - self.logger.error("Cannot configure fastcalo_hypo") + log.error("Cannot configure fastcalo_hypo") - self.logger.debug('fastcalo %s',seq) + log.debug('fastcalo %s',seq) return seq + def _get_fastcalorec(self): + seq = [] + log.debug('fastcalorec %s',seq) + return seq + def _get_fastcalo_electron(self): algo = None name = self._base_name @@ -513,7 +486,7 @@ class EgammaHypoBuilder(object): elif idinfo: algo = L2CaloHypo_e_ID("TrigL2CaloHypo_e"+str(thr)+"_"+idinfo,thr,idinfo) else: - self.logger.error("Cannot configure fastcalo_electron") + log.error("Cannot configure fastcalo_electron") return algo def _get_fastcalo_photon(self): @@ -531,7 +504,7 @@ class EgammaHypoBuilder(object): elif idinfo: algo = L2CaloHypo_g7() else: - self.logger.error("Cannot configure fastcalo_photon") + log.error("Cannot configure fastcalo_photon") return algo def _get_fastringer(self): @@ -544,16 +517,16 @@ class EgammaHypoBuilder(object): ''' fex = None hypo = None - name = self._base_name tt = self._chain_part['trigType'] thr = self._properties['threshold'] idinfo = self._properties['IDinfo'] - suffix = self._algo_suffix - - if 'merged' in idinfo or self._properties['hiptrt']: + + if self._properties['hiptrt']: return [None,None] - if self._properties['perf']: + if 'merged' in idinfo: + fex,hypo = TrigL2CaloRingerFexHypo_e_EtCut(thr) + elif self._properties['perf']: if(tt == 'e'): fex,hypo = TrigL2CaloRingerFexHypo_e_NoCut(thr) if(tt == 'g'): @@ -566,14 +539,14 @@ class EgammaHypoBuilder(object): elif idinfo: fex, hypo = TrigL2CaloRingerFexHypo_e_ID(thr,idinfo,tt) else: - self.logger.error('Cannot configure ringer') + log.error('Cannot configure ringer') seq = [fex,hypo] - self.logger.debug('fastringer %s',seq) + log.debug('fastringer %s',seq) return seq def _get_fasttrack(self): seq = [] - self.logger.debug('fasttrack %s',seq) + log.debug('fasttrack %s',seq) return seq def _get_precisetrack(self): @@ -591,14 +564,14 @@ class EgammaHypoBuilder(object): elif idinfo: algo = EFTrackHypo_e("EFTrackHypo_e"+str(thr)+"_"+idinfo,thr) else: - self.logger.error("Cannot configure fastcalo_photon") + log.error("Cannot configure fastcalo_photon") seq = [algo] - self.logger.debug('precisetrack %s',seq) + log.debug('precisetrack %s',seq) return seq def _get_trackrec(self): seq = [] - self.logger.debug('hlttrack %s',seq) + log.debug('hlttrack %s',seq) return seq def _get_fastrec(self): @@ -608,8 +581,8 @@ class EgammaHypoBuilder(object): elif self._properties['g']: seq = [self._get_fastrec_photon()] else: - self.logger.error("Cannot configure fastrec_hypo") - self.logger.debug('fasthypo %s',seq) + log.error("Cannot configure fastrec_hypo") + log.debug('fasthypo %s',seq) return seq def _get_fastrec_electron(self): @@ -617,12 +590,12 @@ class EgammaHypoBuilder(object): name = self._base_name thr = self._properties['threshold'] idinfo = self._properties['IDinfo'] - if self._properties['etcut'] or self._properties['perf']: + if self._properties['etcut'] or self._properties['perf'] or self._properties['idperf']: algo = L2ElectronHypo_e_NoCut("L2ElectronHypo_"+name+"_NoCut",thr ) elif idinfo: algo = L2ElectronHypo_e_ID("TrigL2ElectronHypo_e"+str(thr)+"_"+idinfo,thr,idinfo) else: - self.logger.error("Cannot configure fastrec_electron") + log.error("Cannot configure fastrec_electron") return algo def _get_fastrec_photon(self): @@ -639,12 +612,12 @@ class EgammaHypoBuilder(object): elif idinfo: algo = L2PhotonHypo_g_ID("L2PhotonHypo_g"+str(thr)+"_"+idinfo,thr,idinfo) else: - self.logger.error("Cannot configure fastrec_photon") + log.error("Cannot configure fastrec_photon") return algo def _get_precisecalo(self): seq = [] - self.logger.debug('precisecalo %s',seq) + log.debug('precisecalo %s',seq) return seq def _get_precisecalocalib(self): @@ -652,7 +625,6 @@ class EgammaHypoBuilder(object): algo = None name = self._base_name thr = self._properties['threshold'] - idinfo = self._properties['IDinfo'] if (self._properties['etcut']): if self._properties['ion']: algo = TrigEFCaloHypo_EtCut("TrigEFCaloHypo_"+name+"_EtCut_heavyIon",thr) @@ -668,9 +640,9 @@ class EgammaHypoBuilder(object): elif self._properties['g']: algo = self._get_precisecalocalib_photon() else: - self.logger.error('Cannot configure precisecalocalib') + log.error('Cannot configure precisecalocalib') seq = [algo] - self.logger.debug('precisecalocalib %s',seq) + log.debug('precisecalocalib %s',seq) return seq def _get_precisecalocalib_electron(self): @@ -684,13 +656,13 @@ class EgammaHypoBuilder(object): elif idinfo: algo = TrigEFCaloHypo_All("TrigEFCaloHypo_e"+str(thr)+"_heavyIon",thr) else: - self.logger.error("Cannot configure precisecalobcalib_electron for ion") + log.error("Cannot configure precisecalobcalib_electron for ion") elif self._properties['ringer']: algo = TrigEFCaloHypo_EtCut("TrigEFCaloHypo_"+name+"_EtCut",thr) elif idinfo: algo = TrigEFCaloHypo_e_ID("TrigEFCaloHypo_e"+str(thr)+"_"+idinfo,thr,idinfo) else: - self.logger.error("Cannot configure precisecalobcalib_electron") + log.error("Cannot configure precisecalobcalib_electron") return algo def _get_precisecalocalib_photon(self): @@ -706,7 +678,7 @@ class EgammaHypoBuilder(object): elif idinfo: algo = TrigEFCaloHypo_g_ID("TrigEFCaloHypo_g"+str(thr)+"_"+idinfo,thr,idinfo) else: - self.logger.error("Cannot configure precisecalobcalib_photon") + log.error("Cannot configure precisecalobcalib_photon") return algo def _get_preciserec(self): @@ -716,13 +688,13 @@ class EgammaHypoBuilder(object): elif self._properties['g']: seq = [self._get_photon_hypo()] else: - self.logger.error("Cannot configure preciserec_hypo") - self.logger.debug('preciserec %s',seq) + log.error("Cannot configure preciserec_hypo") + log.debug('preciserec %s',seq) return seq def _get_photon_hypo(self): - self.logger.debug('photon chain') + log.debug('photon chain') algo=None name = self._base_name thr = self._properties['threshold'] @@ -734,7 +706,7 @@ class EgammaHypoBuilder(object): suffix = suffix +"_heavyIon" if not thr: - self.logger.error("Expect a threshold, none given") + log.error("Expect a threshold, none given") return algo if self._properties['hiptrt']: algo = EFPhotonHypo_g_NoCut("TrigEFPhotonHypo_g_hiptrt_NoCut",0) @@ -753,11 +725,11 @@ class EgammaHypoBuilder(object): elif idinfo: algo = EFPhotonHypo_g_ID_CaloOnly("EFPhotonHypo_"+suffix,thr,idinfo) else: - self.logger.error('Cannot configure precise_photon') + log.error('Cannot configure precise_photon') return algo def _get_electron_hypo(self): - self.logger.debug('electron chain') + log.debug('electron chain') algo = None name = self._base_name thr = self._properties['threshold'] @@ -768,7 +740,7 @@ class EgammaHypoBuilder(object): suffix = self._algo_suffix if not thr: - self.logger.error("Expect a threshold, none given") + log.error("Expect a threshold, none given") return algo if self._properties['ion']: @@ -784,7 +756,7 @@ class EgammaHypoBuilder(object): else: algo = TrigEFElectronHypo_e_ID_HI("TrigEFElectronHypo_"+suffix+"_heavyIon",thr,idinfo) else: - logger.error('Cannot configure precise_electorn for ion') + log.error('Cannot configure precise_electorn for ion') elif wtp: algo = TrigEFElectronHypo_e_WTP("TrigEFElectronHypo_e"+str(thr)+"_WTP",thr) elif (self._properties['idperf'] or self._properties['etcut'] or self._properties['perf']): @@ -800,7 +772,7 @@ class EgammaHypoBuilder(object): else: algo = TrigEFElectronHypo_e_ID("TrigEFElectronHypo_"+suffix,thr,idinfo) else: - self.logger.error("Cannot configure electron hypo") + log.error("Cannot configure electron hypo") return algo @@ -823,6 +795,7 @@ class EgammaSequence(object): sequences with key values: self.sequences['fastcalo'] + self.sequences['fastcalohypo'] self.sequences['fastringer'] self.sequences['fasttrack'] self.sequences['fastrec'] @@ -839,15 +812,14 @@ class EgammaSequence(object): Inits EgammaSequence with chainDict and EgammaFexBuilder object merges sequences from Fex and Hypo Builder instances ''' - self.logger = logging.getLogger('EgammaDef.EgammaSequence') self._chain_name = chainDict['chainName'] self._disable_mon = not KeepMonitoring(self._chain_name,EgammaChainsToKeepMonitoring) self._fex = EgammaSequence.fex_obj.get_sequences(chainDict) self._hypoObj = EgammaHypoBuilder(chainDict) self.sequences = {} - self.logger.debug('Fex: %s',EgammaSequence.fex_obj) - self.logger.debug('Hypos: %s',self._hypoObj) - self.logger.debug('init complete') + log.debug('Fex: %s',EgammaSequence.fex_obj) + log.debug('Hypos: %s',self._hypoObj) + log.debug('init complete') def _config_monitoring(self,seq): ''' Disables monitoring for hypos ''' @@ -857,18 +829,30 @@ class EgammaSequence(object): return def get_sequences(self): + log.debug('Get sequences') seq = self._fex hypo = self._hypoObj.get_sequences() + log.debug('Fex: %s',seq) + log.debug('Hypos: %s',hypo) + for step in seq: - self.logger.debug('Creating sequence for step %s', step) + log.debug('Creating sequence for step %s', step) if seq[step]: if step in hypo: - self.logger.debug('Merging %s %s', seq[step],hypo[step]) + log.debug('Merging %s %s', seq[step],hypo[step]) seq[step].extend(hypo[step]) else: - self.logger.debug('No hypo for step %s ', step) + log.debug('No hypo for step %s ', step) else: - self.logger.error('Step %s found, sequence empty for fex ', step) + log.debug('Step %s found, sequence empty for fex ', step) + seq[step]=hypo[step] + # The sequences are cleaned to remove None + # Now need to check for hypos that don't have fex + # Allows to reset some hypos in a setup function + for step in hypo: + if step not in seq: + log.debug('Hypo only step %s ', step) + seq[step]=hypo[step] if ( self._disable_mon ): self._config_monitoring(hypo) self.sequences = seq @@ -882,29 +866,30 @@ class EgammaSequence(object): if(algo): descr = descr + '%s, ' % (algo.name()) else: - self.logger.debug('no algo added for sequence %s ' % step) + log.debug('no algo added for sequence %s ' % step) descr = descr + '\n' return descr def print_sequence(self,step): for algo in self.sequences[step]: if algo: - self.logger.debug('%s, %s, ' % (step,algo.name())) + log.debug('%s, %s, ' % (step,algo.name())) else: - self.logger.debug('no algo added for sequence %s ' % step) + log.debug('no algo added for sequence %s ' % step) def extend_sequence(self,seq,algo): """Append an algo to a prefined sequence""" sequence = seq.extend([algo]) return sequence + # try to test standalone # Test chain dictionary test_chain_parts = { - 'trigType':'g', - 'threshold':26., - 'IDinfo':'medium', - 'addInfo':'' - } + 'trigType':'g', + 'threshold':26., + 'IDinfo':'medium', + 'addInfo':'' +} test_chainDict = {'chainParts':test_chain_parts, 'chainName':'testChain'} print(test_chainDict) def test_sequence(): diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaSliceFlags.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaSliceFlags.py index 17fed7a48b881864e09a9068ae7361941acc9ebc..db3f019a5e04292775a19fac36c91aa7f04eef64 100755 --- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaSliceFlags.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/egamma/EgammaSliceFlags.py @@ -3,8 +3,8 @@ """ Egamma slice specific flags """ from AthenaCommon.Logging import logging -from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer, jobproperties -from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper, AllowedList +from AthenaCommon.JobProperties import JobProperty, JobPropertyContainer +from TriggerMenu.menu.CommonSliceHelper import CommonSliceHelper __author__ = 'T. Bold, P.Urquijo, R. White' __version__="$Revision: 1.42 $" @@ -45,6 +45,14 @@ class signatures(JobProperty): _flags.append(signatures) +class doRinger(JobProperty): + '''apply ringer selection for Electron chains''' + statusOn=True + allowedTypes=['bool'] + StoredValue=False + +_flags.append(doRinger) + class ringerVersion (JobProperty): """ Version ringer tunes """ statusOn=False @@ -100,9 +108,6 @@ del _flags # make an alias EgammaSliceFlags = TriggerFlags.EgammaSlice -# set properties based on top level trigger flag -from TriggerJobOpts.TriggerFlags import TriggerFlags - run2Flag = TriggerFlags.run2Config if run2Flag is '2016': log.info('EgammaSliceFlags set for %s'%run2Flag) @@ -110,4 +115,3 @@ if run2Flag is '2016': EgammaSliceFlags.clusterCorrectionVersion = None EgammaSliceFlags.calibMVAVersion = 'egammaMVACalib/online/v3' -EgammaSliceFlags.print_JobProperties() diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDef.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDef.py index 287ebcb55cff4b9239f6c156540235f12fb57800..aaec10d58cbe3ebeb7d55e2c1c25c85be63d5de8 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDef.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDef.py @@ -5,15 +5,18 @@ __author__ = 'Moritz Backes & Catrin Bernius' __version__="" __doc__="Implementation of Electron Signature" +import collections from AthenaCommon.Logging import logging -from TriggerMenu.menu.HltConfig import L2EFChainDef, mergeRemovingOverlap -from TriggerMenu.egamma.EgammaCleanMonitoring import * -from TriggerMenu.menu.CleanMonitoring import * +from TriggerMenu.menu.HltConfig import L2EFChainDef, mergeRemovingOverlap from TrigHIHypo.UE import theUEMaker, theFSCellMaker, theElectronUEMonitoring +from TrigMultiVarHypo.TrigL2CaloRingerHypoConfig import TrigL2CaloRingerFexHypo_e_NoCut +from TrigEgammaHypo.TrigEFCaloHypoConfig import TrigEFCaloHypo_EtCut +from TriggerJobOpts.TriggerFlags import TriggerFlags logging.getLogger().info("Importing %s",__name__) log = logging.getLogger("TriggerMenu.egamma.ElectronDef") + ########################################################################################## # # L2 & EF Chain configuration helper classes @@ -24,17 +27,17 @@ class L2EFChain_e(L2EFChainDef): # Define frequently used instances here as class variables - def __init__(self, chainDict, electron_seq): + def __init__(self, chainDict, seqObj): self.L2sequenceList = [] self.EFsequenceList = [] self.L2signatureList = [] self.EFsignatureList = [] - self.TErenamingDict = [] + self.TErenamingDict = {} self.chainPart = chainDict['chainParts'] - self.seqObj = electron_seq - self.sequences = electron_seq.get_sequences() + self.seqObj = seqObj + self.el_sequences = seqObj.get_sequences() self.chainL1Item = chainDict['L1item'] self.chainPartL1Item = self.chainPart['L1item'] @@ -57,15 +60,18 @@ class L2EFChain_e(L2EFChainDef): self.L2InputTE = self.L2InputTE.split("_")[0] self.L2InputTE = self.L2InputTE[1:] if self.L2InputTE[0].isdigit() else self.L2InputTE - + self.use_v7=False + self._ringer_selection=False + self.setRingerSelection() + + #if TriggerFlags.run2Config() == '2017': + if '_v7' in TriggerFlags.triggerMenuSetup(): + self.use_v7=True + # eXXvh_ID type chains: - if self.chainPart['trkInfo']=='idperf': #True:# self.chainPart['IDinfo'] \ - #and not self.chainPart['isoInfo'] \ - #and not self.chainPart['FSinfo'] \ - #and not self.chainPart['recoAlg'] \ - #and not self.chainPart['hypoInfo'] \ - #and not self.chainPart['trkInfo'] \ - #and not self.chainPart['reccalibInfo']: + if self.use_v7: + self.setup_electron() + elif self.chainPart['trkInfo']=='idperf': #True:# self.chainPart['IDinfo'] \ if 'ion' in self.chainPart['extra']: self.setup_eXXvh_idperf_heavyIon() else: @@ -78,7 +84,14 @@ class L2EFChain_e(L2EFChainDef): else: self.setup_eXXvh_ID_run2() - L2EFChainDef.__init__(self, self.chainName, self.L2Name, self.chainCounter, self.chainL1Item, self.EFName, self.chainCounter, self.L2InputTE) + L2EFChainDef.__init__(self, + self.chainName, + self.L2Name, + self.chainCounter, + self.chainL1Item, + self.EFName, + self.chainCounter, + self.L2InputTE) def defineSequences(self): @@ -98,66 +111,129 @@ class L2EFChain_e(L2EFChainDef): def defineTErenaming(self): self.TErenamingMap = self.TErenamingDict + + def setRingerSelection(self): + ''' + determine whether to apply the ringer preselection + can be set globally via TriggerFlag + or by chain type, e.g. idperf + ''' + thr = self.chainPart['threshold'] + log.debug("Apply ringer %s",self._ringer_selection) + + if TriggerFlags.EgammaSlice.doRinger: + log.debug('Ringer selection applied for all chains above 15 GeV %s',thr) + if float(thr)>15.0: + self._ringer_selection=True + else: + self._ringer_selection=False + elif 'ringer' in self.chainPart['addInfo']: + self._ringer_selection = True + elif self.chainPart['trkInfo']=='idperf': + if float(thr)>15.0: + self._ringer_selection=True + else: + self._ringer_selection=False + log.debug("Apply ringer is set %s",self._ringer_selection) -############################### DEFINE GROUPS OF CHAINS HERE ############################## - def setup_eXXvh_idperf(self): - threshold = self.chainPart['threshold'] - IDinfo = self.chainPart['IDinfo'] - isoInfo = self.chainPart['isoInfo'] - run1 = self.chainPart['trkInfo'] - - log.debug('setup_eXXvh_idperf') - log.debug('threshold: %s',threshold) - log.debug('isoInfo: %s',isoInfo) - log.debug('IDinfo: %s',IDinfo) - log.debug('trkInfo: %s',run1) + def setupFromDict(self, seq_te_dict, seq_dict=None): + ''' + Dictionary completely defines steps, algos, sequences, etc.. + pass a dictionary with sequence key values + and tuple with te_out and alias for TE renaming + i.e. seq_te_dict['fastringer']=('L2_e_step1','cl') + ''' - self.L2sequenceList += [[self.L2InputTE, - self.sequences['fastcalo'], - 'L2_e_step1']] + # Use default sequence map if not passed modified map + if seq_dict is None: + seq_dict=self.el_sequences + + log.debug('%s'%seq_dict) + te_in=self.L2InputTE + for step in seq_te_dict: + level=seq_te_dict[step][0].split('_')[0] + te_out=seq_te_dict[step][0] + alias=seq_te_dict[step][-1] + algos=seq_dict[step] + log.debug('%s %s %s %s'%(level,te_in,algos,te_out)) + if level == 'L2': + self.L2sequenceList += [[te_in,algos,te_out]] + self.L2signatureList += [ [[te_out]*self.mult] ] + elif level == 'EF': + self.EFsequenceList += [[te_in,algos,te_out]] + self.EFsignatureList += [ [[te_out]*self.mult] ] + else: + log.error('Sequence TE dictionary incorrect') + te_in=[te_out] + self.TErenamingDict[te_out] = mergeRemovingOverlap(level+'_',self.chainPartNameNoMult+alias) + +############################### DEFINE GROUPS OF CHAINS HERE ############################## + + def setup_electron(self): + ''' + MC_pp_v7 onwards configuration method for electron chains + TrigEMCluster and Ringer reconstruction (same as photons) + Fast Calo-only rejection (w/ ringer or cut-based) + Full track reconstruction + Fast electron reconstruction (optimize pt cut for low/high pt chains) + Mark tracks which match to cluster + Precise Calo + MVA calibration + Et cut hypo on clusters + Offline reco + hypo - self.EFsequenceList += [[['L2_e_step1'], - self.sequences['precisecalo'], - 'EF_e_step1']] + When moving to ringer default, need to make low et chains use cut-based + Also the L2ElectronFex will have low/high et + To preserve backward compt, need to do all this here :( + ''' - self.EFsequenceList += [[['EF_e_step1'], - self.sequences['precisecalocalib'], - 'EF_e_step2']] + # define the ordered dictionary for sequences and TEs - #if 'L2Star' in self.chainPart['addInfo']: - # self.EFsequenceList += [[['EF_e_step2'], - # [theTrigL2SiTrackFinder_eGammaA]+self.theL2StarxAOD+ - # [theTrigL2SiTrackFinder_eGammaB]+self.theL2StarxAOD+ - # [theTrigL2SiTrackFinder_eGammaC]+self.theL2StarxAOD+theEFElectronIDFex, - # 'EF_e_step3']] - self.EFsequenceList += [[['EF_e_step2'], - self.sequences['trackrec'], - 'EF_e_step3']] + thr = self.chainPart['threshold'] + name = str(self.chainPart['threshold']) + name = name.split('.')[0] + log.debug('setup_electron %s, apply ringer %s for %s',self.chainName,self._ringer_selection,thr ) + # Ringer chains not tuned for low-et + # use standard hypo + fastcalohypo=self.el_sequences['fastcalohypo'] + ringerfex,ringerhypo = TrigL2CaloRingerFexHypo_e_NoCut(thr) + # To preserve backward compatibility just remove hypo from calibration step + # Replace by Et cut (marks the clusters as passing) + # Essentially breaks the class design :( + # but + algo = TrigEFCaloHypo_EtCut("TrigEFCaloHypo_e"+name+"_EtCut",thr) + precisecalocalib = self.el_sequences['precisecalocalib'] + precisecalocalib.pop() + precisecalocalib.extend([algo]) + #log.info('RYAN Calo seqeunce %s'%precisecalocalib) + seq_dict = self.el_sequences + seq_dict['precisecalocalib']=precisecalocalib + + if not self._ringer_selection: + seq_dict['fastringerhypo'] = [ringerfex,ringerhypo] + seq_dict['fastcalorec'].extend(fastcalohypo) - self.EFsequenceList += [[['EF_e_step3'], - self.sequences['preciserec'], - 'EF_e_step4']] - - ########### Signatures ########### - - self.L2signatureList += [ [['L2_e_step1']*self.mult] ] - #self.L2signatureList += [ [['L2_e_step2']*self.mult] ] - #self.L2signatureList += [ [['L2_e_step3']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step1']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step2']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step3']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step4']*self.mult] ] + seq_te_dict = collections.OrderedDict() + seq_te_dict['fastcalorec']=('L2_e_step1','cl') + seq_te_dict['fastringerhypo']=('L2_e_step2','clhypo') + seq_te_dict['trackrec']=('L2_e_step3','trk') + seq_te_dict['fastrec']=('L2_e_step4','') + seq_te_dict['precisecalo']=('EF_e_step1','cl') + seq_te_dict['precisecalocalib']=('EF_e_step2','calocalib') + seq_te_dict['preciserec']=('EF_e_step4','') + + self.setupFromDict(seq_te_dict,seq_dict) + + def setup_eXXvh_idperf(self): - ########### TE renaming ########### + seq_te_dict = collections.OrderedDict() + seq_te_dict['fastcalo']=('L2_e_step1','cl') + seq_te_dict['precisecalo']=('EF_e_step1','cl') + seq_te_dict['precisecalocalib']=('EF_e_step2','calocalib') + seq_te_dict['trackrec']=('EF_e_step3','trk') + seq_te_dict['preciserec']=('EF_e_step4','') - self.TErenamingDict = { - 'L2_e_step1': mergeRemovingOverlap('L2_', self.chainPartNameNoMult+'cl'), - 'EF_e_step1': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'cl'), - 'EF_e_step2': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'calocalib'), - 'EF_e_step3': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'trk'), - 'EF_e_step4': mergeRemovingOverlap('EF_', self.chainPartNameNoMult), - } + self.setupFromDict(seq_te_dict) def setup_eXXvh_idperf_heavyIon(self): @@ -172,32 +248,17 @@ class L2EFChain_e(L2EFChainDef): log.debug('IDinfo: %s',IDinfo) log.debug('trkInfo: %s',run1) - precisecalocalib = self.sequences['precisecalocalib'] + # Here we can modify a bit the sequence map (to handle special triggers, e.g. HI) + precisecalocalib = self.el_sequences['precisecalocalib'] precisecalocalib.insert(1,theElectronUEMonitoring) - self.L2sequenceList += [[self.L2InputTE, - self.sequences['fastcalo'], - 'L2_e_step1']] - self.EFsequenceList += [[['L2_e_step1'], - [theFSCellMaker], 'EF_e_step1_fs']] - - self.EFsequenceList += [[['EF_e_step1_fs'], - [theUEMaker], 'EF_e_step1_ue']] - - self.EFsequenceList += [[['L2_e_step1'], - self.sequences['precisecalo'], - 'EF_e_step1']] - self.EFsequenceList += [[['EF_e_step1'], - precisecalocalib, - 'EF_e_step2']] - - self.EFsequenceList += [[['EF_e_step2'], - self.sequences['trackrec'], - 'EF_e_step3']] - - self.EFsequenceList += [[['EF_e_step3'], - self.sequences['preciserec'], - 'EF_e_step4']] + self.L2sequenceList += [[self.L2InputTE,self.el_sequences['fastcalo'],'L2_e_step1']] + self.EFsequenceList += [[['L2_e_step1'],[theFSCellMaker], 'EF_e_step1_fs']] + self.EFsequenceList += [[['EF_e_step1_fs'],[theUEMaker], 'EF_e_step1_ue']] + self.EFsequenceList += [[['L2_e_step1'],self.el_sequences['precisecalo'],'EF_e_step1']] + self.EFsequenceList += [[['EF_e_step1'],precisecalocalib,'EF_e_step2']] + self.EFsequenceList += [[['EF_e_step2'],self.el_sequences['trackrec'],'EF_e_step3']] + self.EFsequenceList += [[['EF_e_step3'],self.el_sequences['preciserec'],'EF_e_step4']] ########### Signatures ########### @@ -222,186 +283,55 @@ class L2EFChain_e(L2EFChainDef): } def setup_eXXvh_ID_ringer(self): - - threshold = self.chainPart['threshold'] - IDinfo = self.chainPart['IDinfo'] - isoInfo = self.chainPart['isoInfo'] - addInfo = self.chainPart['addInfo'] - trkInfo = self.chainPart['trkInfo'] - - log.debug('setup_eXXvh_ID_ringer') - log.debug('threshold: %s',threshold) - log.debug('isoInfo: %s',isoInfo) - log.debug('IDinfo: %s',IDinfo) - log.debug('trkInfo: %s',trkInfo) - - self.L2sequenceList += [[self.L2InputTE, - self.sequences['fastringer'], - 'L2_e_step1']] - - self.EFsequenceList += [[['L2_e_step1'], - self.sequences['precisecalo'], - 'EF_e_step1']] - - self.EFsequenceList += [[['EF_e_step1'], - self.sequences['precisecalocalib'], - 'EF_e_step2']] - - self.EFsequenceList += [[['EF_e_step2'], - self.sequences['trackrec'], - 'EF_e_step3']] - self.EFsequenceList += [[['EF_e_step3'], - self.sequences['preciserec'], - 'EF_e_step4']] - - ########### Signatures ########### - - self.L2signatureList += [ [['L2_e_step1']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step1']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step2']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step3']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step4']*self.mult] ] - ########### TE renaming ########### + seq_te_dict = collections.OrderedDict() + seq_te_dict['fastringer']=('L2_e_step1','cl') + seq_te_dict['precisecalo']=('EF_e_step1','calo') + seq_te_dict['precisecalocalib']=('EF_e_step2','calocalib') + seq_te_dict['trackrec']=('EF_e_step3','id') + seq_te_dict['preciserec']=('EF_e_step4','') - self.TErenamingDict = { - 'L2_e_step1': mergeRemovingOverlap('L2_', self.chainPartNameNoMult+'cl'), - 'EF_e_step1': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'calo'), - 'EF_e_step2': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'calocalib'), - 'EF_e_step3': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'id'), - 'EF_e_step4': mergeRemovingOverlap('EF_', self.chainPartNameNoMult), - } + self.setupFromDict(seq_te_dict) def setup_eXXvh_ID_run2(self): - threshold = self.chainPart['threshold'] - IDinfo = self.chainPart['IDinfo'] - isoInfo = self.chainPart['isoInfo'] - addInfo = self.chainPart['addInfo'] - trkInfo = self.chainPart['trkInfo'] - - log.debug('setup_eXXvh_ID_run2') - log.debug('threshold: %s',threshold) - log.debug('isoInfo: %s',isoInfo) - log.debug('IDinfo: %s',IDinfo) - log.debug('trkInfo: %s',trkInfo) - self.L2sequenceList += [[self.L2InputTE, - self.sequences['fastcalo'], - 'L2_e_step1']] - - self.L2sequenceList += [[['L2_e_step1'], - self.sequences['fasttrack'], - 'L2_e_step2']] - - self.L2sequenceList += [[['L2_e_step2'], - self.sequences['fastrec'], - 'L2_e_step3']] - - self.EFsequenceList += [[['L2_e_step3'], - self.sequences['precisecalo'], - 'EF_e_step1']] - self.EFsequenceList += [[['EF_e_step1'], - self.sequences['precisecalocalib'], - 'EF_e_step2']] - - self.EFsequenceList += [[['EF_e_step2'], - self.sequences['precisetrack'], - 'EF_e_step3']] - - self.EFsequenceList += [[['EF_e_step3'], - self.sequences['preciserec'], - 'EF_e_step4']] - - ########### Signatures ########### - - self.L2signatureList += [ [['L2_e_step1']*self.mult] ] - self.L2signatureList += [ [['L2_e_step2']*self.mult] ] - self.L2signatureList += [ [['L2_e_step3']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step1']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step2']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step3']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step4']*self.mult] ] - ########### TE renaming ########### + seq_te_dict = collections.OrderedDict() + seq_te_dict['fastcalo']=('L2_e_step1','cl') + seq_te_dict['fasttrack']=('L2_e_step2','id') + seq_te_dict['fastrec']=('L2_e_step3','') + seq_te_dict['precisecalo']=('EF_e_step1','calo') + seq_te_dict['precisecalocalib']=('EF_e_step2','calocalib') + seq_te_dict['precisetrack']=('EF_e_step3','id') + seq_te_dict['preciserec']=('EF_e_step4','') - self.TErenamingDict = { - 'L2_e_step1': mergeRemovingOverlap('L2_', self.chainPartNameNoMult+'cl'), - 'L2_e_step2': mergeRemovingOverlap('L2_', self.chainPartNameNoMult+'id'), - 'L2_e_step3': mergeRemovingOverlap('L2_', self.chainPartNameNoMult), - 'EF_e_step1': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'calo'), - 'EF_e_step2': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'calocalib'), - 'EF_e_step3': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'id'), - 'EF_e_step4': mergeRemovingOverlap('EF_', self.chainPartNameNoMult), - } + self.setupFromDict(seq_te_dict) def setup_eXXvh_ID_run2_heavyIon(self): - threshold = self.chainPart['threshold'] - IDinfo = self.chainPart['IDinfo'] - isoInfo = self.chainPart['isoInfo'] - addInfo = self.chainPart['addInfo'] - trkInfo = self.chainPart['trkInfo'] - - log.debug('setup_eXXvh_ID_run2_heavyIon') - log.debug('threshold: %s',threshold) - log.debug('isoInfo: %s',isoInfo) - log.debug('IDinfo: %s',IDinfo) - log.debug('trkInfo: %s',trkInfo) - precisecalocalib = self.sequences['precisecalocalib'] + precisecalocalib = self.el_sequences['precisecalocalib'] precisecalocalib.insert(1,theElectronUEMonitoring) - self.L2sequenceList += [[self.L2InputTE, - self.sequences['fastcalo'], - 'L2_e_step1']] - - self.L2sequenceList += [[['L2_e_step1'], - self.sequences['fasttrack'], - 'L2_e_step2']] - - self.L2sequenceList += [[['L2_e_step2'], - self.sequences['fastrec'], - 'L2_e_step3']] + + seq_dict = self.el_sequences + seq_dict['precisecalocalib']=precisecalocalib + + seq_te_dict = collections.OrderedDict() + seq_te_dict['fastcalo']=('L2_e_step1','cl') + seq_te_dict['fasttrack']=('L2_e_step2','id') + seq_te_dict['fastrec']=('L2_e_step3','') + seq_te_dict['precisecalo']=('EF_e_step1','calo') + seq_te_dict['precisecalocalib']=('EF_e_step2','calocalib') + seq_te_dict['precisetrack']=('EF_e_step3','id') + seq_te_dict['preciserec']=('EF_e_step4','') - self.EFsequenceList += [[['L2_e_step3'], - [theFSCellMaker], 'EF_e_step1_fs']] - - self.EFsequenceList += [[['EF_e_step1_fs'], - [theUEMaker], 'EF_e_step1_ue']] - - self.EFsequenceList += [[['L2_e_step3'], - self.sequences['precisecalo'], - 'EF_e_step1']] + # First set the normal sequence + self.setupFromDict(seq_te_dict,seq_dict) - self.EFsequenceList += [[['EF_e_step1'], - precisecalocalib, - 'EF_e_step2']] - self.EFsequenceList += [[['EF_e_step2'], - self.sequences['precisetrack'], - 'EF_e_step3']] + # Now insert additional steps + self.EFsequenceList.insert(0,[['L2_e_step3'],[theFSCellMaker], 'EF_e_step1_fs']) + self.EFsequenceList.insert(1,[['EF_e_step1_fs'],[theUEMaker], 'EF_e_step1_ue']) + self.EFsignatureList.insert(0, [['EF_e_step1_fs']] ) + self.EFsignatureList.insert(1, [['EF_e_step1_ue']] ) + + self.TErenamingDict['EF_e_step1_fs']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'fs') + self.TErenamingDict['EF_e_step1_ue']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'ue') - self.EFsequenceList += [[['EF_e_step3'], - self.sequences['preciserec'], - 'EF_e_step4']] - - ########### Signatures ########### - - self.L2signatureList += [ [['L2_e_step1']*self.mult] ] - self.L2signatureList += [ [['L2_e_step2']*self.mult] ] - self.L2signatureList += [ [['L2_e_step3']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step1_fs']] ] - self.EFsignatureList += [ [['EF_e_step1_ue']] ] - self.EFsignatureList += [ [['EF_e_step1']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step2']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step3']*self.mult] ] - self.EFsignatureList += [ [['EF_e_step4']*self.mult] ] - ########### TE renaming ########### - - self.TErenamingDict = { - 'L2_e_step1': mergeRemovingOverlap('L2_', self.chainPartNameNoMult+'cl'), - 'L2_e_step2': mergeRemovingOverlap('L2_', self.chainPartNameNoMult+'id'), - 'L2_e_step3': mergeRemovingOverlap('L2_', self.chainPartNameNoMult), - 'EF_e_step1_fs': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'fs'), - 'EF_e_step1_ue': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'ue'), - 'EF_e_step1': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'calo'), - 'EF_e_step2': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'calocalib'), - 'EF_e_step3': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'id'), - 'EF_e_step4': mergeRemovingOverlap('EF_', self.chainPartNameNoMult), - } diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDefIdTest.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDefIdTest.py index 281f477899b224a512419a02f13c0f63c277ffcb..a72dc417b2153fe972aa4a386af6e64eff901077 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDefIdTest.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/egamma/ElectronDefIdTest.py @@ -8,9 +8,8 @@ __doc__="Implementation of Electron Signature" from AthenaCommon.Logging import logging logging.getLogger().info("Importing %s",__name__) -logElectronDef = logging.getLogger("TriggerMenu.egamma.ElectronDef") +log = logging.getLogger("TriggerMenu.egamma.ElectronDef") -from TriggerJobOpts.TriggerFlags import TriggerFlags from TriggerMenu.menu.HltConfig import L2EFChainDef, mergeRemovingOverlap ########################################################################################## @@ -61,7 +60,6 @@ theT2CaloEgamma_cells_e = T2CaloEgamma_cells("T2CaloEgamma_cells") from TrigInDetConf.TrigInDetSequence import TrigInDetSequence [trkfast, trkprec] = TrigInDetSequence("Electron", "electron", "IDTrig").getSequence() -from InDetTrigRecExample.EFInDetConfig import TrigEFIDSequence from TrigInDetConf.TrigInDetSequence import TrigInDetSequence [theFastTrackFinderxAOD] = TrigInDetSequence("Electron","electron","FastxAOD").getSequence() [theL2StarxAOD] = TrigInDetSequence("Electron","electron","L2StarxAOD").getSequence() @@ -169,12 +167,12 @@ class L2EFChain_e(L2EFChainDef): trkInfo = self.chainPart['trkInfo'] L2IDAlg = self.chainPart['L2IDAlg'] - logElectronDef.info('setup_eXXvh_ID') - logElectronDef.info('threshold: %s',threshold) - logElectronDef.info('isoInfo: %s',isoInfo) - logElectronDef.info('IDinfo: %s',IDinfo) - logElectronDef.info('addInfo: %s',addInfo) - logElectronDef.info('trkInfo: %s',trkInfo) + log.info('setup_eXXvh_ID') + log.info('threshold: %s',threshold) + log.info('isoInfo: %s',isoInfo) + log.info('IDinfo: %s',IDinfo) + log.info('addInfo: %s',addInfo) + log.info('trkInfo: %s',trkInfo) # common imports required for EtCut and Electron ID chains # L2 Calo FEX @@ -190,9 +188,8 @@ class L2EFChain_e(L2EFChainDef): from TrigEgammaHypo.TrigL2ElectronFexConfig import L2ElectronFex_L2StarA from TrigEgammaHypo.TrigL2ElectronFexConfig import L2ElectronFex_L2StarB from TrigEgammaHypo.TrigL2ElectronFexConfig import L2ElectronFex_L2StarC - from TrigEgammaHypo.TrigL2ElectronFexConfig import L2ElectronFex_all_NoCut # Depends on L2 Strategy - logElectronDef.info('L2IDAlg: %s', self.chainPart['L2IDAlg']) + log.info('L2IDAlg: %s', self.chainPart['L2IDAlg']) if self.chainPart['L2IDAlg']: if L2IDAlg == 'L2StarA': theL2TrackingFex = TrigL2SiTrackFinder_eGammaA() @@ -204,10 +201,10 @@ class L2EFChain_e(L2EFChainDef): theL2TrackingFex = TrigL2SiTrackFinder_eGammaC() theL2ElectronFex = L2ElectronFex_L2StarC() else: - logElectronDef.info('Incorrect L2IDAlg') + log.info('Incorrect L2IDAlg') # Default else: - logElectronDef.info('Use default L2StarA tracking') + log.info('Use default L2StarA tracking') theL2TrackingFex = TrigL2SiTrackFinder_eGammaA() theL2ElectronFex = L2ElectronFex_L2StarA() @@ -252,7 +249,7 @@ class L2EFChain_e(L2EFChainDef): elif self.chainPart['IDinfo']: algoSuffix = "e%s_%s()" % (str(threshold),IDinfo) - logElectronDef.info('chain suffix: %s', algoSuffix) + log.info('chain suffix: %s', algoSuffix) #if 'mvt' in algoSuffix: # algoSuffix = algoSuffix.replace('mvt','') from TrigEgammaHypo.TrigL2CaloHypoConfig import L2CaloHypo_e_ID @@ -281,8 +278,8 @@ class L2EFChain_e(L2EFChainDef): theEFElectronHypo = TrigEFElectronHypo_e_ID("TrigEFElectronHypo_e"+str(threshold)+"_"+str(IDinfo),threshold,IDinfo) else: algoSuffix = "e%s_%s()" % (str(threshold),IDinfo) - logElectronDef.error('Chain %s could not be assembled', self.chainPartName) - logElectronDef.erro('chain suffix: %s', algoSuffix) + log.error('Chain %s could not be assembled', self.chainPartName) + log.erro('chain suffix: %s', algoSuffix) return False ########### Sequences ########### @@ -339,11 +336,11 @@ class L2EFChain_e(L2EFChainDef): isoInfo = self.chainPart['isoInfo'] run1 = self.chainPart['trkInfo'] - logElectronDef.info('setup_eXXvh_idperf') - logElectronDef.info('threshold: %s',threshold) - logElectronDef.info('isoInfo: %s',isoInfo) - logElectronDef.info('IDinfo: %s',IDinfo) - logElectronDef.info('trkInfo: %s',run1) + log.info('setup_eXXvh_idperf') + log.info('threshold: %s',threshold) + log.info('isoInfo: %s',isoInfo) + log.info('IDinfo: %s',IDinfo) + log.info('trkInfo: %s',run1) # L2 Tracking FEX from TrigL2SiTrackFinder.TrigL2SiTrackFinder_Config import TrigL2SiTrackFinder_eGammaA @@ -354,7 +351,7 @@ class L2EFChain_e(L2EFChainDef): theTrigL2SiTrackFinder_eGammaC=TrigL2SiTrackFinder_eGammaC() # EF Calo from TrigCaloRec.TrigCaloRecConfig import TrigCaloCellMaker_eGamma_cells - theTrigCaloCellMaker_eGamma_cells= TrigCaloCellMaker_eGamma_cells() + #theTrigCaloCellMaker_eGamma_cells= TrigCaloCellMaker_eGamma_cells() from TrigCaloRec.TrigCaloRecConfig import TrigCaloCellMaker_eGamma, TrigCaloTowerMaker_eGamma, TrigCaloClusterMaker_slw theTrigCaloCellMaker_eGamma = TrigCaloCellMaker_eGamma() theTrigCaloTowerMaker_eGamma = TrigCaloTowerMaker_eGamma() @@ -370,7 +367,6 @@ class L2EFChain_e(L2EFChainDef): #print 'ESETUP', self.chainPart # these can be made more configurable later (according to tracking algorithms etc...) - algoSuffix = "e%s_%s()" % (str(threshold),IDinfo) if 'etcut' in self.chainPart['addInfo']: from TrigEgammaHypo.TrigL2CaloHypoConfig import L2CaloHypo_NoCut from TrigEgammaHypo.TrigEFElectronHypoConfig import TrigEFElectronHypo_e_EtCut @@ -434,14 +430,13 @@ class L2EFChain_e(L2EFChainDef): threshold = self.chainPart['threshold'] IDinfo = self.chainPart['IDinfo'] isoInfo = self.chainPart['isoInfo'] - addInfo = self.chainPart['addInfo'] trkInfo = self.chainPart['trkInfo'] - logElectronDef.info('setup_eXXvh_ID_run2') - logElectronDef.info('threshold: %s',threshold) - logElectronDef.info('isoInfo: %s',isoInfo) - logElectronDef.info('IDinfo: %s',IDinfo) - logElectronDef.info('trkInfo: %s',trkInfo) + log.info('setup_eXXvh_ID_run2') + log.info('threshold: %s',threshold) + log.info('isoInfo: %s',isoInfo) + log.info('IDinfo: %s',IDinfo) + log.info('trkInfo: %s',trkInfo) # common imports required for EtCut and Electron ID chains # L2 Calo FEX @@ -489,7 +484,7 @@ class L2EFChain_e(L2EFChainDef): elif self.chainPart['IDinfo']: algoSuffix = "e%s_%s()" % (str(threshold),IDinfo) - logElectronDef.info('chain suffix: %s', algoSuffix) + log.info('chain suffix: %s', algoSuffix) #if 'mvt' in algoSuffix: # algoSuffix = algoSuffix.replace('mvt','') from TrigEgammaHypo.TrigL2CaloHypoConfig import L2CaloHypo_e_ID @@ -514,8 +509,8 @@ class L2EFChain_e(L2EFChainDef): theEFElectronHypo = TrigEFElectronHypo_e_ID("TrigEFElectronHypo_e"+str(threshold)+"_"+str(IDinfo),threshold,IDinfo) else: algoSuffix = "e%s_%s()" % (str(threshold),IDinfo) - logElectronDef.error('Chain %s could not be assembled', self.chainPartName) - logElectronDef.erro('chain suffix: %s', algoSuffix) + log.error('Chain %s could not be assembled', self.chainPartName) + log.erro('chain suffix: %s', algoSuffix) return False ########### Sequences ########### diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/PhotonDef.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/PhotonDef.py index 37ac2c032d5988b080b3566773331aba05b23d1c..97bcb033c5dc583c674d3c32ed96b5d5ef337905 100755 --- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/PhotonDef.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/egamma/PhotonDef.py @@ -5,25 +5,17 @@ __author__ = 'Moritz Backes & Catrin Bernius' __version__="" __doc__="Implementation of Photon Signature" - +import collections from AthenaCommon.Logging import logging logging.getLogger().info("Importing %s",__name__) log = logging.getLogger("TriggerMenu.egamma.PhotonDef") from TriggerJobOpts.TriggerFlags import TriggerFlags -from TriggerMenu.menu.TriggerPythonConfig import * -from TriggerMenu.menu.HltConfig import * - +from TriggerMenu.menu.HltConfig import L2EFChainDef, mergeRemovingOverlap from TrigHIHypo.UE import theUEMaker, theFSCellMaker from TrigInDetConf.TrigInDetSequence import TrigInDetSequence - -from TrigGenericAlgs.TrigGenericAlgsConf import (PESA__DummyCombineAlgo, - PESA__DummyUnseededAllTEAlgo as DummyAlgo) - -from TriggerMenu.commonUtils.makeCaloSequences import (fullScanTopoClusterSequence, - EgammaSlwClusterSequence, - EnergyDensitySequence, - getFullScanTopoClusterEDSequences) +from TrigGenericAlgs.TrigGenericAlgsConf import PESA__DummyCopyAllTEAlgo +from TriggerMenu.commonUtils.makeCaloSequences import getFullScanCaloSequences from TrigTRTHighTHitCounter.TrigTRTHighTHitCounterConf import TrigTRTHTHCounter, TrigTRTHTHhypo ################## # @@ -37,21 +29,19 @@ class L2EFChain_g(L2EFChainDef): # Define frequently used instances here as class variables [theTRTDataPrep] = TrigInDetSequence("Electron","electron","TRTdata").getSequence() - #theTrigTRTHTHCounter = TrigTRTHTHCounter() - #theTrigTRTHTHhypo = TrigTRTHTHhypo() hip_trt_seq = theTRTDataPrep+[TrigTRTHTHCounter(), TrigTRTHTHhypo()] - DummyMergerAlgo = PESA__DummyCombineAlgo("DummyMergerAlgo") - def __init__(self, chainDict, photon_seq): - + DummyMergerAlgo = PESA__DummyCopyAllTEAlgo("DummyMergerAlgo") + fullScanSeqMap = getFullScanCaloSequences() + def __init__(self, chainDict, seqObj): self.L2sequenceList = [] self.EFsequenceList = [] self.L2signatureList = [] self.EFsignatureList = [] - self.TErenamingDict = [] + self.TErenamingDict = {} self.chainPart = chainDict['chainParts'] - self.seqObj = photon_seq - self.sequences = photon_seq.get_sequences() + self.seqObj = seqObj + self.ph_sequences = seqObj.get_sequences() self.chainL1Item = chainDict['L1item'] self.chainPartL1Item = self.chainPart['L1item'] @@ -64,7 +54,6 @@ class L2EFChain_g(L2EFChainDef): self.chainPartName = self.chainPart['chainPartName'] self.chainPartNameNoMult = self.chainPartName[1:] if self.mult > 1 else self.chainPartName self.chainPartNameNoMult += "_"+self.chainL1Item - self.L2InputTE = self.chainPartL1Item or self.chainL1Item # cut of L1_, _EMPTY,..., & multiplicity @@ -74,39 +63,46 @@ class L2EFChain_g(L2EFChainDef): self.L2InputTE = self.L2InputTE.split("_")[0] self.L2InputTE = self.L2InputTE[1:] if self.L2InputTE[0].isdigit() else self.L2InputTE - log.debug('Sequences %s ' % (self.sequences)) + self.use_v7=False + #if TriggerFlags.run2Config()=='2017': + if '_v7' in TriggerFlags.triggerMenuSetup(): + self.use_v7=True + + self.doIsolation=False + if ('ivloose' in self.chainPart['isoInfo'] or + 'iloose' in self.chainPart['isoInfo'] or + 'itight' in self.chainPart['isoInfo']): + self.doIsolation=True + + log.debug('Sequences %s ', self.ph_sequences) # gXX_ID type chains: - #if True: #not self.chainPart['extra'] \ - #and self.chainPart['IDinfo'] \ - #and not self.chainPart['isoInfo'] \ - #and not self.chainPart['FSinfo'] \ - #and not self.chainPart['recoAlg'] \ - #and not self.chainPart['hypoInfo'] \ - #and not self.chainPart['trkInfo'] \ - #and not self.chainPart['reccalibInfo'] \ - #and not self.chainPart['isoInfo'] \ - #and not self.chainPart['addInfo']: if "hiptrt" in self.chainPart['addInfo']: self.setup_gnocut_hiptrt() - elif 'ringer' in self.chainPart['addInfo']: - self.setup_gXX_ID_ringer() - elif 'ivloose' in self.chainPart['isoInfo']: - self.setup_gXX_ID_iso() - elif 'iloose' in self.chainPart['isoInfo']: - self.setup_gXX_ID_iso() - elif 'itight' in self.chainPart['isoInfo']: - self.setup_gXX_ID_iso() + elif self.use_v7: + self.setup_photon() else: - if 'ion' in self.chainPart['extra']: - self.setup_gXX_ID_heavyIon() + if 'ringer' in self.chainPart['addInfo']: + self.setup_gXX_ID_ringer() + elif self.doIsolation: + self.setup_gXX_ID_iso() else: - self.setup_gXX_ID() + if 'ion' in self.chainPart['extra']: + self.setup_gXX_ID_heavyIon() + else: + self.setup_gXX_ID() #else: # log.error('Chain %s could not be assembled' % (self.chainPartName)) # return False - L2EFChainDef.__init__(self, self.chainName, self.L2Name, self.chainCounter, self.chainL1Item, self.EFName, self.chainCounter, self.L2InputTE) + L2EFChainDef.__init__(self, + self.chainName, + self.L2Name, + self.chainCounter, + self.chainL1Item, + self.EFName, + self.chainCounter, + self.L2InputTE) def defineSequences(self): @@ -125,246 +121,205 @@ class L2EFChain_g(L2EFChainDef): for signature in self.EFsignatureList: self.addEFSignature(*signature) - def defineTErenaming(self): self.TErenamingMap = self.TErenamingDict - + + def setupFromDict(self, seq_te_dict, seq_dict=None): + ''' + Dictionary completely defines steps, algos, sequences, etc.. + pass a dictionary with sequence key values + and tuple with te_out and alias for TE renaming + i.e. seq_te_dict['fastringer']=('L2_e_step1','cl') + ''' + # Use default sequence map if not passed modified map + if seq_dict is None: + seq_dict=self.ph_sequences + #log.info('%s'%seq_dict) + te_in=self.L2InputTE + for step in seq_te_dict: + level=seq_te_dict[step][0].split('_')[0] + te_out=seq_te_dict[step][0] + alias=seq_te_dict[step][-1] + algos=seq_dict[step] + #log.info('%s %s %s %s'%(level,te_in,algos,te_out)) + if level == 'L2': + self.L2sequenceList += [[te_in,algos,te_out]] + self.L2signatureList += [ [[te_out]*self.mult] ] + elif level == 'EF': + self.EFsequenceList += [[te_in,algos,te_out]] + self.EFsignatureList += [ [[te_out]*self.mult] ] + else: + log.error('Sequence TE dictionary incorrect') + te_in=[te_out] + self.TErenamingDict[te_out] = mergeRemovingOverlap(level+'_',self.chainPartNameNoMult+alias) + ############################### DEFINE GROUPS OF CHAINS HERE ############################## + def setup_photon(self): + #log.info('Setup Photon for v7 %s'%self.chainName) + seq_te_dict = collections.OrderedDict() + + # required to preserve some backward compatibility + # need to hack a bit the fastcalo step to use the T2CaloRinger + fastcaloseq = self.ph_sequences['fastcalorec'] + log.debug('Photon L2 sequence %s', fastcaloseq) + fastcaloseq.extend(self.ph_sequences['fastcalohypo']) + log.debug('Photon L2 sequence %s', fastcaloseq) + seq_dict = self.ph_sequences + seq_dict['fastcalo']=fastcaloseq + + seq_te_dict['fastcalo']=('L2_g_step1','_calo') + seq_te_dict['fastrec']=('L2_g_step2','') + seq_te_dict['precisecalo']=('EF_g_step1','_calo') + seq_te_dict['precisecalocalib']=('EF_g_step2','_calocalib') + if not self.doIsolation: + seq_te_dict['preciserec']=('EF_g_step3','') + + self.setupFromDict(seq_te_dict,seq_dict) + + if self.doIsolation: + # full scan topo and merging w/ RoI TEs + te_in='' + pos=2 + for step in self.fullScanSeqMap: + self.EFsequenceList.insert(pos,[[te_in],self.fullScanSeqMap[step],step]) + self.EFsignatureList.insert(pos,[[step]] ) + te_in=step + pos+=1 + + self.EFsequenceList.insert(pos,[ ['EF_g_step2',te_in],[self.DummyMergerAlgo],'EF_gCache_step2']) + self.EFsignatureList.insert(pos,[['EF_gCache_step2']]) + self.EFsequenceList.insert(pos+1,[['EF_gCache_step2'],self.ph_sequences['preciserec'],'EF_g_step3']) + self.EFsignatureList.insert(pos+1,[['EF_g_step3']*self.mult]) - def setup_gXX_ID(self): - threshold = self.chainPart['threshold'] - IDinfo = self.chainPart['IDinfo'] - algoSuffix = "g%s_%s()" % (str(threshold),IDinfo) + ########### TE renaming ########### - # list of required key values for sequences - required_seq = ['fastcalo','fastrec','precisecalo','precisecalocalib','preciserec'] + self.TErenamingDict['EF_full']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fs') + self.TErenamingDict['EF_full_cell']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fscalocell') + self.TErenamingDict['EF_FSTopoClusters']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fscalotopo') + self.TErenamingDict['EF_FSTopoClustersED']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fscalotopoed') + self.TErenamingDict['EF_gCache_step2']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'ED') + self.TErenamingDict['EF_g_step3']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult) - # Check for required sequences - for item in required_seq: - if item not in self.sequences: - log.error('%s sequence not defined', item) - else: - log.info('%s',self.sequences[item]) - log.info('%s', self.seqObj.print_sequence(item)) + # larpeb + if 'larpeb' in self.chainPart['addInfo']: + from TrigDetCalib.TrigDetCalibConfig import LArEFROBListWriter + self.EFsequenceList += [[['EF_g_step3'], + [ LArEFROBListWriter('LArEFROBListWriter_' + self.chainName, + addCTPResult = True, addL2Result = True, addEFResult = True) ], + 'EF_g_step4']] - # caloseq = EgammaSlwClusterSequence('L2_g_step2','EF_g_step1') - ########### Sequences ########### - self.L2sequenceList += [[self.L2InputTE, - self.sequences['fastcalo'], - 'L2_g_step1']] + if 'larpeb' in self.chainPart['addInfo']: + self.EFsignatureList += [ [['EF_g_step4']*self.mult] ] - self.L2sequenceList += [[['L2_g_step1'], - self.sequences['fastrec'], - 'L2_g_step2']] - - self.EFsequenceList += [[['L2_g_step2'], - self.sequences['precisecalo'], - 'EF_g_step1']] - - #self.EFsequenceList += [caloseq] - + if 'larpeb' in self.chainPart['addInfo']: + self.TErenamingDict ['EF_g_step4']= mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_larpeb') - self.EFsequenceList += [[['EF_g_step1'], - self.sequences['precisecalocalib'], - 'EF_g_step2']] - + def setup_gXX_ID(self): - self.EFsequenceList += [[['EF_g_step2'], - self.sequences['preciserec'], - 'EF_g_step3']] + seq_te_dict = collections.OrderedDict() + seq_te_dict['fastcalo']=('L2_g_step1','_calo') + seq_te_dict['fastrec']=('L2_g_step2','') + seq_te_dict['precisecalo']=('EF_g_step1','_calo') + seq_te_dict['precisecalocalib']=('EF_g_step2','_calocalib') + seq_te_dict['preciserec']=('EF_g_step3','') + + self.setupFromDict(seq_te_dict) if 'larpeb' in self.chainPart['addInfo']: from TrigDetCalib.TrigDetCalibConfig import LArEFROBListWriter self.EFsequenceList += [[['EF_g_step3'], [ LArEFROBListWriter('LArEFROBListWriter_' + self.chainName, addCTPResult = True, addL2Result = True, addEFResult = True) ], 'EF_g_step4']] - - ########### Signatures ########### - - self.L2signatureList += [ [['L2_g_step1']*self.mult] ] - self.L2signatureList += [ [['L2_g_step2']*self.mult] ] - self.EFsignatureList += [ [['EF_g_step1']*self.mult] ] - self.EFsignatureList += [ [['EF_g_step2']*self.mult] ] - self.EFsignatureList += [ [['EF_g_step3']*self.mult] ] if 'larpeb' in self.chainPart['addInfo']: self.EFsignatureList += [ [['EF_g_step4']*self.mult] ] - ########### TE renaming ########### - - self.TErenamingDict = { - 'L2_g_step1': mergeRemovingOverlap('L2_', self.chainPartNameNoMult+'_calo'), - 'L2_g_step2': mergeRemovingOverlap('L2_', self.chainPartNameNoMult), - 'EF_g_step1': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_calo'), - 'EF_g_step2': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_calocalib'), - 'EF_g_step3': mergeRemovingOverlap('EF_', self.chainPartNameNoMult), - } - if 'larpeb' in self.chainPart['addInfo']: self.TErenamingDict ['EF_g_step4']= mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_larpeb') def setup_gXX_ID_iso(self): - threshold = self.chainPart['threshold'] - IDinfo = self.chainPart['IDinfo'] - isoInfo = self.chainPart['isoInfo'] - algoSuffix = "g%s_%s()" % (str(threshold),IDinfo) - - # list of required key values for sequences - required_seq = ['fastcalo','fastrec','precisecalo','precisecalocalib','preciserec'] - fullScanTopoEDSequences = getFullScanTopoClusterEDSequences() - - ########### Sequences ########### - self.L2sequenceList += [[self.L2InputTE, - self.sequences['fastcalo'], - 'L2_g_step1']] - - self.L2sequenceList += [[['L2_g_step1'], - self.sequences['fastrec'], - 'L2_g_step2']] - - self.EFsequenceList += [[['L2_g_step2'], - self.sequences['precisecalo'], - 'EF_g_step1']] + seq_te_dict = collections.OrderedDict() + seq_te_dict['fastcalo']=('L2_g_step1','_calo') + seq_te_dict['fastrec']=('L2_g_step2','') + seq_te_dict['precisecalo']=('EF_g_step1','_calo') + seq_te_dict['precisecalocalib']=('EF_g_step2','_calocalib') + #seq_te_dict['preciserec']=('EF_g_step3','') + + self.setupFromDict(seq_te_dict) - self.EFsequenceList += [[['EF_g_step1'], - self.sequences['precisecalocalib'], - 'EF_g_step2']] + # full scan topo and merging w/ RoI TEs + te_in='' + pos=2 + for step in self.fullScanSeqMap: + self.EFsequenceList.insert(pos,[[te_in],self.fullScanSeqMap[step],step]) + self.EFsignatureList.insert(pos,[[step]] ) + te_in=step + pos+=1 - self.EFsequenceList += [fullScanTopoEDSequences[0]] - self.EFsequenceList += [fullScanTopoEDSequences[1]] - - self.EFsequenceList += [[ ['EF_g_step2',fullScanTopoEDSequences[1][-1]], - [self.DummyMergerAlgo], - 'EF_gCache_step2']] - - self.EFsequenceList += [[['EF_gCache_step2'], - self.sequences['preciserec'], - 'EF_g_step3']] + self.EFsequenceList.insert(pos,[ ['EF_g_step2',te_in],[self.DummyMergerAlgo],'EF_gCache_step2']) + self.EFsignatureList.insert(pos,[['EF_gCache_step2']]) + self.EFsequenceList.insert(pos+1,[['EF_gCache_step2'],self.ph_sequences['preciserec'],'EF_g_step3']) + self.EFsignatureList.insert(pos+1,[['EF_g_step3']*self.mult]) if 'larpeb' in self.chainPart['addInfo']: from TrigDetCalib.TrigDetCalibConfig import LArEFROBListWriter self.EFsequenceList += [[['EF_g_step3'], - [ LArEFROBListWriter('LArEFROBListWriter_' + self.chainName, addCTPResult = True, addL2Result = True, addEFResult = True) ], + [ LArEFROBListWriter('LArEFROBListWriter_' + self.chainName, + addCTPResult = True, addL2Result = True, addEFResult = True) ], 'EF_g_step4']] - - ########### Signatures ########### - - self.L2signatureList += [ [['L2_g_step1']*self.mult] ] - self.L2signatureList += [ [['L2_g_step2']*self.mult] ] - self.EFsignatureList += [ [['EF_g_step1']*self.mult] ] - self.EFsignatureList += [ [['EF_g_step2']*self.mult] ] - self.EFsignatureList += [ [['EF_gCache_step2']*self.mult] ] - self.EFsignatureList += [ [['EF_g_step3']*self.mult] ] if 'larpeb' in self.chainPart['addInfo']: self.EFsignatureList += [ [['EF_g_step4']*self.mult] ] ########### TE renaming ########### - self.TErenamingDict = { - 'L2_g_step1': mergeRemovingOverlap('L2_', self.chainPartNameNoMult+'_calo'), - 'L2_g_step2': mergeRemovingOverlap('L2_', self.chainPartNameNoMult), - 'EF_g_step1': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_calo'), - 'EF_g_step2': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_calocalib'), - 'EF_gCache_step2': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'ED'), - 'EF_g_step3': mergeRemovingOverlap('EF_', self.chainPartNameNoMult), - } + self.TErenamingDict['EF_full']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fs') + self.TErenamingDict['EF_full_cell']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fscalocell') + self.TErenamingDict['EF_FSTopoClusters']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fscalotopo') + self.TErenamingDict['EF_FSTopoClustersED']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fscalotopoed') + self.TErenamingDict['EF_gCache_step2']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'ED') + self.TErenamingDict['EF_g_step3']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult) if 'larpeb' in self.chainPart['addInfo']: self.TErenamingDict ['EF_g_step4']= mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_larpeb') def setup_gXX_ID_heavyIon(self): - threshold = self.chainPart['threshold'] - IDinfo = self.chainPart['IDinfo'] - algoSuffix = "g%s_%s()" % (str(threshold),IDinfo) - - # list of required key values for sequences - required_seq = ['fastcalo','fastrec','precisecalo','precisecalocalib','preciserec'] - - - ########### Sequences ########### - - self.L2sequenceList += [[self.L2InputTE, - self.sequences['fastcalo'], - 'L2_g_step1']] - - self.L2sequenceList += [[['L2_g_step1'], - self.sequences['fastrec'], - 'L2_g_step2']] - - self.EFsequenceList += [[['L2_g_step2'], - [theFSCellMaker], 'EF_g_step1_fs']] - - self.EFsequenceList += [[['EF_g_step1_fs'], - [theUEMaker], 'EF_g_step1_ue']] - - self.EFsequenceList += [[['L2_g_step2'], - self.sequences['precisecalo'], - 'EF_g_step1']] + seq_te_dict = collections.OrderedDict() + seq_te_dict['fastcalo']=('L2_g_step1','_calo') + seq_te_dict['fastrec']=('L2_g_step2','') + seq_te_dict['precisecalo']=('EF_g_step1','_calo') + seq_te_dict['precisecalocalib']=('EF_g_step2','_calocalib') + seq_te_dict['preciserec']=('EF_g_step3','') - self.EFsequenceList += [[['EF_g_step1'], - self.sequences['precisecalocalib'], - 'EF_g_step2']] + # First set the normal sequence + self.setupFromDict(seq_te_dict) - self.EFsequenceList += [[['EF_g_step2'], - self.sequences['preciserec'], - 'EF_g_step3']] - - ########### Signatures ########### - - self.L2signatureList += [ [['L2_g_step1']*self.mult] ] - self.L2signatureList += [ [['L2_g_step2']*self.mult] ] - self.EFsignatureList += [ [['EF_g_step1_fs']] ] - self.EFsignatureList += [ [['EF_g_step1_ue']] ] - self.EFsignatureList += [ [['EF_g_step1']*self.mult] ] - self.EFsignatureList += [ [['EF_g_step2']*self.mult] ] - self.EFsignatureList += [ [['EF_g_step3']*self.mult] ] + # Now insert additional steps + self.EFsequenceList.insert(0,[['L2_g_step2'],[theFSCellMaker], 'EF_g_step1_fs']) + self.EFsequenceList.insert(1,[['EF_g_step1_fs'],[theUEMaker], 'EF_g_step1_ue']) + self.EFsignatureList.insert(0, [['EF_g_step1_fs']] ) + self.EFsignatureList.insert(1, [['EF_g_step1_ue']] ) - ########### TE renaming ########### - - self.TErenamingDict = { - 'L2_g_step1': mergeRemovingOverlap('L2_', self.chainPartNameNoMult+'_calo'), - 'L2_g_step2': mergeRemovingOverlap('L2_', self.chainPartNameNoMult), - 'EF_g_step1_fs': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fs'), - 'EF_g_step1_ue': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_ue'), - 'EF_g_step1': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_calo'), - 'EF_g_step2': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_calocalib'), - 'EF_g_step3': mergeRemovingOverlap('EF_', self.chainPartNameNoMult), - } + self.TErenamingDict['EF_g_step1_fs']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fs') + self.TErenamingDict['EF_g_step1_ue']=mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_ue') def setup_gnocut_hiptrt(self): # list of required key values for sequences required_seq = ['precisecalo','precisecalocalib','preciserec'] # Check for required sequences for item in required_seq: - if item not in self.sequences: + if item not in self.ph_sequences: log.error('%s sequence not defined', item) else: - log.info('%s', self.seqObj.print_sequence(item)) - # EF Calo - # Reminder that names change for this chain - #theTrigEFCaloHypo = TrigEFCaloHypo_All("TrigEFCaloHypo_g_hiptrt_NoCut",0); - #theEFPhotonHypo = EFPhotonHypo_g_NoCut("TrigEFPhotonHypo_g_hiptrt_NoCut",0) + log.debug('%s', self.seqObj.print_sequence(item)) ########### Sequences ########### - self.L2sequenceList += [[self.L2InputTE, - self.hip_trt_seq, - 'L2_g_step1']] - - self.EFsequenceList += [[['L2_g_step1'], - self.sequences['precisecalo'], - 'EF_g_step1']] - - self.EFsequenceList += [[['EF_g_step1'], - self.sequences['precisecalocalib'], - 'EF_g_step2']] - - self.EFsequenceList += [[['EF_g_step2'], - self.sequences['preciserec'], - 'EF_g_step3']] - + self.L2sequenceList += [[self.L2InputTE,self.hip_trt_seq,'L2_g_step1']] + self.EFsequenceList += [[['L2_g_step1'],self.ph_sequences['precisecalo'],'EF_g_step1']] + self.EFsequenceList += [[['EF_g_step1'],self.ph_sequences['precisecalocalib'],'EF_g_step2']] + self.EFsequenceList += [[['EF_g_step2'],self.ph_sequences['preciserec'],'EF_g_step3']] ########### Signatures ########### @@ -372,42 +327,24 @@ class L2EFChain_g(L2EFChainDef): self.EFsignatureList += [ [['EF_g_step1']*self.mult] ] self.EFsignatureList += [ [['EF_g_step2']*self.mult] ] self.EFsignatureList += [ [['EF_g_step3']*self.mult] ] + ########### TE renaming ########### self.TErenamingDict = { 'L2_g_step1': mergeRemovingOverlap('L2_', self.chainPartNameNoMult), 'EF_g_step1': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_calo'), -# 'EF_g_step2': mergeRemovingOverlap('EF_', self.chainPartNameNoMult), 'EF_g_step2': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_calocalib'), 'EF_g_step3': mergeRemovingOverlap('EF_', self.chainPartNameNoMult), - } + } def setup_gXX_ID_ringer(self): - threshold = self.chainPart['threshold'] - IDinfo = self.chainPart['IDinfo'] - algoSuffix = "g%s_%s()" % (str(threshold),IDinfo) - - # list of required key values for sequences - required_seq = ['fastringer','precisecalo','precisecalocalib','preciserec'] - ########### Sequences ########### - self.L2sequenceList += [[self.L2InputTE, - self.sequences['fastringer'], - 'L2_g_step1']] - - self.EFsequenceList += [[['L2_g_step1'], - self.sequences['preciserec'], - 'EF_g_step1']] - - self.EFsequenceList += [[['EF_g_step1'], - [ self.sequences['precisecalocalib'][0] ], - 'EF_g_step2']] - - self.EFsequenceList += [[['EF_g_step2'], - self.sequences['preciserec'], - 'EF_g_step3']] + self.L2sequenceList += [[self.L2InputTE,self.ph_sequences['fastringer'],'L2_g_step1']] + self.EFsequenceList += [[['L2_g_step1'],self.ph_sequences['preciserec'],'EF_g_step1']] + self.EFsequenceList += [[['EF_g_step1'],[ self.ph_sequences['precisecalocalib'][0] ],'EF_g_step2']] + self.EFsequenceList += [[['EF_g_step2'],self.ph_sequences['preciserec'],'EF_g_step3']] ########### Signatures ########### self.L2signatureList += [ [['L2_g_step1']*self.mult] ] @@ -422,7 +359,7 @@ class L2EFChain_g(L2EFChainDef): 'EF_g_step1': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_calo'), 'EF_g_step2': mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_calocalib'), 'EF_g_step3': mergeRemovingOverlap('EF_', self.chainPartNameNoMult), - } + } diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/generateElectronChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/generateElectronChainDefs.py index 8946d2d6f63a889ba1c89c0c59f626c1f81e208c..8df8c0fb336fe919914a69a5dde75534beb0f0df 100755 --- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/generateElectronChainDefs.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/egamma/generateElectronChainDefs.py @@ -19,7 +19,7 @@ except: log.info(traceback.print_exc()) #from TriggerJobOpts.TriggerFlags import TriggerFlags -from TriggerMenu.menu.MenuUtils import * +from TriggerMenu.menu.MenuUtils import splitChainDict, mergeChainDefs, setupTopoStartFrom Electrons = [] from TriggerMenu.egamma.EgammaDef import EgammaSequence @@ -27,22 +27,19 @@ from TriggerMenu.egamma.EgammaDef import EgammaSequence ########################################################################################## def generateChainDefs(chainDict): - chainParts = chainDict['chainParts'] listOfChainDicts = splitChainDict(chainDict) listOfChainDefs = [] - for subChainDict in listOfChainDicts: electron_seq = EgammaSequence(subChainDict) - log.info('Egamma Sequence: %s', electron_seq) + log.debug('Egamma Sequence: %s', electron_seq) if "IdTest" in subChainDict["chainParts"]["addInfo"]: Electron = L2EFChain_e_IdTest(subChainDict) else: Electron = L2EFChain_e(subChainDict,electron_seq) listOfChainDefs += [Electron.generateHLTChainDef()] - if len(listOfChainDefs)>1: theChainDef = mergeChainDefs(listOfChainDefs) else: @@ -61,64 +58,37 @@ def _addTopoInfo(theChainDef,chainDict,doAtL2AndEF=True): if signature['listOfTriggerElements'][0][0:2] == "L2": maxL2SignatureIndex = max(maxL2SignatureIndex,signatureIndex) - inputTEsL2 = theChainDef.signatureList[maxL2SignatureIndex]['listOfTriggerElements'] inputTEsEF = theChainDef.signatureList[-1]['listOfTriggerElements'] - L2ChainName = "L2_" + chainDict['chainName'] EFChainName = "EF_" + chainDict['chainName'] - HLTChainName = "HLT_" + chainDict['chainName'] - topoThresh = chainDict['topoThreshold'] topoStartFrom = setupTopoStartFrom(topoThresh,theChainDef) if topoThresh else None if "Jpsiee" in chainDict["topo"]: - topo2StartFrom = None if topoStartFrom: - #L2ChainName = L2ChainName+'_tsf' - #topo2StartFrom = L2ChainName EFChainName = EFChainName+'_tsf' - #from TrigEgammaHypo.TrigL2DielectronMassHypoConfig import TrigL2DielectronMassFex_Jpsiee, TrigL2DielectronMassHypo_Jpsiee from TrigEgammaHypo.TrigEFDielectronMassHypoConfig import TrigEFDielectronMassFex_Jpsi, TrigEFDielectronMassHypo_Jpsi - #L2Fex = TrigL2DielectronMassFex_Jpsiee() - #L2Hypo = TrigL2DielectronMassHypo_Jpsiee() - EFFex = TrigEFDielectronMassFex_Jpsi() EFHypo = TrigEFDielectronMassHypo_Jpsi() - #theChainDef.addSequence([L2Fex, L2Hypo],inputTEsL2,L2ChainName, topo_start_from = topoStartFrom) - #theChainDef.addSignatureL2([L2ChainName]) - - #theChainDef.addSequence([EFFex, EFHypo],inputTEsEF,EFChainName, topo_start_from = topo2StartFrom) theChainDef.addSequence([EFFex, EFHypo],inputTEsEF,EFChainName, topo_start_from = topoStartFrom) theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [EFChainName]) elif "Zeg" in chainDict["topo"]: - - #from TrigEgammaHypo.TrigL2DielectronMassHypoConfig import TrigL2DielectronMassFex_Zeg, TrigL2DielectronMassHypo_Zeg from TrigEgammaHypo.TrigEFDielectronMassHypoConfig import TrigEFDielectronMassFex_Zeg, TrigEFDielectronMassHypo_Zeg - #L2Fex = TrigL2DielectronMassFex_Zeg() - #L2Hypo = TrigL2DielectronMassHypo_Zeg() - EFFex = TrigEFDielectronMassFex_Zeg() EFHypo = TrigEFDielectronMassHypo_Zeg() - #theChainDef.addSequence([L2Fex, L2Hypo],inputTEsL2,L2ChainName) - #theChainDef.addSignatureL2([L2ChainName]) - theChainDef.addSequence([EFFex, EFHypo],inputTEsEF,EFChainName) theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [EFChainName]) elif "Zee" in chainDict["topo"]: - #from TrigEgammaHypo.TrigL2DielectronMassHypoConfig import TrigL2DielectronMassFex_Zee, TrigL2DielectronMassHypo_ZeeTight, TrigL2DielectronMassHypo_Zee - from TrigEgammaHypo.TrigEFDielectronMassHypoConfig import TrigEFDielectronMassFex_Zee, TrigEFDielectronMassHypo_ZeeTight, TrigEFDielectronMassHypo_Zee - - #L2Fex = TrigL2DielectronMassFex_Zee() - #L2Hypo = TrigL2DielectronMassHypo_ZeeTight() + from TrigEgammaHypo.TrigEFDielectronMassHypoConfig import TrigEFDielectronMassFex_Zee, TrigEFDielectronMassHypo_ZeeTight if 'etcut' in chainDict['chainName']: from TrigEgammaHypo.TrigEFDielectronMassHypoConfig import TrigEFDielectronMassFexElectronCluster_Zee, TrigEFDielectronMassHypoElectronCluster_Zee @@ -127,10 +97,6 @@ def _addTopoInfo(theChainDef,chainDict,doAtL2AndEF=True): else: EFFex = TrigEFDielectronMassFex_Zee() EFHypo = TrigEFDielectronMassHypo_ZeeTight() - - - #theChainDef.addSequence([L2Fex, L2Hypo],inputTEsL2,L2ChainName) - #theChainDef.addSignatureL2([L2ChainName]) theChainDef.addSequence([EFFex, EFHypo],inputTEsEF,EFChainName) theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [EFChainName]) @@ -147,266 +113,4 @@ def _addTopoInfo(theChainDef,chainDict,doAtL2AndEF=True): -# chains compatible with pp_v4, ALFA_v2, HI_v2 - -# Electrons += [ -# L2EFChain_e('e5_NoCut_firstempty', 961), # not in v4 menus -# L2EFChain_e('e10_NoCut', 998), # not in v4 menus -# L2EFChain_e('e10_loose', 4513), -# L2EFChain_e('e10_loose1', 854), -# L2EFChain_e('e10_medium1', 149), -# L2EFChain_e('e10_loose1_EM3', 5), -# L2EFChain_e('e15_loose', 4543), -# L2EFChain_e('e15_loose0', 520), -# L2EFChain_e('e15_loose1', 523), -# L2EFChain_e('e15_medium1', 532), -# L2EFChain_e('e15_loose_EM10VH', 777), -# L2EFChain_e('e15_loose1_EM10VH', 778), -# L2EFChain_e('e14_tight', 2114), -# L2EFChain_e('e14_tight1', 960), -# L2EFChain_e('e15_tight', 114), -# L2EFChain_e('e15_HLTtighter', 115), -# L2EFChain_e('e18_tight', 24), -# L2EFChain_e('e20_tight', 25), -# L2EFChain_e('e22_tight', 46), -# L2EFChain_e('e15_tight1', 2600), -# L2EFChain_e('e25_medium', 299), -# L2EFChain_e('e5_medium', 28), -# L2EFChain_e('e5_tight', 978), -# L2EFChain_e('e5_tight1', 979), -# L2EFChain_e('e7_tight', 5411), -# L2EFChain_e('e5_loose1', 146), -# L2EFChain_e('e5_medium1', 116), -# L2EFChain_e('e7_loose1', 145), -# L2EFChain_e('e7_medium1', 952), -# L2EFChain_e('e7_tight_L1EM7', 5412), -# L2EFChain_e('e7T_loose1', 535), -# L2EFChain_e('e7T_medium1', 48), -# L2EFChain_e('e9_tight', 5410), -# L2EFChain_e('e7_tight1', 414), -# L2EFChain_e('e9_tight1', 996), -# L2EFChain_e('e10_medium', 30), -# L2EFChain_e('e12T_loose', 7819), -# L2EFChain_e('e12T_loose1_EM10VH', 7821), -# L2EFChain_e('e11T_medium', 5421), -# L2EFChain_e('e6T_medium', 5422), -# L2EFChain_e('e12_medium', 818), -# L2EFChain_e('e18_loose1', 608), -# L2EFChain_e('e18_medium1', 50), -# L2EFChain_e('e18_medium', 4523), -# L2EFChain_e('e20_medium', 297), -# L2EFChain_e('e25_loose', 32), -# L2EFChain_e('e30_loose', 31), -# L2EFChain_e('e25i5vh_medium2', 113), -# L2EFChain_e('e22i6vh_medium2', 114), -# L2EFChain_e('e25i6vh_medium2', 3862), -# L2EFChain_e('e30_medium', 3831), -# L2EFChain_e('e30vh_medium2', 115), ##mistake -# L2EFChain_e('e33_medium', 248), ##mistake -# L2EFChain_e('e35_medium', 249), ##mistake -# L2EFChain_e('e40_medium', 265), -# L2EFChain_e('e45_medium', 546), -# L2EFChain_e('e45_loose1', 2144), -# L2EFChain_e('e45_medium1', 547), -# L2EFChain_e('e60_loose0', 138), -# L2EFChain_e('e60_loose', 527), -# L2EFChain_e('e60_loose1', 215), -# L2EFChain_e('e60_medium1', 676), -# L2EFChain_e('e4_etcut', 2150), -# L2EFChain_e('e5_etcut', 117), -# L2EFChain_e('e5_loose0', 118), -# L2EFChain_e('e7_etcut', 2151), -# L2EFChain_e('e9_etcut', 2152), -# L2EFChain_e('e10_etcut', 27), -# L2EFChain_e('e11_etcut', 140), -# L2EFChain_e('e13_etcut', 2253), -# L2EFChain_e('e13_etcut_EM7', 2254), -# L2EFChain_e('e14_etcut_L1EM12', 2285), -# L2EFChain_e('e14_etcut', 2259), -# L2EFChain_e('e15vh_loose0', 139), -# L2EFChain_e('e20_etcut', 5200), -# L2EFChain_e('e22_etcut_EM12', 5203), -# L2EFChain_e('e22_etcut', 5201), -# L2EFChain_e('e45_etcut', 5204), -# L2EFChain_e('e60_etcut', 5205), -# L2EFChain_e('e22_etcut_EM5', 5202), -# L2EFChain_e('e13_etcutTRT', 2254), -# L2EFChain_e('e20_medium1', 529), -# L2EFChain_e('e20_medium2', 51), -# L2EFChain_e('e13_etcutTrk', 2280), -# L2EFChain_e('e13_etcutTrk_EM7', 2281), -# L2EFChain_e('e20_etcutTrk', 2282), -# L2EFChain_e('e20_etcutTrk_EM12', 2283), -# L2EFChain_e('e22_etcutTrk', 2284), -# L2EFChain_e('e22_loose', 170), -# L2EFChain_e('e22_loose1', 171), -# L2EFChain_e('e22_loose1_EM16VH', 174), -# L2EFChain_e('e22_looseTrk', 172), -# L2EFChain_e('e12Tvh_medium', 235), -# L2EFChain_e('e12Tvh_medium1', 235), -# L2EFChain_e('e12Tvh_loose1', 234), -# L2EFChain_e('e15vh_medium', 3), -# L2EFChain_e('e15vh_medium1', 10), -# L2EFChain_e('e18vh_medium', 8), -# L2EFChain_e('e18vh_medium1', 9), -# L2EFChain_e('e22vh_medium', 528), -# L2EFChain_e('e22vh_loose0', 628), -# L2EFChain_e('e22vh_loose1', 401), -# L2EFChain_e('e22vh_looseTrk', 402), -# L2EFChain_e('e22vh_medium1', 49), -# L2EFChain_e('e22vh_medium2', 175), -# L2EFChain_e('e22vhi_medium1', 180), -# L2EFChain_e('e24vhi_medium1', 178), -# L2EFChain_e('e24vhi_loose1', 1018), -# L2EFChain_e('e24vh_medium1', 179), -# L2EFChain_e('e24vh_tight1', 176), -# L2EFChain_e('e24vh_loose', 181), -# L2EFChain_e('e24vh_loose0', 632), -# L2EFChain_e('e24vh_loose1', 182), -# L2EFChain_e('e25vh_medium1', 1349), -# L2EFChain_e('e20vhT_medium1', 1414), -# L2EFChain_e('e20vhT_tight1', 1415), -# L2EFChain_e('e24vhi_medium1_L2ET21', 3176), -# L2EFChain_e('e24vhi_medium1_L2ET22', 3177), -# L2EFChain_e('e24vhi_medium1_L2ET23', 3178), -# L2EFChain_e('e24vhi_medium1_L2ET24', 3179), -# L2EFChain_e('e12Tvh_loose1_FTK', 2897), -# L2EFChain_e('e24vh_medium1_FTK', 2898), -# L2EFChain_e('e24vh_medium1_SiTrk', 1001), -# L2EFChain_e('e22vh_medium1_SiTrk', 1005), -# L2EFChain_e('e22_medium_SiTrk', 173), -# L2EFChain_e('e4_etcut_SiTrk', 2153), -# L2EFChain_e('e22vh_medium_SiTrk', 104), -# L2EFChain_e('e5_medium_SiTrk', 1629), -# L2EFChain_e('e5_tight_SiTrk', 2329), -# L2EFChain_e('e5_tight1_SiTrk', 1008), -# L2EFChain_e('e4_etcut_IdScan', 2155), -# L2EFChain_e('e22vh_medium1_IdScan', 1006), -# L2EFChain_e('e24vh_medium1_IdScan', 1002), -# L2EFChain_e('e5_tight1_IdScan', 1009), -# L2EFChain_e('e22vh_medium1_TRT', 1014), -# L2EFChain_e('e4_etcut_TRT', 2154), -# L2EFChain_e('e24vh_medium1_TRT', 1013), -# L2EFChain_e('e5_medium_TRT', 2006), -# L2EFChain_e('e5_tight_TRT', 2330), -# L2EFChain_e('e5_tight1_TRT', 1009), -# L2EFChain_e('e20_loose_TRT', 2016), -# L2EFChain_e_TRT_Ringer('e20_medium_TRT', 105), #not in v4 menu -# L2EFChain_e_TRT_Ringer('e22vh_medium_TRT', 105), #not in v4 menu -# L2EFChain_e_L2Star('e4_etcut_L2StarB', 314), -# L2EFChain_e_L2Star('e4_etcut_L2StarC', 315), -# L2EFChain_e_L2Star('e12Tvh_loose1_L2StarB', 416), -# L2EFChain_e_L2Star('e12Tvh_medium1_L2StarB', 577), -# L2EFChain_e_L2Star('e7_medium1_L2StarB', 414), -# L2EFChain_e_L2Star('e7T_medium1_L2StarB', 327), -# L2EFChain_e_L2Star('e7T_loose1_L2StarB', 634), -# L2EFChain_e_L2Star('e7_loose1_L2StarB', 5123), -# L2EFChain_e_L2Star('e12_medium1_L2StarB', 5124), -# L2EFChain_e_L2Star('e24vh_medium1_L2StarB', 316), -# L2EFChain_e_L2Star('e24vh_medium1_L2StarC', 317), -# L2EFChain_e_L2Star('e5_tight1_L2StarB', 3374), -# L2EFChain_e_L2Star('e5_tight1_L2StarC', 3375), -# L2EFChain_e_NoIDTrkCut('e5_NoCut', 2341), -# L2EFChain_e_NoIDTrkCut('e15_NoCut', 531), -# L2EFChain_e_NoIDTrkCut('e15_NoCut_R1', 2342), -# L2EFChain_e_NoIDTrkCut('e5_medium1_IDTrkNoCut', 234), -# L2EFChain_e_NoIDTrkCut('e15_loose1_IDTrkNoCut', 235), -# L2EFChain_e_NoIDTrkCut('e15_loose1_IDTrkNoCut_R1', 2344), -# L2EFChain_e_NoIDTrkCut('e22vh_medium_IDTrkNoCut', 530), -# L2EFChain_e_NoIDTrkCut('e22vh_medium_IDTrkNoCut_R1', 2347), -# L2EFChain_e_NoIDTrkCut('e22_medium_IDTrkNoCut', 175), -# L2EFChain_e_NoIDTrkCut('e20_loose_IDTrkNoCut', 997), -# L2EFChain_e_NoIDTrkCut('e22_medium_IDTrkNoCut_R1', 2345), -# L2EFChain_e_NoIDTrkCut('e20_loose_IDTrkNoCut_R1', 2346), -# L2EFChain_e_NoIDTrkCut('e24vh_medium1_IDTrkNoCut', 1004), -# L2EFChain_e_NoIDTrkCut('e22vh_medium1_IDTrkNoCut', 1007), -# L2EFChain_e_NoIDTrkCut('e24vh_medium1_IDTrkNoCut_R1', 2348), -# L2EFChain_e_NoIDTrkCut('e22vh_medium1_IDTrkNoCut_R1', 2349), -# L2EFChain_e_NoIDTrkCut_IDT('e24vh_medium1_IDTrkNoCut_IDT', 2450), #not in v4 menu -# L2EFChain_e_noL2ID('e24vhi_medium1_noL2ID', 3181), -# L2EFChain_e_noL2IDnoEFID('e24vhi_medium1_noL2IDnoEFID', 3182), -# L2EFChain_e_noL2IDnoEF('e24vhi_medium1_noL2IDnoEF', 3183), -# L2EFChain_e_noL2noEFID('e24vhi_medium1_noL2noEFID', 3184), -# L2EFChain_e_noL2('e24vhi_medium1_noL2', 3185), -# ] - - -# if (TriggerFlags.triggerMenuSetup() in Lvl1Flags.ALFAv2Menus()): -# Electrons += [ -# L2EFChain_e('e5_tight1_ALFA_ANY', 777), -# L2EFChain_e('e5_tight1_ALFA_MBTS_C', 778), -# L2EFChain_e('e5_tight1_ALFA_MBTS_A', 783), -# L2EFChain_e('e5_tight1_ALFA_ANY_UNPAIREDISO', 784), -# L2EFChain_e('e5_tight1_ALFA_MBTS_C_UNPAIREDISO', 781), -# L2EFChain_e('e5_tight1_ALFA_MBTS_A_UNPAIREDISO', 782), -# ] - -# if TriggerFlags.triggerMenuSetup() in Lvl1Flags.PPv4Menus(): -# Electrons += [ ##e22vh_loose for previous menu is defined in ElectronDef_v2.py -# L2EFChain_e('e22vh_loose', 534), -# ] - -# if TriggerFlags.triggerMenuSetup() in Lvl1Flags.NoVHThresholdMenus(): #v2, v3, HI_v2, HI_v3 -# Electrons += [ -# L2EFChain_e('e12T_medium', 5420), -# L2EFChain_e('e15_medium', 3), -# L2EFChain_e('e20_loose1', 401), -# L2EFChain_e('e20_looseTrk', 402), -# L2EFChain_e('e22_medium', 528), -# L2EFChain_e('e22_medium1', 49), -# L2EFChain_e('e22_medium2', 69), -# L2EFChain_e('e20_medium_SiTrk', 104), -# L2EFChain_e('e22_medium_TRT', 174), -# L2EFChain_e_NoIDTrkCut('e20_medium_IDTrkNoCut', 530), -# L2EFChain_e_NoIDTrkCut('e20_medium_IDTrkNoCut_R1', 2350), -# ] - -# try: -# from TrigEgammaHypo.TrigEFElectronHypoConfig import TrigEFElectronHypo_e24i5_medium1_AthSel -# print 'AthSel code does exist' -# configAthSel=True -# except: -# print 'AthSel code does not exist' -# configAthSel=False - -# if configAthSel: -# Electrons += [ -# L2EFChain_e('e60_medium1_AthSel', 5676), -# L2EFChain_e('e12Tvh_loose1_AthSel', 5234), -# L2EFChain_e('e24vh_loose0_AthSel', 5632), -# L2EFChain_e('e24vhi_medium1_AthSel', 3187), -# L2EFChain_e('e24vhi_medium1_AthLHSel', 3188), -# ] - -# try: -# from TrigL2SiTrackFinder.TrigL2SiTrackFinder_Config import TrigL2SiTrackFinder_eGammaA_Brem -# doABrem=True -# except: -# doABrem=False - -# if doABrem: -# Electrons += [ -# L2EFChain_e('e24vhi_medium1_L2StarABrem', 3180), -# ] - -# try: -# from TrigL2SiTrackFinder.TrigL2SiTrackFinder_Config import TrigL2SiTrackFinder_eGammaA -# configL2Star=True -# except: -# configL2Star=False - -# if configL2Star : -# Electrons += [ -# L2EFChain_e_L2Star('e5_medium_L2StarA', 3370), -# L2EFChain_e_L2Star('e5_medium_L2StarB', 3371), -# L2EFChain_e_L2Star('e5_medium_L2StarC', 3372), -# L2EFChain_e_L2Star('e12_medium_L2StarA', 3373), -# L2EFChain_e_L2Star('e12_medium_L2StarB', 3374), -# L2EFChain_e_L2Star('e12_medium_L2StarC', 3375), -# L2EFChain_e_L2Star('e22vh_medium_L2StarA',3376), -# L2EFChain_e_L2Star('e22vh_medium_L2StarB',3377), -# L2EFChain_e_L2Star('e22vh_medium_L2StarC',3378), -# L2EFChain_e_NoIDTrkCut('e22vh_medium_L2Star_IDTrkNoCut', 1345), -# L2EFChain_e_NoIDTrkCut('e20_L2Star_IDTrkNoCut', 1320), -# ] diff --git a/Trigger/TriggerCommon/TriggerMenu/python/egamma/generatePhotonChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/egamma/generatePhotonChainDefs.py index 8d3de713e49100709cdfd16a72eee03a8ebffc55..676fe8bdbdb52b8cf531d7c86bccf19180032870 100755 --- a/Trigger/TriggerCommon/TriggerMenu/python/egamma/generatePhotonChainDefs.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/egamma/generatePhotonChainDefs.py @@ -6,13 +6,10 @@ __doc__="" __version__="Implementation of Photon Slice single electron signatures" from AthenaCommon.Logging import logging -logging.getLogger().info("Importing %s",__name__) +log = logging.getLogger( 'TriggerMenu.egamma.generatePhotonChainDefs' ) - -from TriggerMenu.egamma.PhotonDef import * - -from TriggerJobOpts.TriggerFlags import TriggerFlags -from TriggerMenu.menu.MenuUtils import * +from TriggerMenu.egamma.PhotonDef import L2EFChain_g +from TriggerMenu.menu.MenuUtils import splitChainDict, mergeChainDefs Photons = [] @@ -21,14 +18,13 @@ from TriggerMenu.egamma.EgammaDef import EgammaSequence ########################################################################################## def generateChainDefs(chainDict): - chainParts = chainDict['chainParts'] listOfChainDicts = splitChainDict(chainDict) listOfChainDefs = [] for subChainDict in listOfChainDicts: photon_seq = EgammaSequence(subChainDict) - log.info('Egamma Sequence: %s', photon_seq) + log.debug('Egamma Sequence: %s', photon_seq) Photon = L2EFChain_g(subChainDict,photon_seq) listOfChainDefs += [Photon.generateHLTChainDef()] @@ -56,7 +52,6 @@ def _addTopoInfo(theChainDef,chainDict,doAtL2AndEF=True): L2ChainName = "L2_" + chainDict['chainName'] EFChainName = "EF_" + chainDict['chainName'] - HLTChainName = "HLT_" + chainDict['chainName'] if "Jpsiee" in chainDict["topo"]: diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py index debfdde11aa0cabbe57a786b6356e3ad702f1eea..24e4dde2e37a1c62fa697b25a3cf7c648dda4945 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/JetSequencesBuilder.py @@ -39,6 +39,17 @@ class AlgList(object): # allow sequence trees by specifing the sequence to follow self.attach_to = attach_to +class AlgStringProxy(object): + + def __init__(self, alg): + self.alg = alg + self.manual_attrs = {} + + def asString(self): + return 'AlgStringProxy: Presintantiated Algorithm instance' + + def __str__(self): + return self.asString() class JetSequencesBuilder(object): """Route incoming ChainConfig to the appropriate sequence @@ -76,6 +87,8 @@ class JetSequencesBuilder(object): self.router = {'fs': self.make_fs, # full scan 'fs2': self.make_fs2, # fsull scan/cellmaker/cluster 'cmfs': self.make_cmfs, # cell/cluster maker full scan + 'cmfs1': self.make_cmfs1, # cell maker full scan + 'cmfs2': self.make_cmfs2, # cluster maker full scan 'ed': self.make_ed, # energy density 'jr': self.make_jr_clusters, # jet rec 'hijr': self.make_hijr, # hi jet rec @@ -96,6 +109,8 @@ class JetSequencesBuilder(object): 'ds': self.make_datascouting, } + # map with common calo sequences + self.calo_seq_map = makeCaloSequences.getFullScanCaloSequences() # object that produces Alg objects self.alg_factory = alg_factory @@ -134,12 +149,13 @@ class JetSequencesBuilder(object): do_trimming = menu_data.fex_params.fex_type == 'jetrec_trimming' seq_order = { # ('tc', 'FS'): ['fs', 'cmfs', 'ed', 'jr'], - ('tc', 'FS', False): ['fs2', 'ed', 'jr'], + #('tc', 'FS', False): ['fs2', 'ed', 'jr'], + ('tc','FS',False): ['fs2','cmfs1','cmfs2','ed','jr'], # ('tc', 'FS'): ['fs', 'cmfs', 'jr'], ('tc', 'PS', False): ['ps', 'cm', 'jr'], ('ion', 'FS', False): ['fs','hicm','hijr'], ('TT', 'FS', False): ['tt', 'jt'], - ('tc', 'FS', True): ['fs2', 'ed', 'tr']}.get((data_type, + ('tc', 'FS', True): ['fs2', 'cmfs1', 'cmfs2','ed', 'tr']}.get((data_type, scan_type, do_trimming), []) @@ -219,22 +235,8 @@ class JetSequencesBuilder(object): """make full scan/CellMaker/ClusterMAker sequence using common code from TriggerMenu""" - sequence = makeCaloSequences.fullScanTopoClusterSequence() - - class AlgStringProxy(object): - - def __init__(self, alg): - self.alg = alg - self.manual_attrs = {} - - def asString(self): - return 'AlgStringProxy: Presintantiated Algorithm instance' - - def __str__(self): - return self.asString() - alg_list = [AlgStringProxy(a) for a in sequence[1]] - return AlgList(alg_list=alg_list, alias=sequence[2]) - + alg_list = [AlgStringProxy(a) for a in self.calo_seq_map['EF_full']] + return AlgList(alg_list=alg_list,alias='EF_full') def make_ps(self): """make partial scan Alglist""" @@ -260,6 +262,14 @@ class JetSequencesBuilder(object): return AlgList(algs, alias=alias) + def make_cmfs1(self): + alg_list = [AlgStringProxy(a) for a in self.calo_seq_map['EF_full_cell']] + return AlgList(alg_list=alg_list,alias='EF_full_cell') + + def make_cmfs2(self): + alg_list = [AlgStringProxy(a) for a in self.calo_seq_map['EF_FSTopoClusters']] + return AlgList(alg_list=alg_list,alias='EF_FSTopoClusters') + def make_ed(self): """Return Energy Density Alg""" diff --git a/Trigger/TriggerCommon/TriggerMenu/python/jet/generateJetChainDefs.py b/Trigger/TriggerCommon/TriggerMenu/python/jet/generateJetChainDefs.py index f45f32787297b79fc33df6eca172bcdf3d263980..4ec6e1b5d890fb7dbdd63a71f97c125c2a7804ac 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/jet/generateJetChainDefs.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/jet/generateJetChainDefs.py @@ -20,6 +20,7 @@ from exc2string import exc2string2 from TriggerMenu.menu.ChainDef import ErrorChainDef import os, inspect +from TriggerMenu.commonUtils.makeCaloSequences import getFullScanCaloSequences # TrigEFHLTJetMassDEta_Config = __import__("TrigHLTJetHypo.TrigEFHLTJetMassDEtaConfig",fromlist=[""]) @@ -104,9 +105,9 @@ def _addTopoInfo(theChainDef,chainDict, topoAlgs, doAtL2AndEF=True): ########################################################################################## def generateMuonClusterLLPchain(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoAlgs): + HLTChainName = "HLT_" + chainDict['chainName'] - if 'EMPTY' in HLTChainName: l1item = 'MU4' elif 'UNPAIRED' in HLTChainName: @@ -116,42 +117,45 @@ def generateMuonClusterLLPchain(theChainDef, chainDict, inputTEsL2, inputTEsEF, # tracking from TrigInDetConf.TrigInDetSequence import TrigInDetSequence - [trkcore, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", "2step").getSequence() - + [trkcore,trkiso,trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", "2step").getSequence() + # muon cluster from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConfig import MuonClusterConfig fexes_l2_MuonCluster = MuonClusterConfig() - # muon cluster hypo + # muon cluster isolation + from TrigL2LongLivedParticles.TrigL2LongLivedParticlesConfig import MuonClusterIsolationConfig + fexes_l2_MuonClusterIsolation = MuonClusterIsolationConfig() + from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoConfig import MuonClusterHypoConfig + hypos_l2_MuonCluster = MuonClusterHypoConfig("MuonClusterHypo_all", maxEta=2.5, midEta=1.0) + + # muon cluster hypo + from TrigLongLivedParticlesHypo.TrigLongLivedParticlesHypoConfig import MuonClusterIsolationHypoConfig if ('noiso' not in topoAlgs): - hypos_l2_MuonCluster = MuonClusterHypoConfig("MuonClusterHypo_primary",maxEta=2.5, numJet=0, numTrk=0) + hypos_l2_MuonClusterIso = MuonClusterIsolationHypoConfig("MuonClusterIsolationHypo_primary", maxEta=2.5, midEta = 1.0, numJet=0, numTrk=0,doIsolation=True) else: - hypos_l2_MuonCluster = MuonClusterHypoConfig("MuonClusterHypo_background",maxEta=2.5, numJet=-1, numTrk=-1) - + hypos_l2_MuonClusterIso = MuonClusterIsolationHypoConfig("MuonClusterIsolationHypo_background", maxEta=2.5, midEta = 1.0, numJet=-1, numTrk=-1,doIsolation=False) -# print "NILS: Called generateMuonClusterLLPchain for chain: "+HLTChainName+" with inputTEs:" -# print inputTEsEF + TE_muonClusters = HLTChainName+'_muonClusters' TEmuonIsoB = HLTChainName+'_muIsoB' TEmuonClusterFex = HLTChainName+'_muClusFex' TEmuonClusterHypo = HLTChainName+'_muClusHypo' - # adding muonIso sequence - theChainDef.addSequence(trkiso+trkprec,l1item, TEmuonIsoB) + # make clusters, then test if they pass the hypo + theChainDef.addSequence([fexes_l2_MuonCluster,hypos_l2_MuonCluster], l1item, TE_muonClusters) + theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [TE_muonClusters]) + + # adding muonIso tracking sequence, seeded by good RoI clusters + theChainDef.addSequence(trkiso+trkprec,TE_muonClusters, TEmuonIsoB) theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [TEmuonIsoB]) - - # adding seq using jetTE and TE from seq above (MuonCluster fex) -# theChainDef.addSequence([fexes_l2_MuonCluster], [TEmuonIsoB, inputTEsEF], TEmuonClusterFex) - theChainDef.addSequence([fexes_l2_MuonCluster,hypos_l2_MuonCluster], [TEmuonIsoB, inputTEsEF], TEmuonClusterFex) - theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [TEmuonClusterFex]) -# # adding MuonCluster hypo -# theChainDef.addSequence([hypos_l2_MuonCluster], TEmuonClusterFex, TEmuonClusterHypo) -# theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [TEmuonClusterHypo]) + # test if clusters pass isolation + theChainDef.addSequence([fexes_l2_MuonClusterIsolation,hypos_l2_MuonClusterIso], [TEmuonIsoB, inputTEsEF], TEmuonClusterFex) + theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, [TEmuonClusterFex]) return theChainDef - ########################################################################################## def generateCaloRatioLLPchain(theChainDef, chainDict, inputTEsL2, inputTEsEF, topoAlgs): HLTChainName = "HLT_" + chainDict['chainName'] @@ -206,17 +210,13 @@ def generateCaloRatioLLPchain(theChainDef, chainDict, inputTEsL2, inputTEsEF, to # adding LoF sequence if ('noiso' not in topoAlgs): # create a dummy roi and get full calo - from TrigGenericAlgs.TrigGenericAlgsConf import PESA__DummyUnseededAllTEAlgo as DummyAlgo - theDummyRoiCreator = DummyAlgo('RoiCreator') - - from TrigCaloRec.TrigCaloRecConfig import TrigCaloCellMaker_jet_fullcalo - theTrigCaloCellMaker_jet_fullcalo = TrigCaloCellMaker_jet_fullcalo("CellMakerFullCalo_topo", doNoise=0, AbsE=True, doPers=True) - - theChainDef.addSequence(theDummyRoiCreator,'', 'EF_full_roi') - theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, ['EF_full_roi']) + fullScanSeqMap = getFullScanCaloSequences() + + theChainDef.addSequence(fullScanSeqMap['EF_full'][0],'', 'EF_full') + theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, ['EF_full']) - theChainDef.addSequence(theTrigCaloCellMaker_jet_fullcalo,'EF_full_roi', 'EF_full_cell') - theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, ['EF_full_cell']) + theChainDef.addSequence(fullScanSeqMap['EF_full_cell'][0],'EF_full', 'EF_full_cell') + theChainDef.addSignature(theChainDef.signatureList[-1]['signature_counter']+1, ['EF_full']) # adding beam halo removal sequence theChainDef.addSequence(theBHremoval, ['EF_full_cell',TE_LogRatioCut],TE_LogRatioCut_Fcalo) diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDef.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDef.py index 9ba2f2a1da23567ea79aa040a0bb230d516fa585..31b494acc9303fe4a3b6a2204d629d17ff191bf6 100755 --- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDef.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/ItemDef.py @@ -581,6 +581,8 @@ class ItemDef: LVL1MenuItem('L1_MU10_2J15_J20' ).setLogic( MU10 & J15.x(2) & J20 & physcond).setTriggerType(TT.calo) LVL1MenuItem('L1_MU4_J50_XE40' ).setLogic( MU4 & J50 & XE40 & physcond).setTriggerType(TT.calo) LVL1MenuItem('L1_2MU4_J40_XE20' ).setLogic( MU4.x(2) & J40 & XE20 & physcond).setTriggerType(TT.calo) + LVL1MenuItem('L1_MU20_J40' ).setLogic( MU20 & J40 & physcond).setTriggerType(TT.calo) ## ATR-14377 + LVL1MenuItem('L1_MU20_XE30' ).setLogic( MU20 & XE30 & physcond) ## ATR-14377 # HI LVL1MenuItem('L1_J15_NZ' ).setLogic( J15 & Not(ZDC_AND) & physcond).setTriggerType(TT.calo) LVL1MenuItem('L1_2J15_NZ').setLogic( J15.x(2) & Not(ZDC_AND) & physcond).setTriggerType(TT.calo) @@ -1290,6 +1292,8 @@ class ItemDef: LVL1MenuItem('L1_J40_DPHI-J20s2XE30').setLogic( J40 & TOPO_10MINDPHI_J20s2_XE30 & physcond) LVL1MenuItem('L1_MU4_J20_XE30_DPHI-J20s2XE30').setLogic( MU4 & J20 & XE30 & TOPO_10MINDPHI_J20s2_XE30 & physcond) LVL1MenuItem('L1_2MU4_J20_XE30_DPHI-J20s2XE30').setLogic( MU4.x(2) & J20 & XE30 & TOPO_10MINDPHI_J20s2_XE30 & physcond) + LVL1MenuItem('L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30').setLogic( MU4 & EM3.x(2) & J20 & XE30 & TOPO_10MINDPHI_J20s2_XE30 & physcond) + LVL1MenuItem('L1_3EM3_J40_XE50_DPHI-J20s2XE50').setLogic( EM3.x(3) & J40 & XE50 & TOPO_10MINDPHI_J20s2_XE50 & physcond) LVL1MenuItem('L1_J40_XE50_DPHI-J20s2XE50').setLogic( J40 & XE50 & TOPO_10MINDPHI_J20s2_XE50 & physcond) @@ -1590,6 +1594,8 @@ class ItemDef: LVL1MenuItem('L1_SC111').setLogic( TOPO_SC111_CJ15abETA26 & physcond) LVL1MenuItem('L1_SC85').setLogic( TOPO_SC85_CJ15abETA26 & physcond) + LVL1MenuItem('L1_TAU60_DR-TAU20ITAU12I' ).setLogic( HA60 & TOPO_0DR28_TAU20abi_TAU12abi & physcond) + except Exception, ex: print "Creation of L1Topo item failed, will abort! Exception is : " , ex raise RuntimeError("Creation of L1Topo item failed, will not continue") diff --git a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_pp_v7.py b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_pp_v7.py index 941208c479e804080822c1f0e5d8f08ae4c2ba41..57b67588ca4f8fbd63a18c17e11ae7a1800319c0 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_pp_v7.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/l1menu/Menu_MC_pp_v7.py @@ -451,6 +451,8 @@ def defineMenu(): #'L1_MU4_J50', 'L1_MU10_2J20','L1_MU10_3J20', 'L1_MU10_2J15_J20', 'L1_2MU4_J40_XE20', + 'L1_MU20_J40', + 'L1_MU20_XE30', # single jet "L1_J12","L1_J15","L1_J20","L1_J25", "L1_J30", "L1_J40", "L1_J50" ,"L1_J75","L1_J85", "L1_J100", "L1_J120", "L1_J400", @@ -716,6 +718,8 @@ def defineMenu(): 'L1_DPHI-CJ20XE50', 'L1_MU4_J20_XE30_DPHI-J20s2XE30', 'L1_2MU4_J20_XE30_DPHI-J20s2XE30', + 'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30', + 'L1_3EM3_J40_XE50_DPHI-J20s2XE50', 'L1_MJJ-900', 'L1_MJJ-800', 'L1_MJJ-700', @@ -798,6 +802,8 @@ def defineMenu(): 'L1_LATE-MU10_XE50', 'L1_LATE-MU10_J50', + 'L1_TAU60_DR-TAU20ITAU12I', + 'L1_SC111', 'L1_SC85', @@ -963,6 +969,7 @@ def defineMenu(): 'L1_MU10_TAU12I-J25' : 73, 'L1_TAU20IM_2J20_XE45' : 74, 'L1_TAU30_UNPAIRED_ISO' :343, + 'L1_TAU60_DR-TAU20ITAU12I' : 76, 'L1_EM15HI_2TAU12IM_XE35' : 78, 'L1_MU10_TAU12IM_XE35' : 81, # 'L1_MU10_TAU12IM_XE40' : 82, @@ -976,6 +983,8 @@ def defineMenu(): 'L1_MU6_J40' : 89, 'L1_MU6_J75' : 90, 'L1_2MU4_J40_XE20' : 331, + 'L1_MU20_J40' : 428, + 'L1_MU20_XE30' : 433, 'L1_J12' : 91, 'L1_J15' : 92, 'L1_J20' : 93, @@ -1209,6 +1218,8 @@ def defineMenu(): 'L1_J40_DPHI-CJ20XE50' : 253, 'L1_MU4_J20_XE30_DPHI-J20s2XE30' : 257, 'L1_2MU4_J20_XE30_DPHI-J20s2XE30' : 271, + 'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30' : 434, + 'L1_3EM3_J40_XE50_DPHI-J20s2XE50' : 435, #SX # 'L1_BPH-DR-2MU4-B_BPH-2M-2MU4-B' : 254, # 'L1_BPH-DR-2MU4-B_BPH-4M8-2MU4-B' : 255, diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/DictFromChainName.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/DictFromChainName.py index 563ce3797db57dbd4dc478ea47105594c983e65e..83225cf19d58673aa28d2ffc6f9240e320d646ca 100755 --- a/Trigger/TriggerCommon/TriggerMenu/python/menu/DictFromChainName.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/DictFromChainName.py @@ -459,9 +459,9 @@ class DictFromChainName(object): chainProperties[prop] = part matchedparts.append(part) - logDict.info("matched parts %s", matchedparts) + logDict.debug("matched parts %s", matchedparts) leftoverparts = set(parts)-set(matchedparts) - logDict.info('leftoverparts %s', leftoverparts) + logDict.debug('leftoverparts %s', leftoverparts) for pindex, part in enumerate(leftoverparts): for prop, allowedValues in allowedSignaturePropertiesAndValues.items(): if prop in chainProperties.keys(): continue diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v6.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v6.py index 3be54d5c8a6b8084bdb30eb9883e0c3cfd6168ea..cf05f85d73ffc415b3fffac007e3bfb5d6354897 100755 --- a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v6.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v6.py @@ -3422,6 +3422,39 @@ ps_Jpsi_list = [ ps_ftk_list = [ ] +ps_Bphys_list = [ + '2mu4_bBmumux_BcmumuDsloose', + '2mu4_bBmumux_BcmumuDsloose_noL2', + 'mu6_mu4_bBmumux_BcmumuDsloose_noL2', + '2mu6_bBmumux_BcmumuDsloose_noL2', + 'mu10_mu6_bBmumux_BcmumuDsloose_noL2', + '2mu10_bBmumux_BcmumuDsloose_noL2', + '2mu4_bBmumux_BcmumuDsloose_noL2_L12MU4-B', + '2mu4_bBmumux_BcmumuDsloose_noL2_L12MU4-BO', + 'mu6_mu4_bBmumux_BcmumuDsloose_noL2_L12MU4-B', + 'mu6_mu4_bBmumux_BcmumuDsloose_noL2_L1MU6MU4-BO', + '2mu6_bBmumux_BcmumuDsloose_noL2_L12MU6-B', + '2mu6_bBmumux_BcmumuDsloose_noL2_L12MU6-BO', + 'mu10_mu6_bBmumux_BcmumuDsloose_noL2_L1LFV-MU', + '2mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-2MU4', + '2mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-2MU4_BPH-0DR15-2MU4', + '2mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4', + 'mu6_mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4', + 'mu6_mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4', + '2mu6_bBmumux_BcmumuDsloose_noL2_L1BPH-2M9-2MU6_BPH-2DR15-2MU6', + '2mu4_bBmumux_BcmumuDsloose_L1BPH-2M8-2MU4_BPH-0DR15-2MU4', + '2mu4_bBmumux_BcmumuDsloose_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4', + '2mu4_bBmumux_BcmumuDsloose_L1BPH-2M9-2MU4_BPH-0DR15-2MU4', + 'mu6_mu4_bBmumux_BcmumuDsloose_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', + '2mu6_bBmumux_BcmumuDsloose_L1LFV-MU6', + '2mu4_bBmumux_LbmumuLambda', + 'mu6_mu4_bBmumux_LbmumuLambda', + '2mu6_bBmumux_LbmumuLambda', + '2mu6_bBmumux_LbmumuLambda_L1LFV-MU6', + '2mu4_bBmumux_LbmumuLambda_L1BPH-2M9-2MU4_BPH-0DR15-2MU4', + 'mu6_mu4_bBmumux_LbmumuLambda_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', + '2mu6_bBmumux_LbmumuLambda_L1BPH-2M9-2MU6_BPH-2DR15-2MU6', +] if TriggerFlags.doFTK(): ps_ftk_list = [ @@ -3547,7 +3580,7 @@ Prescales.HLTPrescales_loose_mc_prescale.update(dict(map(None,chain_list,len(cha Prescales.L1Prescales_tightperf_mc_prescale= deepcopy(Prescales.L1Prescales) Prescales.HLTPrescales_tightperf_mc_prescale = deepcopy(Prescales.HLTPrescales_loose_mc_prescale) -chain_list=ps_eb_list+ps_fwdphys_list+ps_minb_list#+ps_Jpsi_list # enabling JPSI ee again ATR-15162 +chain_list=ps_eb_list+ps_fwdphys_list+ps_minb_list+ps_Bphys_list#+ps_Jpsi_list # enabling JPSI ee again ATR-15162 if not TriggerFlags.doFTK(): chain_list+=ps_ftk_list @@ -3558,7 +3591,7 @@ Prescales.HLTPrescales_tightperf_mc_prescale.update(dict(map(None,chain_list,len ###################################################### Prescales.L1Prescales_tight_mc_prescale = deepcopy(Prescales.L1Prescales) Prescales.HLTPrescales_tight_mc_prescale = deepcopy(Prescales.HLTPrescales_tightperf_mc_prescale) -chain_list=ps_perform_list#+ps_Jpsi_list # enabling JPSI ee again ATR-15162 +chain_list=ps_perform_list+ps_Bphys_list#+ps_Jpsi_list # enabling JPSI ee again ATR-15162 #Prescales.HLTPrescales_tight_mc_prescale = deepcopy(Prescales.HLTPrescales_loose_mc_prescale) #chain_list=ps_eb_list+ps_fwdphys_list+ps_minb_list+ps_ftk_list+ps_perform_list diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v7.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v7.py index 43710a5a41203e4b2e2f6336f3754492c69cfb24..a3acb3561d422b3f7ee17dd9da88ac602a665178 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v7.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/MC_pp_v7.py @@ -38,6 +38,7 @@ def setupMenu(): ['mu24_icalo', 'L1_MU20', [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1], ['mu24_iloosecalo', 'L1_MU20', [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1], ['mu24_imediumcalo', 'L1_MU20', [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1], + ['mu26_ivarmediumcalo', 'L1_MU20', [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1], ['mu20_imedium_mu8noL1', 'L1_MU20', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_imedium','mu8noL1']]], ['mu20_iloose_mu8noL1', 'L1_MU20', ['L1_MU20',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_iloose','mu8noL1']]], @@ -59,14 +60,6 @@ def setupMenu(): ['3mu4_noMuCombOvlpRm', 'L1_3MU4', [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1], ['2mu14_noMuCombOvlpRm', 'L1_2MU10', [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1], - #low-pt multi-muon analyses. ATR-15704 - ['3mu4_mu4noL1', 'L1_3MU4', ['L1_3MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['3mu4','mu4noL1']]], - ['3mu4_mu2noL1', 'L1_3MU4', ['L1_3MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['3mu4','mu2noL1']]], - ['3mu4_nomucomb_mu4noL1', 'L1_3MU4', ['L1_3MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['3mu4_nomucomb','mu4noL1']]], - ['3mu4_nomucomb_mu2noL1', 'L1_3MU4', ['L1_3MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['3mu4_nomucomb','mu2noL1']]], - ['4mu4', 'L1_4MU4', ['L1_4MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['4mu4','']]], - ['4mu4_nomucomb', 'L1_4MU4', ['L1_4MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['4mu4_nomucomb','']]], - # #ATR-15246 ['mu22_mu8noL1_mu6noL1', 'L1_MU20', ['L1_MU20','',''], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1,['serial',-1,['mu22','mu8noL1','mu6noL1']]], @@ -121,6 +114,26 @@ def setupMenu(): ### ATR-14377: remove noComb for tests ['mu20_msonly_mu15noL1_msonly_nscan05', 'L1_MU20', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan05']]], + + ### ATR-14377: nscan with iloosems legs + ['mu20_msonly_iloosems_mu10noL1_msonly_nscan05_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu10noL1_msonly_nscan05_noComb']]], + ['mu20_msonly_iloosems_mu10noL1_msonly_nscan03_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu10noL1_msonly_nscan03_noComb']]], + ['mu20_msonly_iloosems_mu15noL1_msonly_nscan05_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu15noL1_msonly_nscan05_noComb']]], + ['mu20_msonly_iloosems_mu15noL1_msonly_nscan03_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu15noL1_msonly_nscan03_noComb']]], + ['mu20_msonly_iloosems_mu12noL1_msonly_nscan03_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu12noL1_msonly_nscan03_noComb']]], + ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05', 'L1_MU20', ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05']]], + ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05_noComb']]], + ['mu20_msonly_mu6noL1_msonly_nscan03', 'L1_MU20', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan03']]], + ['mu20_msonly_iloosems_mu6noL1_msonly_nscan03', 'L1_MU20', ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan03']]], + ['mu20_msonly_iloosems_mu6noL1_msonly_nscan03_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan03_noComb']]], + + + ### ATR-14377: nscan with different L1 seeds + ['mu20_msonly_mu6noL1_msonly_nscan05_L1MU20_XE30', 'L1_MU20_XE30', ['L1_MU20_XE30','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]], + ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU20_XE30', 'L1_MU20_XE30', ['L1_MU20_XE30','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05']]], + ['mu20_msonly_mu6noL1_msonly_nscan05_L1MU20_J40', 'L1_MU20_J40', ['L1_MU20_J40','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]], + ['mu20_msonly_iloosems_mu6noL1_msonly_nscan05_L1MU20_J40', 'L1_MU20_J40', ['L1_MU20_J40','L2_mu20_msonly_iloosems'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly_iloosems','mu6noL1_msonly_nscan05']]], + #['mu20noL1_calotag_0eta010', '', [], [PhysicsStream], ['RATE:SingleMuon','BW:Muon'], -1,], #['mu20noL1_calotag_0eta500', '', [], [PhysicsStream], ['RATE:SingleMuon','BW:Muon'], -1,], @@ -165,7 +178,6 @@ def setupMenu(): ['mu18_2mu0noL1_JpsimumuFS', 'L1_MU15', ['L1_MU15',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu18','2mu0noL1_JpsimumuFS']]], ['mu18_2mu4_JpsimumuL2', 'L1_MU15', ['L1_MU15','L1_2MU4'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['2mu4_JpsimumuL2','mu18']]], ['3mu4_l2msonly', 'L1_3MU4', [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1], - ['3mu4_nomucomb', 'L1_3MU4', [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1], ['mu6_l2msonly_2mu4_l2msonly_L1MU6_3MU4', 'L1_MU6_3MU4', ['L1_MU6','L1_3MU4'], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1,['serial',-1,['mu6_l2msonly','2mu4_l2msonly']]], ['2mu6_l2msonly_mu4_l2msonly_L12MU6_3MU4', 'L1_2MU6_3MU4', ['L1_2MU6','L1_3MU4'], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1,['serial',-1,['2mu6_l2msonly','mu4_l2msonly']]], @@ -431,7 +443,7 @@ def setupMenu(): # boffperf_split #['j55_boffperf_split', 'L1_J20',[], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], - ['j300_boffperf_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], + ['j300_boffperf_split', 'L1_J75', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], # tagged # ['j100_bmv2c2040_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], @@ -2437,6 +2449,15 @@ def setupMenu(): ['2e5_lhmedium_nod0_j50_xe80_mht_L1J40_XE50_DPHI-J20s2XE50', 'L1_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2e5_lhmedium_nod0","j50","xe80_mht"] ]], + #['e5_lhmedium_nod0_mu4_xe40_mht_L12EM3_MU4_J20_XE30_DPHI-J20s2XE30', 'L1_2EM3_MU4_J20_XE30_DPHI-J20s2XE30', ['L1_EM3','',''], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","mu4","xe40_mht"] ]], + ['e5_lhmedium_nod0_mu4_xe40_mht_L1MU4_2EM3_J20_XE30_DPHI-J20s2XE30', 'L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30', ['L1_EM3','',''], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["e5_lhmedium_nod0","mu4","xe40_mht"] ]], + + ['2e5_lhmedium_nod0_j50_xe80_mht_L13EM3_J40_XE50_DPHI-J20s2XE50', 'L1_3EM3_J40_XE50_DPHI-J20s2XE50', ['L1_EM3','',''], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2e5_lhmedium_nod0","j50","xe80_mht"] ]], + + ['e5_lhmedium_nod0', 'L1_EM3', ['L1_EM3','',''], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], + + ['2mu4_j85_xe50_pufit', 'L1_2MU4_J40_XE20', [], [PhysicsStream], ['RATE:MuonJetMET', 'BW:Muon', 'BW:Jet'], -1, ['serial',-1,["2mu4","j85","xe50_pufit"] ]], + # L1Topo VBF ['g15_loose_2j40_0eta490_3j25_0eta490', 'L1_MJJ-400', ['L1_EM13VH','',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma'], -1,['serial',-1,["g15_loose","2j40_0eta490","3j25_0eta490"]]], @@ -3421,6 +3442,39 @@ ps_Jpsi_list = [ ps_ftk_list = [ ] +ps_Bphys_list = [ + '2mu4_bBmumux_BcmumuDsloose', + '2mu4_bBmumux_BcmumuDsloose_noL2', + 'mu6_mu4_bBmumux_BcmumuDsloose_noL2', + '2mu6_bBmumux_BcmumuDsloose_noL2', + 'mu10_mu6_bBmumux_BcmumuDsloose_noL2', + '2mu10_bBmumux_BcmumuDsloose_noL2', + '2mu4_bBmumux_BcmumuDsloose_noL2_L12MU4-B', + '2mu4_bBmumux_BcmumuDsloose_noL2_L12MU4-BO', + 'mu6_mu4_bBmumux_BcmumuDsloose_noL2_L12MU4-B', + 'mu6_mu4_bBmumux_BcmumuDsloose_noL2_L1MU6MU4-BO', + '2mu6_bBmumux_BcmumuDsloose_noL2_L12MU6-B', + '2mu6_bBmumux_BcmumuDsloose_noL2_L12MU6-BO', + 'mu10_mu6_bBmumux_BcmumuDsloose_noL2_L1LFV-MU', + '2mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-2MU4', + '2mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-2MU4_BPH-0DR15-2MU4', + '2mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4', + 'mu6_mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-MU6MU4_BPH-0DR15-MU6MU4', + 'mu6_mu4_bBmumux_BcmumuDsloose_noL2_L1BPH-2M8-MU6MU4-B_BPH-0DR15-MU6MU4', + '2mu6_bBmumux_BcmumuDsloose_noL2_L1BPH-2M9-2MU6_BPH-2DR15-2MU6', + '2mu4_bBmumux_BcmumuDsloose_L1BPH-2M8-2MU4_BPH-0DR15-2MU4', + '2mu4_bBmumux_BcmumuDsloose_L1BPH-2M8-2MU4-B_BPH-0DR15-2MU4', + '2mu4_bBmumux_BcmumuDsloose_L1BPH-2M9-2MU4_BPH-0DR15-2MU4', + 'mu6_mu4_bBmumux_BcmumuDsloose_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', + '2mu6_bBmumux_BcmumuDsloose_L1LFV-MU6', + '2mu4_bBmumux_LbmumuLambda', + 'mu6_mu4_bBmumux_LbmumuLambda', + '2mu6_bBmumux_LbmumuLambda', + '2mu6_bBmumux_LbmumuLambda_L1LFV-MU6', + '2mu4_bBmumux_LbmumuLambda_L1BPH-2M9-2MU4_BPH-0DR15-2MU4', + 'mu6_mu4_bBmumux_LbmumuLambda_L1BPH-2M9-MU6MU4_BPH-0DR15-MU6MU4', + '2mu6_bBmumux_LbmumuLambda_L1BPH-2M9-2MU6_BPH-2DR15-2MU6', +] if TriggerFlags.doFTK(): ps_ftk_list = [ @@ -3576,7 +3630,7 @@ Prescales.HLTPrescales_loose_mc_prescale.update(dict(map(None,chain_list,len(cha Prescales.L1Prescales_tightperf_mc_prescale= deepcopy(Prescales.L1Prescales) Prescales.HLTPrescales_tightperf_mc_prescale = deepcopy(Prescales.HLTPrescales_loose_mc_prescale) -chain_list=ps_eb_list+ps_fwdphys_list+ps_minb_list#+ps_Jpsi_list # enabling JPSI ee again ATR-15162 +chain_list=ps_eb_list+ps_fwdphys_list+ps_minb_list+ps_Bphys_list#+ps_Jpsi_list # enabling JPSI ee again ATR-15162 if not TriggerFlags.doFTK(): chain_list+=ps_ftk_list @@ -3587,7 +3641,7 @@ Prescales.HLTPrescales_tightperf_mc_prescale.update(dict(map(None,chain_list,len ###################################################### Prescales.L1Prescales_tight_mc_prescale = deepcopy(Prescales.L1Prescales) Prescales.HLTPrescales_tight_mc_prescale = deepcopy(Prescales.HLTPrescales_tightperf_mc_prescale) -chain_list=ps_perform_list#+ps_Jpsi_list # enabling JPSI ee again ATR-15162 +chain_list=ps_perform_list+ps_Bphys_list#+ps_Jpsi_list # enabling JPSI ee again ATR-15162 #Prescales.HLTPrescales_tight_mc_prescale = deepcopy(Prescales.HLTPrescales_loose_mc_prescale) #chain_list=ps_eb_list+ps_fwdphys_list+ps_minb_list+ps_ftk_list+ps_perform_list diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/MenuUtils.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/MenuUtils.py index 3cf00bcaf21b20bc8808a4f094bca7d1154a51ec..41c6d631ae91c07f55444b07c36a980000ad58ea 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/menu/MenuUtils.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/MenuUtils.py @@ -21,8 +21,6 @@ def splitInterSignatureChainDict(chainDict): newSplitChainDict['chainParts'] = [chainPart] newSplitChainDict['signature'] = chainPart['signature'] listOfSplitChainDicts += [newSplitChainDict] - #print "Hi : adding to listofsplitchaindicts " + str(newSplitChainDict) - #special code to handle chains with "AND" in the name #jet,ht and bjet jet chains belong to the same signature @@ -69,7 +67,7 @@ def splitInterSignatureChainDict(chainDict): #oder the splitted dicts orderedListOfSplitChainDicts = [] - if not chainDict.has_key("mergingOrder"): + if "mergingOrder" not in chainDict: log.debug("No merging order given for chain %s.", chainDict['chainName']) elif chainDict["mergingOrder"] == []: log.info("No merging order given for chain %s.", chainDict['chainName']) @@ -78,11 +76,11 @@ def splitInterSignatureChainDict(chainDict): for splitChainDict in listOfSplitChainDicts: if splitChainDict['chainParts'][0]['chainPartName'] == chainPartName: orderedListOfSplitChainDicts += [splitChainDict] - #print "Hi : adding to orderedListOfSplitChainDicts " + str(splitChainDict) + if not len(orderedListOfSplitChainDicts) == len(listOfSplitChainDicts): for chainPartName in chainDict["mergingOrder"]: log.error("Ordering of split chain dicts failed. Please check that orderedListOfSplitChainDicts and listOfSplitChainDicts contain the same elements!!") - print chainDict + log.info(chainDict) return orderedListOfSplitChainDicts @@ -156,7 +154,9 @@ def _replicateMissingSignatures(listOfChainDefs,unevenSigs,level): -def mergeChainDefs(listOfChainDefs,strategy="parallel",offset=-1,preserveL2EFOrder=True,removeDuplicateTEs=False,doTopo=True,chainDicts='',noTEreplication=False, noMergeBJet=False): +def mergeChainDefs(listOfChainDefs, strategy="parallel", offset=-1, + preserveL2EFOrder=True, removeDuplicateTEs=False, doTopo=True, + chainDicts='', noTEreplication=False, noMergeBJet=False): log.debug("Combine using %s merging", strategy) @@ -165,7 +165,7 @@ def mergeChainDefs(listOfChainDefs,strategy="parallel",offset=-1,preserveL2EFOrd elif strategy=="serial": return _mergeChainDefsSerial(chainDicts,listOfChainDefs,offset,preserveL2EFOrder=preserveL2EFOrder,doTopo=doTopo,noTEreplication=noTEreplication) else: - log.error("Merging failed for chain %s. Merging strategy '%s' not known." % (level, chainDef.chain_name)) + log.error("Merging failed for %s. Merging strategy '%s' not known.", (listOfChainDefs, strategy)) return -1 @@ -193,21 +193,16 @@ def _mergeChainDefsSerial(ChainDicts,listOfChainDefs,offset,preserveL2EFOrder=Tr for chainDict in ChainDicts: if (chainDict["signature"] == "Jet"): jet_count+=1 - #print "BETTA: adding one jet count: ",chainDict elif (chainDict["signature"] == "HT"): ht_count+=1 - #print "BETTA: adding one ht count: ",chainDict elif (chainDict["signature"] == "MET"): for chainpart in chainDict["chainParts"]: if 'xe' in chainpart['trigType'] and 'cell' not in chainpart['EFrecoAlg']: met_count+=1 - #print "BETTA: adding one met count: ",chainDict else: - #print "BETTA-adding ",chainDict["signature"] other_count+=1 - #print "BETTA Total count: jet-", jet_count, " HT-", ht_count, " xe-", met_count, "other:-", other_count, " in: ",ChainDicts[0]['chainName'] - + #print "BETTA Total count: jet-", jet_count, " HT-", ht_count, " xe-", met_count, "other:-", other_count, " in: ",ChainDicts[0]['chainName'] except: pass @@ -225,15 +220,8 @@ def _mergeChainDefsSerial(ChainDicts,listOfChainDefs,offset,preserveL2EFOrder=Tr listOfChainDefs = deepcopy(listOfChainDefs) - # get last TEs of all ChainDefs - for chainDef in listOfChainDefs: - lastTE = chainDef.signatureList[-1] - - # copy the chaindef into which we want to merge the other chaindefs mergedChainDef = deepcopy(listOfChainDefs[0]) - firstChainDefLastTEs = mergedChainDef.signatureList[-1]['listOfTriggerElements'] - #remove the first chaindef from the list listOfChainDefs.pop(0) @@ -252,11 +240,9 @@ def _mergeChainDefsSerial(ChainDicts,listOfChainDefs,offset,preserveL2EFOrder=Tr for signatureIdx,signature in enumerate(chainDef.signatureList): # if a topo is appended after the chain merging, or in same special cases, the replication of the last TEs is not necessary if noTEreplication: - print "Removing replication of the TE for chain: ",chainDef.chain_name - log.info("Removing replication of the TE for chain: %s" %(chainDef.chain_name)) + log.info("Removing replication of the TE for chain: %s", chainDef.chain_name) signatureToAdd = signature['listOfTriggerElements'] else: - #print "no change for chain: ",chainDef.chain_name signatureToAdd = signature['listOfTriggerElements'] if doTopo else signature['listOfTriggerElements'] + currentLastTEs #signatureToAdd = signature['listOfTriggerElements'] if preserveL2EFOrder: @@ -278,11 +264,7 @@ def _mergeChainDefsSerial(ChainDicts,listOfChainDefs,offset,preserveL2EFOrder=Tr mergedChainDef.signatureList[offset+signatureIdx]['listOfTriggerElements'] += signatureToAdd else: mergedChainDef.appendSignature(signatureToAdd) - - - - - + return mergedChainDef @@ -299,8 +281,6 @@ def _mergeChainDefsParallel(listOfChainDefs,offset=-1,removeDuplicateTEs=False, for chainDef in listOfChainDefs: log.debug("List of ChainDefs to be merged %s ", chainDef) - newSequenceList = [] - if offset!=-1: log.warning("Parallel merging with offset has been tested only for EF-only chains. If you're doing something different, check it works ok!!") @@ -430,7 +410,6 @@ def setupTopoStartFrom(topoThresholds, theChainDef): te0 = None te1 = None outTE = None - topoStartFrom = None for i in range(len(topoThresholds)): if i == 0: diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v6.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v6.py index 1ac2b1caee77082999f0ed55dcf53df76434115e..c888a899e96698bfb781d099ddda772a8f83a313 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v6.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v6.py @@ -170,8 +170,8 @@ def setupMenu(): ['3mu6_msonly_L1MU4_UNPAIRED_NONISO', 'L1_MU4_UNPAIRED_NONISO', ['L1_3MU6'], ["Late"], ['RATE:MultiMuon', 'BW:Muon'], -1], - ['mu20_msonly_mu10noL1_msonly_nscan05_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan05_noComb']]], - ['mu20_msonly_mu10noL1_msonly_nscan03_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan03_noComb']]], + ['mu20_msonly_mu10noL1_msonly_nscan05_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan05_noComb']]], + ['mu20_msonly_mu10noL1_msonly_nscan03_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu10noL1_msonly_nscan03_noComb']]], ['mu20_msonly_mu10noL1_msonly_nscan05_noComb_L1MU6_EMPTY', 'L1_MU6_EMPTY', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05_noComb']]], ['mu20_msonly_mu10noL1_msonly_nscan03_noComb_L1MU6_EMPTY', 'L1_MU6_EMPTY', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan03_noComb']]], ['mu20_msonly_mu10noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05_noComb']]], @@ -181,18 +181,18 @@ def setupMenu(): ### ATR-14377: Emergency additional class of chains instead of mu20_msonly_mu10noL1_msonly_nscan05_noComb* - ['mu20_msonly_mu15noL1_msonly_nscan05_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan05_noComb']]], + ['mu20_msonly_mu15noL1_msonly_nscan05_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan05_noComb']]], ['mu20_msonly_mu15noL1_msonly_nscan05_noComb_L1MU6_EMPTY', 'L1_MU6_EMPTY', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05_noComb']]], ['mu20_msonly_mu15noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05_noComb']]], ['mu20_msonly_mu15noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_NONISO','L1_MU4_UNPAIRED_NONISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05_noComb']]], ### ATR-14377: - ['mu20_msonly_mu15noL1_msonly_nscan03_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan03_noComb']]], + ['mu20_msonly_mu15noL1_msonly_nscan03_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu15noL1_msonly_nscan03_noComb']]], ['mu20_msonly_mu15noL1_msonly_nscan03_noComb_L1MU6_EMPTY', 'L1_MU6_EMPTY', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan03_noComb']]], ['mu20_msonly_mu15noL1_msonly_nscan03_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan03_noComb']]], ['mu20_msonly_mu15noL1_msonly_nscan03_noComb_L1MU4_UNPAIRED_NONISO','L1_MU4_UNPAIRED_NONISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan03_noComb']]], - ['mu20_msonly_mu12noL1_msonly_nscan03_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu12noL1_msonly_nscan03_noComb']]], + ['mu20_msonly_mu12noL1_msonly_nscan03_noComb', 'L1_MU20', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu12noL1_msonly_nscan03_noComb']]], ['mu20_msonly_mu12noL1_msonly_nscan03_noComb_L1MU6_EMPTY', 'L1_MU6_EMPTY', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan03_noComb']]], ['mu20_msonly_mu12noL1_msonly_nscan03_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan03_noComb']]], ['mu20_msonly_mu12noL1_msonly_nscan03_noComb_L1MU4_UNPAIRED_NONISO','L1_MU4_UNPAIRED_NONISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan03_noComb']]], @@ -213,10 +213,13 @@ def setupMenu(): #nscan05 triggers rejecting CB muons - ['mu20_msonly_mu6noL1_msonly_nscan05', 'L1_MU20', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]], + ['mu20_msonly_mu6noL1_msonly_nscan05', 'L1_MU20', ['L1_MU20','L2_mu20_msonly'], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]], + ['mu20_msonly_mu6noL1_msonly_nscan05_L1MU4_EMPTY', 'L1_MU4_EMPTY', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05']]], ['mu20_msonly_mu6noL1_msonly_nscan05_noComb_L1MU4_EMPTY', 'L1_MU4_EMPTY', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05_noComb']]], ['mu20_msonly_mu6noL1_msonly_nscan05_noComb_L1MU4_UNPAIRED_ISO','L1_MU4_UNPAIRED_ISO', ['L1_MU20','L2_mu20_msonly'], ["Late"], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['mu20_msonly','mu6noL1_msonly_nscan05_noComb']]], + + ['mu20_iloose_L1MU15', 'L1_MU15', [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1], ['mu20_imedium_L1MU15', 'L1_MU15', [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1], ['mu20_ivarmedium_L1MU15', 'L1_MU15', [], [PhysicsStream], ['RATE:SingleMuon', 'BW:Muon'], -1], @@ -4392,6 +4395,7 @@ chain_list=[ 'zdcpeb_L1ZDC_C', 'zdcpeb_L1ZDC_AND', 'zdcpeb_L1ZDC_A_C', + 'timeburner', ] Prescales.HLTPrescales_tight_physics_prescale.update(dict(map(None,chain_list,len(chain_list)*[ [-1, 0,-1] ]))) ###################################################### diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7.py index 5c59fb37a10baf2994dff3f86dee4e05a39d9185..a93ff5fd7bb512386837aacb3bab1291ef540f54 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/Physics_pp_v7.py @@ -124,6 +124,17 @@ def setupMenu(): # Primary (multi muon chains) ['3mu4', 'L1_3MU4', [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1], + #low-pt multi-muon chains, ATR-15704 + ['3mu4_nomucomb', 'L1_3MU4', [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1], + ['3mu4_mu2noL1', 'L1_3MU4', ['L1_3MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['3mu4','mu2noL1']]], + ['3mu4_nomucomb_mu2noL1', 'L1_3MU4', ['L1_3MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['3mu4_nomucomb','mu2noL1']]], + ['2mu4_mu3_mu2noL1_L13MU4', 'L1_3MU4', ['L1_2MU4','L1_MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['2mu4','mu3','mu2noL1']]], + ['3mu3_mu3noL1_L13MU4', 'L1_3MU4', ['L1_3MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['3mu3','mu3noL1']]], + ['3mu4_mu4noL1', 'L1_3MU4', ['L1_3MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['3mu4','mu4noL1']]], + ['3mu4_nomucomb_mu4noL1', 'L1_3MU4', ['L1_3MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['3mu4_nomucomb','mu4noL1']]], + ['4mu4', 'L1_4MU4', ['L1_4MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['4mu4','']]], + ['4mu4_nomucomb', 'L1_4MU4', ['L1_4MU4',''], [PhysicsStream], ['RATE:MultiMuon','BW:Muon'], -1,['serial',-1,['4mu4_nomucomb','']]], + #DiMuon for TAU OVERLAY ['2mu20_L12MU20_OVERLAY', 'L1_2MU20_OVERLAY', [], ['TauOverlay'], ["RATE:TauOverlay", "BW:TauOverlay"], -1], @@ -165,7 +176,7 @@ def setupMenu(): # L1 is seeded from single EMPTY/UNPAIRED_ISO, but, at HLT it does a same sequence as main ones (e.g. MU4_EMPTY single seeded, but 3MU6 is required at HLT) # this is done on purpose (ATR-11482) ['3mu6_msonly_L1MU4_EMPTY', 'L1_MU4_EMPTY', ['L1_3MU6'], ["Late"], ['RATE:MultiMuon', 'BW:Muon'], -1], - ['3mu6_msonly_L1MU6_EMPTY', 'L1_MU6_EMPTY', ['L1_3MU6'], ["Late"], ['RATE:MultiMuon', 'BW:Muon'], -1], + ['3mu6_msonly_L1MU6_EMPTY', 'L1_MU6_EMPTY', ['L1_3MU6'], ["Late"], ['RATE:MultiMuon', 'BW:Muon'], -1], ['3mu6_msonly_L1MU4_UNPAIRED_ISO', 'L1_MU4_UNPAIRED_ISO', ['L1_3MU6'], ["Late"], ['RATE:MultiMuon', 'BW:Muon'], -1], ['3mu6_msonly_L1MU4_UNPAIRED_NONISO', 'L1_MU4_UNPAIRED_NONISO', ['L1_3MU6'], ["Late"], ['RATE:MultiMuon', 'BW:Muon'], -1], @@ -202,7 +213,7 @@ def setupMenu(): # exclusive di-lep ['2mu6_10invm30_pt2_z10', 'L1_2MU6', [], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1], - + #new narrow-scan muon triggers for tau->3mu ['mu6_2mu4', 'L1_MU6_3MU4', ['L1_MU6','L1_3MU4'], [PhysicsStream], ['RATE:MultiMuon', 'BW:Muon'], -1], ['mu20_imedium_L1MU10_2J20', 'L1_MU10_2J20', [], [PhysicsStream], ['RATE:MuonJet', 'BW:Muon','BW:Jet'], -1], @@ -600,6 +611,7 @@ def setupMenu(): ['j225_gsc320_bperf_split', 'L1_J85', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], # boffperf_split + ['j15_boffperf_split', 'L1_RD0_FILLED', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], ['j35_boffperf_split', 'L1_J15', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], ['j45_boffperf_split', 'L1_J15', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], ['j55_boffperf_split', 'L1_J20', [], [PhysicsStream, 'express'], ['RATE:SingleBJet', 'BW:BJet'], -1], @@ -611,6 +623,7 @@ def setupMenu(): # ['j200_boffperf_split', 'L1_J40', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], ['j225_boffperf_split', 'L1_J100', [], [PhysicsStream, 'express'], ['RATE:SingleBJet', 'BW:BJet'], -1], ['j260_boffperf_split', 'L1_J75', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], + ['j275_boffperf_split', 'L1_J75', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], ['j320_boffperf_split', 'L1_J85', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], ['j360_boffperf_split', 'L1_J100', [], [PhysicsStream, 'express'], ['RATE:SingleBJet', 'BW:BJet'], -1], ['j380_boffperf_split', 'L1_J100', [], [PhysicsStream, 'express'], ['RATE:SingleBJet', 'BW:BJet'], -1], @@ -630,7 +643,9 @@ def setupMenu(): # ['j150_gsc200_boffperf_split', 'L1_J40', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], ['j175_gsc225_boffperf_split', 'L1_J100', [], [PhysicsStream, 'express'], ['RATE:SingleBJet', 'BW:BJet'], -1], ['j175_gsc260_boffperf_split', 'L1_J75', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], - ['j225_gsc320_boffperf_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], + ['j225_gsc275_boffperf_split', 'L1_J75', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], + ['j225_gsc320_boffperf_split', 'L1_J75', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], + ['j200_gsc300_boffperf_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], ['j225_gsc360_boffperf_split', 'L1_J100', [], [PhysicsStream, 'express'], ['RATE:SingleBJet', 'BW:BJet'], -1], ['j225_gsc380_boffperf_split', 'L1_J100', [], [PhysicsStream, 'express'], ['RATE:SingleBJet', 'BW:BJet'], -1], ['j225_gsc400_boffperf_split', 'L1_J100', [], [PhysicsStream], ['RATE:SingleBJet', 'BW:BJet'], -1], @@ -787,6 +802,9 @@ def setupMenu(): ['j150_2j55_bmv2c2070_split', 'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1], ['j150_2j55_bmv2c2077_split', 'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1], + ['j100_2j55_bmv2c2060_split', 'L1_J85_3J30', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1], + ['j100_2j55_bmv2c2050_split', 'L1_J85_3J30', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1], + ['j110_gsc150_boffperf_split_2j35_gsc55_boffperf_split', 'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1], ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c2050_split', 'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1], ['j110_gsc150_boffperf_split_2j35_gsc55_bmv2c2060_split', 'L1_J75_3J20', [], [PhysicsStream], ['RATE:MultiBJet', 'BW:BJet'], -1], @@ -1395,6 +1413,7 @@ def setupMenu(): ['tau35_loose1_tracktwo', 'L1_TAU20IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1], ['tau35_medium1_tracktwo', 'L1_TAU20IM', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1], ['tau50_medium1_tracktwo_L1TAU12', 'L1_TAU12', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1], + ['tau60_medium1_tracktwo', 'L1_TAU40', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1], ['tau80_medium1_tracktwo', 'L1_TAU40', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1], ['tau80_medium1_tracktwo_L1TAU60', 'L1_TAU60', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1], ['tau125_medium1_tracktwo', 'L1_TAU60', [], [PhysicsStream], ['RATE:SingleTau', 'BW:Tau'], -1], @@ -1446,6 +1465,7 @@ def setupMenu(): ['tau35_tight1_tracktwo_tau25_tight1_tracktwo_03dR30_L1DR-TAU20ITAU12I-J25', 'L1_DR-TAU20ITAU12I-J25',['L1_TAU20IM','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau35_tight1_tracktwo","tau25_tight1_tracktwo"]]], + ['tau80_medium1_tracktwo_L1TAU60_tau35_medium1_tracktwo_L1TAU12IM_L1TAU60_DR-TAU20ITAU12I', 'L1_TAU60_DR-TAU20ITAU12I',['L1_TAU60','L1_TAU12IM'], [PhysicsStream], ['RATE:MultiTau', 'BW:Tau'], -1,['serial',-1,["tau80_medium1_tracktwo_L1TAU60","tau35_medium1_tracktwo_L1TAU12IM"]]] , # High-pT DiTau seeding off of single-tau @@ -1589,6 +1609,7 @@ def setupMenu(): ['g60_loose_L12EM20VH', 'L1_EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], ##Adding tight diphoton triggers (ATR-10762) ['2g22_tight', 'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], + ['2g25_tight_L12EM20VH', 'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], # Tri-photon triggers ['3g15_loose', 'L1_2EM13VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], @@ -1598,7 +1619,7 @@ def setupMenu(): ['3g20_loose_L12EM18VH', 'L1_2EM18VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], ['2g24_loose_g15_loose', 'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], ['2g24_loose_g20_loose', 'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], - + ['3g24_loose_L12EM20VH', 'L1_2EM20VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], #prescaled ['2g20_loose_L12EM15', 'L1_2EM15', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], ['2g20_loose', 'L1_2EM15VH', [], [PhysicsStream], ['RATE:MultiPhoton', 'BW:Egamma'],-1], @@ -1705,6 +1726,11 @@ def setupMenu(): ['e100_lhvloose_nod0', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ], ['e120_lhvloose_nod0', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ], + ['e80_medium', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ], + ['e80_lhmedium_nod0', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ], + ['e80_medium_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ], + ['e80_lhmedium_nod0_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1 ], + # Prescaled triggers # Rate = 1 Hz each ['e5_etcut', 'L1_EM3', [], [PhysicsStream], ['RATE:SingleElectron', 'BW:Egamma'],-1], @@ -1862,6 +1888,8 @@ def setupMenu(): ['2e15_lhvloose_L12EM13VH', 'L1_2EM13VH', [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1], ['2e15_lhvloose_nod0_L12EM13VH', 'L1_2EM13VH', [], [PhysicsStream], ['RATE:MultiElectron', 'BW:Egamma'],-1], + + # support for g+tau chains (ATR-13841) ['g35_medium_L1EM22VHI', 'L1_EM22VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1], ['g35_medium_L1EM24VHI', 'L1_EM24VHI', [], [PhysicsStream], ['RATE:SinglePhoton', 'BW:Egamma'],-1], @@ -2833,6 +2861,8 @@ def setupMenu(): # lepton + jets ['e15_lhtight_ivarloose_3j20_L1EM13VH_3J20', 'L1_EM13VH_3J20', ['L1_EM13VH_3J20',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e15_lhtight_ivarloose","3j20"] ]], + ['e15_lhtight_nod0_ivarloose_3j20_L1EM13VH_3J20', 'L1_EM13VH_3J20', ['L1_EM13VH_3J20',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e15_lhtight_nod0_ivarloose","3j20"] ]], + ### ATR-15524 ['e20_lhtight_nod0_ivarloose_3j20_L1EM18VH_3J20', 'L1_EM18VH_3J20', ['L1_EM18VH_3J20',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e20_lhtight_nod0_ivarloose","3j20"] ]], ['e20_lhmedium_nod0_3j20_L1EM18VH_3J20', 'L1_EM18VH_3J20', ['L1_EM18VH_3J20',''], [PhysicsStream], ['RATE:EgammaJet', 'BW:Egamma', 'BW:Jet'],-1, ['serial',-1,["e20_lhmedium_nod0","3j20"] ]], @@ -4696,6 +4726,7 @@ chain_list=[ 'zdcpeb_L1ZDC_C', 'zdcpeb_L1ZDC_AND', 'zdcpeb_L1ZDC_A_C', + 'timeburner', ] Prescales.HLTPrescales_tight_physics_prescale.update(dict(map(None,chain_list,len(chain_list)*[ [-1, 0,-1] ]))) ###################################################### diff --git a/Trigger/TriggerCommon/TriggerMenu/python/menu/SignatureDicts.py b/Trigger/TriggerCommon/TriggerMenu/python/menu/SignatureDicts.py index 58d362c3760cd47a02d61bd42bf1d63ebffc418c..aefa382fb0adf740e4050baedfe45d8de443c57c 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/menu/SignatureDicts.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/menu/SignatureDicts.py @@ -191,7 +191,7 @@ MuonChainParts = { 'threshold' : '', 'extra' : ['noL1'], 'IDinfo' : [], - 'isoInfo' : ['iloose', 'imedium', 'itight', 'ivarloose', 'ivarmedium','icalo','iloosecalo','imediumcalo'], + 'isoInfo' : ['iloose', 'imedium', 'itight', 'ivarloose', 'ivarmedium','icalo','iloosecalo','imediumcalo','iloosems', 'ivarloosecalo', 'ivarmediumcalo'], 'reccalibInfo' : ['msonly', 'l2msonly', 'l2idonly', 'nomucomb', 'idperf','muoncalib', 'mucombTag','muL2', 'mgonly'], 'trkInfo' : ['fasttr', 'hlttr', 'ftk', 'IDT'], 'hypoInfo' : [], diff --git a/Trigger/TriggerCommon/TriggerMenu/python/met/MissingETDef.py b/Trigger/TriggerCommon/TriggerMenu/python/met/MissingETDef.py index 73da2291c736e9035a904c901e8c482dc54277de..300be93e66518ebcab9290a31914593213d8fc17 100644 --- a/Trigger/TriggerCommon/TriggerMenu/python/met/MissingETDef.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/met/MissingETDef.py @@ -235,21 +235,31 @@ class L2EFChain_met(L2EFChainDef): # m_output[i]= jetChainDef.sequenceList[i]['output'] # m_algo[i] =jetChainDef.sequenceList[i]['algorithm'] - #obtaining DummyUnseededAllTEAlgo/RoiCreator, TrigCaloCellMaker/FS, TrigCaloClusterMaker + #obtaining DummyUnseededAllTEAlgo/RoiCreator input0=jetChainDef.sequenceList[0]['input'] output0 =jetChainDef.sequenceList[0]['output'] algo0 =jetChainDef.sequenceList[0]['algorithm'] - - #obtaining TrigHLTEnergyDensity + + #obtaing TrigCaloCellMaker/FS input1=jetChainDef.sequenceList[1]['input'] output1 =jetChainDef.sequenceList[1]['output'] algo1 =jetChainDef.sequenceList[1]['algorithm'] - - #obtaining TrigHLTJetRecFromCluster + + #obtaining TrigCaloClusterMaker input2=jetChainDef.sequenceList[2]['input'] output2 =jetChainDef.sequenceList[2]['output'] algo2 =jetChainDef.sequenceList[2]['algorithm'] + #obtaining TrigHLTEnergyDensity + input3=jetChainDef.sequenceList[3]['input'] + output3 =jetChainDef.sequenceList[3]['output'] + algo3 =jetChainDef.sequenceList[3]['algorithm'] + + #obtaining TrigHLTJetRecFromCluster + input4=jetChainDef.sequenceList[4]['input'] + output4 =jetChainDef.sequenceList[4]['output'] + algo4 =jetChainDef.sequenceList[4]['algorithm'] + #---End of obtaining jet TEs------------------------------ ########### Sequences ########### @@ -275,18 +285,21 @@ class L2EFChain_met(L2EFChainDef): # --- EF --- #topocluster if EFrecoAlg=='tc' or EFrecoAlg=='pueta' or EFrecoAlg=='pufit': - self.EFsequenceList +=[[ input0,algo0, output0 ]] self.EFsequenceList +=[[ input0,algo0, output0 ]] self.EFsequenceList +=[[ input1,algo1, output1 ]] - self.EFsequenceList +=[[ [output1], [theEFMETFex], 'EF_xe_step1' ]] + self.EFsequenceList +=[[ input2,algo2, output2 ]] + self.EFsequenceList +=[[ input3,algo3, output3 ]] + self.EFsequenceList +=[[ [output3], [theEFMETFex], 'EF_xe_step1' ]] self.EFsequenceList +=[[ ['EF_xe_step1',muonSeed], [theEFMETMuonFex, theEFMETHypo], 'EF_xe_step2' ]] #trigger-jet based MET elif EFrecoAlg=='mht': self.EFsequenceList +=[[ input0,algo0, output0 ]] self.EFsequenceList +=[[ input1,algo1, output1 ]] - self.EFsequenceList +=[[ input2,algo2, output2 ]] - self.EFsequenceList +=[[ [output2], [theEFMETFex], 'EF_xe_step1' ]] + self.EFsequenceList +=[[ input2,algo2, output2 ]] + self.EFsequenceList +=[[ input3,algo3, output3 ]] + self.EFsequenceList +=[[ input4,algo4, output4 ]] + self.EFsequenceList +=[[ [output4], [theEFMETFex], 'EF_xe_step1' ]] self.EFsequenceList +=[[ ['EF_xe_step1',muonSeed], [theEFMETMuonFex, theEFMETHypo], 'EF_xe_step2' ]] if "FStracks" in addInfo: from TrigInDetConf.TrigInDetSequence import TrigInDetSequence diff --git a/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py b/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py index cb2d49d94280919a8c191f05c15038e619d3dbe8..adca5daf138af5854268b57007d3f059d6946d5b 100755 --- a/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py +++ b/Trigger/TriggerCommon/TriggerMenu/python/muon/MuonDef.py @@ -21,6 +21,7 @@ from TrigL2MuonSA.TrigL2MuonSAConfig import TrigL2MuonSAConfig from TrigMuonHypo.TrigMuonHypoConfig import MucombHypoConfig, MufastHypoConfig from TrigMuonEF.TrigMuonEFConfig import (TrigMuonEFTrackIsolationConfig, + TrigMuonEFMSTrackIsolationConfig, TrigMuonEFTrackIsolationVarConfig, TrigMuonEFCaloIsolationConfig, TrigMuonEFRoiAggregatorConfig) @@ -31,7 +32,8 @@ from TrigMuonHypo.TrigMuonHypoConfig import (TrigMuonEFTrackIsolationHypoConfig, TrigMuonEFCaloIsolationHypoConfig) from TrigHIHypo.HFMuonHypos import hiHFMuonHypos - +from TrigGenericAlgs.TrigGenericAlgsConf import PESA__DummyCopyAllTEAlgo +from TriggerMenu.commonUtils.makeCaloSequences import getFullScanCaloSequences #----------------------------------- class L2EFChain_mu(L2EFChainDef): #----------------------------------- @@ -42,11 +44,8 @@ class L2EFChain_mu(L2EFChainDef): theL2OvlpRmConfig_mucomb = TrigL2MuonOverlapRemoverConfig('Mucomb','nominal') # ---- This is for Calo isolation -------------------------------- - from TrigCaloRec.TrigCaloRecConfig import TrigCaloCellMaker_jet_fullcalo, TrigCaloClusterMaker_topo - trigCaloCellMaker_fullcalo = TrigCaloCellMaker_jet_fullcalo("TrigCaloCellMaker_topo_Muon", - doNoise=0, AbsE=True, doPers=True) - topologicalClusterMaker = TrigCaloClusterMaker_topo('TrigCaloClusterMaker_topo_Muon', - doMoments=True, doLC=False) + DummyMergerAlgo = PESA__DummyCopyAllTEAlgo("DummyMergerAlgo") + fullScanSeqMap = getFullScanCaloSequences() # ---------------------------------------------------------------- def __init__(self, chainDict, asymDiMuonChain = False, AllMuons = []): @@ -394,6 +393,12 @@ class L2EFChain_mu(L2EFChainDef): elif self.chainPart['isoInfo'] == "imediumcalo": theTrigMuonEFTrackIsolationHypoConfig = TrigMuonEFTrackIsolationHypoConfig("Muon","RelEFOnlyTightWide") theTrigMuonEFCaloIsolationHypoConfig = TrigMuonEFCaloIsolationHypoConfig("Muon", "Rel") + elif self.chainPart['isoInfo'] == "ivarloosecalo": + theTrigMuonEFTrackIsolationHypoConfig = TrigMuonEFTrackIsolationHypoConfig("Muon","RelEFOnlyVarMedium") + theTrigMuonEFCaloIsolationHypoConfig = TrigMuonEFCaloIsolationHypoConfig("Muon", "Rel") + elif self.chainPart['isoInfo'] == "ivarmediumcalo": + theTrigMuonEFTrackIsolationHypoConfig = TrigMuonEFTrackIsolationHypoConfig("Muon","RelEFOnlyVarTightWide") + theTrigMuonEFCaloIsolationHypoConfig = TrigMuonEFCaloIsolationHypoConfig("Muon", "Rel") else: log.error("Isolation %s not yet supported." % (self.chainPart['isoInfo'])) return False @@ -412,17 +417,49 @@ class L2EFChain_mu(L2EFChainDef): [TrigMuonEFTrackIsolationVarConfig("TrigMuonEFTrackIsolationVar"),theTrigMuonEFTrackIsolationHypoConfig], 'EF_mu_step4']] elif self.chainPart['isoInfo'] == "icalo": - self.EFsequenceList += [[['EF_mu_step2'], - [self.trigCaloCellMaker_fullcalo,self.topologicalClusterMaker], - 'EF_mu_step3']] + + # full scan topo and merging w/ RoI TEs + te_in='' + for step in self.fullScanSeqMap: + self.EFsequenceList += [[[te_in],self.fullScanSeqMap[step],step]] + te_in=step + self.EFsequenceList += [[ ['EF_mu_step2',te_in],[self.DummyMergerAlgo],'EF_mu_step3']] + + #self.EFsequenceList += [[['EF_mu_step2'], + # [self.trigCaloCellMaker_fullcalo,self.topologicalClusterMaker], + # 'EF_mu_step3']] self.EFsequenceList += [[['EF_mu_step3'], [ TrigMuonEFCaloIsolationConfig("TrigMuonEFCaloIsolation"),theTrigMuonEFCaloIsolationHypoConfig ], 'EF_mu_step4']] elif self.chainPart['isoInfo'] == "iloosecalo" or self.chainPart['isoInfo'] == "imediumcalo": - self.EFsequenceList += [[['EF_mu_step3'], - [self.trigCaloCellMaker_fullcalo,self.topologicalClusterMaker], - 'EF_mu_step4']] + te_in='' + for step in self.fullScanSeqMap: + self.EFsequenceList += [[[te_in],self.fullScanSeqMap[step],step]] + te_in=step + self.EFsequenceList += [[ ['EF_mu_step3',te_in],[self.DummyMergerAlgo],'EF_mu_step4']] + + #self.EFsequenceList += [[['EF_mu_step3'], + # [self.trigCaloCellMaker_fullcalo,self.topologicalClusterMaker], + # 'EF_mu_step4']] + + self.EFsequenceList += [[['EF_mu_step4'], + [TrigMuonEFTrackIsolationConfig("TrigMuonEFTrackIsolation"),theTrigMuonEFTrackIsolationHypoConfig], + 'EF_mu_step5']] + + self.EFsequenceList += [[['EF_mu_step5'], + [ TrigMuonEFCaloIsolationConfig("TrigMuonEFCaloIsolation"),theTrigMuonEFCaloIsolationHypoConfig ], + 'EF_mu_step6']] + elif self.chainPart['isoInfo'] == "ivarloosecalo" or self.chainPart['isoInfo'] == "ivarmediumcalo": + te_in='' + for step in self.fullScanSeqMap: + self.EFsequenceList += [[[te_in],self.fullScanSeqMap[step],step]] + te_in=step + self.EFsequenceList += [[ ['EF_mu_step3',te_in],[self.DummyMergerAlgo],'EF_mu_step4']] + + #self.EFsequenceList += [[['EF_mu_step3'], + # [self.trigCaloCellMaker_fullcalo,self.topologicalClusterMaker], + # 'EF_mu_step4']] self.EFsequenceList += [[['EF_mu_step4'], [TrigMuonEFTrackIsolationVarConfig("TrigMuonEFTrackIsolationVar"),theTrigMuonEFTrackIsolationHypoConfig], @@ -433,6 +470,7 @@ class L2EFChain_mu(L2EFChainDef): 'EF_mu_step6']] + #--- adding signatures ---- self.L2signatureList += [ [['L2_mu_step1']*self.mult] ] if (self.doOvlpRm): @@ -456,7 +494,12 @@ class L2EFChain_mu(L2EFChainDef): if (self.chainPart['isoInfo']):# == "iloose" or self.chainPart['isoInfo'] == "imedium": self.EFsignatureList += [ [['EF_mu_step3']*self.mult] ] self.EFsignatureList += [ [['EF_mu_step4']*self.mult] ] - if self.chainPart['isoInfo'] == 'iloosecalo' or self.chainPart['isoInfo'] == 'imediumcalo': + if self.chainPart['isoInfo'] == 'icalo': + for step in self.fullScanSeqMap: + self.EFsignatureList += [ [[step]] ] + if self.chainPart['isoInfo'] == 'iloosecalo' or self.chainPart['isoInfo'] == 'imediumcalo' or self.chainPart['isoInfo'] == 'ivarloosecalo' or self.chainPart['isoInfo'] == 'ivarmediumcalo': + for step in self.fullScanSeqMap: + self.EFsignatureList += [ [[step]] ] self.EFsignatureList += [ [['EF_mu_step5']*self.mult] ] self.EFsignatureList += [ [['EF_mu_step6']*self.mult] ] @@ -495,20 +538,31 @@ class L2EFChain_mu(L2EFChainDef): 'EF_mu_step2': mergeRemovingOverlap('EF_SuperEF_', chainPartNameNoMultNoDS.replace('_'+self.chainPart['isoInfo'],'')), 'EF_mu_step3': mergeRemovingOverlap('EF_invm_', chainPartNameNoMultNoDS)}) - if (self.chainPart['isoInfo']) and ( self.chainPart['isoInfo'] not in ["icalo","iloosecalo","imediumcalo"] ): + if (self.chainPart['isoInfo']) and ( self.chainPart['isoInfo'] not in ["icalo","iloosecalo","imediumcalo","ivarmediumcalo","ivarloosecalo"] ): + self.TErenamingDict.update({'EF_mu_step1': mergeRemovingOverlap('EF_EFIDInsideOut_', chainPartNameNoMultNoDS.replace('_'+self.chainPart['isoInfo'],'')), 'EF_mu_step2': mergeRemovingOverlap('EF_SuperEF_', chainPartNameNoMultNoDS.replace('_'+self.chainPart['isoInfo'],'')), 'EF_mu_step3': mergeRemovingOverlap('EF_muI_efid_', chainPartNameNoMultNoDS), 'EF_mu_step4': mergeRemovingOverlap('EF_trkIso_', chainPartNameNoMultNoDS)}) if (self.chainPart['isoInfo']) and ( self.chainPart['isoInfo'] == "icalo" ): + self.TErenamingDict.update({'EF_mu_step1': mergeRemovingOverlap('EF_EFIDInsideOut_', self.chainPartNameNoMult.replace('_'+self.chainPart['isoInfo'],'')), 'EF_mu_step2': mergeRemovingOverlap('EF_SuperEF_', self.chainPartNameNoMult.replace('_'+self.chainPart['isoInfo'],'')), + 'EF_full':mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fs'), + 'EF_full_cell':mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fscalocell'), + 'EF_FSTopoClusters':mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fscalotopo'), + 'EF_FSTopoClustersED':mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fscalotopoed'), 'EF_mu_step3': mergeRemovingOverlap('EF_fullcalo_', self.chainPartNameNoMult), 'EF_mu_step4': mergeRemovingOverlap('EF_caloIso_', self.chainPartNameNoMult)}) - if (self.chainPart['isoInfo']) and ( self.chainPart['isoInfo'] == "iloosecalo" or self.chainPart['isoInfo'] == "imediumcalo"): - self.TErenamingDict.update({'EF_mu_step1': mergeRemovingOverlap('EF_EFIDInsideOut_', self.chainPartNameNoMult.replace('_'+self.chainPart['isoInfo'],'')), + if (self.chainPart['isoInfo']) and ( self.chainPart['isoInfo'] == "iloosecalo" or self.chainPart['isoInfo'] == "imediumcalo" or self.chainPart['isoInfo'] == "ivarloosecalo" or self.chainPart['isoInfo'] == "ivarmediumcalo"): + + self.TErenamingDict.update({'EF_mu_step1': mergeRemovingOverlap('EF_EFIDInsideOut_', self.chainPartNameNoMult.replace('_'+self.chainPart['isoInfo'],'')), 'EF_mu_step2': mergeRemovingOverlap('EF_SuperEF_', self.chainPartNameNoMult.replace('_'+self.chainPart['isoInfo'],'')), 'EF_mu_step3': mergeRemovingOverlap('EF_muI_efid_', chainPartNameNoMultNoDS), + 'EF_full':mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fs'), + 'EF_full_cell':mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fscalocell'), + 'EF_FSTopoClusters':mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fscalotopo'), + 'EF_FSTopoClustersED':mergeRemovingOverlap('EF_', self.chainPartNameNoMult+'_fscalotopoed'), 'EF_mu_step4': mergeRemovingOverlap('EF_fullcalo_', self.chainPartNameNoMult), 'EF_mu_step5': mergeRemovingOverlap('EF_trkIso_', self.chainPartNameNoMult), 'EF_mu_step6': mergeRemovingOverlap('EF_caloIso_', self.chainPartNameNoMult)}) @@ -899,10 +953,15 @@ class L2EFChain_mu(L2EFChainDef): from TrigMuonHypo.TrigMuonHypoConfig import TrigMuonEFExtrapolatorHypoConfig theTrigMuonEFExtrapolatorHypoConfig = TrigMuonEFExtrapolatorHypoConfig(EFRecoAlgName, EFExtrapolatorThresh) + [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", "2step").getSequence() + if "wOvlpRm" in self.chainPart['overlapRemoval']: from TrigMuonHypo.TrigEFMuonOverlapRemoverConfig import TrigEFMuonOverlapRemoverConfig theEFOvlpRmConfig = TrigEFMuonOverlapRemoverConfig('MuExtr','loose') + if self.chainPart['isoInfo'] == "iloosems": + theTrigMuonEFTrackIsolationHypoConfig = TrigMuonEFTrackIsolationHypoConfig("Muon","MSEFOnlyLooseWide") + ########### Sequence List ############## self.L2sequenceList += [[self.L2InputTE, @@ -923,7 +982,15 @@ class L2EFChain_mu(L2EFChainDef): if (self.doOvlpRm): self.EFsequenceList += [[['EF_mu_step1'], [theEFOvlpRmConfig ],'EF_mu_step1_wOvlpRm']] - + if self.chainPart['isoInfo'] == "iloosems": + self.EFsequenceList += [[['EF_mu_step1'], + trkfast+trkiso+trkprec, + 'EF_mu_step2']] + + self.EFsequenceList += [[['EF_mu_step2'], + [TrigMuonEFMSTrackIsolationConfig("TrigMuonEFMSTrackIsolation"),theTrigMuonEFTrackIsolationHypoConfig], + 'EF_mu_step3']] + ########### Signatures ########### self.L2signatureList += [ [['L2_mu_step1']*self.mult] ] @@ -932,6 +999,9 @@ class L2EFChain_mu(L2EFChainDef): self.EFsignatureList += [ [['EF_mu_step1']*self.mult] ] if (self.doOvlpRm): self.EFsignatureList += [ [['EF_mu_step1_wOvlpRm']*self.mult] ] + if self.chainPart['isoInfo'] == "iloosems": + self.EFsignatureList += [ [['EF_mu_step2']*self.mult] ] + self.EFsignatureList += [ [['EF_mu_step3']*self.mult] ] ########### TE renaming ########## @@ -939,6 +1009,10 @@ class L2EFChain_mu(L2EFChainDef): 'L2_mu_step1': mergeRemovingOverlap('L2_mu_SA_', L2AlgName+muFastThresh+'_'+self.L2InputTE), 'EF_mu_step1': mergeRemovingOverlap('EF_SuperEF_', self.chainPartNameNoMult), } + if (self.chainPart['isoInfo']): + self.TErenamingDict.update({'EF_mu_step2': mergeRemovingOverlap('EF_EFIDInsideOut_', self.chainPartNameNoMult.replace('_'+self.chainPart['isoInfo'],'')), + 'EF_mu_step3': mergeRemovingOverlap('EF_trkIso_', self.chainPartNameNoMult)}) + if self.doOvlpRm: self.TErenamingDict.update({'L2_mu_step1_wOvlpRm' : mergeRemovingOverlap('L2_mu_SAOvlpRm_', L2AlgName+muFastThresh+'_'+self.L2InputTE+'_wOvlpRm' ), @@ -1379,12 +1453,17 @@ class L2EFChain_mu(L2EFChainDef): from TrigInDetConf.TrigInDetSequence import TrigInDetSequence - [trkfast, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig").getSequence() - + if self.chainPart['isoInfo'] == "iloosems": + [trkfast, trkiso, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig", "2step").getSequence() + else: + [trkfast, trkprec] = TrigInDetSequence("Muon", "muon", "IDTrig").getSequence() from TrigMuonEF.TrigMuonEFConfig import TrigMuonEFRoiAggregatorConfig from TrigMuonHypo.TrigMuonHypoConfig import TrigMuonEFCombinerMultiHypoConfig, TrigMuonEFCombinerHypoConfig + if self.chainPart['isoInfo'] == "iloosems": + theTrigMuonEFTrackIsolationHypoConfig = TrigMuonEFTrackIsolationHypoConfig("Muon","MSEFOnlyLooseWide") + name = 'Muon' if "noComb" in self.chainPart['addInfo']: name = 'Muon_noComb' @@ -1436,55 +1515,75 @@ class L2EFChain_mu(L2EFChainDef): theTrigMuonEFCombinerMultiHypoConfigNS.ConeSize=0.3 if "msonly" in self.chainPart['reccalibInfo']: # self.EFsequenceList += [[self.chainPart['L1item'].replace("L1_",""), - self.EFsequenceList += [['EF_dummy', - [CfgGetter.getAlgorithm("TrigMuSuperEF_FSSA")], - 'EF_SA_NS']] - self.EFsequenceList += [['EF_SA_NS', - [theTrigMuonEFSA_NS_Hypo], - 'EF_SA_NS2']] - if "noComb" in self.chainPart['addInfo']: - self.EFsequenceList += [['EF_SA_NS', - [CfgGetter.getAlgorithm("TrigMuonEFFSRoiMaker")], - 'EF_SAR_NS']] - self.EFsequenceList += [['EF_SAR_NS', - trkfast+trkprec, #theTrigEFIDInsideOut_Muon, #a fallback - it should be replaced by the previous line if it works - 'EF_NStracksMuon']] - self.EFsequenceList += [['EF_NStracksMuon', - [CfgGetter.getAlgorithm("TrigMuSuperEF_TMEFCombinerOnly")], - 'EF_CB_NS_single']] - self.EFsequenceList += [['EF_CB_NS_single', - [TrigMuonEFRoiAggregatorConfig('TrigMuonEFFSRoiAggregator'), - theTrigMuonEFCombinerMultiHypoConfigNS], - 'EF_CB_NS']] + self.EFsequenceList += [['EF_dummy', + [CfgGetter.getAlgorithm("TrigMuSuperEF_FSSA")], + 'EF_SA_NS']] + self.EFsequenceList += [['EF_SA_NS', + [theTrigMuonEFSA_NS_Hypo], + 'EF_SA_NS2']] + if self.chainPart['isoInfo'] == "iloosems": + self.EFsequenceList += [['EF_SA_NS', + [CfgGetter.getAlgorithm("TrigMuonEFFSRoiMaker")], + 'EF_SAR_NS']] + self.EFsequenceList += [[['EF_SAR_NS'], + trkfast+trkiso+trkprec, + 'EF_NStracksMuonIso']] + self.EFsequenceList += [[['EF_NStracksMuonIso'], + [TrigMuonEFMSTrackIsolationConfig("TrigMuonEFMSTrackIsolation"),theTrigMuonEFTrackIsolationHypoConfig], + 'EF_msIso']] + if "noComb" in self.chainPart['addInfo']: + self.EFsequenceList += [['EF_SA_NS', + [CfgGetter.getAlgorithm("TrigMuonEFFSRoiMaker")], + 'EF_SAR_NS']] + if self.chainPart['isoInfo'] == "iloosems": + self.EFsequenceList += [['EF_NStracksMuonIso', + [CfgGetter.getAlgorithm("TrigMuSuperEF_TMEFCombinerOnly")], + 'EF_CB_NS_singleIso']] + self.EFsequenceList += [['EF_CB_NS_singleIso', + [TrigMuonEFRoiAggregatorConfig('TrigMuonEFFSRoiAggregator'), + theTrigMuonEFCombinerMultiHypoConfigNS], + 'EF_CB_NSIso']] + + else: + self.EFsequenceList += [['EF_SAR_NS', + trkfast+trkprec, #theTrigEFIDInsideOut_Muon, #a fallback - it should be replaced by the previous line if it works + 'EF_NStracksMuon']] + self.EFsequenceList += [['EF_NStracksMuon', + [CfgGetter.getAlgorithm("TrigMuSuperEF_TMEFCombinerOnly")], + 'EF_CB_NS_single']] + self.EFsequenceList += [['EF_CB_NS_single', + [TrigMuonEFRoiAggregatorConfig('TrigMuonEFFSRoiAggregator'), + theTrigMuonEFCombinerMultiHypoConfigNS], + 'EF_CB_NS']] else: - # self.EFsequenceList += [[self.chainPart['L1item'].replace("L1_",""), - self.EFsequenceList += [['EF_dummy', - [CfgGetter.getAlgorithm("TrigMuSuperEF_FSSA")], - 'EF_SA_NS']] - self.EFsequenceList += [['EF_SA_NS', - [theTrigMuonEFSA_NS_Hypo], - 'EF_SA_NS2']] - self.EFsequenceList += [['EF_SA_NS', - [CfgGetter.getAlgorithm("TrigMuonEFFSRoiMaker")], - 'EF_SAR_NS']] - self.EFsequenceList += [['EF_SAR_NS', - trkfast+trkprec, + # self.EFsequenceList += [[self.chainPart['L1item'].replace("L1_",""), + self.EFsequenceList += [['EF_dummy', + [CfgGetter.getAlgorithm("TrigMuSuperEF_FSSA")], + 'EF_SA_NS']] + self.EFsequenceList += [['EF_SA_NS', + [theTrigMuonEFSA_NS_Hypo], + 'EF_SA_NS2']] + self.EFsequenceList += [['EF_SA_NS', + [CfgGetter.getAlgorithm("TrigMuonEFFSRoiMaker")], + 'EF_SAR_NS']] + self.EFsequenceList += [['EF_SAR_NS', + trkfast+trkprec, 'EF_NStracksMuon']] - self.EFsequenceList += [['EF_NStracksMuon', - [CfgGetter.getAlgorithm("TrigMuSuperEF_TMEFCombinerOnly")], - 'EF_CB_NS_single']] - self.EFsequenceList += [['EF_CB_NS_single', - [TrigMuonEFRoiAggregatorConfig('TrigMuonEFFSRoiAggregator'), - theTrigMuonEFCombinerMultiHypoConfigNS], - 'EF_CB_NS']] + self.EFsequenceList += [['EF_NStracksMuon', + [CfgGetter.getAlgorithm("TrigMuSuperEF_TMEFCombinerOnly")], + 'EF_CB_NS_single']] + self.EFsequenceList += [['EF_CB_NS_single', + [TrigMuonEFRoiAggregatorConfig('TrigMuonEFFSRoiAggregator'), + theTrigMuonEFCombinerMultiHypoConfigNS], + 'EF_CB_NS']] elif "nscan05" in self.chainPart['FSinfo']: cone = "_cone05" theTrigMuonEFExtrapolatorMultiHypoConfigNS.ConeSize=0.3 theTrigMuonEFCombinerMultiHypoConfigNS.ConeSize=0.3 # self.EFsequenceList += [[self.chainPart['L1item'].replace("L1_",""), self.EFsequenceList += [['EF_dummy', - [CfgGetter.getAlgorithm("TrigMuSuperEF_FSSA")], + [CfgGetter.getAlgorithm("TrigMuSuperEF_FSSA")], 'EF_SA_NS']] self.EFsequenceList += [['EF_SA_NS', [theTrigMuonEFSA_NS_Hypo], @@ -1493,16 +1592,32 @@ class L2EFChain_mu(L2EFChainDef): self.EFsequenceList += [['EF_SA_NS', [CfgGetter.getAlgorithm("TrigMuonEFFSRoiMaker")], 'EF_SAR_NS']] - self.EFsequenceList += [['EF_SAR_NS', - trkfast+trkprec, #theTrigEFIDInsideOut_Muon, #a fallback - it should be replaced by the previous line if it works - 'EF_NStracksMuon']] - self.EFsequenceList += [['EF_NStracksMuon', - [CfgGetter.getAlgorithm("TrigMuSuperEF_TMEFCombinerOnly")], - 'EF_CB_NS_single']] - self.EFsequenceList += [['EF_CB_NS_single', - [TrigMuonEFRoiAggregatorConfig('TrigMuonEFFSRoiAggregator'), - theTrigMuonEFCombinerMultiHypoConfigNS], - 'EF_CB_NS']] + if self.chainPart['isoInfo'] == "iloosems": + self.EFsequenceList += [[['EF_SAR_NS'], + trkfast+trkiso+trkprec, + 'EF_NStracksMuonIso']] + self.EFsequenceList += [[['EF_NStracksMuonIso'], + [TrigMuonEFMSTrackIsolationConfig("TrigMuonEFMSTrackIsolation"),theTrigMuonEFTrackIsolationHypoConfig], + 'EF_msIso']] + self.EFsequenceList += [['EF_NStracksMuonIso', + [CfgGetter.getAlgorithm("TrigMuSuperEF_TMEFCombinerOnly")], + 'EF_CB_NS_singleIso']] + self.EFsequenceList += [['EF_CB_NS_singleIso', + [TrigMuonEFRoiAggregatorConfig('TrigMuonEFFSRoiAggregator'), + theTrigMuonEFCombinerMultiHypoConfigNS], + 'EF_CB_NSIso']] + + else: + self.EFsequenceList += [['EF_SAR_NS', + trkfast+trkprec, #theTrigEFIDInsideOut_Muon, #a fallback - it should be replaced by the previous line if it works + 'EF_NStracksMuon']] + self.EFsequenceList += [['EF_NStracksMuon', + [CfgGetter.getAlgorithm("TrigMuSuperEF_TMEFCombinerOnly")], + 'EF_CB_NS_single']] + self.EFsequenceList += [['EF_CB_NS_single', + [TrigMuonEFRoiAggregatorConfig('TrigMuonEFFSRoiAggregator'), + theTrigMuonEFCombinerMultiHypoConfigNS], + 'EF_CB_NS']] else: log.error("No other cone than 05 or 03 was implemented") @@ -1516,9 +1631,21 @@ class L2EFChain_mu(L2EFChainDef): if "msonly" in self.chainPart['reccalibInfo']: if "noComb" in self.chainPart['addInfo']: self.EFsignatureList += [ [['EF_SAR_NS']] ] - self.EFsignatureList += [ [['EF_NStracksMuon']] ] - self.EFsignatureList += [ [['EF_CB_NS_single']] ] - self.EFsignatureList += [ [['EF_CB_NS','EF_SA_NS2']] ] + if self.chainPart['isoInfo'] == "iloosems": + self.EFsignatureList += [ [['EF_NStracksMuonIso']] ] + self.EFsignatureList += [ [['EF_msIso']] ] + self.EFsignatureList += [ [['EF_CB_NS_singleIso']] ] + self.EFsignatureList += [ [['EF_CB_NSIso','EF_SA_NS2']] ] + else: + self.EFsignatureList += [ [['EF_NStracksMuon']] ] + self.EFsignatureList += [ [['EF_CB_NS_single']] ] + self.EFsignatureList += [ [['EF_CB_NS','EF_SA_NS2']] ] + else: + if self.chainPart['isoInfo'] == "iloosems": + self.EFsignatureList += [ [['EF_NStracksMuonIso']] ] + self.EFsignatureList += [ [['EF_msIso']] ] + + else: self.EFsignatureList += [ [['EF_SAR_NS']] ] self.EFsignatureList += [ [['EF_NStracksMuon']] ] @@ -1527,28 +1654,52 @@ class L2EFChain_mu(L2EFChainDef): if "nscan05" in self.chainPart['FSinfo']: if "noComb" in self.chainPart['addInfo']: self.EFsignatureList += [ [['EF_SAR_NS']] ] - self.EFsignatureList += [ [['EF_NStracksMuon']] ] - self.EFsignatureList += [ [['EF_CB_NS_single']] ] - self.EFsignatureList += [ [['EF_CB_NS','EF_SA_NS2']] ] - + if self.chainPart['isoInfo'] == "iloosems": + self.EFsignatureList += [ [['EF_NStracksMuonIso']] ] + self.EFsignatureList += [ [['EF_msIso']] ] + self.EFsignatureList += [ [['EF_CB_NS_singleIso']] ] + self.EFsignatureList += [ [['EF_CB_NSIso','EF_SA_NS2']] ] + else: + self.EFsignatureList += [ [['EF_NStracksMuon']] ] + self.EFsignatureList += [ [['EF_CB_NS_single']] ] + self.EFsignatureList += [ [['EF_CB_NS','EF_SA_NS2']] ] + nscanseed = self.chainPart['L1item'] l1seed = self.chainL1Item if "nscan03" in self.chainPart['FSinfo']: if "msonly" in self.chainPart['reccalibInfo']: if "noComb" in self.chainPart['addInfo']: - self.TErenamingDict = { - 'EF_SA_NS': mergeRemovingOverlap('EF_SA_NS_','SANShyp'), - 'EF_SA_NS2': mergeRemovingOverlap('EF_SA_NS_','SANShyp2'+hypocut+cone+'_noComb_'+nscanseed+'_'+l1seed), - 'EF_SAR_NS': mergeRemovingOverlap('EF_SAR_NS_','SANSHypo'), - 'EF_NStracksMuon': mergeRemovingOverlap('EF_NStracksMuon_', 'SANSHypo'), - 'EF_CB_NS_single': mergeRemovingOverlap('EF_CB_NS_single_','SANSHypo'), - 'EF_CB_NS': mergeRemovingOverlap('EF_CB_NS_', 'SANSHypo'+hypocut+'_'+hypocutEF+cone+'_noComb_'+nscanseed+'_'+l1seed), - } + if (self.chainPart['isoInfo']): + self.TErenamingDict = { + 'EF_SA_NS': mergeRemovingOverlap('EF_SA_NS_','SANShyp'), + 'EF_SA_NS2': mergeRemovingOverlap('EF_SA_NS_','SANShyp2'+hypocut+cone+'_noComb_'+nscanseed+'_'+l1seed), + 'EF_SAR_NS': mergeRemovingOverlap('EF_SAR_NS_','SANSHypo'), + 'EF_NStracksMuonIso': mergeRemovingOverlap('EF_NStracksMuonIso_', 'SANSHypo'), + 'EF_CB_NS_singleIso': mergeRemovingOverlap('EF_CB_NS_singleIso_','SANSHypo'), + 'EF_CB_NSIso': mergeRemovingOverlap('EF_CB_NSIso_', 'SANSHypo'+hypocut+'_'+hypocutEF+cone+'_noComb_'+nscanseed+'_'+l1seed), + 'EF_msIso' : mergeRemovingOverlap('EF_msIso_', 'SANSHypo'), + } + else: + self.TErenamingDict = { + 'EF_SA_NS': mergeRemovingOverlap('EF_SA_NS_','SANShyp'), + 'EF_SA_NS2': mergeRemovingOverlap('EF_SA_NS_','SANShyp2'+hypocut+cone+'_noComb_'+nscanseed+'_'+l1seed), + 'EF_SAR_NS': mergeRemovingOverlap('EF_SAR_NS_','SANSHypo'), + 'EF_NStracksMuon': mergeRemovingOverlap('EF_NStracksMuon_', 'SANSHypo'), + 'EF_CB_NS_single': mergeRemovingOverlap('EF_CB_NS_single_','SANSHypo'), + 'EF_CB_NS': mergeRemovingOverlap('EF_CB_NS_', 'SANSHypo'+hypocut+'_'+hypocutEF+cone+'_noComb_'+nscanseed+'_'+l1seed), + } else: - self.TErenamingDict = { - 'EF_SA_NS': mergeRemovingOverlap('EF_SA_NS_','SANShyp'), - } + if (self.chainPart['isoInfo']): + self.TErenamingDict = { + 'EF_SA_NS': mergeRemovingOverlap('EF_SA_NS_','SANShyp'), + 'EF_NStracksMuonIso': mergeRemovingOverlap('EF_NStracksMuonIso_', 'SANSHypo'), + 'EF_msIso' : mergeRemovingOverlap('EF_msIso_', 'SANSHypo'), + } + else: + self.TErenamingDict = { + 'EF_SA_NS': mergeRemovingOverlap('EF_SA_NS_','SANShyp'), + } else: self.TErenamingDict = { 'EF_SA_NS': mergeRemovingOverlap('EF_SA_NS_','SANShyp'), @@ -1557,21 +1708,39 @@ class L2EFChain_mu(L2EFChainDef): 'EF_NStracksMuon': mergeRemovingOverlap('EF_NStrkMu_', 'SANShyp'), 'EF_CB_NS_single': mergeRemovingOverlap('EF_CB_NS_sngl_','SANShyp'), 'EF_CB_NS': mergeRemovingOverlap('EF_CB_NS_', 'SANShyp'+hypocut+'_'+hypocutEF+cone+'_'+nscanseed+'_'+l1seed), - } + } if "nscan05" in self.chainPart['FSinfo']: if "noComb" in self.chainPart['addInfo']: - self.TErenamingDict = { - 'EF_SA_NS': mergeRemovingOverlap('EF_SA_NS_','SANShyp'), - 'EF_SA_NS2': mergeRemovingOverlap('EF_SA_NS_','SANShyp'+hypocut+cone+'_'+nscanseed+'_'+l1seed), - 'EF_SAR_NS': mergeRemovingOverlap('EF_SAR_NS_','SANSHypo'), - 'EF_NStracksMuon': mergeRemovingOverlap('EF_NStracksMuon_', 'SANSHypo'), - 'EF_CB_NS_single': mergeRemovingOverlap('EF_CB_NS_single_','SANSHypo'), - 'EF_CB_NS': mergeRemovingOverlap('EF_CB_NS_', 'SANSHypo'+hypocut+'_'+hypocutEF+cone+'_noComb_'+nscanseed+'_'+l1seed), - } + if (self.chainPart['isoInfo']): + self.TErenamingDict = { + 'EF_SA_NS': mergeRemovingOverlap('EF_SA_NS_','SANShyp'), + 'EF_SA_NS2': mergeRemovingOverlap('EF_SA_NS_','SANShyp'+hypocut+cone+'_'+nscanseed+'_'+l1seed), + 'EF_SAR_NS': mergeRemovingOverlap('EF_SAR_NS_','SANSHypo'), + 'EF_NStracksMuonIso': mergeRemovingOverlap('EF_NStracksMuonIso_', 'SANSHypo'), + 'EF_CB_NS_singleIso': mergeRemovingOverlap('EF_CB_NS_singleIso_','SANSHypo'), + 'EF_CB_NSIso': mergeRemovingOverlap('EF_CB_NSIso_', 'SANSHypo'+hypocut+'_'+hypocutEF+cone+'_noComb_'+nscanseed+'_'+l1seed), + 'EF_msIso' : mergeRemovingOverlap('EF_msIso_', 'SANSHypo'), + } + else: + self.TErenamingDict = { + 'EF_SA_NS': mergeRemovingOverlap('EF_SA_NS_','SANShyp'), + 'EF_SA_NS2': mergeRemovingOverlap('EF_SA_NS_','SANShyp'+hypocut+cone+'_'+nscanseed+'_'+l1seed), + 'EF_SAR_NS': mergeRemovingOverlap('EF_SAR_NS_','SANSHypo'), + 'EF_NStracksMuon': mergeRemovingOverlap('EF_NStracksMuon_', 'SANSHypo'), + 'EF_CB_NS_single': mergeRemovingOverlap('EF_CB_NS_single_','SANSHypo'), + 'EF_CB_NS': mergeRemovingOverlap('EF_CB_NS_', 'SANSHypo'+hypocut+'_'+hypocutEF+cone+'_noComb_'+nscanseed+'_'+l1seed), + } else: - self.TErenamingDict = { - 'EF_SA_NS': mergeRemovingOverlap('EF_SA_NS_','SANShyp'), - } + if (self.chainPart['isoInfo']): + self.TErenamingDict = { + 'EF_SA_NS': mergeRemovingOverlap('EF_SA_NS_','SANShyp'), + 'EF_NStracksMuonIso': mergeRemovingOverlap('EF_NStracksMuonIso_', 'SANSHypo'), + 'EF_msIso' : mergeRemovingOverlap('EF_msIso_', 'SANSHypo'), + } + else: + self.TErenamingDict = { + 'EF_SA_NS': mergeRemovingOverlap('EF_SA_NS_','SANShyp'), + } ################################################################################################# diff --git a/Trigger/TriggerCommon/TriggerMenuXML/CMakeLists.txt b/Trigger/TriggerCommon/TriggerMenuXML/CMakeLists.txt index e19abffe5384c7660180907d4cf49dc86fb27c9c..3b04211f9b28e77c7de6df4c0fac227c1c6989b4 100644 --- a/Trigger/TriggerCommon/TriggerMenuXML/CMakeLists.txt +++ b/Trigger/TriggerCommon/TriggerMenuXML/CMakeLists.txt @@ -109,12 +109,14 @@ atlas_install_xmls( data/*.xml ) # List of menus to be created: atlas_build_trigger_menu( Physics_pp_v6 ) +atlas_build_trigger_menu( Physics_pp_v6_tight_physics_prescale ) atlas_build_trigger_menu( MC_pp_v6 ) atlas_build_trigger_menu( MC_pp_v6_loose_mc_prescale ) atlas_build_trigger_menu( MC_pp_v6_tight_mc_prescale ) atlas_build_trigger_menu( MC_pp_v6_tightperf_mc_prescale ) atlas_build_trigger_menu( Physics_pp_v7 ) +atlas_build_trigger_menu( Physics_pp_v7_tight_physics_prescale ) atlas_build_trigger_menu( MC_pp_v7 ) atlas_build_trigger_menu( MC_pp_v7_loose_mc_prescale ) atlas_build_trigger_menu( MC_pp_v7_tight_mc_prescale ) diff --git a/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_MC_pp_v7.xml b/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_MC_pp_v7.xml index 8cc7b64193e45a63f8fb9c55bec5ec4235ec5453..5bbda1d8f74144c6f198a432832ec98c2de2dc48 100644 --- a/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_MC_pp_v7.xml +++ b/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_MC_pp_v7.xml @@ -3,7 +3,7 @@ <LVL1Config name="MC_pp_v7" ctpVersion="4" l1Version="1"> <!--File is generated by TriggerMenu--> <!--No. L1 thresholds defined: 281--> - <!--No. L1 items defined: 460--> + <!--No. L1 items defined: 465--> <TriggerMenu name="MC_pp_v7" phase="lumi"> <TriggerItem ctpid="0" partition="1" name="L1_EM3" complex_deadtime="0" definition="(EM3[x1]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000"> <AND> @@ -577,16 +577,17 @@ <InternalTrigger name="BGRP4"/> </AND> </TriggerItem> - <TriggerItem ctpid="76" partition="1" name="L1_AFP_NSC" complex_deadtime="0" definition="(AFP_NSC[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000"> + <TriggerItem ctpid="76" partition="1" name="L1_TAU60_DR-TAU20ITAU12I" complex_deadtime="0" definition="(HA60[x1]&0DR28-TAU20abi-TAU12abi[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> + <TriggerCondition multi="1" name="HA60_x1" triggerthreshold="HA60"/> + <TriggerCondition multi="1" name="0DR28-TAU20abi-TAU12abi_x1" triggerthreshold="0DR28-TAU20abi-TAU12abi"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="77" partition="1" name="L1_AFP_FSC" complex_deadtime="0" definition="(AFP_FSC[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000"> + <TriggerItem ctpid="77" partition="1" name="L1_AFP_NSC" complex_deadtime="0" definition="(AFP_NSC[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000"> <AND> - <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> + <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -600,24 +601,21 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="79" partition="1" name="L1_AFP_C_ANY" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="79" partition="1" name="L1_AFP_FSC" complex_deadtime="0" definition="(AFP_FSC[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000"> <AND> - <OR> - <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> - <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> - </OR> + <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="80" partition="1" name="L1_AFP_C_ANY_UNPAIRED_ISO" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP4)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="80" partition="1" name="L1_AFP_C_ANY" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <OR> <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> </OR> <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP4"/> + <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> <TriggerItem ctpid="81" partition="1" name="L1_MU10_TAU12IM_XE35" complex_deadtime="0" definition="(MU10[x1]&HA12IM[x1]&XE35[x1]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000"> @@ -931,14 +929,14 @@ <InternalTrigger name="BGRP8"/> </AND> </TriggerItem> - <TriggerItem ctpid="124" partition="1" name="L1_AFP_C_ANY_UNPAIRED_NONISO" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP5)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="124" partition="1" name="L1_AFP_C_ANY_UNPAIRED_ISO" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP4)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <OR> <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> </OR> <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP5"/> + <InternalTrigger name="BGRP4"/> </AND> </TriggerItem> <TriggerItem ctpid="125" partition="1" name="L1_J20_J20.31ETA49" complex_deadtime="0" definition="(J20[x1]&J20.31ETA49[x1]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000"> @@ -1043,14 +1041,14 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="139" partition="1" name="L1_AFP_C_ANY_EMPTY" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP3)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="139" partition="1" name="L1_AFP_C_ANY_UNPAIRED_NONISO" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP5)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <OR> <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> </OR> <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP3"/> + <InternalTrigger name="BGRP5"/> </AND> </TriggerItem> <TriggerItem ctpid="140" partition="1" name="L1_5J15.0ETA25" complex_deadtime="0" definition="(J15.0ETA25[x5]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000"> @@ -2150,28 +2148,30 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="274" partition="1" name="L1_AFP_C_ANY_FIRSTEMPTY" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP6)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="274" partition="1" name="L1_AFP_C_ANY_EMPTY" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP3)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <OR> <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> </OR> <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP6"/> + <InternalTrigger name="BGRP3"/> </AND> </TriggerItem> - <TriggerItem ctpid="275" partition="1" name="L1_AFP_C_AND" complex_deadtime="0" definition="(AFP_FSC[x1]&AFP_NSC[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="275" partition="1" name="L1_AFP_C_ANY_FIRSTEMPTY" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP6)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> - <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> + <OR> + <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> + <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> + </OR> <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP1"/> + <InternalTrigger name="BGRP6"/> </AND> </TriggerItem> - <TriggerItem ctpid="276" partition="1" name="L1_EM12_W-MT25" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="276" partition="1" name="L1_AFP_C_AND" complex_deadtime="0" definition="(AFP_FSC[x1]&AFP_NSC[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/> - <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> + <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> + <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -2219,7 +2219,15 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="283" partition="1" name="L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&XS30[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="283" partition="1" name="L1_EM12_W-MT25" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <AND> + <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/> + <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> + <InternalTrigger name="BGRP0"/> + <InternalTrigger name="BGRP1"/> + </AND> + </TriggerItem> + <TriggerItem ctpid="284" partition="1" name="L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&XS30[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> @@ -2230,7 +2238,7 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="284" partition="1" name="L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&XS40[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="285" partition="1" name="L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&XS40[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> @@ -2241,26 +2249,26 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="285" partition="1" name="L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&90RATIO2-XE0-HT0-AJj15all.ETA49[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="286" partition="1" name="L1_EM15_W-MT35" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> - <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> - <TriggerCondition multi="1" name="90RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="90RATIO2-XE0-HT0-AJj15all.ETA49"/> - <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> - <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> + <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> + <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="286" partition="1" name="L1_EM15_W-MT35" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="287" partition="1" name="L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&90RATIO2-XE0-HT0-AJj15all.ETA49[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> - <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> + <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> + <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> + <TriggerCondition multi="1" name="90RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="90RATIO2-XE0-HT0-AJj15all.ETA49"/> + <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> + <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="287" partition="1" name="L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="288" partition="1" name="L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> @@ -2271,7 +2279,7 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="288" partition="1" name="L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="289" partition="1" name="L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> @@ -2282,7 +2290,7 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="289" partition="1" name="L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="290" partition="1" name="L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> @@ -2293,7 +2301,7 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="290" partition="1" name="L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS60[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="291" partition="1" name="L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS60[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> @@ -2304,7 +2312,7 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="291" partition="1" name="L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS60[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="292" partition="1" name="L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS60[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> @@ -2315,7 +2323,7 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="292" partition="1" name="L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS40[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="293" partition="1" name="L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS40[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> @@ -2326,7 +2334,7 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="293" partition="1" name="L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS40[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="294" partition="1" name="L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS40[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> @@ -2337,15 +2345,6 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="294" partition="1" name="L1_EM12_W-MT35_XS50" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&XS50[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> - <AND> - <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> - <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> - <TriggerCondition multi="1" name="XS50_x1" triggerthreshold="XS50"/> - <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP1"/> - </AND> - </TriggerItem> <TriggerItem ctpid="295" partition="1" name="L1_EM18VH_3J20" complex_deadtime="0" definition="(EM18VH[x1]&J20[x3]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="EM18VH_x1" triggerthreshold="EM18VH"/> @@ -2450,20 +2449,20 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="308" partition="1" name="L1_EM15_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS60[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="308" partition="1" name="L1_EM12_W-MT35_XS50" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&XS50[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> - <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> - <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/> + <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> + <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> + <TriggerCondition multi="1" name="XS50_x1" triggerthreshold="XS50"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="309" partition="1" name="L1_EM10VH_W-MT35_XS50" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM10VH[x1]&XS50[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="309" partition="1" name="L1_EM15_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS60[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> - <TriggerCondition multi="1" name="EM10VH_x1" triggerthreshold="EM10VH"/> - <TriggerCondition multi="1" name="XS50_x1" triggerthreshold="XS50"/> + <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> + <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> + <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -2523,11 +2522,11 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="317" partition="1" name="L1_EM15VH_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15VH[x1]&XS60[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="317" partition="1" name="L1_EM10VH_W-MT35_XS50" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM10VH[x1]&XS50[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> - <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/> - <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/> + <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> + <TriggerCondition multi="1" name="EM10VH_x1" triggerthreshold="EM10VH"/> + <TriggerCondition multi="1" name="XS50_x1" triggerthreshold="XS50"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -2658,10 +2657,10 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="335" partition="1" name="L1_EM20VH_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM20VH[x1]&XS60[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="335" partition="1" name="L1_EM15VH_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15VH[x1]&XS60[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> - <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/> + <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/> <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> @@ -2709,11 +2708,11 @@ <InternalTrigger name="BGRP3"/> </AND> </TriggerItem> - <TriggerItem ctpid="342" partition="1" name="L1_EM22VHI_W-MT35_XS40" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM22VHI[x1]&XS40[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="342" partition="1" name="L1_EM20VH_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM20VH[x1]&XS60[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> - <TriggerCondition multi="1" name="EM22VHI_x1" triggerthreshold="EM22VHI"/> - <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/> + <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/> + <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -2725,13 +2724,11 @@ <InternalTrigger name="BGRP4"/> </AND> </TriggerItem> - <TriggerItem ctpid="344" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&90RATIO2-XE0-HT0-AJj15all.ETA49[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="344" partition="1" name="L1_EM22VHI_W-MT35_XS40" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM22VHI[x1]&XS40[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/> - <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> - <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> - <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> - <TriggerCondition multi="1" name="90RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="90RATIO2-XE0-HT0-AJj15all.ETA49"/> + <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> + <TriggerCondition multi="1" name="EM22VHI_x1" triggerthreshold="EM22VHI"/> + <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -3048,13 +3045,13 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="384" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&XS20[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="384" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&90RATIO2-XE0-HT0-AJj15all.ETA49[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/> <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> - <TriggerCondition multi="1" name="XS20_x1" triggerthreshold="XS20"/> + <TriggerCondition multi="1" name="90RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="90RATIO2-XE0-HT0-AJj15all.ETA49"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -3287,12 +3284,13 @@ <InternalTrigger name="BGRP6"/> </AND> </TriggerItem> - <TriggerItem ctpid="416" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="416" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&XS20[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/> <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> + <TriggerCondition multi="1" name="XS20_x1" triggerthreshold="XS20"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -3378,13 +3376,10 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="428" partition="1" name="L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&XS30[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="428" partition="1" name="L1_MU20_J40" complex_deadtime="0" definition="(MU20[x1]&J40[x1]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> - <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> - <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/> - <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/> - <TriggerCondition multi="1" name="XS30_x1" triggerthreshold="XS30"/> + <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/> + <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -3423,7 +3418,57 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="433" partition="1" name="L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="433" partition="1" name="L1_MU20_XE30" complex_deadtime="0" definition="(MU20[x1]&XE30[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <AND> + <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/> + <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/> + <InternalTrigger name="BGRP0"/> + <InternalTrigger name="BGRP1"/> + </AND> + </TriggerItem> + <TriggerItem ctpid="434" partition="1" name="L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30" complex_deadtime="0" definition="(MU4[x1]&EM3[x2]&J20[x1]&XE30[x1]&10MINDPHI-J20s2-XE30[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <AND> + <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/> + <TriggerCondition multi="2" name="EM3_x2" triggerthreshold="EM3"/> + <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/> + <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/> + <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE30_x1" triggerthreshold="10MINDPHI-J20s2-XE30"/> + <InternalTrigger name="BGRP0"/> + <InternalTrigger name="BGRP1"/> + </AND> + </TriggerItem> + <TriggerItem ctpid="435" partition="1" name="L1_3EM3_J40_XE50_DPHI-J20s2XE50" complex_deadtime="0" definition="(EM3[x3]&J40[x1]&XE50[x1]&10MINDPHI-J20s2-XE50[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <AND> + <TriggerCondition multi="3" name="EM3_x3" triggerthreshold="EM3"/> + <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/> + <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/> + <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE50_x1" triggerthreshold="10MINDPHI-J20s2-XE50"/> + <InternalTrigger name="BGRP0"/> + <InternalTrigger name="BGRP1"/> + </AND> + </TriggerItem> + <TriggerItem ctpid="436" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <AND> + <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/> + <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> + <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> + <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> + <InternalTrigger name="BGRP0"/> + <InternalTrigger name="BGRP1"/> + </AND> + </TriggerItem> + <TriggerItem ctpid="437" partition="1" name="L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&XS30[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <AND> + <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> + <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> + <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/> + <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/> + <TriggerCondition multi="1" name="XS30_x1" triggerthreshold="XS30"/> + <InternalTrigger name="BGRP0"/> + <InternalTrigger name="BGRP1"/> + </AND> + </TriggerItem> + <TriggerItem ctpid="438" partition="1" name="L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> @@ -3433,7 +3478,7 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="434" partition="1" name="L1_HT150-JJ15.ETA49_MJJ-400" complex_deadtime="0" definition="(HT150-AJj15all.ETA49[x1]&400INVM9999-AJ30s6-AJ20s6[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="439" partition="1" name="L1_HT150-JJ15.ETA49_MJJ-400" complex_deadtime="0" definition="(HT150-AJj15all.ETA49[x1]&400INVM9999-AJ30s6-AJ20s6[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="HT150-AJj15all.ETA49_x1" triggerthreshold="HT150-AJj15all.ETA49"/> <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/> @@ -4051,11 +4096,11 @@ <Prescale ctpid="432" cut="000001" value="1"/> <Prescale ctpid="433" cut="000001" value="1"/> <Prescale ctpid="434" cut="000001" value="1"/> - <Prescale ctpid="435" cut="-000001" value="-1"/> - <Prescale ctpid="436" cut="-000001" value="-1"/> - <Prescale ctpid="437" cut="-000001" value="-1"/> - <Prescale ctpid="438" cut="-000001" value="-1"/> - <Prescale ctpid="439" cut="-000001" value="-1"/> + <Prescale ctpid="435" cut="000001" value="1"/> + <Prescale ctpid="436" cut="000001" value="1"/> + <Prescale ctpid="437" cut="000001" value="1"/> + <Prescale ctpid="438" cut="000001" value="1"/> + <Prescale ctpid="439" cut="000001" value="1"/> <Prescale ctpid="440" cut="-000001" value="-1"/> <Prescale ctpid="441" cut="-000001" value="-1"/> <Prescale ctpid="442" cut="-000001" value="-1"/> diff --git a/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_Physics_pp_v7.xml b/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_Physics_pp_v7.xml index 8ef8686b16a72c9481f84cdbd0e8379ba8de8242..dff2fd61443c8da429a10a074ad64dfdc9ceb4c2 100644 --- a/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_Physics_pp_v7.xml +++ b/Trigger/TriggerCommon/TriggerMenuXML/data/LVL1config_Physics_pp_v7.xml @@ -3,7 +3,7 @@ <LVL1Config name="Physics_pp_v7" ctpVersion="4" l1Version="1"> <!--File is generated by TriggerMenu--> <!--No. L1 thresholds defined: 281--> - <!--No. L1 items defined: 459--> + <!--No. L1 items defined: 466--> <TriggerMenu name="Physics_pp_v7" phase="lumi"> <TriggerItem ctpid="0" partition="1" name="L1_EM3" complex_deadtime="0" definition="(EM3[x1]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:111|HF:000"> <AND> @@ -337,9 +337,9 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="46" partition="1" name="L1_TE15.0ETA24" complex_deadtime="0" definition="(TE15.0ETA24[x1]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000"> + <TriggerItem ctpid="46" partition="1" name="L1_4MU4" complex_deadtime="0" definition="(MU4[x4]&BGRP0&BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="TE15.0ETA24_x1" triggerthreshold="TE15.0ETA24"/> + <TriggerCondition multi="4" name="MU4_x4" triggerthreshold="MU4"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -351,9 +351,10 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="48" partition="1" name="L1_AFP_NSC" complex_deadtime="0" definition="(AFP_NSC[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000"> + <TriggerItem ctpid="48" partition="1" name="L1_EM8VH_MU15" complex_deadtime="0" definition="(EM8VH[x1]&MU15[x1]&BGRP0&BGRP1)" trigger_type="10001000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> + <TriggerCondition multi="1" name="EM8VH_x1" triggerthreshold="EM8VH"/> + <TriggerCondition multi="1" name="MU15_x1" triggerthreshold="MU15"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -365,9 +366,9 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="50" partition="1" name="L1_AFP_FSC" complex_deadtime="0" definition="(AFP_FSC[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000"> + <TriggerItem ctpid="50" partition="1" name="L1_TE15.0ETA24" complex_deadtime="0" definition="(TE15.0ETA24[x1]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> + <TriggerCondition multi="1" name="TE15.0ETA24_x1" triggerthreshold="TE15.0ETA24"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -576,24 +577,19 @@ <InternalTrigger name="BGRP4"/> </AND> </TriggerItem> - <TriggerItem ctpid="76" partition="1" name="L1_AFP_C_ANY" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="76" partition="1" name="L1_TAU60_DR-TAU20ITAU12I" complex_deadtime="0" definition="(HA60[x1]&0DR28-TAU20abi-TAU12abi[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <OR> - <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> - <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> - </OR> + <TriggerCondition multi="1" name="HA60_x1" triggerthreshold="HA60"/> + <TriggerCondition multi="1" name="0DR28-TAU20abi-TAU12abi_x1" triggerthreshold="0DR28-TAU20abi-TAU12abi"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="77" partition="1" name="L1_AFP_C_ANY_UNPAIRED_ISO" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP4)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="77" partition="1" name="L1_AFP_NSC" complex_deadtime="0" definition="(AFP_NSC[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000"> <AND> - <OR> - <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> - <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> - </OR> + <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP4"/> + <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> <TriggerItem ctpid="78" partition="1" name="L1_EM15HI_2TAU12IM_XE35" complex_deadtime="0" definition="(EM15HI[x1]&HA12IM[x2]&XE35[x1]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000"> @@ -605,24 +601,21 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="79" partition="1" name="L1_AFP_C_ANY_UNPAIRED_NONISO" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP5)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="79" partition="1" name="L1_AFP_FSC" complex_deadtime="0" definition="(AFP_FSC[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000"> <AND> - <OR> - <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> - <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> - </OR> + <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP5"/> + <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="80" partition="1" name="L1_AFP_C_ANY_EMPTY" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP3)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="80" partition="1" name="L1_AFP_C_ANY" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <OR> <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> </OR> <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP3"/> + <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> <TriggerItem ctpid="81" partition="1" name="L1_MU10_TAU12IM_XE35" complex_deadtime="0" definition="(MU10[x1]&HA12IM[x1]&XE35[x1]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000"> @@ -936,14 +929,14 @@ <InternalTrigger name="BGRP8"/> </AND> </TriggerItem> - <TriggerItem ctpid="124" partition="1" name="L1_AFP_C_ANY_FIRSTEMPTY" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP6)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="124" partition="1" name="L1_AFP_C_ANY_UNPAIRED_ISO" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP4)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <OR> <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> </OR> <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP6"/> + <InternalTrigger name="BGRP4"/> </AND> </TriggerItem> <TriggerItem ctpid="125" partition="1" name="L1_J20_J20.31ETA49" complex_deadtime="0" definition="(J20[x1]&J20.31ETA49[x1]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000"> @@ -1048,12 +1041,14 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="139" partition="1" name="L1_AFP_C_AND" complex_deadtime="0" definition="(AFP_FSC[x1]&AFP_NSC[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="139" partition="1" name="L1_AFP_C_ANY_UNPAIRED_NONISO" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP5)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> - <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> + <OR> + <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> + <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> + </OR> <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP1"/> + <InternalTrigger name="BGRP5"/> </AND> </TriggerItem> <TriggerItem ctpid="140" partition="1" name="L1_5J15.0ETA25" complex_deadtime="0" definition="(J15.0ETA25[x5]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000"> @@ -1969,12 +1964,14 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="250" partition="1" name="L1_EM12_W-MT25" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="250" partition="1" name="L1_AFP_C_ANY_EMPTY" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP3)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/> - <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> + <OR> + <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> + <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> + </OR> <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP1"/> + <InternalTrigger name="BGRP3"/> </AND> </TriggerItem> <TriggerItem ctpid="251" partition="1" name="L1_J40_DPHI-J20s2XE50" complex_deadtime="0" definition="(J40[x1]&10MINDPHI-J20s2-XE50[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:111|HF:000"> @@ -2152,35 +2149,28 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="274" partition="1" name="L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&XS30[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="274" partition="1" name="L1_AFP_C_ANY_FIRSTEMPTY" complex_deadtime="0" definition="((AFP_FSC[x1]|AFP_NSC[x1])&BGRP0&BGRP6)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> - <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> - <TriggerCondition multi="1" name="XS30_x1" triggerthreshold="XS30"/> - <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> - <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> + <OR> + <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> + <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> + </OR> <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP1"/> + <InternalTrigger name="BGRP6"/> </AND> </TriggerItem> - <TriggerItem ctpid="275" partition="1" name="L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&XS40[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="275" partition="1" name="L1_AFP_C_AND" complex_deadtime="0" definition="(AFP_FSC[x1]&AFP_NSC[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> - <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> - <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/> - <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/> - <TriggerCondition multi="1" name="05MINDPHI-EM12s6-XE0_x1" triggerthreshold="05MINDPHI-EM12s6-XE0"/> + <TriggerCondition multi="1" name="AFP_FSC_x1" triggerthreshold="AFP_FSC"/> + <TriggerCondition multi="1" name="AFP_NSC_x1" triggerthreshold="AFP_NSC"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="276" partition="1" name="L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&90RATIO2-XE0-HT0-AJj15all.ETA49[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="276" partition="1" name="L1_EM12_W-MT25" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> + <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/> <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> - <TriggerCondition multi="1" name="90RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="90RATIO2-XE0-HT0-AJj15all.ETA49"/> - <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> - <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -2228,127 +2218,133 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="283" partition="1" name="L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="283" partition="1" name="L1_EM12_W-MT35_XS30_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&XS30[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> - <TriggerCondition multi="1" name="250RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="250RATIO2-XE0-HT0-AJj15all.ETA49"/> + <TriggerCondition multi="1" name="XS30_x1" triggerthreshold="XS30"/> + <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> + <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> + <InternalTrigger name="BGRP0"/> + <InternalTrigger name="BGRP1"/> + </AND> + </TriggerItem> + <TriggerItem ctpid="284" partition="1" name="L1_EM12_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&XS40[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <AND> + <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> + <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> + <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/> <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/> <TriggerCondition multi="1" name="05MINDPHI-EM12s6-XE0_x1" triggerthreshold="05MINDPHI-EM12s6-XE0"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="284" partition="1" name="L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="285" partition="1" name="L1_EM12_W-MT35_W-90RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&90RATIO2-XE0-HT0-AJj15all.ETA49[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> - <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> - <TriggerCondition multi="1" name="250RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="250RATIO2-XE0-HT0-AJj15all.ETA49"/> + <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> + <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> + <TriggerCondition multi="1" name="90RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="90RATIO2-XE0-HT0-AJj15all.ETA49"/> <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> - <TriggerCondition multi="1" name="15MINDPHI-EM15s6-XE0_x1" triggerthreshold="15MINDPHI-EM15s6-XE0"/> + <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="285" partition="1" name="L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="286" partition="1" name="L1_EM15_W-MT35" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> - <TriggerCondition multi="1" name="250RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="250RATIO2-XE0-HT0-AJj15all.ETA49"/> - <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/> - <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="286" partition="1" name="L1_EM15_W-MT35" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="287" partition="1" name="L1_EM12_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EMXE" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> - <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> + <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> + <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> + <TriggerCondition multi="1" name="250RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="250RATIO2-XE0-HT0-AJj15all.ETA49"/> + <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/> + <TriggerCondition multi="1" name="05MINDPHI-EM12s6-XE0_x1" triggerthreshold="05MINDPHI-EM12s6-XE0"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="287" partition="1" name="L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS60[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="288" partition="1" name="L1_EM15_W-MT35_W-250RO2-XEHT-0_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> - <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/> + <TriggerCondition multi="1" name="250RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="250RATIO2-XE0-HT0-AJj15all.ETA49"/> <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> <TriggerCondition multi="1" name="15MINDPHI-EM15s6-XE0_x1" triggerthreshold="15MINDPHI-EM15s6-XE0"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="288" partition="1" name="L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS60[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="289" partition="1" name="L1_EM15_W-MT35_W-250RO2-XEHT-0_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&250RATIO2-XE0-HT0-AJj15all.ETA49[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> - <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/> + <TriggerCondition multi="1" name="250RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="250RATIO2-XE0-HT0-AJj15all.ETA49"/> <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/> <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="289" partition="1" name="L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS40[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="290" partition="1" name="L1_EM15_W-MT35_XS60_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS60[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> - <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/> + <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/> <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> <TriggerCondition multi="1" name="15MINDPHI-EM15s6-XE0_x1" triggerthreshold="15MINDPHI-EM15s6-XE0"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="290" partition="1" name="L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS40[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="291" partition="1" name="L1_EM15_W-MT35_XS60_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS60[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> - <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/> + <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/> <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/> <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="291" partition="1" name="L1_EM12_W-MT35_XS50" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&XS50[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="292" partition="1" name="L1_EM15_W-MT35_XS40_W-15DPHI-JXE-0_W-15DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS40[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> - <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> - <TriggerCondition multi="1" name="XS50_x1" triggerthreshold="XS50"/> + <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> + <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> + <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/> + <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> + <TriggerCondition multi="1" name="15MINDPHI-EM15s6-XE0_x1" triggerthreshold="15MINDPHI-EM15s6-XE0"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="292" partition="1" name="L1_EM15_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS60[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="293" partition="1" name="L1_EM15_W-MT35_XS40_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS40[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> - <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/> + <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/> + <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/> + <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="293" partition="1" name="L1_EM10VH_W-MT35_XS50" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM10VH[x1]&XS50[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="294" partition="1" name="L1_EM12_W-MT35_XS50" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM12[x1]&XS50[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> - <TriggerCondition multi="1" name="EM10VH_x1" triggerthreshold="EM10VH"/> + <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> <TriggerCondition multi="1" name="XS50_x1" triggerthreshold="XS50"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="294" partition="1" name="L1_EM15VH_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15VH[x1]&XS60[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> - <AND> - <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> - <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/> - <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/> - <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP1"/> - </AND> - </TriggerItem> <TriggerItem ctpid="295" partition="1" name="L1_EM18VH_3J20" complex_deadtime="0" definition="(EM18VH[x1]&J20[x3]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="EM18VH_x1" triggerthreshold="EM18VH"/> @@ -2453,20 +2449,20 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="308" partition="1" name="L1_EM20VH_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM20VH[x1]&XS60[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="308" partition="1" name="L1_EM15_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&XS60[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> - <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/> + <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="309" partition="1" name="L1_EM22VHI_W-MT35_XS40" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM22VHI[x1]&XS40[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="309" partition="1" name="L1_EM10VH_W-MT35_XS50" complex_deadtime="0" definition="(35MT-EM12s6-XE0[x1]&EM10VH[x1]&XS50[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> - <TriggerCondition multi="1" name="EM22VHI_x1" triggerthreshold="EM22VHI"/> - <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/> + <TriggerCondition multi="1" name="35MT-EM12s6-XE0_x1" triggerthreshold="35MT-EM12s6-XE0"/> + <TriggerCondition multi="1" name="EM10VH_x1" triggerthreshold="EM10VH"/> + <TriggerCondition multi="1" name="XS50_x1" triggerthreshold="XS50"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -2526,13 +2522,11 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="317" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&90RATIO2-XE0-HT0-AJj15all.ETA49[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="317" partition="1" name="L1_EM15VH_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15VH[x1]&XS60[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/> - <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> - <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> - <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> - <TriggerCondition multi="1" name="90RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="90RATIO2-XE0-HT0-AJj15all.ETA49"/> + <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> + <TriggerCondition multi="1" name="EM15VH_x1" triggerthreshold="EM15VH"/> + <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -2663,13 +2657,11 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="335" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&XS20[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="335" partition="1" name="L1_EM20VH_W-MT35_XS60" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM20VH[x1]&XS60[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/> - <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> - <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> - <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> - <TriggerCondition multi="1" name="XS20_x1" triggerthreshold="XS20"/> + <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> + <TriggerCondition multi="1" name="EM20VH_x1" triggerthreshold="EM20VH"/> + <TriggerCondition multi="1" name="XS60_x1" triggerthreshold="XS60"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -2716,12 +2708,11 @@ <InternalTrigger name="BGRP3"/> </AND> </TriggerItem> - <TriggerItem ctpid="342" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="342" partition="1" name="L1_EM22VHI_W-MT35_XS40" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM22VHI[x1]&XS40[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/> - <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> - <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> - <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> + <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> + <TriggerCondition multi="1" name="EM22VHI_x1" triggerthreshold="EM22VHI"/> + <TriggerCondition multi="1" name="XS40_x1" triggerthreshold="XS40"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -2733,13 +2724,13 @@ <InternalTrigger name="BGRP4"/> </AND> </TriggerItem> - <TriggerItem ctpid="344" partition="1" name="L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&XS30[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="344" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_W-90RO2-XEHT-0" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&90RATIO2-XE0-HT0-AJj15all.ETA49[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> - <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> - <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/> - <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/> - <TriggerCondition multi="1" name="XS30_x1" triggerthreshold="XS30"/> + <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/> + <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> + <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> + <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> + <TriggerCondition multi="1" name="90RATIO2-XE0-HT0-AJj15all.ETA49_x1" triggerthreshold="90RATIO2-XE0-HT0-AJj15all.ETA49"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -3056,12 +3047,13 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="384" partition="1" name="L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="384" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE_XS20" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&XS20[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> - <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> - <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/> - <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/> + <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/> + <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> + <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> + <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> + <TriggerCondition multi="1" name="XS20_x1" triggerthreshold="XS20"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -3294,10 +3286,12 @@ <InternalTrigger name="BGRP6"/> </AND> </TriggerItem> - <TriggerItem ctpid="416" partition="1" name="L1_HT150-JJ15.ETA49_MJJ-400" complex_deadtime="0" definition="(HT150-AJj15all.ETA49[x1]&400INVM9999-AJ30s6-AJ20s6[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <TriggerItem ctpid="416" partition="1" name="L1_EM12_W-MT25_W-15DPHI-JXE-0_W-15DPHI-EMXE" complex_deadtime="0" definition="(25MT-EM12s6-XE0[x1]&EM12[x1]&15MINDPHI-AJj10s6-XE0[x1]&15MINDPHI-EM12s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> <AND> - <TriggerCondition multi="1" name="HT150-AJj15all.ETA49_x1" triggerthreshold="HT150-AJj15all.ETA49"/> - <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/> + <TriggerCondition multi="1" name="25MT-EM12s6-XE0_x1" triggerthreshold="25MT-EM12s6-XE0"/> + <TriggerCondition multi="1" name="EM12_x1" triggerthreshold="EM12"/> + <TriggerCondition multi="1" name="15MINDPHI-AJj10s6-XE0_x1" triggerthreshold="15MINDPHI-AJj10s6-XE0"/> + <TriggerCondition multi="1" name="15MINDPHI-EM12s6-XE0_x1" triggerthreshold="15MINDPHI-EM12s6-XE0"/> <InternalTrigger name="BGRP0"/> <InternalTrigger name="BGRP1"/> </AND> @@ -3383,11 +3377,12 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="428" partition="2" name="L1_RD2_BGRP14" complex_deadtime="0" definition="(RNDM2&BGRP0&BGRP14)" trigger_type="0001" monitor="LF:000|HF:000"> + <TriggerItem ctpid="428" partition="1" name="L1_MU20_J40" complex_deadtime="0" definition="(MU20[x1]&J40[x1]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000"> <AND> - <InternalTrigger name="RNDM2"/> + <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/> + <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/> <InternalTrigger name="BGRP0"/> - <InternalTrigger name="BGRP14"/> + <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> <TriggerItem ctpid="429" partition="1" name="L1_TAU40_2TAU12IM_XE40" complex_deadtime="0" definition="(HA40[x1]&HA12IM[x2]&XE40[x1]&BGRP0&BGRP1)" trigger_type="10000100" monitor="LF:000|HF:000"> @@ -3424,7 +3419,72 @@ <InternalTrigger name="BGRP1"/> </AND> </TriggerItem> - <TriggerItem ctpid="433" partition="3" name="L1_RD3_BGRP15" complex_deadtime="0" definition="(RNDM3&BGRP0&BGRP15)" trigger_type="0001" monitor="LF:000|HF:000"> + <TriggerItem ctpid="433" partition="1" name="L1_MU20_XE30" complex_deadtime="0" definition="(MU20[x1]&XE30[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <AND> + <TriggerCondition multi="1" name="MU20_x1" triggerthreshold="MU20"/> + <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/> + <InternalTrigger name="BGRP0"/> + <InternalTrigger name="BGRP1"/> + </AND> + </TriggerItem> + <TriggerItem ctpid="434" partition="1" name="L1_MU4_2EM3_J20_XE30_DPHI-J20s2XE30" complex_deadtime="0" definition="(MU4[x1]&EM3[x2]&J20[x1]&XE30[x1]&10MINDPHI-J20s2-XE30[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <AND> + <TriggerCondition multi="1" name="MU4_x1" triggerthreshold="MU4"/> + <TriggerCondition multi="2" name="EM3_x2" triggerthreshold="EM3"/> + <TriggerCondition multi="1" name="J20_x1" triggerthreshold="J20"/> + <TriggerCondition multi="1" name="XE30_x1" triggerthreshold="XE30"/> + <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE30_x1" triggerthreshold="10MINDPHI-J20s2-XE30"/> + <InternalTrigger name="BGRP0"/> + <InternalTrigger name="BGRP1"/> + </AND> + </TriggerItem> + <TriggerItem ctpid="435" partition="1" name="L1_3EM3_J40_XE50_DPHI-J20s2XE50" complex_deadtime="0" definition="(EM3[x3]&J40[x1]&XE50[x1]&10MINDPHI-J20s2-XE50[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <AND> + <TriggerCondition multi="3" name="EM3_x3" triggerthreshold="EM3"/> + <TriggerCondition multi="1" name="J40_x1" triggerthreshold="J40"/> + <TriggerCondition multi="1" name="XE50_x1" triggerthreshold="XE50"/> + <TriggerCondition multi="1" name="10MINDPHI-J20s2-XE50_x1" triggerthreshold="10MINDPHI-J20s2-XE50"/> + <InternalTrigger name="BGRP0"/> + <InternalTrigger name="BGRP1"/> + </AND> + </TriggerItem> + <TriggerItem ctpid="436" partition="1" name="L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE_XS30" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&XS30[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <AND> + <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> + <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> + <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/> + <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/> + <TriggerCondition multi="1" name="XS30_x1" triggerthreshold="XS30"/> + <InternalTrigger name="BGRP0"/> + <InternalTrigger name="BGRP1"/> + </AND> + </TriggerItem> + <TriggerItem ctpid="437" partition="1" name="L1_EM15_W-MT35_W-05DPHI-JXE-0_W-05DPHI-EM15XE" complex_deadtime="0" definition="(35MT-EM15s6-XE0[x1]&EM15[x1]&05MINDPHI-AJj10s6-XE0[x1]&05MINDPHI-EM15s6-XE0[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <AND> + <TriggerCondition multi="1" name="35MT-EM15s6-XE0_x1" triggerthreshold="35MT-EM15s6-XE0"/> + <TriggerCondition multi="1" name="EM15_x1" triggerthreshold="EM15"/> + <TriggerCondition multi="1" name="05MINDPHI-AJj10s6-XE0_x1" triggerthreshold="05MINDPHI-AJj10s6-XE0"/> + <TriggerCondition multi="1" name="05MINDPHI-EM15s6-XE0_x1" triggerthreshold="05MINDPHI-EM15s6-XE0"/> + <InternalTrigger name="BGRP0"/> + <InternalTrigger name="BGRP1"/> + </AND> + </TriggerItem> + <TriggerItem ctpid="438" partition="1" name="L1_HT150-JJ15.ETA49_MJJ-400" complex_deadtime="0" definition="(HT150-AJj15all.ETA49[x1]&400INVM9999-AJ30s6-AJ20s6[x1]&BGRP0&BGRP1)" trigger_type="10000000" monitor="LF:000|HF:000"> + <AND> + <TriggerCondition multi="1" name="HT150-AJj15all.ETA49_x1" triggerthreshold="HT150-AJj15all.ETA49"/> + <TriggerCondition multi="1" name="400INVM9999-AJ30s6-AJ20s6_x1" triggerthreshold="400INVM9999-AJ30s6-AJ20s6"/> + <InternalTrigger name="BGRP0"/> + <InternalTrigger name="BGRP1"/> + </AND> + </TriggerItem> + <TriggerItem ctpid="439" partition="2" name="L1_RD2_BGRP14" complex_deadtime="0" definition="(RNDM2&BGRP0&BGRP14)" trigger_type="0001" monitor="LF:000|HF:000"> + <AND> + <InternalTrigger name="RNDM2"/> + <InternalTrigger name="BGRP0"/> + <InternalTrigger name="BGRP14"/> + </AND> + </TriggerItem> + <TriggerItem ctpid="440" partition="3" name="L1_RD3_BGRP15" complex_deadtime="0" definition="(RNDM3&BGRP0&BGRP15)" trigger_type="0001" monitor="LF:000|HF:000"> <AND> <InternalTrigger name="RNDM3"/> <InternalTrigger name="BGRP0"/> @@ -4040,13 +4100,13 @@ <Prescale ctpid="431" cut="000001" value="1"/> <Prescale ctpid="432" cut="000001" value="1"/> <Prescale ctpid="433" cut="000001" value="1"/> - <Prescale ctpid="434" cut="-000001" value="-1"/> - <Prescale ctpid="435" cut="-000001" value="-1"/> - <Prescale ctpid="436" cut="-000001" value="-1"/> - <Prescale ctpid="437" cut="-000001" value="-1"/> - <Prescale ctpid="438" cut="-000001" value="-1"/> - <Prescale ctpid="439" cut="-000001" value="-1"/> - <Prescale ctpid="440" cut="-000001" value="-1"/> + <Prescale ctpid="434" cut="000001" value="1"/> + <Prescale ctpid="435" cut="000001" value="1"/> + <Prescale ctpid="436" cut="000001" value="1"/> + <Prescale ctpid="437" cut="000001" value="1"/> + <Prescale ctpid="438" cut="000001" value="1"/> + <Prescale ctpid="439" cut="000001" value="1"/> + <Prescale ctpid="440" cut="000001" value="1"/> <Prescale ctpid="441" cut="-000001" value="-1"/> <Prescale ctpid="442" cut="-000001" value="-1"/> <Prescale ctpid="443" cut="-000001" value="-1"/> diff --git a/Trigger/TriggerCommon/TriggerMenuXML/doc/mainpage.h b/Trigger/TriggerCommon/TriggerMenuXML/doc/mainpage.h deleted file mode 100644 index a5c62b312a41f63682683c4013997088bfc3f8eb..0000000000000000000000000000000000000000 --- a/Trigger/TriggerCommon/TriggerMenuXML/doc/mainpage.h +++ /dev/null @@ -1,20 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - - - -@mainpage - -@section TrigerMenuPythonIntro Introduction - -This package contains only fozen trigger configurations in XML files. -This files are meant to be used during productions. They should be for low/high luminosities. - -@htmlinclude used_packages.html - -@include requirements - -*/ diff --git a/Trigger/TriggerCommon/TriggerMenuXML/scripts/XMLDumperFromAthena.sh b/Trigger/TriggerCommon/TriggerMenuXML/scripts/XMLDumperFromAthena.sh index 8498e57c90832b577b0130a213f4e47c1e25b711..ab2abe193511efe715e1baea68736498f9b7958d 100755 --- a/Trigger/TriggerCommon/TriggerMenuXML/scripts/XMLDumperFromAthena.sh +++ b/Trigger/TriggerCommon/TriggerMenuXML/scripts/XMLDumperFromAthena.sh @@ -59,7 +59,6 @@ TRAPTERM() { return 143 # 128+SIGTERM } - ## menu generation starts here if [ -n "${AtlasTrigger_PLATFORM}" ]; then # CMAKE platform=${AtlasTrigger_PLATFORM} @@ -76,16 +75,13 @@ generateL1TopoMenu.py $menu >&! $logfiletopo cp L1Topoconfig_*.xml ${dest} # L1 + HLT config file -if [ -z "$TMXML_BUILD_TEST" ]; then - athena.py -c "TriggerMenuSetup='$menu'" $jo >&! $logfile - athena_exit=$? +if [ -z "$TMXML_DEBUG" ]; then + MSGLVL="" else - # Set the above env var to fake the output files (for fast build system test) - echo $menu > outputLVL1config.xml - echo $menu > outputHLTconfig.xml - echo $menu > $logfile - athena_exit=0 + MSGLVL="-lDEBUG" fi +athena.py $MSGLVL -c "TriggerMenuSetup='$menu'" $jo >&! $logfile +athena_exit=$? cp $logfile $logfiletopo ${dest} if [ $athena_exit -eq 0 ]; then diff --git a/Trigger/TriggerRelease/doc/mainpage.h b/Trigger/TriggerRelease/doc/mainpage.h deleted file mode 100755 index c7751c64923b4220c6f6999da972afd4c7ad9066..0000000000000000000000000000000000000000 --- a/Trigger/TriggerRelease/doc/mainpage.h +++ /dev/null @@ -1,35 +0,0 @@ -/* - Copyright (C) 2002-2017 CERN for the benefit of the ATLAS collaboration -*/ - -/** - -@mainpage TriggerRelease Package -@author John.Baines@cern.ch Simon.George@cern.ch Tomasz.Bold@cern.ch Xin.Wu@cern.ch Brian.Petersen@cern.ch -@section IntroTriggerRelease Introduction - -This package contains the top level jobOptions for the standalone (e.g. online) running of the trigger -and for the decoding of trigger results at the tier 0. The main jobOptions are - - - runHLT_standalone.py : main jobOptions for running standalone trigger. - Usage is documented at the head of the file and at https://twiki.cern.ch/twiki/bin/view/Atlas/HLTAlgorithmOnlineIntegration - - Trigger_topOptions_writeBS.py: - jobOptions for converting RDO to BS for testing the standalone trigger - - BStoESD_Tier0_HLTConfig_jobOptions.py: - For setting up the decoding of trigger result in bytestream files recorded at point 1. - This is included from RecExCommon - - -@section ModifierIntro Modifiers: - -The standalone trigger is mainly setup in the file Trigger_topOptions_standalone.py by including -the relevant detector jobOptions, trigger getter and generating the HLT menu from python. However, -it is frequently necessary to do some minor changes to the settings in order to properly run on -data or with some special settings. To simplify and make it clear what modifications are used, -runHLT_standalone.py allows one to apply "modifiers" before and/or after the main setup in -Trigger_topOptions_standalone.py. Each modifier is a short snippet of python code in python/Modifiers.py -and is mostly used to modify default values for a few configurables. Default lists of modifers are defined -up for cosmics and physics menus plus data and MC running in runHLT_standalone.py, but can be modified by -the user by using the option "ModifierName=True/False". - -*/ diff --git a/Trigger/TriggerRelease/python/Modifiers.py b/Trigger/TriggerRelease/python/Modifiers.py index c321a46806edf043a5d9f100f306ec58e76f5eca..8d63b6001288f2c87a9fe98960f5f0daa09cf42c 100644 --- a/Trigger/TriggerRelease/python/Modifiers.py +++ b/Trigger/TriggerRelease/python/Modifiers.py @@ -1409,6 +1409,8 @@ class doValidation(_modifier): def preSetup(self): TriggerFlags.Online.doValidation = True + # Replace Online with Validation monitoring + TriggerFlags.enableMonitoring = filter(lambda x:x!='Online', TriggerFlags.enableMonitoring())+['Validation'] for m in self.modifiers: m.preSetup() def postSetup(self): @@ -1533,7 +1535,7 @@ class enableCostMonitoring(_modifier): Enable Cost Monitoring for online """ def preSetup(self): - TriggerFlags.enableMonitoring = TriggerFlags.enableMonitoring.get_Value()+['CostExecL2','CostExecEF','CostExecHLT'] + TriggerFlags.enableMonitoring = TriggerFlags.enableMonitoring.get_Value()+['CostExecHLT'] def postSetup(self): from TrigCostMonitor.TrigCostMonitorConfig import postSetupOnlineCost diff --git a/Trigger/TriggerRelease/share/runHLT_standalone.py b/Trigger/TriggerRelease/share/runHLT_standalone.py index 24c5cb5fbbdb579f193255a3f34b65c7951e210c..b28fa51f869ced47d61437e3fbf6dbc7355b95e6 100755 --- a/Trigger/TriggerRelease/share/runHLT_standalone.py +++ b/Trigger/TriggerRelease/share/runHLT_standalone.py @@ -352,7 +352,7 @@ log.info("Trigger xml files HLT : in = %s , out = %s (read from XML = %s)" % # define a unique HLT configuration xml when running in a partition import os -if os.environ.has_key("TDAQ_PARTITION"): +if "TDAQ_PARTITION" in os.environ: from TriggerRelease import Utils ident = Utils.uniqueFileName() TriggerFlags.outputHLTconfigFile ="outputHLTconfig_%s.xml" % ident