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

Revert "Added develop branch to CI builds" #212

Merged
merged 1 commit into from
Feb 28, 2025
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
4 changes: 2 additions & 2 deletions .github/workflows/c-cpp.yml
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@ name: C/C++ CI

on:
push:
branches: [ "main", "develop" ]
branches: [ "main", "Liam-CI-test", "liam_dev" ]
pull_request:
branches: [ "main", "develop" ]
branches: [ "main" ]

jobs:
build:
Expand Down
4 changes: 1 addition & 3 deletions src/TMS_Kalman.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -41,13 +41,11 @@ TMS_Kalman::TMS_Kalman(std::vector<TMS_Hit> &Candidates, double charge) :

TVector3 vecc = TVector3(x,y,z);

//if (! (TMS_Geom::GetInstance().IsInsideBox(vecc, TMS_Const::TMS_Start_Exact, TMS_Const::TMS_End_Exact))) // TODO should use exact, uncomment when geometry is fixed-ish
if (! (TMS_Geom::GetInstance().IsInsideBox(vecc, TMS_Const::TMS_Start, TMS_Const::TMS_End)))
if (! (TMS_Geom::GetInstance().IsInsideBox(vecc, TMS_Const::TMS_Start_Exact, TMS_Const::TMS_End_Exact)))
{
std::cerr << "[TMS_Kalman.cpp] Hit " << i << "/" << nCand << " position not within TMS before Kalman filter, (x,y,z) = (" << x << ", " << y << ", " << z << ")" << std::endl;
std::cerr << "[TMS_Kalman.cpp] Were reco x and y values set before running Kalman?" << std::endl;
//throw; // yeet it
ErrorDetVol = true;
}

int j;
Expand Down
13 changes: 2 additions & 11 deletions src/TMS_Kalman.h
Original file line number Diff line number Diff line change
Expand Up @@ -161,8 +161,8 @@ class TMS_KalmanNode {
void FillNoiseMatrix()
{
double H = 0.00274576; // ( tan(3 deg) )**2
double A = 1.5*LayerBarWidth; //10.0; //10.0 mm bar width based uncert
double B = 1.2*LayerBarLength;//4000.0; //4000.0 mm bar length based uncert
double A = LayerBarWidth; //10.0; //10.0 mm bar width based uncert
double B = LayerBarLength;//4000.0; //4000.0 mm bar length based uncert

int sign;
if ( LayerOrientation == TMS_Bar::kUBar) {
Expand All @@ -174,11 +174,6 @@ class TMS_KalmanNode {
NoiseMatrix(1,1) = A*A;
NoiseMatrix(1,0) = NoiseMatrix(0,1) = 0.0;
return;
} else if (LayerOrientation == TMS_Bar::kYBar) { // this should just work right?
NoiseMatrix(0,0) = A*A;
NoiseMatrix(1,1) = B*B;
NoiseMatrix(1,0) = NoiseMatrix(0,1) = 0.0;
return;
} else {
throw; // xd haha TODO tho
}
Expand Down Expand Up @@ -233,11 +228,7 @@ class TMS_Kalman {
public:
TRandom3 RNG;
TMS_Kalman();
//TMS_Kalman(std::vector<TMS_Hit> &Candidates);
TMS_Kalman(std::vector<TMS_Hit> &Candidates, double charge);

bool ErrorDetVol = false;


double Start[3];
double End[3];
Expand Down
2 changes: 0 additions & 2 deletions src/TMS_Reco.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -561,8 +561,6 @@ void TMS_TrackFinder::FindTracks(TMS_Event &event) {

double assumed_charge = TMS_Manager::GetInstance().Get_Reco_Kalman_Assumed_Charge();

trk.KalmanErrorDetVol = KalmanFilter.ErrorDetVol;

for (auto &trk : HoughTracks3D) {
//assumed_charge = 0.1 works well, can set to 0.05 or 0.01 or 0.5. right now it serve as a scale factor
KalmanFilter = TMS_Kalman(trk.Hits, assumed_charge); //will make the muon chi square smaller
Expand Down
1 change: 0 additions & 1 deletion src/TMS_Reco.h
Original file line number Diff line number Diff line change
Expand Up @@ -237,7 +237,6 @@ class TMS_TrackFinder {

double CalculateTrackLengthKalman(const TMS_Track &Hits);


std::vector<std::vector<TMS_Hit> > FindClusters(const std::vector<TMS_Hit> &TMS_Hits);

// Exclude hits Mask from set Orig
Expand Down
3 changes: 3 additions & 0 deletions src/TMS_Track.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ void TMS_Track::Print()
//0x90; // TODO: add a function here
};


// Set the start direction of the track object, normalised so magnitude == 1
void TMS_Track::SetStartDirection(double ax, double ay, double az) {
double mag = sqrt(ax*ax + ay*ay + az*az);
Expand Down Expand Up @@ -252,3 +253,5 @@ void TMS_Track::ApplyTrackSmoothing() {
std::cout<<",\ttrack smoothness final: "<<final_track_smoothness;
std::cout<<",\tn hits: "<<Hits.size()<<std::endl;*/
}


1 change: 0 additions & 1 deletion src/TMS_Track.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,7 +59,6 @@ class TMS_Track {

// Kalman filter track info
int nKalmanNodes;
int KalmanErrorDetVol = 0;
std::vector<TMS_KalmanNode> KalmanNodes;

void Compare()
Expand Down
7 changes: 4 additions & 3 deletions src/TMS_TreeWriter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -237,8 +237,7 @@ void TMS_TreeWriter::MakeBranches() {
Reco_Tree->Branch("nHits", nHitsIn3DTrack, "nHits[nTracks]/I");
Reco_Tree->Branch("TrackHitPos", RecoTrackHitPos, "TrackHitPos[nTracks][200][3]/F");
Reco_Tree->Branch("nKalmanNodes", nKalmanNodes, "nKalmanNodes[nTracks]/I");
Reco_Tree->Branch("KalmanErrorDetVol",KalmanErrorDetVol, "KalmanErrorDetVol[nTracks]/I");
Reco_Tree->Branch("KalmanPos", RecoTrackKalmanPos, "TrackHitPos[nTracks][200][3]/F");
Reco_Tree->Branch("KalmanPos", RecoTrackKalmanPos, "KalmanPos[nTracks][200][3]/F");
Reco_Tree->Branch("RecoTrackKalmanFirstPlaneBarView", RecoTrackKalmanFirstPlaneBarView, "RecoTrackKalmanFirstPlaneBarView[nTracks][3]/I");
Reco_Tree->Branch("RecoTrackKalmanLastPlaneBarView", RecoTrackKalmanLastPlaneBarView, "RecoTrackKalmanLastPlaneBarView[nTracks][3]/I");
Reco_Tree->Branch("RecoTrackKalmanPlaneBarView", RecoTrackKalmanPlaneBarView, "RecoTrackKalmanPlaneBarView[nTracks][200][3]/I");
Expand All @@ -255,7 +254,9 @@ void TMS_TreeWriter::MakeBranches() {
Reco_Tree->Branch("Momentum", RecoTrackMomentum, "Momentum[nTracks]/F");
Reco_Tree->Branch("Length", RecoTrackLength, "Length[nTracks]/F");
Reco_Tree->Branch("Charge", RecoTrackCharge, "Charge[nTracks]/I");

Reco_Tree->Branch("Chi2", RecoTrackChi2, "Chi2[nTracks]/F");

Reco_Tree->Branch("TrackHitEnergies", RecoTrackHitEnergies, "TrackHitEnergies[nTracks][200]/F");
Reco_Tree->Branch("TrackHitBarType", RecoTrackHitBarType, "RecoTrackHitBarType[nTracks][200]/I");

Expand Down Expand Up @@ -1210,7 +1211,7 @@ void TMS_TreeWriter::Fill(TMS_Event &event) {
for (auto RecoTrack = Reco_Tracks.begin(); RecoTrack != Reco_Tracks.end(); ++RecoTrack, ++itTrack) {
nHitsIn3DTrack[itTrack] = (int) RecoTrack->Hits.size(); // Do we need to cast it? idk
nKalmanNodes[itTrack] = (int) RecoTrack->KalmanNodes.size();
KalmanErrorDetVol[itTrack] = RecoTrack->KalmanErrorDetVol;
// std::cout << "TreeWriter number of hits: " << nHitsIn3DTrack[itTrack] << std::endl;
RecoTrackEnergyRange[itTrack] = RecoTrack->EnergyRange;
RecoTrackLength[itTrack] = 0.5 * (TrackLengthU[itTrack] + TrackLengthV[itTrack]); //RecoTrack->Length;// RecoTrack->Length;, 2d is better estimate than 3d because of y jumps
RecoTrackEnergyDeposit[itTrack] = RecoTrack->EnergyDeposit;
Expand Down
3 changes: 1 addition & 2 deletions src/TMS_TreeWriter.h
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@ class TMS_TreeWriter {
int nTracks;
int nHitsIn3DTrack[__TMS_MAX_TRACKS__];
int nKalmanNodes[__TMS_MAX_TRACKS__];
int KalmanErrorDetVol[__TMS_MAX_TRACKS__];
float RecoTrackKalmanPos[__TMS_MAX_TRACKS__][__TMS_MAX_LINE_HITS__][3];
int RecoTrackKalmanFirstPlaneBarView[__TMS_MAX_TRACKS__][3];
int RecoTrackKalmanLastPlaneBarView[__TMS_MAX_TRACKS__][3];
Expand All @@ -57,7 +56,7 @@ class TMS_TreeWriter {
int RecoTrackKalmanFirstPlaneBarViewTrue[__TMS_MAX_TRACKS__][3];
int RecoTrackKalmanLastPlaneBarViewTrue[__TMS_MAX_TRACKS__][3];
int RecoTrackKalmanPlaneBarViewTrue[__TMS_MAX_TRACKS__][__TMS_MAX_LINE_HITS__][3];
float RecoTrackHitPos[__TMS_MAX_TRACKS__][__TMS_MAX_LINE_HITS__][4]; // (x,y,z,t) Due to a lack of variables, but as this is taken from line hits, it would make sense (maybe times 2?)
float RecoTrackHitPos[__TMS_MAX_TRACKS__][__TMS_MAX_LINE_HITS__][3]; // Due to a lack of variables, but as this is taken from line hits, it would make sense (maybe times 2?)
float RecoTrackHitEnergies[__TMS_MAX_TRACKS__][__TMS_MAX_LINE_HITS__]; // Due to a lack of variables, but as this is taken from line hits, it would make sense (maybe times 2?)
int RecoTrackHitBarType[__TMS_MAX_TRACKS__][__TMS_MAX_LINE_HITS__];
float RecoTrackStartPos[__TMS_MAX_TRACKS__][3];
Expand Down