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

Agnostic helix finder and correction of the charged pion lifetime #1210

Merged
merged 79 commits into from
May 6, 2024
Merged
Show file tree
Hide file tree
Changes from 42 commits
Commits
Show all changes
79 commits
Select commit Hold shift + click to select a range
340b866
filter based on the PID of the helix
NamithaChitrazee Aug 20, 2023
23c68d3
Update prolog.fcl
NamithaChitrazee Aug 20, 2023
4239a11
added average hit times for both readout sides of a CRV coincidence c…
ehrlich-uva Sep 8, 2023
7c37ef7
fcl file for extracted position in EventDisplay
ehrlich-uva Sep 8, 2023
e18faa2
changes related to CRV coincidence finder: remove std::pairs, replace…
ehrlich-uva Sep 10, 2023
787c321
bug fixes
ehrlich-uva Sep 10, 2023
5561b6b
reconstruct CRV hit position based on readout times at both counter ends
ehrlich-uva Sep 17, 2023
0699253
comment about fiberSignalSpeed
ehrlich-uva Sep 17, 2023
db36f13
Merge branch 'pbar2m' into pbar2m3
NamithaChitrazee Sep 24, 2023
2c379aa
Merge pull request #11 from NamithaChitrazee/pbar2m3
NamithaChitrazee Sep 24, 2023
393ec80
Fix config bug
brownd1978 Sep 20, 2023
945813e
putting in framework to filter out bad TCs for Ethan to work on
matthewstortini Nov 1, 2023
69dfe24
fix charges pion lifetime
Nov 3, 2023
ae54f21
add more columns to 1-like-per object printout
Nov 3, 2023
0be99c5
extend generator_tool to return its process code
Nov 3, 2023
235da9d
fit charged pion lifetime
Nov 3, 2023
b953053
merging offline p051, fix tabs and whitespaces
Nov 26, 2023
bdb7ecc
fix indentation
gianipez Nov 27, 2023
071f641
starting point for Hussein
Nov 29, 2023
e2f976a
bug fix
Nov 29, 2023
dc4a23a
fix compilation in prof mode
Nov 29, 2023
d98351f
Merge remote-tracking branch 'origin/main' into merge_051
Nov 29, 2023
a673c96
Merge branch 'main' into merge_051
NamithaChitrazee Jan 9, 2024
5ee711e
small changes
Jan 14, 2024
0ebcd55
Merge branch 'pbar2m' into merge_051
NamithaChitrazee Jan 23, 2024
bec3987
Merge pull request #13 from NamithaChitrazee/merge_051
NamithaChitrazee Jan 23, 2024
39a7a61
added the option to run filters without filtering
Feb 5, 2024
13b447c
update comments
Feb 18, 2024
a57ad67
generate pi+ --> enu
Feb 18, 2024
697c370
generate pi+ --> enu
Feb 18, 2024
5d924f2
Merge pull request #14 from NamithaChitrazee/merge_051
NamithaChitrazee Feb 19, 2024
5afcf2a
adding HelixFinder to CalPatRec
matthewstortini Feb 28, 2024
365bbc8
fixing format issues in fcl
matthewstortini Feb 28, 2024
02062be
Add TZClusterSelection in TZClusterFinder
Feb 29, 2024
7467f3f
Removed the CosmicFilter module unused
Mar 5, 2024
d5015fa
removed the prolog_trigger
Mar 5, 2024
b49e324
Merge branch 'Mu2e:main' into pbar2m
NamithaChitrazee Mar 5, 2024
f9516b4
fixed the default value
gianipez Mar 7, 2024
304fa7f
changing default fcl param
matthewstortini Mar 7, 2024
802b0c5
added multiplicity option to filters
ethanmar Mar 7, 2024
59277ed
Merge branch 'main' into pbar2m
pavel1murat Mar 8, 2024
c622f75
fixed param value
gianipez Mar 8, 2024
5e53cc0
added the option to not check the z propagation direction
ethanmar Mar 28, 2024
612500e
addressing PR comments
matthewstortini Apr 1, 2024
1e5d479
fixing small error
matthewstortini Apr 1, 2024
b7a261b
fixing one missed comment from Dave
matthewstortini Apr 2, 2024
52a86d7
fixing one missed comment from Dave again
matthewstortini Apr 2, 2024
bde3c55
Addressing the PR comments
NamithaChitrazee Apr 2, 2024
c3cbf76
Update HitData_t.hh
NamithaChitrazee Apr 2, 2024
a92287f
Merge branch 'main' into pbar2m
gianipez Apr 2, 2024
c5f656a
Remove EventGenerator/src/ParticleGunMu_tool.cc
NamithaChitrazee Apr 2, 2024
86d06b7
Remove EventGenerator/src/EventGeneratorMu_module.cc
NamithaChitrazee Apr 2, 2024
ebc9f7a
Remove EventGenerator/src/StoppedPiENuGenerator_tool.cc
NamithaChitrazee Apr 2, 2024
08fc1ae
addreass comments by Dave: remove commented out lines, hide CalPatRec…
Apr 2, 2024
3a42755
cleanup
Apr 2, 2024
673869c
Removed the PhiZSeedFinder module for the time being
Apr 4, 2024
40c45d5
Revert Event Generator changes
Apr 4, 2024
26b1b2b
Revert Event Generator changes
Apr 4, 2024
6cda914
small fix
NamithaChitrazee Apr 4, 2024
b926632
Revert of TZClusterFinder
Apr 4, 2024
143b331
as requested
Apr 4, 2024
4eb209a
one minor prolog change and aesthetic changes
matthewstortini Apr 4, 2024
3978b11
Fix DeltaFinderAlg.hh and DeltaFinderAlg.cc, the parameter maximumTim…
Apr 5, 2024
c4b32e9
Add TZClusterFilter as independent module separated from TZClusterFinder
Apr 5, 2024
4ccb9b7
Add XYZVectorF to TZClusterFilter
Apr 8, 2024
6973850
save locally
Apr 9, 2024
53ca285
saving my local changes
Apr 14, 2024
9fd3069
catch invalid time range
Apr 17, 2024
6c47133
remove confusing proton
Apr 23, 2024
d5c2154
Merge branch 'main' into pbar2m
NamithaChitrazee Apr 23, 2024
94b1775
remove files added by mistake
Apr 23, 2024
cc22fe1
revert some changes
Apr 24, 2024
492fca6
revert some changes 2
NamithaChitrazee Apr 24, 2024
cf56377
revert some changes 3
NamithaChitrazee Apr 24, 2024
8897edf
revert some changes 4
NamithaChitrazee Apr 24, 2024
bf54ad6
revert some changes 5
NamithaChitrazee Apr 24, 2024
7c6fc89
revert some changes 6
NamithaChitrazee Apr 24, 2024
a6be539
Merge remote-tracking branch 'mu2e/main' into pbar2m
gianipez Apr 30, 2024
d99670e
removed white spaces
gianipez Apr 30, 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
113 changes: 100 additions & 13 deletions CalPatRec/fcl/prolog.fcl
Original file line number Diff line number Diff line change
Expand Up @@ -362,8 +362,8 @@ CalPatRec : { @table::CalPatRec
pickupProtonHits : 1 # the third step of proton finding

timeBin : 40 # ns, prev: 50 (use 40 with makePH.maxDS=5)
minHitTime : 350. # ns
minimumTime : 400. # ns
minHitTime : 350. # ns, not used
brownd1978 marked this conversation as resolved.
Show resolved Hide resolved
minimumTime : 400. # ns, not used
maximumTime : 1750. # ns
maxDeltaEDep : 0.004 # max allowed delta eDep
maxSeedEDep : 0.005 # max allowed seed eDep
Expand Down Expand Up @@ -431,6 +431,43 @@ CalPatRec : { @table::CalPatRec
}
}
}
#------------------------------------------------------------------------------
PhiZSeedFinder : { module_type:PhiZSeedFinder
chCollTag : "makePH" ## input CH coll
sschCollTag : "makeSH" ## input single-straw CH coll
sdmcCollTag : "compressDigiMCs" ## used for debug only

testHitMask : false ## off by default
goodHitMask : [ "TimeDivision" ] ## is there a point in using combohits made
## out of straw hits with an apriory wrong wdist ?
bkgHitMask : [ ] ##
writeFilteredComboHits : 0 ## by default, clone all hits with updated flags
writeStrawHits : 1 ## used by the track fit
testOrder : 0

debugLevel : 0
diagLevel : 0
printErrors : 0
# finder algorithm parameters
finderParameters : {
testOrder : 0
debugLevel : 0
diagLevel : 0
printErrors : 0
}
#
diagPlugin : { tool_type : "PhiZSeedFinderDiag"
diagLevel : 0
mcDiag : false
mcTruth : 0
printComboHits : 0
printGoodComboHits : 0
mcUtils : { tool_type : "TrkRecoMcUtils"
strawDigiMCCollTag : "compressDigiMCs"
comboHitCollTag : "makePH"
}
}
}
}
#------------------------------------------------------------------------------
# no separate hit flag collections any longer, hit flags are stored
Expand Down Expand Up @@ -564,7 +601,6 @@ CalPatRec : { @table::CalPatRec
debugLevel : 0
printFrequency : 1000
runDisplay : 0
saveProtCand : 0
useCCs : 1
recoverCCs : 1
chCollLabel : "FlagBkgHits"
Expand All @@ -585,16 +621,16 @@ CalPatRec : { @table::CalPatRec
minCaloEnergy : 50.0
caloDtMax : 30.0
caloTimeOffset : @local::TrackCaloMatching.DtOffset
doComptonClean : 0
maxIntersectSig : 5.0
maxApproachSigma : 5.0
maxAppSigmaTrans : 5.0
comptonThresh : 8
doIsoClean : 0
isoRad : 100.0
doPhiClean : 0
phiCleanPhi : 45.0
phiCleanThresh : 5
doRefine : 0
minSHsInCluster : 15
minCHsInCluster : 10
nPairs : 1
minCHsInCubes : 2
maxDeltaRInStn : 100
maxDeltaRBtwStns : 120
maxDeltaPhiInStn : 0.4
maxDeltaPhiBtwStns : 0.6
thirdStation : true

diagPlugin : { tool_type : "TZClusterFinderDiag"
mcTruth : 1
Expand All @@ -603,6 +639,57 @@ CalPatRec : { @table::CalPatRec
}
}

HelixFinder : {
module_type : HelixFinder
diagLevel : 0
debug : 0
runDisplay : 0
chCollLabel : "FlagBkgHits"
tcCollLabel : "TimeClusterFinderDe"
ccCollLabel : "CaloClusterMaker"
findMultipleHelices : true # whether or not to allow more than 1 helix per tc
useStoppingTarget : true
intenseEventThresh : 30
intenseClusterThresh : 60
doLineFlag : false
doIsolationFlag : true
isoRad : 150.0
isoMinHitsNear : 2
doAverageFlag : true
minDistCut : 20.0
minTripletSeedZ : 0.0
minTripletDz : 50.0
maxTripletDz : 500.0
minTripletDist : 50.0
minTripletArea : 1.0e4
maxSeedCircleResidual : 2.0
minSeedCircleHits : 7
maxDeltaPhi : 2.0
maxZWindow : 500.0
minLineSegmentHits : 3
segMultiplier : 3.0
max2PiAmbigResidual : 2.0
maxPhiZResidual : 2.0
minFinalSeedHits : 7
maxCircleRecoverSigma : 3.0
maxLineRecoverSigma : 3.0
caloClusterSigma : 30.0
minNHelixComboHits : 8
minNHelixStrawHits : 12
minHelixPerpMomentum : 40.0
maxHelixPerpMomentum : 140.0
minHelixMomentum : 60.0
maxHelixMomentum : 400.0
chi2LineSaveThresh : 5.0
debugPdgID : 11
debugMomentum : 100.0
debugDirection : "down"
debugStrawHitThresh : 12
debugScatterThresh : 3.0
mcUtils : { @table::TrkReco.McUtils }
diagPlugin : { tool_type : "HelixFinderDiag" }
}

PhiClusterFinder : { module_type : PhiClusterFinder
ComboHitCollection : "makePH"
#TimeClusterCollection : "TimeClusterFinderDmu"
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#ifndef DeltaFinder_enums_hh
#define DeltaFinder_enums_hh
#ifndef CalPatRec_inc__enums_hh
#define CalPatRec_inc__enums_hh

#include "Offline/DataProducts/inc/StrawId.hh"

Expand Down
19 changes: 19 additions & 0 deletions CalPatRec/inc/ChannelID.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,19 @@
#ifndef __CalPatRec_inc_ChannelID_hh__
#define __CalPatRec_inc_ChannelID_hh__

namespace CalPatRec {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why do we need this structure? Its content is identical to StrawId, and all of the functionality ( station, plane, face, panel) is available through accessor functions in StrawId. Having multiple structures represent ingthe same data is confusing and exposes the code to errors.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this is an internal for the algorithm helper class which returns hit indices ordered in Z. This functionality is not provided by the StrawId class.

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

what functionality is not provided by StrawId?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

at the time when the code has been developed, the StrawId interface was not providing an ordering of the faces in assending global Z. As you already mentioned, it might be a good idea to integrate this functionality into the StrawId class

Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will start an issue and assign it for resolution after this PR

struct ChannelID {
int Station;
int Plane;
int Face;
int Panel;

static void orderID (ChannelID* X, ChannelID* Ordered);
static void deOrderID(ChannelID* X, ChannelID* Ordered);

static void testOrderID ();
static void testdeOrderID();
};
}

#endif
10 changes: 2 additions & 8 deletions CalPatRec/inc/DeltaFinder_structures.hh
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@
#ifndef CalPatRec_DeltaFinder_structures_hh
#define CalPatRec_DeltaFinder_structures_hh

#include "Offline/CalPatRec/inc/DeltaFinder_enums.hh"
#include "Offline/CalPatRec/inc/CalPatRec_enums.hh"
#include "Offline/CalPatRec/inc/ChannelID.hh"
#include "Offline/CalPatRec/inc/HitData_t.hh"

namespace mu2e {
Expand All @@ -23,13 +24,6 @@ namespace mu2e {
float fErr; // uncertainty, defines the window
int fPanelID; // if can predict the panel, -1 otherwise
};

struct ChannelID {
int Station;
int Plane;
int Face;
int Panel;
};
//-----------------------------------------------------------------------------
// intersection of the two hit wires
//-----------------------------------------------------------------------------
Expand Down
81 changes: 8 additions & 73 deletions CalPatRec/inc/DeltaFinder_types.hh
Original file line number Diff line number Diff line change
Expand Up @@ -25,74 +25,24 @@ namespace fhicl {

#include "Offline/Mu2eUtilities/inc/McUtilsToolBase.hh"

#include "Offline/CalPatRec/inc/ManagedList.hh"
#include "Offline/CalPatRec/inc/Pzz_t.hh"
#include "Offline/CalPatRec/inc/ChannelID.hh"
#include "Offline/CalPatRec/inc/HitData_t.hh"
#include "Offline/CalPatRec/inc/DeltaFinder_structures.hh"
#include "Offline/CalPatRec/inc/DeltaSeed.hh"
#include "Offline/CalPatRec/inc/DeltaCandidate.hh"
#include "Offline/CalPatRec/inc/ProtonCandidate.hh"

using CalPatRec::ChannelID;
using CalPatRec::HitData_t;
using CalPatRec::Pzz_t;

namespace mu2e {
class Panel;
class SimParticle;
class DeltaFinderAlg;
//-----------------------------------------------------------------------------
// assume that class T has, say, Init method, which reinitialize an object
// allocated before
// in particular, that assumes that T owns all its pointers (if any) and Init
// handles them correctly
// T is supposed to have a constructor T(int N) , wher N is the element index in the list
// light-weight and crippled version of TClonesArray
//-----------------------------------------------------------------------------
template <class T> struct ManagedList {
int fN;
int fNAllocated;
std::vector<T*> fList;

ManagedList() {
fN = 0;
fNAllocated = 0;
}

~ManagedList() {
for (int i=0; i<fNAllocated; i++) delete fList[i];
}

T* at(int I) { return fList[I]; }

void clear () { fN = 0; }

void reserve (int N) { fList.reserve(N); }

void reinitialize() {
for (int i=0; i<fNAllocated; i++) delete fList[i];
fList.clear();
fN = 0;
fNAllocated = 0;
}

int N() { return fN; }

T* New() {
T* ds;
if (fN < (int) fList.size()) {
//-----------------------------------------------------------------------------
// reuse already allocated slot
//-----------------------------------------------------------------------------
ds = fList[fN];
}
else {
//-----------------------------------------------------------------------------
// allocate new slot
//-----------------------------------------------------------------------------
ds = new T(fN);
fList.push_back(ds);
fNAllocated++;
}
fN++;
return ds;
}

};
//-----------------------------------------------------------------------------
// delta-electron seed: structure within the station
// doesn't own anything, no need to delete any pinters
//-----------------------------------------------------------------------------
Expand Down Expand Up @@ -127,15 +77,6 @@ namespace mu2e {
//-----------------------------------------------------------------------------
// data structures passed to the diagnostics plugin
//-----------------------------------------------------------------------------
struct Pzz_t {
int fID; // 3*face+panel, for pre-calculating overlaps
double wx; // direction cosines of the wire, all wires are assumed parallel
double wy;
double nx; // direction cosines of the normal to the wires, pointing outwards
double ny;
float z; // Z-coordinate of the face
};

struct FaceZ_t {
int fID; // 3*face+panel, for pre-calculating overlaps

Expand Down Expand Up @@ -240,15 +181,9 @@ namespace mu2e {

ProtonCandidate* newProtonCandidate() { return fListOfProtonCandidates.New(); }

static void orderID (ChannelID* X, ChannelID* Ordered);
static void deOrderID (ChannelID* X, ChannelID* Ordered);

void printHitData (HitData_t* HitData, const char* Option = "");
void printDeltaSeed (DeltaSeed* Seed , const char* Option = "");
void printDeltaCandidate(DeltaCandidate* Delta , const char* Option = "");

void testOrderID ();
void testdeOrderID();
};

//-----------------------------------------------------------------------------
Expand Down
5 changes: 2 additions & 3 deletions CalPatRec/inc/DeltaSeed.hh
Original file line number Diff line number Diff line change
Expand Up @@ -8,17 +8,16 @@

using ROOT::Math::XYZVectorF;

#include "Offline/CalPatRec/inc/DeltaFinder_enums.hh"
// #include "Offline/CalPatRec/inc/CalPatRec_enums.hh"
NamithaChitrazee marked this conversation as resolved.
Show resolved Hide resolved
#include "Offline/CalPatRec/inc/DeltaFinder_structures.hh"

namespace mu2e {

namespace DeltaFinderTypes {
struct HitData_t;
struct McPart_t;
}

using DeltaFinderTypes::HitData_t;
using CalPatRec::HitData_t;
using DeltaFinderTypes::McPart_t;

class Panel;
Expand Down
31 changes: 31 additions & 0 deletions CalPatRec/inc/HelixFinder_types.hh
Original file line number Diff line number Diff line change
@@ -0,0 +1,31 @@
#ifndef CalPatRec_HelixFinder_types_hh
#define CalPatRec_HelixFinder_types_hh

#include "fhiclcpp/types/Atom.h"

namespace mu2e {

namespace HelixFinderTypes {

struct Config {
fhicl::Atom<std::string> tool_type{fhicl::Name("tool_type"),
fhicl::Comment("tool type: HelixFinderDiag")};
};

struct tcInfo {
int nHelices;
int nComboHits;
int nStrawHits;
float time;
};

struct diagInfo {
float moduleTime;
int nHelices;
int nTimeClusters;
std::vector<tcInfo> timeClusterData;
};

} // namespace HelixFinderTypes
} // namespace mu2e
#endif
Loading