Commit 2f55bf12 authored by vpalladi's avatar vpalladi

The code is now able to link all needed lib define in env.sh. All the relative...

The code is now able to link all needed lib define in env.sh. All the relative path used in the code has been disabled.  readSimHitFileTest.cpp has been restored at the commint 5b6d3757.
parent 13fae2b5
......@@ -2,21 +2,14 @@
# compiler
CXX = g++
##############
### define ###
##############
DEFINES =
DEFINES += -DRELATIVE_PATH
#DEFINES += -DWRITE_ANALYSIS
################
### ext libs ###
################
PYTHON_EXE = /usr/include/python2.6
HEPMC_DIR = /vols/cms/vpalladi/SW/BaseCentOS6/HepMC/2.06.09
BOOST_DIR = /vols/cms/vpalladi/SW/BaseCentOS6/boost/1_61_0
RAWDATA_DIR = /vols/cms/HgcData/RawDataV2
HEPMC_DIR = $(HEPMCSYS)
BOOST_DIR = $(BOOSTSYS)
RAWDATA_DIR = $(SIMRAWDATA)
####################
......@@ -36,31 +29,30 @@ NAMING_DIR = $(PYTHON_CODE)/naming
# local interface
INTERFACE_DIR = $(TOP)/interface
NAVIGATION_INC = $(INTERFACE_DIR)/navigation
NAVIGATION_DIR = $(INTERFACE_DIR)/navigation
# bin dir
BIN_DIR = $(CURRENT)/bin
# lib dir
LIB_DIR = $(TOP)/lib
# config dir
CONFIG_DIR_ABS = $(TOP)/config
CONFIG_DIR_LN = $(CURRENT)/config
CONFIG_DIR = $(TOP)/config
# raw data dir
RAWDATA_LN = $(CURRENT)/RawData
##############
### define ###
##############
DEFINES =
#DEFINES += -DRELATIVE_PATH
DEFINES += -DRAW_DATA_PATH=\"$(SIMRAWDATA)\"
DEFINES += -DCONFIG_PATH=\"$(TOP)/config\"
#DEFINES += -DWRITE_ANALYSIS
#############
### links ###
#############
HEPMC_LN = $(LIB_DIR)/HepMC
BOOST_LN = $(LIB_DIR)/boost
################################################
### copy the launcher in the $CURRENT folder ###
################################################
LS_LAUNCHER = $(shell ls launcherIC.py)
LS_LAUNCHER = $(shell ls launcherIC.py 2>/dev/null)
##########################
### flags and libs and INC
......@@ -72,22 +64,23 @@ ROOT_LIBS = $(shell root-config --libs)
ROOT_GLIBS = $(shell root-config --glibs)
# Boost
#BOOST_LIBS = /usr/lib/x86_64-linux-gnu/libboost_system.so.1.54.0 -lboost_filesystem
BOOST_LIBS = -L$(BOOST_LN)/lib -lboost_filesystem-mt -lboost_system
BOOST_FLAGS = -I$(BOOST_DIR)/include
BOOST_LIBS = -L$(BOOST_DIR)/lib -lboost_filesystem -lboost_system
# HepMC flags
HEPMC_FLAGS = -I$(HEPMC_LN)/include
HEPMC_LIBS = -L$(HEPMC_LN)/lib -lHepMC #-lHepMCfio
HEPMC_FLAGS = -I$(HEPMC_DIR)/include
HEPMC_LIBS = -L$(HEPMC_DIR)/lib -lHepMC #-lHepMCfio
# CXX flags
#CXXFLAGS = -Wall -std=c++0x -Wno-write-strings
CXXFLAGS = -Wall -std=c++0x -Wno-write-strings
CXXFLAGS += $(ROOT_CFLAGS)
CXXFLAGS += $(BOOST_FLAGS)
CXXFLAGS += $(HEPMC_FLAGS)
CXXFLAGS += -I$(NAVIGATION_INC)
CXXFLAGS += -I$(NAVIGATION_DIR)
CXXFLAGS += -I$(INTERFACE_DIR)
CXXFLAGS += -I$(TOP)/src
CXXFLAGS += -I$(PYTHON_EXE)
#CXXFLAGS += -I$(PYTHON_EXE)
# CXX LIBS
CXXLIBS = $(ROOT_GLIBS)
......@@ -102,27 +95,23 @@ INCLUDES_HH := $(wildcard $(INTERFACE_DIR)/*.hh)
EXES := $(MAINS_CPP:.cpp=.exe)
all: link_to_libs link_to_config link_to_rawdata $(EXES)
all: $(EXES)
%.exe: %.cpp cplauncher
@mkdir -p $(BIN_DIR)
$(CXX) -o bin/$(notdir $@) $< $(DEFINES) $(CXXFLAGS) $(CXXLIBS)
$(CXX) -o bin/$(notdir $@) $< $(DEFINES) $(CXXFLAGS) $(CXXLIBS)
py_lib:
make TOP=$(TOP) -C $(INTERFACE_DIR)
clean:
rm $(CURRENT)/bin/*
unlink $(HEPMC_LN)
unlink $(BOOST_LN)
unlink $(RAWDATA_LN)
unlink $(CONFIG_DIR_LN)
rm -rf $(LIB_DIR)
rm launcherIC.py
echo:
# echo $(HEPMCFLAGS)
echo $(TOP)
echo $(CURRENT)
echo $(BOOST_DIR)
# echo $(INTERFACE_DIR)
# echo $(CXX) $(CXXFLAGS) -o bin/$@ $<
# echo $(EXES)
......@@ -130,19 +119,20 @@ echo:
cplauncher:
ifeq ($(LS_LAUNCHER),launcherIC.py)
@echo " >>> 'launcherIC.py' already exists"
else
@echo " >>> copyng 'launcherIC.py' in the current directory"
@cp $(TOP)/python/launcherIC/launcherIC.py .
@chmod u+x launcherIC.py
endif
link_to_libs:
if [ ! -d $(LIB_DIR) ]; then mkdir $(LIB_DIR); ln -s $(BOOST_DIR) $(BOOST_LN); ln -s $(HEPMC_DIR) $(HEPMC_LN); fi;
link_to_config:
if [ ! -d $(CONFIG_DIR_LN) ]; then ln -s $(CONFIG_DIR_ABS) $(CONFIG_DIR_LN); fi;
link_to_rawdata:
if [ ! -d $(RAWDATA_LN) ]; then ln -s $(RAWDATA_DIR) $(RAWDATA_LN); fi;
#
#link_to_libs:
# if [ ! -d $(LIB_DIR) ]; then mkdir $(LIB_DIR); ln -s $(BOOST_DIR) $(BOOST_LN); ln -s $(HEPMC_DIR) $(HEPMC_LN); fi;
#
#link_to_config:
# if [ ! -d $(CONFIG_DIR_LN) ]; then ln -s $(CONFIG_DIR_ABS) $(CONFIG_DIR_LN); fi;
#
#link_to_rawdata:
# if [ ! -d $(RAWDATA_LN) ]; then ln -s $(RAWDATA_DIR) $(RAWDATA_LN); fi;
#
......@@ -19,7 +19,7 @@ data are expected to be stored or linked in a folder called 'RawData' located in
4. boost is needed.
5. env.sh is an example of script to link to the correct libriries (HepMC and boost)
5. env.sh MUST be updated according your system configuration !!! SOURCE BEFORE MAKE !!!
############################################# DEPRECATED #############################################
### 1. HepMC:
......
# boost base dir
export BOOSTSYS=/vols/cms/vpalladi/SW/BaseCentOS6/boost/1_61_0
# HepMC base dir
export HEPMCSYS=/vols/cms/vpalladi/SW/BaseCentOS6/HepMC/2.06.09
# Raw data dir
export SIMRAWDATA=/vols/cms/HgcData/RawDataV2
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$BOOSTSYS/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HEPMCSYS/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/hep/vpalladi/Tests/HGC/HgcTpgSim/lib/boost/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/hep/vpalladi/Tests/HGC/HgcTpgSim/lib/HepMC/lib
......@@ -294,15 +294,22 @@ public:
for(unsigned k(0);k<2;k++) {
#ifdef RELATIVE_PATH
string path_TC128 = bin_path;
path_TC128.append("/../config/TC128.txt");
string path_TC128 = bin_path; // defined in the makefile
path_TC128.append("/TC128.txt");
string path_TC256 = bin_path;
path_TC256.append("/../config/TC256.txt");
path_TC256.append("/TC256.txt");
#else
string path_TC128("HgcTpgSim/config/TC128.txt");
string path_TC256("HgcTpgSim/config/TC256.txt");
string path_TC128( CONFIG_PATH ); // defined in the makefile
path_TC128.append("/TC128.txt");
string path_TC256( CONFIG_PATH ); // defined in the makefile
path_TC256.append("/TC256.txt");
// string path_TC128("HgcTpgSim/config/TC128.txt");
// string path_TC256("HgcTpgSim/config/TC256.txt");
#endif
if(k==0) {
......
......@@ -138,12 +138,12 @@ public:
<< " (L " << fLayerId << ")" << endl;
cout << " >>> >>> Neighbours ";
for(unsigned i_n=0; i_n<kmaxWafers; i_n++)
for(int i_n=0; i_n<kmaxWafers; i_n++)
if(fNeighbours[i_n])
cout << i_n << "(" << fNeighboursPos[i_n] << ")" << ", ";
cout << endl;
for(unsigned i_tc=0; i_tc<kmaxTriggerCells; i_tc++){
for(int i_tc=0; i_tc<kmaxTriggerCells; i_tc++){
if( fTriggerCellsPresent[i_tc] )
fTriggerCells[i_tc].print();
}
......
......@@ -22,25 +22,10 @@
#include "ReadSimHitFile.hh"
#ifdef RELATIVE_PATH
/* to use relative path */
#include <boost/filesystem/operations.hpp>
#include <boost/filesystem/path.hpp>
#endif
int main(int argc, const char **argv) {
#ifdef RELATIVE_PATH
boost::filesystem::path full_path( boost::filesystem::initial_path<boost::filesystem::path>() );
full_path = boost::filesystem::system_complete(boost::filesystem:: path( argv[0] ) );
#endif
TRandom3 random;
#ifdef RELATIVE_PATH
const Geometry geo( full_path.remove_filename().string() );
#else
const Geometry geo;
#endif
TRandom3 random;
Geometry geo;
Constants::print();
......@@ -52,11 +37,15 @@ int main(int argc, const char **argv) {
TH1F *hSimNumber,
*hSimDetector,*hSimSubdetector,*hSimEndcap,*hSimLayer,
*hSimWafer,*hSimType,*hSimCell,
*hSimWafer,*hSimType,*hSimCell,*hSimX,*hSimY,*hSimZ,
*hSimLayerSubdetector3,*hSimLayerSubdetector4,
*hSimCellType0,*hSimCellType1,
*hSimHalfCellType0,*hSimHalfCellType1;
TH2F *hSimEndcapvZ,*hSimTypevCell,*hSimTypevSublayer,*hSimSubdetectorvLayer,*hSimLayervWafer,
*hSimHalfCellType0,*hSimHalfCellType1,
*hSimZEndcap0,*hSimZEndcap1;
TH2F *hSimXvWafer,*hSimYvWafer,*hSimEndcapvZ,*hSimTypevCell,*hSimTypevSublayer,*hSimSubdetectorvLayer,*hSimLayervWafer,
*hSimEEWafervXY[28],*hSimFHWafervXY[12],
*hSimEEXvWafer[28],*hSimFHXvWafer[12],
*hSimEEYvWafer[28],*hSimFHYvWafer[12],
*hSimYvXType0,*hSimYvXType1,
*hSimEdge23Type0,*hSimEdge23Type1,
*hSimEdge32Type0,*hSimEdge32Type1,
......@@ -78,64 +67,69 @@ int main(int argc, const char **argv) {
hSimHalfCellType0=new TH1F("SimHalfCellType0","Sim ",250,0.0,250.0);
hSimCellType1=new TH1F("SimCellType1","Sim ",250,0.0,250.0);
hSimHalfCellType1=new TH1F("SimHalfCellType1","Sim ",250,0.0,250.0);
//
// hSimXvWafer=new TH2F("SimXvWafer","Sim ",1000,0.0,1000,1000,-200.0,200.0);
// hSimYvWafer=new TH2F("SimYvWafer","Sim ",1000,0.0,1000,1000,-200.0,200.0);
// hSimLayervWafer=new TH2F("SimLayervWafer","Sim ",1000,0.0,1000.0,40,0.0,40.0);
// hSimLayerVsWafer=new TH2B("SimLayerVsWafer",";Wafer;Layer",700,0.0,700.0,40,0.0,40.0);
// hSimEndcapvZ=new TH2F("SimEndcapvZ","Sim ",2000,-500.0,500.0,2,0.0,2.0);
// hSimTypevCell=new TH2F("SimTypevCell","Sim ",256,0.0,256,2,0.0,2.0);
// hSimTypevSublayer=new TH2F("SimTypevSublayer","Sim ",3,0.0,3.0,2,0.0,2.0);
// hSimSubdetectorvLayer=new TH2F("SimSubdetectorvLayer","Sim ",30,0.0,30.0,5,0.0,5.0);
// hSimYvXType0=new TH2F("SimYvXType0","Sim ",500,-10.0,10.0,500,-10.0,10.0);
// hSimYvXType1=new TH2F("SimYvXType1","Sim ",500,-10.0,10.0,500,-10.0,10.0);
// hSimEdge23Type0=new TH2F("SimEdge23Type0","Type 0 Right;Cell number on right edge;Cell number on left edge",28,0.0,140.0,28,0.0,140.0);
// hSimEdge23Type1=new TH2F("SimEdge23Type1","Type 1 Right;Cell number on right edge;Cell number on left edge",24,0.0,240.0,24,0.0,240.0);
// hSimEdge32Type0=new TH2F("SimEdge32Type0","Type 0 Wrong;Cell number on right edge;Cell number on left edge",28,0.0,140.0,28,0.0,140.0);
// hSimEdge32Type1=new TH2F("SimEdge32Type1","Type 1 Wrong;Cell number on right edge;Cell number on left edge",24,0.0,240.0,24,0.0,240.0);
// hSimCorrType0=new TH2F("SimCorrType0","Type 0 Right;Cell number;Cell number",140,0.0,140.0,140,0.0,140.0);
// hSimCorrType1=new TH2F("SimCorrType1","Type 1 Right;Cell number;Cell number",250,0.0,250.0,250,0.0,250.0);
// hSimRoccType0=new TH2F("SimRoccType0","Type 0 Wrong;Cell number;Cell number",140,0.0,140.0,140,0.0,140.0);
// hSimRoccType1=new TH2F("SimRoccType1","Type 1 Wrong;Cell number;Cell number",250,0.0,250.0,250,0.0,250.0);
// for(unsigned l(0);l<28;l++) {
// std::ostringstream sout;
// sout << std::setw(2) << std::setfill('0') << l;
//
// hSimEEXvWafer[l]=
// new TH2F((std::string("SimEEXvWaferLayer")+sout.str()).c_str(),
// (std::string(";Wafer;x")).c_str(),
// 1000,0.0,1000,1000,-200.0,200.0);
// hSimEEYvWafer[l]=
// new TH2F((std::string("SimEEYvWaferLayer")+sout.str()).c_str(),
// (std::string(";Wafer;y")).c_str(),
// 1000,0.0,1000,1000,-200.0,200.0);
//
//
// hSimEEWafervXY[l]=
// new TH2F((std::string("SimEEWafervXYLayer")+sout.str()).c_str(),
// (std::string(";x;y;Wafer")).c_str(),
// 1000,-200.0,200.0,1000,-200.0,200.0);
// }
//
// for(unsigned l(0);l<12;l++) {
// std::ostringstream sout;
// sout << std::setw(2) << std::setfill('0') << l;
//
// hSimFHXvWafer[l]=
// new TH2F((std::string("SimFHXvWaferLayer")+sout.str()).c_str(),
// (std::string(";Wafer;x")).c_str(),
// 1000,0.0,1000,1000,-200.0,200.0);
// hSimFHYvWafer[l]=
// new TH2F((std::string("SimFHYvWaferLayer")+sout.str()).c_str(),
// (std::string(";Wafer;y")).c_str(),
// 1000,0.0,1000,1000,-200.0,200.0);
//
// hSimFHWafervXY[l]=
// new TH2F((std::string("SimFHWafervXYLayer")+sout.str()).c_str(),
// (std::string("x;y;Wafer")).c_str(),
// 1000,-200.0,200.0,1000,-200.0,200.0);
// }
hSimX=new TH1F("SimX","Sim ",1000,-200.0,200.0);
hSimY=new TH1F("SimY","Sim ",1000,-200.0,200.0);
hSimZ=new TH1F("SimZ","Sim ",2000,-500.0,500.0);
hSimZEndcap0=new TH1F("SimZEndcap0","Sim ",2000,300.0,500.0);
hSimZEndcap1=new TH1F("SimZEndcap1","Sim ",2000,300.0,500.0);
hSimXvWafer=new TH2F("SimXvWafer","Sim ",1000,0.0,1000,1000,-200.0,200.0);
hSimYvWafer=new TH2F("SimYvWafer","Sim ",1000,0.0,1000,1000,-200.0,200.0);
hSimLayervWafer=new TH2F("SimLayervWafer","Sim ",1000,0.0,1000.0,40,0.0,40.0);
hSimLayerVsWafer=new TH2B("SimLayerVsWafer",";Wafer;Layer",700,0.0,700.0,40,0.0,40.0);
hSimEndcapvZ=new TH2F("SimEndcapvZ","Sim ",2000,-500.0,500.0,2,0.0,2.0);
hSimTypevCell=new TH2F("SimTypevCell","Sim ",256,0.0,256,2,0.0,2.0);
hSimTypevSublayer=new TH2F("SimTypevSublayer","Sim ",3,0.0,3.0,2,0.0,2.0);
hSimSubdetectorvLayer=new TH2F("SimSubdetectorvLayer","Sim ",30,0.0,30.0,5,0.0,5.0);
hSimYvXType0=new TH2F("SimYvXType0","Sim ",500,-10.0,10.0,500,-10.0,10.0);
hSimYvXType1=new TH2F("SimYvXType1","Sim ",500,-10.0,10.0,500,-10.0,10.0);
hSimEdge23Type0=new TH2F("SimEdge23Type0","Type 0 Right;Cell number on right edge;Cell number on left edge",28,0.0,140.0,28,0.0,140.0);
hSimEdge23Type1=new TH2F("SimEdge23Type1","Type 1 Right;Cell number on right edge;Cell number on left edge",24,0.0,240.0,24,0.0,240.0);
hSimEdge32Type0=new TH2F("SimEdge32Type0","Type 0 Wrong;Cell number on right edge;Cell number on left edge",28,0.0,140.0,28,0.0,140.0);
hSimEdge32Type1=new TH2F("SimEdge32Type1","Type 1 Wrong;Cell number on right edge;Cell number on left edge",24,0.0,240.0,24,0.0,240.0);
hSimCorrType0=new TH2F("SimCorrType0","Type 0 Right;Cell number;Cell number",140,0.0,140.0,140,0.0,140.0);
hSimCorrType1=new TH2F("SimCorrType1","Type 1 Right;Cell number;Cell number",250,0.0,250.0,250,0.0,250.0);
hSimRoccType0=new TH2F("SimRoccType0","Type 0 Wrong;Cell number;Cell number",140,0.0,140.0,140,0.0,140.0);
hSimRoccType1=new TH2F("SimRoccType1","Type 1 Wrong;Cell number;Cell number",250,0.0,250.0,250,0.0,250.0);
for(unsigned l(0);l<28;l++) {
std::ostringstream sout;
sout << std::setw(2) << std::setfill('0') << l;
hSimEEXvWafer[l]=
new TH2F((std::string("SimEEXvWaferLayer")+sout.str()).c_str(),
(std::string(";Wafer;x")).c_str(),
1000,0.0,1000,1000,-200.0,200.0);
hSimEEYvWafer[l]=
new TH2F((std::string("SimEEYvWaferLayer")+sout.str()).c_str(),
(std::string(";Wafer;y")).c_str(),
1000,0.0,1000,1000,-200.0,200.0);
hSimEEWafervXY[l]=
new TH2F((std::string("SimEEWafervXYLayer")+sout.str()).c_str(),
(std::string(";x;y;Wafer")).c_str(),
1000,-200.0,200.0,1000,-200.0,200.0);
}
for(unsigned l(0);l<12;l++) {
std::ostringstream sout;
sout << std::setw(2) << std::setfill('0') << l;
hSimFHXvWafer[l]=
new TH2F((std::string("SimFHXvWaferLayer")+sout.str()).c_str(),
(std::string(";Wafer;x")).c_str(),
1000,0.0,1000,1000,-200.0,200.0);
hSimFHYvWafer[l]=
new TH2F((std::string("SimFHYvWaferLayer")+sout.str()).c_str(),
(std::string(";Wafer;y")).c_str(),
1000,0.0,1000,1000,-200.0,200.0);
hSimFHWafervXY[l]=
new TH2F((std::string("SimFHWafervXYLayer")+sout.str()).c_str(),
(std::string("x;y;Wafer")).c_str(),
1000,-200.0,200.0,1000,-200.0,200.0);
}
TH1F *hSimEnergyThickness[40][3][3],*hSimMipsThickness[40][3][3];
......
......@@ -262,38 +262,39 @@ int main(int argc, char *const *argv) {
assert(filename!="");
// Ensure geometery and calibration are ready
#ifdef RELATIVE_PATH
Geometry::initialise( full_path.remove_filename().string(), false, true);
#else
Geometry::initialise(false,false);
#endif
Calibration::initialise();
// SHOULD BE REMOVED
std::ostringstream sArg;
sArg << std::setw(6) << std::setfill('0') << nEvt;
//TFileHandler tfh(std::string("trgAnalysis")+sArg.str());
/*
std::vector<SimHit> vEvtSimHit;
std::vector<SimHbh> vEvtSimHbh;
std::vector<SimHit> vMinSimHit;
std::vector<SimHbh> vMinSimHbh;
std::vector<HepMC::GenEvent*> vEvtGenEvent;
std::vector<HepMC::GenEvent*> vMinGenEvent;
*/
#ifdef RELATIVE_PATH
Geometry::initialise( full_path.remove_filename().string(), false, true);
#else
Geometry::initialise(false,false);
#endif
Calibration::initialise();
// SHOULD BE REMOVED
std::ostringstream sArg;
sArg << std::setw(6) << std::setfill('0') << nEvt;
//TFileHandler tfh(std::string("trgAnalysis")+sArg.str());
/*
std::vector<SimHit> vEvtSimHit;
std::vector<SimHbh> vEvtSimHbh;
std::vector<SimHit> vMinSimHit;
std::vector<SimHbh> vMinSimHbh;
std::vector<HepMC::GenEvent*> vEvtGenEvent;
std::vector<HepMC::GenEvent*> vMinGenEvent;
*/
// Directory for data files
#ifdef RELATIVE_PATH
const std::string sDir( full_path.remove_filename().string()+"/../RawData/" );
const std::string sDir( RAW_DATA_PATH );
#else
const std::string sDir("RawData/");
const std::string sDir( RAW_DATA_PATH );
#endif
// Signal file reader
std::cout << "------------" << sDir << std::endl;
ReadEventTruthFile retfEvt;
assert(retfEvt.open(sDir+args.fFilename));
assert(retfEvt.open(sDir+"/"+args.fFilename));
// Min bias file reader
ReadEventTruthPu retfMin;
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment