Skip to content

Commit 14d29a5

Browse files
committed
Instructions & makefile to build SVfit w/o CMSSW FW
1 parent 98de658 commit 14d29a5

File tree

5 files changed

+103
-3
lines changed

5 files changed

+103
-3
lines changed

.gitignore

+4
Original file line numberDiff line numberDiff line change
@@ -1 +1,5 @@
11
*~
2+
exec/
3+
dep/
4+
obj/
5+
lib/

Makefile

+67
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
CXX = g++
2+
3+
WFLAGS = -Wall -Wextra -Wpedantic -Werror -Wno-unused-parameter -Wno-vla
4+
CXXFLAGS = $(WFLAGS) -fvisibility-inlines-hidden -fno-math-errno --param vect-max-version-for-alias-checks=50 \
5+
-Xassembler --compress-debug-sections -fno-crossjumping -msse3 -felide-constructors -fmessage-length=0 \
6+
-fdiagnostics-show-option -pipe -fPIC $(shell root-config --cflags)
7+
8+
LDFLAGS = -flto
9+
10+
ifdef DEBUG
11+
CXXFLAGS += -Og -ggdb3
12+
else
13+
CXXFLAGS += -O3 -ggdb0
14+
LDFLAGS += -s
15+
endif
16+
17+
BASEDIR = TauAnalysis/ClassicSVfit
18+
19+
SOURCE_PATH = $(BASEDIR)/src
20+
BIN_PATH = $(BASEDIR)/bin
21+
22+
OBJ_PATH = $(BASEDIR)/obj
23+
DEP_PATH = $(BASEDIR)/dep
24+
LIB_PATH = $(BASEDIR)/lib
25+
EXEC_PATH = $(BASEDIR)/exec
26+
27+
SRC_EXT = cc
28+
OBJ_EXT = o
29+
DEP_EXT = d
30+
LIB_EXT = so
31+
32+
INCLUDES = -I.
33+
LIBS = $(shell root-config --libs) -lGenVector
34+
35+
SRCS = $(shell find $(SOURCE_PATH) -name '*.$(SRC_EXT)' -exec basename {} \;)
36+
OBJS = $(SRCS:%.$(SRC_EXT)=$(OBJ_PATH)/%.$(OBJ_EXT))
37+
DEPS = $(SRCS:%.$(SRC_EXT)=$(DEP_PATH)/%.$(DEP_EXT))
38+
TRGT_SRCS = $(shell find $(BIN_PATH) -name '*.$(SRC_EXT)' -exec basename {} \;)
39+
TRGT_OBJS = $(TRGT_SRCS:%.$(SRC_EXT)=$(OBJ_PATH)/%.$(OBJ_EXT))
40+
TRGT = $(TRGT_SRCS:%.$(SRC_EXT)=$(EXEC_PATH)/%)
41+
TRGT_LIB_BASE = $(subst /,_,$(BASEDIR))
42+
TRGT_LIB_PATH = $(LIB_PATH)/lib$(TRGT_LIB_BASE).$(LIB_EXT)
43+
44+
all: $(TRGT)
45+
46+
$(TRGT): $(EXEC_PATH)/%: $(OBJ_PATH)/%.$(OBJ_EXT) $(TRGT_LIB_PATH)
47+
@mkdir -p $(EXEC_PATH)
48+
@$(CXX) $(CXXFLAGS) $^ -o $@ $(LDFLAGS) $(LIBS) -l$(TRGT_LIB_BASE)
49+
50+
$(TRGT_LIB_PATH): $(OBJS)
51+
@mkdir -p $(LIB_PATH)
52+
@$(CXX) $(CXXFLAGS) -shared $^ -o $@ $(LDFLAGS) $(LIBS)
53+
54+
$(OBJ_PATH)/%.$(OBJ_EXT): $(SOURCE_PATH)/%.$(SRC_EXT)
55+
@mkdir -p $(@D)
56+
@mkdir -p $(DEP_PATH)
57+
@$(CXX) $(CXXFLAGS) $(INCLUDES) -MMD -MF $(patsubst $(OBJ_PATH)/%.$(OBJ_EXT),$(DEP_PATH)/%.$(DEP_EXT),$@) -c $< -o $@
58+
59+
$(OBJ_PATH)/%.$(OBJ_EXT): $(BIN_PATH)/%.$(SRC_EXT)
60+
@mkdir -p $(@D)
61+
@mkdir -p $(DEP_PATH)
62+
@$(CXX) $(CXXFLAGS) $(INCLUDES) -MMD -MF $(patsubst $(OBJ_PATH)/%.$(OBJ_EXT),$(DEP_PATH)/%.$(DEP_EXT),$@) -c $< -o $@
63+
64+
.PHONY: clean
65+
66+
clean:
67+
@rm -rf $(OBJ_PATH) $(DEP_PATH) $(EXEC_PATH)

README.md

+25
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,31 @@ scram b -j 4
2121
In case of compilation problems, please sutmitt an issue on
2222
https://github.com/SVfit/ClassicSVfit/issues
2323

24+
# Without CMSSW software
25+
26+
It is possible to build the software without CMSSW framework if the following prerequisites are satisfied (oldest software version the instructions were tested with):
27+
- ROOT (6.10/3 or newer)
28+
- GCC (6.3 or newer)
29+
30+
In order to build the software, please execute the following lines in any directory with write access:
31+
```bash
32+
git clone https://github.com/SVfit/ClassicSVfit TauAnalysis/ClassicSVfit
33+
make -f TauAnalysis/ClassicSVfit/Makefile -j4
34+
```
35+
36+
The test executables will be placed to `$PWD/TauAnalysis/ClassicSVfit/exec`. In order to use them:
37+
```bash
38+
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$PWD/TauAnalysis/ClassicSVfit/lib
39+
40+
# either enter the full path to the executable, e.g.
41+
./TauAnalysis/ClassicSVfit/exec/testClassicSVfit
42+
43+
# or make the executable available globally
44+
export PATH=$PATH:$PWD/TauAnalysis/ClassicSVfit/exec
45+
testClassicSVfit # run anywhere
46+
```
47+
You can add the export statements to your `$HOME/.bashrc` to make their effect permanent.
48+
2449
# Running instructions
2550

2651
- [Presentation, slides 2+3](https://indico.cern.ch/event/684622/contributions/2807248/attachments/1575090/2487044/presentation_tmuller.pdf)

interface/MeasuredTauLepton.h

+1-1
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,6 @@ namespace classic_svFit
121121
{
122122
bool operator() (const MeasuredTauLepton& measuredTauLepton1, const MeasuredTauLepton& measuredTauLepton2);
123123
};
124-
};
124+
}
125125

126126
#endif

src/ClassicSVfitIntegrand.cc

+6-2
Original file line numberDiff line numberDiff line change
@@ -111,10 +111,14 @@ double ClassicSVfitIntegrand::EvalPS(const double* q) const
111111
return 0.;
112112
}
113113

114+
double visPtShift1 = 1.;
115+
double visPtShift2 = 1.;
116+
#ifdef USE_SVFITTF
114117
int idx_visPtShift1 = legIntegrationParams_[0].idx_VisPtShift_;
115-
double visPtShift1 = ( useHadTauTF_ && idx_visPtShift1 != -1 && !leg1isLeptonicTauDecay_ ) ? (1./x_[idx_visPtShift1]) : 1.;
116118
int idx_visPtShift2 = legIntegrationParams_[1].idx_VisPtShift_;
117-
double visPtShift2 = ( useHadTauTF_ && idx_visPtShift2 != -1 && !leg2isLeptonicTauDecay_ ) ? (1./x_[idx_visPtShift2]) : 1.;
119+
if( useHadTauTF_ && idx_visPtShift1 != -1 && !leg1isLeptonicTauDecay_ ) visPtShift1 = (1./x_[idx_visPtShift1]);
120+
if( useHadTauTF_ && idx_visPtShift2 != -1 && !leg2isLeptonicTauDecay_ ) visPtShift2 = (1./x_[idx_visPtShift2]);
121+
#endif
118122
if ( visPtShift1 < 1.e-2 || visPtShift2 < 1.e-2 ) return 0.;
119123

120124
// scale momenta of visible tau decays products

0 commit comments

Comments
 (0)