Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

test #39

Open
wants to merge 71 commits into
base: hipo_ext
Choose a base branch
from
Open

test #39

Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
71 commits
Select commit Hold shift + click to select a range
cfc32b9
Merge pull request #38 from dglazier/hipo_ext
dglazier Feb 5, 2024
6bb8a6f
update workflow check ofr external hipo
dglazier Feb 5, 2024
b8ee926
update workflow check ofr external hipo
dglazier Feb 5, 2024
66901f3
update workflow check ofr external hipo
dglazier Feb 5, 2024
cbb72a8
update workflow check ofr external hipo
dglazier Feb 5, 2024
53f68cf
remove internal hipo4 files
dglazier Feb 5, 2024
8561100
readd hipo ntuple classes and libHipo4
dglazier Feb 5, 2024
5d9f6ae
update workflow check ofr external hipo
dglazier Feb 5, 2024
2081647
update workflow check ofr external hipo
dglazier Feb 5, 2024
51f3b82
update workflow check ofr external hipo
dglazier Feb 5, 2024
4ba8b21
update workflow check ofr external hipo
dglazier Feb 5, 2024
a7ba949
Merge pull request #64 from dglazier/master
dglazier Feb 7, 2024
f0db553
fix HIPO_LIBS
dglazier Feb 7, 2024
fc984ee
Merge pull request #65 from dglazier/master
dglazier Feb 7, 2024
7e73dce
fix(ci): update actions and dependencies
c-dilks Feb 8, 2024
04c373e
fix: `yes`
c-dilks Feb 8, 2024
0ba1658
test: run `scons` directly
c-dilks Feb 8, 2024
fba9a31
fix: need `git`
c-dilks Feb 8, 2024
6685a29
ci: default runner shell to `bash`
c-dilks Feb 8, 2024
8e0f9c3
fix: kluge around CCDB build config syntax
c-dilks Feb 8, 2024
41f0a59
test: try PyPI scons
c-dilks Feb 8, 2024
99b3c90
fix: install `pip`
c-dilks Feb 8, 2024
c2cfce1
fix: skip version queries
c-dilks Feb 8, 2024
15e558d
fix: run with python2
c-dilks Feb 8, 2024
cab813e
Merge pull request #66 from c-dilks/ci-fixes
dglazier Feb 12, 2024
032c289
Merge pull request #40 from JeffersonLab/master
dglazier Feb 13, 2024
17b730d
Create db.C
baltzell Mar 26, 2024
e54f432
Update db.C
baltzell Mar 26, 2024
c5bc95e
Merge pull request #67 from baltzell/master
dglazier May 7, 2024
190c5fb
Merge branch 'JeffersonLab:master' into master
dglazier May 10, 2024
ca32f42
add getBankPTrs function, perhaps useful for Iguana
dglazier May 12, 2024
a21b197
add LoadIguana.C for Iguana
dglazier May 12, 2024
e9bbc86
behviour changed (root 6.28 anyway) in copying database paths to proo…
dglazier May 13, 2024
8a1477f
improve const correctness in banks classes
dglazier May 17, 2024
d3f18a5
first proper iguana push
dglazier May 22, 2024
d04441e
use interpreter include path
dglazier May 22, 2024
7bb0db6
add clas12root/iguana as include directory
dglazier May 23, 2024
1454bc1
modify iguana classes to be more automated
dglazier May 24, 2024
423c10c
remove need to setC12 ever event
dglazier May 24, 2024
30c30f4
remove need to setC12 ever event
dglazier May 24, 2024
dbdb547
Merge pull request #41 from dglazier/iguana
dglazier May 24, 2024
fac3340
Merge pull request #69 from dglazier/master
dglazier May 29, 2024
8f13807
Update README.md
dglazier May 30, 2024
e5745e8
add iguana to tests
May 30, 2024
3229130
change in rich beahviour with new hipo was fixed by insisting notify …
dglazier Jul 18, 2024
2dd8595
Merge pull request #42 from dglazier/checkrich
dglazier Jul 18, 2024
2df25ae
Merge pull request #72 from dglazier/master
dglazier Jul 19, 2024
079974e
actually fix rich bug this time, need to set _detector_id_order to 0 …
dglazier Jul 19, 2024
90c771b
Merge pull request #73 from dglazier/master
dglazier Jul 22, 2024
4ccfdcf
build: remove `ccdb` submodule
c-dilks Sep 9, 2024
7baf926
build: add Nathan's `ccdb` fork, at tag `v1.99.4`
c-dilks Sep 9, 2024
b8c9957
ci: use Python 3
c-dilks Sep 9, 2024
4ddf6f6
Merge pull request #76 from c-dilks/ccdb-nathan
dglazier Sep 24, 2024
592c052
ci: HIPO's build system is now Meson
c-dilks Sep 9, 2024
bbf30e8
feat: HIPO submodule and installation script
c-dilks Sep 24, 2024
b485e2b
doc: fix `hipo` repo name and some typos
c-dilks Sep 25, 2024
1269bed
Merge pull request #77 from c-dilks/hipo-meson
dglazier Sep 26, 2024
a70db49
Update .gitignore
dglazier Sep 26, 2024
a4fb3ba
updating to qadb v2, move construction of qadb to applyQADB method a…
dglazier Nov 20, 2024
e7d3275
make sure run number is used when creating qadb and exit if try and …
dglazier Nov 20, 2024
d3144ff
make sure run number is used when creating qadb and exit if try and …
dglazier Nov 20, 2024
53ab4d8
update qadb to main. We want a tag before realesing a clas12root tag…
dglazier Nov 20, 2024
571fa9c
update example on databases for qadb v2
dglazier Nov 20, 2024
0b8d3de
add FiducialFilter but needs change to iguana
dglazier Nov 20, 2024
a9c511e
update iguana interface for PhotonGBTFilter and FiducialFilter
dglazier Nov 22, 2024
42760a1
update for iguana 0.8
dglazier Nov 27, 2024
55812e3
Merge pull request #43 from dglazier/iguana_filter
dglazier Nov 27, 2024
282793e
update non chain qadb example
dglazier Dec 3, 2024
8b5446b
update README for qadb
dglazier Dec 3, 2024
ac573aa
purge not allowed algorithms
dglazier Dec 3, 2024
41fcc6c
purge PhotonGBTFilter
dglazier Dec 3, 2024
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
36 changes: 17 additions & 19 deletions .github/workflows/main.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,25 +2,30 @@ name: C++ CI Testing

on: pull_request

defaults:
run:
shell: bash

jobs:
build_and_test:
build_and_test:
runs-on: ubuntu-latest
container: rootproject/root:${{ matrix.version }}
strategy:
matrix:
version: [6.28.12-ubuntu22.04]

steps:
- name: system dependancies
- name: system dependencies
run: |
apt update
apt -y install git scons python2
apt -y update
apt -y upgrade
apt -y install git python3-pip
python -m pip install scons meson ninja

- name: checkout repository
uses: actions/checkout@v3
uses: actions/checkout@v4
with:
submodules: recursive
path: .

- name: set env vars
run: |
Expand All @@ -36,25 +41,18 @@ build_and_test:
echo "PATH=$PWD/bin:$CCDB_HOME:$CCDB_HOME/bin:$RCDB_HOME/bin:$RCDB_HOME/cpp/bin:$PATH" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=$RCDB_HOME/cpp/lib:$CCDB_HOME/lib:$LD_LIBRARY_PATH" >> $GITHUB_ENV


- name: checkout hipo
uses: actions/checkout@v4
with:
repository: gavalian/hipo
ref: 4.0.1 # if you want to use a fixed tag; remove if you want to use `main`
path: ${HIPO}
- name: Create hipo folder
run: |
mkdir -p $HIPO

- name: build hipo
run: |
cd $HIPO
cmake -DCMAKE_INSTALL_PREFIX=$HIPO
cmake --build . --target install
run: ./installHIPO $HIPO

- name: build ccdb
run: |
cd $CCDB_HOME
bash environment.bash
/usr/bin/env python2 $(which scons)
source environment.bash
python $(which scons)

- name: build clas12root
run: |
Expand Down
5 changes: 4 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,10 +1,13 @@
# diff between stock checkout and after ./installC12Root
bin
build
hipo4
lib
man

# dependency installations
##############
/hipo

# hipo source
##############
ExtraPackages/rhipo/chipo/
Expand Down
9 changes: 6 additions & 3 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -1,12 +1,15 @@
[submodule "lz4"]
path = lz4
url = https://github.com/lz4/lz4.git
[submodule "ccdb"]
path = ccdb
url = https://github.com/JeffersonLab/ccdb.git
[submodule "rcdb"]
path = rcdb
url = https://github.com/JeffersonLab/rcdb
[submodule "clas12-qadb"]
path = clas12-qadb
url = https://github.com/JeffersonLab/clas12-qadb
[submodule "ccdb"]
path = ccdb
url = https://github.com/baltzell/ccdb.git
[submodule "hipo_src"]
path = hipo_src
url = https://github.com/gavalian/hipo.git
6 changes: 5 additions & 1 deletion CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ if (DEFINED ENV{HIPO})

set(HIPOEXT $ENV{HIPO})
set(HIPO_INCLUDE_DIR ${HIPOEXT}/include/)
set(HIPO_LIBS -L${HIPOEXT}/ -lhipo4)
set(HIPO_LIBS "-L${HIPOEXT}/lib -lhipo4")

MESSAGE( STATUS "HIPO INCLUDE_DIR : " ${HIPO_INCLUDE_DIR} )
MESSAGE( STATUS "HIPO LIBRARIES : " ${HIPO_LIBS} )
Expand All @@ -52,10 +52,14 @@ ENDIF (DEFINED ENV{QADB})



set(HIPOROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/hipo4)
set(CLAS12ROOT_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Clas12Root)
set(CLAS12BANKS_DIR ${CMAKE_CURRENT_SOURCE_DIR}/Clas12Banks)


include_directories(${HIPOROOT_DIR})
add_subdirectory (${HIPOROOT_DIR})

include_directories(${CLAS12BANKS_DIR})
add_subdirectory (${CLAS12BANKS_DIR})

Expand Down
26 changes: 16 additions & 10 deletions Clas12Banks/clas12databases.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,10 +41,12 @@ namespace clas12 {
_myRcdbPath=other._myRcdbPath;
_myCcdbPath=other._myCcdbPath;
//_myQadbPath=other._myQadbPath;

_pass = other._pass;

initDBs();

if(_qadb.get()){
if(other._qadb.get()){
initQA();
qadb_requireOkForAsymmetry(other._qadbReqOKAsymmetry);
qadb_requireGolden(other._qadbReqGolden);
qadb_setQARequirements(other._qadbReqsQA);
Expand All @@ -57,11 +59,12 @@ namespace clas12 {
_myRcdbPath=other._myRcdbPath;
_myCcdbPath=other._myCcdbPath;
//_myQadbPath=other._myQadbPath;

_pass = other._pass;

initDBs();

if(_qadb.get()){
if(other._qadb.get()){
initQA();
qadb_requireOkForAsymmetry(other._qadbReqOKAsymmetry);
qadb_requireGolden(other._qadbReqGolden);
qadb_setQARequirements(other._qadbReqsQA);
Expand All @@ -86,10 +89,10 @@ namespace clas12 {
}


_qadb.reset( new qadb_reader{0} );
qadb_requireOkForAsymmetry(_qadbReqOKAsymmetry);
qadb_requireGolden(_qadbReqGolden);
qadb_setQARequirements(_qadbReqsQA);
// _qadb.reset( new qadb_reader{0} );
// qadb_requireOkForAsymmetry(_qadbReqOKAsymmetry);
// qadb_requireGolden(_qadbReqGolden);
// qadb_setQARequirements(_qadbReqsQA);

}
//update run number to each database
Expand All @@ -105,8 +108,11 @@ namespace clas12 {
if(_ccdb.get()!=nullptr){
_ccdb->setRun(runNb);
_ccdb->updateTables();
}
if(_qadb.get()!=nullptr)_qadb->setRun(runNb);
}
if(_qadb.get()!=nullptr){
// _qadb->setRun(runNb);
initQA();
}
if(_rcdb.get()!=nullptr)_rcdb->readRun(runNb);

close();
Expand Down
20 changes: 19 additions & 1 deletion Clas12Banks/clas12databases.h
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,12 @@ namespace clas12 {
//qadb stuff
//I would rather this was not needed here
//but it is to make sure it gets passed to PROOF
void qadb_addQARequirement(string req){ _qadb->addQARequirement(req);_qadbReqsQA.push_back(req);};
void qadb_addQARequirement(string req){
if(_qadb.get()==nullptr){
throw std::runtime_error("clas12databases::qadb_addQARequirement - Need to call clas12reader::applyQA(cook) first");
}
_qadb->addQARequirement(req);_qadbReqsQA.push_back(req);
}
void qadb_setQARequirements( std::vector<string> reqs){_qadb->setQARequirements(reqs); _qadbReqsQA = reqs;};

void qadb_requireOkForAsymmetry(bool ok){_qadb->requireOkForAsymmetry(ok);_qadbReqOKAsymmetry=ok;};
Expand All @@ -75,13 +80,26 @@ namespace clas12 {
void turnOffQADB(){_qadb.reset();}
void turnOffRCDB(){_rcdb.reset();}
void turnOffCCDB(){_ccdb.reset();}

void setPass(const string& pass){
_pass = pass;
initQA();
}
void initQA(){
std::cout<<"clas12databases::initQA pass = "<<_pass<<" run ="<<_runNb<<std::endl;
_qadb.reset( new qadb_reader{_pass,_runNb} );
qadb_requireOkForAsymmetry(_qadbReqOKAsymmetry);
qadb_requireGolden(_qadbReqGolden);
qadb_setQARequirements(_qadbReqsQA);
}
private:

//names for copying to ROOT file for selector
string _myRcdbPath;
string _myCcdbPath;
//string _myQadbPath;

string _pass; //!
int _runNb={0};//!

std::unique_ptr<rcdb_reader> _rcdb;//!
Expand Down
36 changes: 27 additions & 9 deletions Clas12Banks/clas12reader.h
Original file line number Diff line number Diff line change
Expand Up @@ -146,14 +146,37 @@ namespace clas12 {
int getBankOrder(int ibank,std::string itemname ) const{
return getBank(ibank)->getSchema().getEntryOrder(itemname.data());
}

const std::vector<hipo::bank*> getBanksPtrs(std::vector<std::string> names) const{
std::vector<hipo::bank*> blist;
for(const auto& name:names){
//Find this bank in all banks
auto it = std::find_if(
_allBanks.begin(),
_allBanks.end(),
[&name](auto* bank)
{ return bank->getSchema().getName() == name; });
if(it == _allBanks.end()) {
cerr<<"clas12reader::getBanks : bank "<<name<<" does not exist"<<endl;
exit(0);
}
//make a copy and add to list
auto cpBank = dynamic_cast<hipo::bank*>(*it);
blist.push_back(cpBank);

}
cout<<"clas12reader::getBanks got "<<blist.size()<<endl;
return blist;
}

/////////////////////////////////

std::vector<region_part_ptr>& getDetParticles(){return _detParticles;}
std::vector<region_part_ptr>* getDetParticlesPtr(){return &_detParticles;}
std::vector<region_part_ptr> getByID(int id);
std::vector<region_part_ptr> getByRegion(int ir);
std::vector<region_part_ptr> getByCharge(int ch);

const std::vector<short>& preCheckPids();
const std::vector<short>& preCheckPidsOrCharge();

Expand Down Expand Up @@ -347,14 +370,9 @@ namespace clas12 {
clas12databases* db(){return _db;};

//clas12-qadb
void applyQA() {
// if(_db)
if( _db->qa() )
_applyQA=true;

if( _applyQA==false){
std::cout<<"Warning, clas12reader applyQA() not valid"<<std::endl;
}
void applyQA(const string& pass) {
_applyQA=true;
_db->setPass(pass);
}

//double sumChargeFromQA();
Expand Down
6 changes: 3 additions & 3 deletions Clas12Banks/covmatrix.h
Original file line number Diff line number Diff line change
Expand Up @@ -40,8 +40,8 @@ namespace clas12 {
int getPindex() { return getInt(_pindex_order,_index);}
int getIndex() const {return _index;}
int getIndex(int pindex);
void setIndex(int ind){_index=ind;}
void setEntry(int ind){_index=ind;}
void setIndex(int ind) const{_index=ind;}
void setEntry(int ind) const{_index=ind;}
void setBankEntry(int ind){_index=ind;}

const CovMatrix* matrix();
Expand Down Expand Up @@ -79,7 +79,7 @@ namespace clas12 {
CovMatrix _matrix={5,std::vector<float>(5,0)};
IndMatrix _morder={5,std::vector<int>(5,-1)};
int _pindex_order=-1;
int _index=-1;
mutable int _index=-1;
//std::map<int,int> _rmap;
std::vector<int> _rvec;
};
Expand Down
2 changes: 1 addition & 1 deletion Clas12Banks/event.h
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ namespace clas12 {
void notify() final{
bank::notify();
}
void setEntry(int ind){}
void setEntry(int ind) const{}
void setBankEntry(int ind){}

private :
Expand Down
2 changes: 1 addition & 1 deletion Clas12Banks/ftbevent.h
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ namespace clas12 {

long getCategory() const noexcept{ return getLong(_cat_order,0); }
float getStartTime() const noexcept{ return getFloat(_st_order,0); }
void setEntry(int ind){}
void setEntry(int ind) const {}
void setBankEntry(int ind){}

/**
Expand Down
4 changes: 2 additions & 2 deletions Clas12Banks/ftbparticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ namespace clas12 {
int _py_order{-1};
int _pz_order{-1};

short _entry{0};
mutable short _entry{0};

public:

Expand Down Expand Up @@ -67,7 +67,7 @@ namespace clas12 {
float getPz() const noexcept{ return getFloat(_pz_order,_entry);}


void setEntry(short i){
void setEntry(short i) const{
if( i<getRows() )_entry=i;
else _entry = -1;
}
Expand Down
2 changes: 1 addition & 1 deletion Clas12Banks/helflip.h
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ namespace clas12 {
void notify() final{
bank::notify();
}
void setEntry(int ind){}
void setEntry(int ind) const{}
void setBankEntry(int ind){}

private :
Expand Down
2 changes: 1 addition & 1 deletion Clas12Banks/helonline.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ namespace clas12 {
void notify() final{
bank::notify();
}
void setEntry(int ind){}
void setEntry(int ind) const{}
void setBankEntry(int ind){}

private :
Expand Down
10 changes: 5 additions & 5 deletions Clas12Banks/mcparticle.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,12 +81,12 @@ namespace clas12 {
return atan2(y,x);
}

void setEntry(short i){
void setEntry(short i) const{
if( i<getRows() )_entry=i;
else _entry = -1;

}
void setMatchEntry(short ip,short imc){
void setMatchEntry(short ip,short imc) const{
_entry=imc;
_matched_pindex=ip;
if(_match.get())_match->setEntry(_matched_pindex);
Expand All @@ -105,7 +105,7 @@ namespace clas12 {
_matched_pindex=-1;
bank::notify();
}
int match_to(int pindex){//pindex is index of reconstructed particle
int match_to(int pindex) const{//pindex is index of reconstructed particle
_matched_pindex=pindex;
return _match.get()!=nullptr ?
_entry=_match->getMCindex(pindex) : _entry=-1 ;
Expand Down Expand Up @@ -136,8 +136,8 @@ namespace clas12 {
int _parent_order{-1};
int _daughter_order{-1};

short _entry={0};
short _matched_pindex;
mutable short _entry={0};
mutable short _matched_pindex;
mcmatch_uptr _match;
};

Expand Down
Loading
Loading