PHOS - Fixing circular dependecies + initial DA files
authoragrigora <alina.grigoras@cern.ch>
Mon, 24 Nov 2014 14:58:39 +0000 (15:58 +0100)
committeragrigora <alina.grigoras@cern.ch>
Mon, 15 Dec 2014 12:51:59 +0000 (13:51 +0100)
35 files changed:
PHOS/DA/CMakeLists.txt [new file with mode: 0644]
PHOS/DA/PHOSBCMda.cxx [moved from PHOS/PHOSBCMda.cxx with 100% similarity]
PHOS/DA/PHOSGAINda.cxx [moved from PHOS/PHOSGAINda.cxx with 100% similarity]
PHOS/DA/PHOSLEDda.cxx [moved from PHOS/PHOSLEDda.cxx with 100% similarity]
PHOS/DA/PHOSPEDda.cxx [moved from PHOS/PHOSPEDda.cxx with 100% similarity]
PHOS/PHOSbase/AliPHOS.cxx [moved from PHOS/PHOSsim/AliPHOS.cxx with 100% similarity]
PHOS/PHOSbase/AliPHOS.h [moved from PHOS/PHOSsim/AliPHOS.h with 100% similarity]
PHOS/PHOSbase/AliPHOSClusterizerv1.cxx [moved from PHOS/PHOSrec/AliPHOSClusterizerv1.cxx with 100% similarity]
PHOS/PHOSbase/AliPHOSClusterizerv1.h [moved from PHOS/PHOSrec/AliPHOSClusterizerv1.h with 100% similarity]
PHOS/PHOSbase/AliPHOSLink.cxx [moved from PHOS/PHOSrec/AliPHOSLink.cxx with 100% similarity]
PHOS/PHOSbase/AliPHOSLink.h [moved from PHOS/PHOSrec/AliPHOSLink.h with 100% similarity]
PHOS/PHOSbase/AliPHOSPIDv1.cxx [moved from PHOS/PHOSrec/AliPHOSPIDv1.cxx with 100% similarity]
PHOS/PHOSbase/AliPHOSPIDv1.h [moved from PHOS/PHOSrec/AliPHOSPIDv1.h with 100% similarity]
PHOS/PHOSbase/AliPHOSReconstructor.cxx [moved from PHOS/PHOSrec/AliPHOSReconstructor.cxx with 100% similarity]
PHOS/PHOSbase/AliPHOSReconstructor.h [moved from PHOS/PHOSrec/AliPHOSReconstructor.h with 100% similarity]
PHOS/PHOSbase/AliPHOSTRURawReader.cxx [moved from PHOS/PHOSrec/AliPHOSTRURawReader.cxx with 100% similarity]
PHOS/PHOSbase/AliPHOSTRURawReader.h [moved from PHOS/PHOSrec/AliPHOSTRURawReader.h with 100% similarity]
PHOS/PHOSbase/AliPHOSTick.cxx [moved from PHOS/PHOSsim/AliPHOSTick.cxx with 100% similarity]
PHOS/PHOSbase/AliPHOSTick.h [moved from PHOS/PHOSsim/AliPHOSTick.h with 100% similarity]
PHOS/PHOSbase/AliPHOSTrackSegmentMakerv1.cxx [moved from PHOS/PHOSrec/AliPHOSTrackSegmentMakerv1.cxx with 100% similarity]
PHOS/PHOSbase/AliPHOSTrackSegmentMakerv1.h [moved from PHOS/PHOSrec/AliPHOSTrackSegmentMakerv1.h with 100% similarity]
PHOS/PHOSbase/AliPHOSTracker.cxx [moved from PHOS/PHOSrec/AliPHOSTracker.cxx with 100% similarity]
PHOS/PHOSbase/AliPHOSTracker.h [moved from PHOS/PHOSrec/AliPHOSTracker.h with 100% similarity]
PHOS/PHOSbase/AliPHOSTriggerRawDigiProducer.cxx [moved from PHOS/PHOSrec/AliPHOSTriggerRawDigiProducer.cxx with 100% similarity]
PHOS/PHOSbase/AliPHOSTriggerRawDigiProducer.h [moved from PHOS/PHOSrec/AliPHOSTriggerRawDigiProducer.h with 100% similarity]
PHOS/PHOSbase/AliPHOSTriggerRawDigit.cxx [moved from PHOS/PHOSrec/AliPHOSTriggerRawDigit.cxx with 100% similarity]
PHOS/PHOSbase/AliPHOSTriggerRawDigit.h [moved from PHOS/PHOSrec/AliPHOSTriggerRawDigit.h with 100% similarity]
PHOS/PHOSbase/AliPHOSTriggerRawReader.cxx [moved from PHOS/PHOSrec/AliPHOSTriggerRawReader.cxx with 100% similarity]
PHOS/PHOSbase/AliPHOSTriggerRawReader.h [moved from PHOS/PHOSrec/AliPHOSTriggerRawReader.h with 100% similarity]
PHOS/PHOSbase/CMakeLists.txt
PHOS/PHOSbase/PHOSbaseLinkDef.h
PHOS/PHOSrec/CMakeLists.txt
PHOS/PHOSrec/PHOSrecLinkDef.h
PHOS/PHOSsim/CMakeLists.txt
PHOS/PHOSsim/PHOSsimLinkDef.h

diff --git a/PHOS/DA/CMakeLists.txt b/PHOS/DA/CMakeLists.txt
new file mode 100644 (file)
index 0000000..9162f78
--- /dev/null
@@ -0,0 +1,71 @@
+# **************************************************************************
+# * Copyright(c) 1998-2014, ALICE Experiment at CERN, All rights reserved. *
+# *                                                                        *
+# * Author: The ALICE Off-line Project.                                    *
+# * Contributors are mentioned in the code where appropriate.              *
+# *                                                                        *
+# * Permission to use, copy, modify and distribute this software and its   *
+# * documentation strictly for non-commercial purposes is hereby granted   *
+# * without fee, provided that the above copyright notice appears in all   *
+# * copies and that both the copyright notice and this permission notice   *
+# * appear in the supporting documentation. The authors make no claims     *
+# * about the suitability of this software for any purpose. It is          *
+# * provided "as is" without express or implied warranty.                  *
+# **************************************************************************
+
+# Module include folder
+include_directories(${AliRoot_SOURCE_DIR}/PHOS/DA)
+
+# Additional include folders in alphabetical order
+include_directories(
+                    ${AliRoot_SOURCE_DIR}/PHOS/PHOSbase
+                    ${AliRoot_SOURCE_DIR}/PHOS/PHOSshuttle
+                    ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
+                    ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
+                    ${AliRoot_SOURCE_DIR}/STEER/STEERBase
+                   )
+
+
+# DIM
+link_directories(${DIMDIR}/${ODIR})
+
+#daqDA flags
+include_directories(${daqDA})
+link_directories(${daqDA})
+
+# AMORE definitions
+add_definitions(${AMORE_DEFINITIONS})
+include_directories(${AMORE_INCLUDE_DIR})
+
+# Generating the DA executable
+add_executable(PHOSBCMda PHOSBCMda.cxx) # 1
+add_executable(PHOSGAINda PHOSGAINda.cxx) # 2
+add_executable(PHOSLEDda PHOSLEDda.cxx) # 3
+add_executable(PHOSPEDda PHOSPEDda.cxx) # 4
+
+set(MODULE_COMPILE_FLAGS)
+set(MODULE_LINK_FLAGS)
+
+target_link_libraries(PHOSBCMda PHOSbase-static PHOSshuttle-static RAWDatabase-static RAWDatarec-static STEERBase-static ${DATE_MONLIBRARIES} daqDA Root RootExtra ${DATE_RCPROXYLIBRARIES}) # 1
+target_link_libraries(PHOSGAINda PHOSbase-static PHOSshuttle-static RAWDatabase-static RAWDatarec-static STEERBase-static AmoreDA daqDA ${DATE_MONLIBRARIES}  Root RootExtra ${DATE_RCPROXYLIBRARIES}) # 2
+target_link_libraries(PHOSLEDda PHOSbase-static PHOSshuttle-static RAWDatabase-static RAWDatarec-static STEERBase-static AmoreDA daqDA ${DATE_MONLIBRARIES} Root RootExtra ${DATE_RCPROXYLIBRARIES}) # 3 
+target_link_libraries(PHOSPEDda RAWDatabase-static RAWDatarec-static STEERBase-static AmoreDA daqDA ${DATE_MONLIBRARIES} Root RootExtra ${DATE_RCPROXYLIBRARIES}) # 4
+
+# different flags
+set(MODULE_COMPILE_FLAGS "${DATE_CFLAGS} ${AMORE_CFLAGS}")
+set(MODULE_LINK_FLAGS "${DATE_LDFLAGS} ${AMORE_STATICLIBS} ${AMORE_AUXLIBS}")
+
+set_target_properties(PHOSBCMda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(PHOSBCMda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+set_target_properties(PHOSGAINda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(PHOSGAINda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+set_target_properties(PHOSLEDda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(PHOSLEDda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+set_target_properties(PHOSPEDda PROPERTIES COMPILE_FLAGS ${MODULE_COMPILE_FLAGS})
+set_target_properties(PHOSPEDda PROPERTIES LINK_FLAGS "${MODULE_LINK_FLAGS}")
+
+# Installation
+install(TARGETS PHOSBCMda PHOSGAINda PHOSLEDda PHOSPEDda RUNTIME DESTINATION bin)
\ No newline at end of file
similarity index 100%
rename from PHOS/PHOSBCMda.cxx
rename to PHOS/DA/PHOSBCMda.cxx
similarity index 100%
rename from PHOS/PHOSGAINda.cxx
rename to PHOS/DA/PHOSGAINda.cxx
similarity index 100%
rename from PHOS/PHOSLEDda.cxx
rename to PHOS/DA/PHOSLEDda.cxx
similarity index 100%
rename from PHOS/PHOSPEDda.cxx
rename to PHOS/DA/PHOSPEDda.cxx
index 1ffa016..9118b10 100644 (file)
@@ -23,8 +23,7 @@ include_directories(${AliRoot_SOURCE_DIR}/PHOS/${MODULE})
 include_directories(${ROOT_INCLUDE_DIRS}
                     ${AliRoot_SOURCE_DIR}/RAW/RAWDatabase
                     ${AliRoot_SOURCE_DIR}/RAW/RAWDatarec
-                    ${AliRoot_SOURCE_DIR}/PHOS/PHOSrec
-                    ${AliRoot_SOURCE_DIR}/PHOS/PHOSsim
+                    ${AliRoot_SOURCE_DIR}/RAW/RAWDatasim
                     ${AliRoot_SOURCE_DIR}/PHOS/PHOSUtils
                     ${AliRoot_SOURCE_DIR}/STEER/CDB
                     ${AliRoot_SOURCE_DIR}/STEER/ESD
@@ -34,8 +33,10 @@ include_directories(${ROOT_INCLUDE_DIRS}
 
 # Sources in alphabetical order
 set(SRCS
+    AliPHOS.cxx
     AliPHOSCalibData.cxx
     AliPHOSClusterizer.cxx
+    AliPHOSClusterizerv1.cxx
     AliPHOSCpvCalibData.cxx
     AliPHOSCpvRecPoint.cxx
     AliPHOSDigit.cxx
@@ -47,6 +48,7 @@ set(SRCS
     AliPHOSGeometry.cxx
     AliPHOSHit.cxx
     AliPHOSImpact.cxx
+    AliPHOSLink.cxx
     AliPHOSLoader.cxx
     AliPHOSModuleMisalignment.cxx
     AliPHOSPID.cxx
@@ -59,16 +61,26 @@ set(SRCS
     AliPHOSRawFitterv3.cxx
     AliPHOSRawFitterv4.cxx
     AliPHOSRecoParam.cxx
+    AliPHOSReconstructor.cxx
     AliPHOSRecParticle.cxx
     AliPHOSRecPoint.cxx
+    AliPHOSPIDv1.cxx
     AliPHOSSDigitizer.cxx
     AliPHOSSimParam.cxx
     AliPHOSSurvey1.cxx
     AliPHOSSurvey.cxx
+    AliPHOSTick.cxx
+    AliPHOSTracker.cxx
     AliPHOSTrackSegment.cxx
     AliPHOSTrackSegmentMaker.cxx
+    AliPHOSTrackSegmentMakerv1.cxx
     AliPHOSTrigger.cxx
     AliPHOSTriggerParameters.cxx
+    AliPHOSTriggerRawDigit.cxx
+    AliPHOSTriggerRawDigiProducer.cxx
+    AliPHOSTriggerRawReader.cxx
+    AliPHOSTRURawReader.cxx
+
    )
 
 # Headers from sources
@@ -79,17 +91,25 @@ string(REPLACE ".cxx" ".h" HDRS "${SRCS}")
 get_directory_property(incdirs INCLUDE_DIRECTORIES)
 generate_dictionary("${MODULE}" "${MODULE}LinkDef.h" "${HDRS}" "${incdirs}")
 
+set(ROOT_DEPENDENCIES)
+set(ALIROOT_DEPENDENCIES STEERBase STEER CDB ESD RAWDatabase RAWDatarec PHOSUtils)
+
 # Generate the ROOT map
 # Dependecies
-set(LIBDEPS STEERBase STEER CDB ESD RAWDatabase RAWDatarec PHOSUtils PHOSrec PHOSsim)
+set(LIBDEPS ${ALIROOT_DEPENDENCIES} ${ROOT_DEPENDENCIES})
 generate_rootmap("${MODULE}" "${LIBDEPS}" "${CMAKE_CURRENT_SOURCE_DIR}/${MODULE}LinkDef.h")
 
+# Create an object to be reused in case of static libraries 
+# Otherwise the sources will be compiled twice
+add_library(${MODULE}-object OBJECT ${SRCS} G__${MODULE}.cxx)
+# Add a library to the project using the object
+add_library(${MODULE} SHARED $<TARGET_OBJECTS:PHOSbase-object>)
 
-# Add a library to the project using the specified source files
-add_library(${MODULE} SHARED ${SRCS} G__${MODULE}.cxx)
+# Linking
+target_link_libraries(${MODULE} ${ALIROOT_DEPENDENCIES} ${ALIROOT_DEPENDENCIES})
 
 # Additional compilation flags
-set_target_properties(${MODULE} PROPERTIES COMPILE_FLAGS "-O -g")
+set_target_properties(${MODULE}-object PROPERTIES COMPILE_FLAGS "-O -g -fPIC")
 
 # System dependent: Modify the way the library is build
 if(${CMAKE_SYSTEM} MATCHES Darwin)
@@ -101,4 +121,20 @@ install(TARGETS ${MODULE}
         ARCHIVE DESTINATION lib
         LIBRARY DESTINATION lib)
 
-install(FILES ${HDRS} DESTINATION include)
\ No newline at end of file
+install(FILES ${HDRS} DESTINATION include)
+
+# Static version if DA enabled
+if(ALIROOT_STATIC)
+    add_library(${MODULE}-static STATIC $<TARGET_OBJECTS:PHOSbase-object>)
+    set_target_properties(${MODULE}-static PROPERTIES OUTPUT_NAME ${MODULE})
+
+    # list of shared dependencies / the name of the variable containing the list of static ones
+    generate_static_dependencies("${ALIROOT_DEPENDENCIES}" "STATIC_ALIROOT_DEPENDENCIES")
+    target_link_libraries(${MODULE}-static ${STATIC_ALIROOT_DEPENDENCIES} Root)
+    set_target_properties(${MODULE}-static PROPERTIES LINK_FLAGS "-Wl,--whole-archive")
+
+    # Installation
+    install(TARGETS ${MODULE}-static
+            ARCHIVE DESTINATION lib
+            LIBRARY DESTINATION lib)
+endif(ALIROOT_STATIC)
index 0be36a2..b03aa90 100644 (file)
 #pragma link C++ class AliPHOSImpact+;
 #pragma link C++ class AliPHOSTrigger+;
 
+#pragma link C++ class AliPHOSTick+;
+#pragma link C++ class AliPHOSReconstructor+;
+#pragma link C++ class AliPHOS+;
+#pragma link C++ class AliPHOSClusterizerv1+;
+#pragma link C++ class AliPHOSTrackSegmentMakerv1+;
+#pragma link C++ class AliPHOSPIDv1+;
+#pragma link C++ class AliPHOSTracker+;
+#pragma link C++ class AliPHOSTriggerRawDigiProducer+;
+#pragma link C++ class AliPHOSTriggerRawDigit+;
+#pragma link C++ class AliPHOSLink+;
+#pragma link C++ class AliPHOSTriggerRawReader+;
+#pragma link C++ class AliPHOSTRURawReader+;
+
 #endif
index 27d52d2..109e4d1 100644 (file)
@@ -36,27 +36,17 @@ include_directories(${ROOT_INCLUDE_DIRS}
 # Sources in alphabetical order
 set(SRCS
     AliPHOSAodCluster.cxx
-    AliPHOSClusterizerv1.cxx
     AliPHOSClusterizerv2.cxx
     AliPHOSEsdCluster.cxx
     AliPHOSEvalRecPoint.cxx
     AliPHOSGridFile.cxx
     AliPHOSIhepAnalyze.cxx
-    AliPHOSLink.cxx
     AliPHOSPIDv0.cxx
-    AliPHOSPIDv1.cxx
     AliPHOSQADataMakerRec.cxx
     AliPHOSRecCpvManager.cxx
     AliPHOSRecEmcManager.cxx
     AliPHOSRecManager.cxx
-    AliPHOSReconstructor.cxx
-    AliPHOSTracker.cxx
-    AliPHOSTrackSegmentMakerv1.cxx
     AliPHOSTrackSegmentMakerv2.cxx
-    AliPHOSTriggerRawDigiProducer.cxx
-    AliPHOSTriggerRawDigit.cxx
-    AliPHOSTriggerRawReader.cxx
-    AliPHOSTRURawReader.cxx
    )
 
 # Headers from sources
index 1ac1a10..16a16e4 100644 (file)
@@ -4,9 +4,6 @@
 #pragma link off all classes;
 #pragma link off all functions;
 
-#pragma link C++ class AliPHOSLink+;
-#pragma link C++ class AliPHOSClusterizerv1+;
-#pragma link C++ class AliPHOSTrackSegmentMakerv1+;
 #pragma link C++ class AliPHOSTrackSegmentMakerv2+;
 #pragma link C++ class AliPHOSPIDv0+;
 #pragma link C++ class AliPHOSIhepAnalyze+;
 #pragma link C++ class AliPHOSRecEmcManager+;
 #pragma link C++ class AliPHOSClusterizerv2+;
 #pragma link C++ class AliPHOSEvalRecPoint+;
-#pragma link C++ class AliPHOSPIDv1+;
 #pragma link C++ class AliPHOSGridFile+;
-#pragma link C++ class AliPHOSTracker+;
 #pragma link C++ class AliPHOSEsdCluster+;
 #pragma link C++ class AliPHOSAodCluster+;
 #pragma link C++ class AliPHOSQADataMakerRec+;
-#pragma link C++ class AliPHOSTriggerRawReader+;
-#pragma link C++ class AliPHOSTRURawReader+;
-#pragma link C++ class AliPHOSTriggerRawDigiProducer+;
-#pragma link C++ class AliPHOSTriggerRawDigit+;
-
-#pragma link C++ class AliPHOSReconstructor+;
 #endif
index 7d5b20d..f1da326 100644 (file)
@@ -35,9 +35,7 @@ include_directories(${ROOT_INCLUDE_DIRS}
 # Sources in alphabetical order
 set(SRCS
     AliPHOSCPVDigit.cxx
-    AliPHOS.cxx
     AliPHOSQADataMakerSim.cxx
-    AliPHOSTick.cxx
     AliPHOSv0.cxx
     AliPHOSv1.cxx
     AliPHOSv2.cxx
index b328b8e..9ea2494 100644 (file)
@@ -4,14 +4,12 @@
 #pragma link off all classes;
 #pragma link off all functions;
 
-#pragma link C++ class AliPHOS+;
 #pragma link C++ class AliPHOSv0+;
 #pragma link C++ class AliPHOSv1+;
 #pragma link C++ class AliPHOSv2+;
 #pragma link C++ class AliPHOSvFast+;
 #pragma link C++ class AliPHOSvImpacts+;
 #pragma link C++ class AliPHOSCPVDigit+;
-#pragma link C++ class AliPHOSTick+;
 #pragma link C++ class AliPHOSQADataMakerSim+;
 
 #endif