Commit fbc72090 authored by vpalladi's avatar vpalladi
Browse files

Fixies

parent de1ca761
......@@ -7,44 +7,51 @@ CXX = g++
##############
DEFINES =
#DEFINES += -DRELATIVE_PATH
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
####################
### useful paths ###
####################
# top and current dirs
MKFILE_PATH = $(abspath $(lastword $(MAKEFILE_LIST)))
TOP = $(dir $(MKFILE_PATH))
TOP = $(patsubst %/,%,$(dir $(MKFILE_PATH)))
CURRENT = $(shell pwd)
# python
PYTHON_CODE = $(TOP)/python
NAMING_DIR = $(PYTHON_CODE)/naming
PYTHON_EXE = /usr/include/python2.6
# naming
NAMING_DIR = $(PYTHON_CODE)/naming
# local interface
INTERFACE_DIR = $(TOP)/interface
NAVIGATION_INC = $(INTERFACE_DIR)/navigation
# lib
LIB_DIR = $(TOP)/lib
# HepMC Dir
HEPMC_DIR = $(TOP)/HepMC/2.06.09
# bin dir
BIN_DIR = $(CURRENT)/bin
# lib dir
LIB_DIR = $(TOP)/lib
##################################################
### create $(TOP)/bin directory if it does not exist
##################################################
MKD_BIN = mkdir -p $(CURRENT)/bin
#############
### links ###
#############
HEPMC_LN = $(LIB_DIR)/HepMC
BOOST_LN = $(LIB_DIR)/boost
################################################
### copy the launcher in the $CURRENT folder ###
################################################
prova = $(shell ls launcherIC.py)
LS_LAUNCHER = $(shell ls launcherIC.py)
##########################
### flags and libs and INC
......@@ -57,11 +64,11 @@ 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/vols/cms/vpalladi/SW/BaseCentOS6/boost/1_61_0/lib -lboost_filesystem-mt -lboost_system
BOOST_LIBS = -L$(BOOST_LN)/lib -lboost_filesystem-mt -lboost_system
# HepMC flags
HEPMC_FLAGS = -I$(HEPMC_DIR)/include
HEPMC_LIBS = -L$(HEPMC_DIR)/lib -lHepMC #-lHepMCfio
HEPMC_FLAGS = -I$(HEPMC_LN)/include
HEPMC_LIBS = -L$(HEPMC_LN)/lib -lHepMC #-lHepMCfio
# CXX flags
#CXXFLAGS = -Wall -std=c++0x -Wno-write-strings
......@@ -86,10 +93,10 @@ INCLUDES_HH := $(wildcard $(INTERFACE_DIR)/*.hh)
EXES := $(MAINS_CPP:.cpp=.exe)
all: $(EXES)
all: link_to_libs $(EXES)
%.exe: %.cpp cplauncher
$(MKD_BIN)
%.exe: %.cpp cplauncher
@mkdir -p $(BIN_DIR)
$(CXX) -o bin/$(notdir $@) $< $(DEFINES) $(CXXFLAGS) $(CXXLIBS)
py_lib:
......@@ -97,6 +104,9 @@ py_lib:
clean:
rm $(CURRENT)/bin/*
unlink $(HEPMC_LN)
unlink $(BOOST_LN)
rm -rf $(LIB_DIR)
echo:
# echo $(HEPMCFLAGS)
......@@ -108,10 +118,16 @@ echo:
# echo $(MAINS_CPP)
cplauncher:
ifeq ($(prova),launcherIC.py)
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;
......@@ -9,23 +9,7 @@
## installation ##
##################
1. HepMC:
DISCLAIMER: cmake is required
a. http://lcgapp.cern.ch/project/simu/HepMC/ls ()
b. download the version (e.g. HepMC-2.06.09.tar.gz)
c. install:
c.1. create a directory called HepMC in your root dir, copy the tar.gz in there
c.2. untar: tar -xvf HepMC-2.06.09.tar.gz
c.3. mkdir 2.06.09
c.3. cd 2.06.09
c.4. cmake -DCMAKE_INSTALL_PREFIX=~/$(ROOT_DIR)/HepMC/2.06.09 -Dmomentum:STRINGC=GEV -Dlength:STRING=CM ../HepMC-2.06.09
c.5. make
c.6. make test
c.7. make install
1. HepMC is provided already compiled on lxXX machines. The Makefile is now able to authomaticly link to those libs. However if you want to use your own version you must manually change the path into the Makefile
2. python: tested with versions 2.6 2.7; numpy and matplotlib needed
......@@ -33,3 +17,26 @@
data are expected to be stored or linked in a folder called 'RawData' located in your top directory
4. boost is needed.
5. env.sh is an example of script to link to the correct libriries (HepMC and boost)
############################################# DEPRECATED #############################################
### 1. HepMC:
###
### DISCLAIMER: cmake is required
###
### a. http://lcgapp.cern.ch/project/simu/HepMC/ls ()
###
### b. download the version (e.g. HepMC-2.06.09.tar.gz)
###
### c. install:
### c.1. create a directory called HepMC in your root dir, copy the tar.gz in there
### c.2. untar: tar -xvf HepMC-2.06.09.tar.gz
### c.3. mkdir 2.06.09
### c.3. cd 2.06.09
### c.4. cmake -DCMAKE_INSTALL_PREFIX=~/$(ROOT_DIR)/HepMC/2.06.09 -Dmomentum:STRINGC=GEV -Dlength:STRING=CM ../HepMC-2.06.09
### c.5. make
### c.6. make test
### c.7. make install
#######################################################################################################
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
......@@ -27,7 +27,21 @@
#include "RecHit.hh"
#include "TrgHit.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
TFileHandler tfh("CalibrationTest");
TH2F *h2[2][2];
......@@ -35,38 +49,42 @@ int main(int argc, const char **argv) {
h2[0][1]=new TH2F("SNIrr",";#rho (cm);Signal/Noise",160,0.0,160.0,2200,0.0,22.0);
h2[1][0]=new TH2F("NoiseUnirr",";#rho (cm);Noise",160,0.0,160.0,2000,0.0,2.0);
h2[1][1]=new TH2F("SNUnirr",";#rho (cm);Signal/Noise",160,0.0,160.0,2200,0.0,22.0);
#ifdef RELATIVE_PATH
Geometry::initialise( full_path.remove_filename().string(), false, true );
#else
Geometry::initialise(false,false);
#endif
Calibration cal;
Geometry geo;
//Geometry geo;
unsigned e(0);
unsigned l(0);
double minType[3]={100,100,100};
for(unsigned w(0);w<geo.numberOfWafers(l);w++) {
if(geo.validWafer(l,w)) {
for(unsigned w(0);w<Geometry::numberOfWafers(l);w++) {
if(Geometry::validWafer(l,w)) {
unsigned nC(Geometry::numberOfCells(l,w));
double sig((Geometry::waferThickness(l,w)+1)*Calibration::fMip100mu*Calibration::fFcPerGev);
for(unsigned c(0);c<nC;c++) {
Point p(geo.waferCellPoint(e,l,w,c));
Point p(Geometry::waferCellPoint(e,l,w,c));
double r(p.rho());
double nse;
Calibration::fIrradiated=true;
nse=Calibration::noise(r,geo.waferThickness(l,w),geo.halfCell(Geometry::waferType(l,w)==0,c));
nse=Calibration::noise(r,Geometry::waferThickness(l,w),Geometry::halfCell(Geometry::waferType(l,w)==0,c));
//double sOverN=geo.waferType(l,w)*Calibration::fcPerMip()/(3.0*Calibration::noise(r,geo.waferType(l,w),geo.halfCell(Geometry::waferType(l,w)==0,c)));
//double sOverN=Geometry::waferType(l,w)*Calibration::fcPerMip()/(3.0*Calibration::noise(r,Geometry::waferType(l,w),Geometry::halfCell(Geometry::waferType(l,w)==0,c)));
double sOverN(sig/nse);
if(minType[geo.waferThickness(l,w)]>sOverN) minType[geo.waferThickness(l,w)]=sOverN;
if(minType[Geometry::waferThickness(l,w)]>sOverN) minType[Geometry::waferThickness(l,w)]=sOverN;
h2[0][0]->Fill(r,nse);
h2[0][1]->Fill(r,sOverN);
Calibration::fIrradiated=false;
nse=Calibration::noise(r,geo.waferThickness(l,w),geo.halfCell(Geometry::waferType(l,w)==0,c));
nse=Calibration::noise(r,Geometry::waferThickness(l,w),Geometry::halfCell(Geometry::waferType(l,w)==0,c));
sOverN=sig/nse;
h2[1][0]->Fill(r,nse);
h2[1][1]->Fill(r,sOverN);
......
......@@ -23,8 +23,18 @@
#include "readGeoHits.cc"
int main(int argc, const char **argv) {
#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
/*
unsigned nArg(2);
......@@ -40,7 +50,13 @@ int main(int argc, const char **argv) {
TFileHandler tfh("trgGeo");//sFile.str().c_str());
#ifdef RELATIVE_PATH
const Geometry geo( full_path.remove_filename().string() );
#else
const Geometry geo;
#endif
GeometryCheck geoCheck(geo);
std::vector<GeoHit> vGeoHit;
......
......@@ -22,10 +22,25 @@
#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) {
TRandom3 random;
Geometry geo;
#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
Constants::print();
......
......@@ -26,10 +26,24 @@
#include "readSimHits.cc"
#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;
Geometry geo;
#ifdef RELATIVE_PATH
const Geometry geo( full_path.remove_filename().string() );
#else
const Geometry geo;
#endif
Constants::print();
......
Supports Markdown
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