Skip to content

Commit 5a2a621

Browse files
committed
FCAL cal. plugins
1 parent 05fb583 commit 5a2a621

20 files changed

+3436
-0
lines changed
Binary file not shown.
Binary file not shown.
302 KB
Binary file not shown.

calcal/fcal/fcal-cal/JEventProcessor_FCAL_Pi0TOF.cc

Lines changed: 1552 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
// $Id$
2+
//
3+
// File: JEventProcessor_FCAL_Pi0TOF.h
4+
// Created: Wed Aug 30 16:23:49 EDT 2017
5+
// Creator: mstaib (on Linux egbert 2.6.32-696.10.1.el6.x86_64 x86_64)
6+
//
7+
8+
#ifndef _JEventProcessor_FCAL_Pi0TOF_
9+
#define _JEventProcessor_FCAL_Pi0TOF_
10+
#include <JANA/JApplication.h>
11+
#include <JANA/JEventProcessor.h>
12+
#include <PID/DNeutralParticle.h>
13+
#include <FCAL/DFCALShower.h>
14+
#include <FCAL/DFCALCluster.h>
15+
#include <HDGEOMETRY/DGeometry.h>
16+
#include <FCAL/DFCALGeometry.h>
17+
#include <TOF/DTOFPoint.h>
18+
#include "units.h"
19+
#include "DLorentzVector.h"
20+
#include "DVector3.h"
21+
#include "HistogramTools.h"
22+
#include "DANA/DApplication.h"
23+
#include "DANA/DStatusBits.h"
24+
#include "TProfile.h"
25+
#include "DVector3.h"
26+
#include "PID/DVertex.h"
27+
28+
#include "PID/DBeamPhoton.h"
29+
#include "PID/DEventRFBunch.h"
30+
#include "TRIGGER/DL1Trigger.h"
31+
32+
using namespace std;
33+
34+
class JEventProcessor_FCAL_Pi0TOF:public jana::JEventProcessor{
35+
public:
36+
JEventProcessor_FCAL_Pi0TOF();
37+
~JEventProcessor_FCAL_Pi0TOF();
38+
const char* className(void){return "JEventProcessor_FCAL_Pi0TOF";}
39+
40+
private:
41+
jerror_t init(void); ///< Called once at program start.
42+
jerror_t brun(jana::JEventLoop *eventLoop, int32_t runnumber); ///< Called everytime a new run number is detected.
43+
jerror_t evnt(jana::JEventLoop *eventLoop, uint64_t eventnumber); ///< Called every event.
44+
jerror_t erun(void); ///< Called everytime run number changes, provided brun has been called.
45+
jerror_t fini(void); ///< Called after last event of last event source has been processed.
46+
47+
//vector<const DTOFPoint*> tof_points;
48+
double bar2x( int bar );
49+
int TOF_Match(double kinVertexX, double kinVertexY, double kinVertexZ, double x, double y, double z);
50+
double m_beamSpotX;
51+
double m_beamSpotY;
52+
double m_targetZ;
53+
double m_Ethres;
54+
double m_Ethres_default;
55+
double m_Ethres_ring[30];
56+
int DO_METHOD;
57+
int USE_TRACKS;
58+
double m_time_FCALRF_cut;
59+
double m_time_RF_offset;
60+
double m_time_FCALFCAL_cut;
61+
int m_bit, m_no_bit;
62+
double frac_thres_1_to_5;
63+
double frac_thres_6_to_23;
64+
65+
66+
67+
TProfile *hCurrentGainConstants;
68+
TProfile *hCurrentBLKQualities;
69+
};
70+
71+
#endif // _JEventProcessor_FCAL_Pi0TOF_
72+

calcal/fcal/fcal-cal/SConstruct

Lines changed: 142 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,142 @@
1+
2+
#
3+
# Jan. 31, 2014 David Lawrence
4+
#
5+
# This SConstruct file can be copied into a directory containing
6+
# the source for a plugin and used to compile it. It will use and
7+
# install into the directory specified by the HALLD_MY environment
8+
# variable if defined. Otherwise, it will install in the HALLD_RECON_HOME
9+
# directory.
10+
#
11+
# This file should not need modification. It will be copied in by
12+
# the mkplugin or mkfactory_plugin scripts or you can just copy it
13+
# by hand.
14+
#
15+
# To use this, just type "scons install" to build and install.
16+
# Just type "scons" if you want to build, but not install it.
17+
#
18+
# > scons install
19+
#
20+
# Note that unlike the rest of the SBMS system, this does not
21+
# use a separate build directory and builds everything in the
22+
# source directory. This is due to technical details and will hopefully
23+
# be fixed in the future. For now it means, that you must be
24+
# diligent of building for multiple platforms using the same source.
25+
#
26+
27+
from __future__ import division
28+
from __future__ import absolute_import
29+
from __future__ import print_function
30+
from __future__ import unicode_literals
31+
32+
from builtins import map
33+
from builtins import str
34+
from builtins import open
35+
from builtins import int
36+
from future import standard_library
37+
standard_library.install_aliases()
38+
39+
import os
40+
import sys
41+
import subprocess
42+
import glob
43+
44+
# Get HALLD_RECON_HOME environment variable, verifying it is set
45+
halld_home = os.getenv('HALLD_RECON_HOME')
46+
if(halld_home == None):
47+
print('HALLD_RECON_HOME environment variable not set!')
48+
exit(-1)
49+
50+
# Get HALLD_MY if it exists. Otherwise use HALLD_RECON_HOME
51+
halld_my = os.getenv('HALLD_MY', halld_home)
52+
53+
# Add SBMS directory to PYTHONPATH
54+
sbmsdir = "%s/src/SBMS" % halld_home
55+
sys.path.append(sbmsdir)
56+
57+
import sbms
58+
59+
# Get command-line options
60+
SHOWBUILD = ARGUMENTS.get('SHOWBUILD', 0)
61+
62+
# Get platform-specific name
63+
osname = os.getenv('BMS_OSNAME', 'build')
64+
65+
# Get architecture name
66+
arch_out = ROOT_CFLAGS = subprocess.Popen(["uname"], stdout=subprocess.PIPE).communicate()[0].strip()
67+
arch = str(arch_out, 'utf-8')
68+
69+
# Setup initial environment
70+
installdir = "%s/%s" %(halld_my, osname)
71+
include = "%s/include" % (installdir)
72+
bin = "%s/bin" % (installdir)
73+
lib = "%s/lib" % (installdir)
74+
plugins = "%s/plugins" % (installdir)
75+
env = Environment( ENV = os.environ, # Bring in full environment, including PATH
76+
CPPPATH = [include],
77+
LIBPATH = ["%s/%s/lib" %(halld_home, osname)], # n.b. add HALLD_RECON_HOME here and prepend HALLD_MY below
78+
variant_dir = ".%s" % (osname))
79+
80+
# Only add HALLD_MY library search path if it already exists
81+
# since we'll get a warning otherwise
82+
if (os.path.exists(lib)): env.PrependUnique(lib)
83+
84+
# These are SBMS-specific variables (i.e. not default scons ones)
85+
env.Replace(INSTALLDIR = installdir,
86+
OSNAME = osname,
87+
INCDIR = include,
88+
BINDIR = bin,
89+
LIBDIR = lib,
90+
PLUGINSDIR = plugins,
91+
ALL_SOURCES = [], # used so we can add generated sources
92+
SHOWBUILD = SHOWBUILD,
93+
COMMAND_LINE_TARGETS = COMMAND_LINE_TARGETS)
94+
95+
# Use terse output unless otherwise specified
96+
if SHOWBUILD==0:
97+
env.Replace( CCCOMSTR = "Compiling [$SOURCE]",
98+
CXXCOMSTR = "Compiling [$SOURCE]",
99+
FORTRANPPCOMSTR = "Compiling [$SOURCE]",
100+
FORTRANCOMSTR = "Compiling [$SOURCE]",
101+
SHCCCOMSTR = "Compiling [$SOURCE]",
102+
SHCXXCOMSTR = "Compiling [$SOURCE]",
103+
LINKCOMSTR = "Linking [$TARGET]",
104+
SHLINKCOMSTR = "Linking [$TARGET]",
105+
INSTALLSTR = "Installing [$TARGET]",
106+
ARCOMSTR = "Archiving [$TARGET]",
107+
RANLIBCOMSTR = "Ranlib [$TARGET]")
108+
109+
110+
# Get compiler from environment variables (if set)
111+
env.Replace( CXX = os.getenv('CXX', 'g++'),
112+
CC = os.getenv('CC' , 'gcc'),
113+
FC = os.getenv('FC' , 'gfortran') )
114+
115+
# Add local directory, directories from HALLD_MY and HALLD_RECON_HOME to include search path
116+
#env.PrependUnique(CPPPATH = ['#'])
117+
env.PrependUnique(CPPPATH = ['%s/src' % halld_my, '%s/src/libraries' % halld_my, '%s/src/libraries/include' % halld_my])
118+
env.PrependUnique(CPPPATH = ['%s/src' % halld_home, '%s/src/libraries' % halld_home, '%s/src/libraries/include' % halld_home])
119+
120+
env.PrependUnique(CPPPATH = ['%s/%s/include' % (halld_my,osname)])
121+
env.PrependUnique(CPPPATH = ['%s/%s/include' % (halld_home,osname)])
122+
123+
# Turn on debug symbols and warnings
124+
env.PrependUnique( CFLAGS = ['-g', '-fPIC', '-Wall'])
125+
env.PrependUnique( CXXFLAGS = ['-g', '-fPIC', '-Wall'])
126+
env.PrependUnique(FORTRANFLAGS = ['-g', '-fPIC', '-Wall'])
127+
128+
env.PrependUnique( CXXFLAGS = ['-std=c++11'])
129+
130+
# Apply any platform/architecture specific settings
131+
sbms.ApplyPlatformSpecificSettings(env, arch)
132+
sbms.ApplyPlatformSpecificSettings(env, osname)
133+
134+
# Make plugin from source in this directory
135+
sbms.AddDANA(env)
136+
sbms.AddROOT(env)
137+
sbms.plugin(env)
138+
139+
# Make install target
140+
env.Alias('install', installdir)
141+
142+
62.2 KB
Binary file not shown.

0 commit comments

Comments
 (0)