From 4a27bc6663cfdf7452f881cbbc8066c6476c961b Mon Sep 17 00:00:00 2001 From: Ananya2003Gupta Date: Sat, 9 Sep 2023 18:45:25 +0530 Subject: [PATCH] Changed primitive Datatypes to Abstract Datatypes in default parameters --- .github/workflows/CI.yml | 2 +- src/CaloHitContributionStruct.jl | 1 + src/CalorimeterHitStruct.jl | 1 + src/ClusterStruct.jl | 4 +- src/Edm4hep.jl | 516 +++++++++--------- src/EventHeaderStruct.jl | 1 + src/HitLevelDataStruct.jl | 2 +- src/HypothesisStruct.jl | 2 +- src/MCParticleStruct.jl | 3 +- src/MCRecoCaloAssociationStruct.jl | 5 +- src/MCRecoCaloParticleAssociationStruct.jl | 3 +- src/MCRecoClusterParticleAssociationStruct.jl | 3 +- src/MCRecoParticleAssociationStruct.jl | 1 + src/MCRecoTrackParticleAssociationStruct.jl | 1 + src/MCRecoTrackerAssociationStruct.jl | 3 +- src/MCRecoTrackerHitPlaneAssociationStruct.jl | 3 +- src/ParticleIDStruct.jl | 1 + src/QuantityStruct.jl | 2 +- src/RawCalorimeterHitStruct.jl | 1 + src/RawTimeSeriesStruct.jl | 1 + src/RecDqdxStruct.jl | 4 +- src/RecIonizationClusterStruct.jl | 2 +- src/RecoParticleVertexAssociationStruct.jl | 2 +- src/ReconstructedParticleStruct.jl | 4 +- src/SimCalorimeterHitStruct.jl | 3 +- src/SimPrimaryIonizationClusterStruct.jl | 1 + src/SimTrackerHitStruct.jl | 1 + src/TimeSeriesStruct.jl | 1 + src/TrackStateStruct.jl | 4 +- src/TrackStruct.jl | 1 + src/TrackerHitPlaneStruct.jl | 6 +- src/TrackerHitStruct.jl | 4 +- src/TrackerPulseStruct.jl | 1 - src/VertexStruct.jl | 2 +- 34 files changed, 305 insertions(+), 287 deletions(-) diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml index 11ec6e5..63da67f 100644 --- a/.github/workflows/CI.yml +++ b/.github/workflows/CI.yml @@ -18,7 +18,7 @@ jobs: fail-fast: false matrix: version: - - '1.0' + - '1.4' - '1.6' - '1.9' os: diff --git a/src/CaloHitContributionStruct.jl b/src/CaloHitContributionStruct.jl index 0e61e38..4f8e06c 100644 --- a/src/CaloHitContributionStruct.jl +++ b/src/CaloHitContributionStruct.jl @@ -1,3 +1,4 @@ + include("Vector3fStruct.jl") mutable struct CaloHitContributionStruct{MCParticleT} PDG::Int32 diff --git a/src/CalorimeterHitStruct.jl b/src/CalorimeterHitStruct.jl index b372f5d..b552d0a 100644 --- a/src/CalorimeterHitStruct.jl +++ b/src/CalorimeterHitStruct.jl @@ -1,3 +1,4 @@ + include("Vector3fStruct.jl") mutable struct CalorimeterHitStruct cellID::UInt64 diff --git a/src/ClusterStruct.jl b/src/ClusterStruct.jl index d649b8e..6ee557f 100644 --- a/src/ClusterStruct.jl +++ b/src/ClusterStruct.jl @@ -1,7 +1,7 @@ -using StaticArrays include("Vector3fStruct.jl") -mutable struct ClusterStruct{CalorimeterHitT,ParticleIDT,ClusterT} +using StaticArrays +mutable struct ClusterStruct{CalorimeterHitT,ClusterT,ParticleIDT} type::Int32 energy::Float32 energyError::Float32 diff --git a/src/Edm4hep.jl b/src/Edm4hep.jl index 07b7eb4..6e2b530 100644 --- a/src/Edm4hep.jl +++ b/src/Edm4hep.jl @@ -105,145 +105,145 @@ include("TimeSeriesStruct.jl") include("RecDqdxStruct.jl") function Vector3f( - x::Float32 = Float32(0), - y::Float32 = Float32(0), - z::Float32 = Float32(0), + x::Real = Float32(0), + y::Real = Float32(0), + z::Real = Float32(0), ) return Vector3fStruct( - x, - y, - z, + Float32(x), + Float32(y), + Float32(z), ) end function Vector3d( - x::Float64 = Float64(0), - y::Float64 = Float64(0), - z::Float64 = Float64(0), + x::Real = Float64(0), + y::Real = Float64(0), + z::Real = Float64(0), ) return Vector3dStruct( - x, - y, - z, + Float64(x), + Float64(y), + Float64(z), ) end function Vector2i( - a::Int32 = Int32(0), - b::Int32 = Int32(0), + a::Signed = Int32(0), + b::Signed = Int32(0), ) return Vector2iStruct( - a, - b, + Int32(a), + Int32(b), ) end function Vector2f( - a::Float32 = Float32(0), - b::Float32 = Float32(0), + a::Real = Float32(0), + b::Real = Float32(0), ) return Vector2fStruct( - a, - b, + Float32(a), + Float32(b), ) end function TrackState( - location::Int32 = Int32(0), - D0::Float32 = Float32(0), - phi::Float32 = Float32(0), - omega::Float32 = Float32(0), - Z0::Float32 = Float32(0), - tanLambda::Float32 = Float32(0), - time::Float32 = Float32(0), + location::Signed = Int32(0), + D0::Real = Float32(0), + phi::Real = Float32(0), + omega::Real = Float32(0), + Z0::Real = Float32(0), + tanLambda::Real = Float32(0), + time::Real = Float32(0), referencePoint::Vector3fStruct = Vector3f(), covMatrix::MVector{21, Float32} = MVector{21, Float32}(undef), ) return TrackStateStruct( - location, - D0, - phi, - omega, - Z0, - tanLambda, - time, + Int32(location), + Float32(D0), + Float32(phi), + Float32(omega), + Float32(Z0), + Float32(tanLambda), + Float32(time), referencePoint, covMatrix, ) end function ObjectID( - index::Int32 = Int32(0), - collectionID::Int32 = Int32(0), + index::Signed = Int32(0), + collectionID::Signed = Int32(0), ) return ObjectIDStruct( - index, - collectionID, + Int32(index), + Int32(collectionID), ) end function Quantity( - type::Int16 = Int16(0), - value::Float32 = Float32(0), - error::Float32 = Float32(0), + type::Signed = Int16(0), + value::Real = Float32(0), + error::Real = Float32(0), ) return QuantityStruct( - type, - value, - error, + Int16(type), + Float32(value), + Float32(error), ) end function Hypothesis( - chi2::Float32 = Float32(0), - expected::Float32 = Float32(0), - sigma::Float32 = Float32(0), + chi2::Real = Float32(0), + expected::Real = Float32(0), + sigma::Real = Float32(0), ) return HypothesisStruct( - chi2, - expected, - sigma, + Float32(chi2), + Float32(expected), + Float32(sigma), ) end function HitLevelData( - cellID::UInt64 = UInt64(0), - N::UInt32 = UInt32(0), - eDep::Float32 = Float32(0), - pathLength::Float32 = Float32(0), + cellID::Unsigned = UInt64(0), + N::Unsigned = UInt32(0), + eDep::Real = Float32(0), + pathLength::Real = Float32(0), ) return HitLevelDataStruct( - cellID, - N, - eDep, - pathLength, + UInt64(cellID), + UInt32(N), + Float32(eDep), + Float32(pathLength), ) end function EventHeader( - eventNumber::Int32 = Int32(0), - runNumber::Int32 = Int32(0), - timeStamp::UInt64 = UInt64(0), - weight::Float32 = Float32(0), + eventNumber::Signed = Int32(0), + runNumber::Signed = Int32(0), + timeStamp::Unsigned = UInt64(0), + weight::Real = Float32(0), ) return EventHeaderStruct( - eventNumber, - runNumber, - timeStamp, - weight, + Int32(eventNumber), + Int32(runNumber), + UInt64(timeStamp), + Float32(weight), ) end EventHeaderCollection = Vector{ EventHeaderStruct } function MCParticle( - PDG::Int32 = Int32(0), - generatorStatus::Int32 = Int32(0), - simulatorStatus::Int32 = Int32(0), - charge::Float32 = Float32(0), - time::Float32 = Float32(0), - mass::Float64 = Float64(0), + PDG::Signed = Int32(0), + generatorStatus::Signed = Int32(0), + simulatorStatus::Signed = Int32(0), + charge::Real = Float32(0), + time::Real = Float32(0), + mass::Real = Float64(0), vertex::Vector3dStruct = Vector3d(), endpoint::Vector3dStruct = Vector3d(), momentum::Vector3fStruct = Vector3f(), @@ -254,12 +254,12 @@ function MCParticle( daughters::Vector{ MCParticleStruct } = Vector{ MCParticleStruct }(), ) return MCParticleStruct{MCParticleStruct}( - PDG, - generatorStatus, - simulatorStatus, - charge, - time, - mass, + Int32(PDG), + Int32(generatorStatus), + Int32(simulatorStatus), + Float32(charge), + Float32(time), + Float64(mass), vertex, endpoint, momentum, @@ -274,21 +274,21 @@ end MCParticleCollection = Vector{ MCParticleStruct{MCParticleStruct} } function SimTrackerHit( - cellID::UInt64 = UInt64(0), - EDep::Float32 = Float32(0), - time::Float32 = Float32(0), - pathLength::Float32 = Float32(0), - quality::Int32 = Int32(0), + cellID::Unsigned = UInt64(0), + EDep::Real = Float32(0), + time::Real = Float32(0), + pathLength::Real = Float32(0), + quality::Signed = Int32(0), position::Vector3dStruct = Vector3d(), momentum::Vector3fStruct = Vector3f(), MCParticle::Union{Nothing, MCParticleStruct } = nothing, ) return SimTrackerHitStruct{MCParticleStruct}( - cellID, - EDep, - time, - pathLength, - quality, + UInt64(cellID), + Float32(EDep), + Float32(time), + Float32(pathLength), + Int32(quality), position, momentum, MCParticle, @@ -298,16 +298,16 @@ end SimTrackerHitCollection = Vector{ SimTrackerHitStruct{MCParticleStruct} } function CaloHitContribution( - PDG::Int32 = Int32(0), - energy::Float32 = Float32(0), - time::Float32 = Float32(0), + PDG::Signed = Int32(0), + energy::Real = Float32(0), + time::Real = Float32(0), stepPosition::Vector3fStruct = Vector3f(), particle::Union{Nothing, MCParticleStruct } = nothing, ) return CaloHitContributionStruct{MCParticleStruct}( - PDG, - energy, - time, + Int32(PDG), + Float32(energy), + Float32(time), stepPosition, particle, ) @@ -316,14 +316,14 @@ end CaloHitContributionCollection = Vector{ CaloHitContributionStruct{MCParticleStruct} } function SimCalorimeterHit( - cellID::UInt64 = UInt64(0), - energy::Float32 = Float32(0), + cellID::Unsigned = UInt64(0), + energy::Real = Float32(0), position::Vector3fStruct = Vector3f(), contributions::Vector{ CaloHitContributionStruct } = Vector{ CaloHitContributionStruct }(), ) return SimCalorimeterHitStruct{CaloHitContributionStruct}( - cellID, - energy, + UInt64(cellID), + Float32(energy), position, contributions, ) @@ -332,51 +332,51 @@ end SimCalorimeterHitCollection = Vector{ SimCalorimeterHitStruct{CaloHitContributionStruct} } function RawCalorimeterHit( - cellID::UInt64 = UInt64(0), - amplitude::Int32 = Int32(0), - timeStamp::Int32 = Int32(0), + cellID::Unsigned = UInt64(0), + amplitude::Signed = Int32(0), + timeStamp::Signed = Int32(0), ) return RawCalorimeterHitStruct( - cellID, - amplitude, - timeStamp, + UInt64(cellID), + Int32(amplitude), + Int32(timeStamp), ) end RawCalorimeterHitCollection = Vector{ RawCalorimeterHitStruct } function CalorimeterHit( - cellID::UInt64 = UInt64(0), - energy::Float32 = Float32(0), - energyError::Float32 = Float32(0), - time::Float32 = Float32(0), + cellID::Unsigned = UInt64(0), + energy::Real = Float32(0), + energyError::Real = Float32(0), + time::Real = Float32(0), position::Vector3fStruct = Vector3f(), - type::Int32 = Int32(0), + type::Signed = Int32(0), ) return CalorimeterHitStruct( - cellID, - energy, - energyError, - time, + UInt64(cellID), + Float32(energy), + Float32(energyError), + Float32(time), position, - type, + Int32(type), ) end CalorimeterHitCollection = Vector{ CalorimeterHitStruct } function ParticleID( - type::Int32 = Int32(0), - PDG::Int32 = Int32(0), - algorithmType::Int32 = Int32(0), - likelihood::Float32 = Float32(0), + type::Signed = Int32(0), + PDG::Signed = Int32(0), + algorithmType::Signed = Int32(0), + likelihood::Real = Float32(0), parameters::Vector{ Float32 } = Vector{ Float32 }([]), ) return ParticleIDStruct( - type, - PDG, - algorithmType, - likelihood, + Int32(type), + Int32(PDG), + Int32(algorithmType), + Float32(likelihood), parameters, ) end @@ -384,13 +384,13 @@ end ParticleIDCollection = Vector{ ParticleIDStruct } function Cluster( - type::Int32 = Int32(0), - energy::Float32 = Float32(0), - energyError::Float32 = Float32(0), + type::Signed = Int32(0), + energy::Real = Float32(0), + energyError::Real = Float32(0), position::Vector3fStruct = Vector3f(), positionError::MVector{6, Float32} = MVector{6, Float32}(undef), - iTheta::Float32 = Float32(0), - phi::Float32 = Float32(0), + iTheta::Real = Float32(0), + phi::Real = Float32(0), directionError::Vector3fStruct = Vector3f(), clusters::Vector{ ClusterStruct } = Vector{ ClusterStruct }(), hits::Vector{ CalorimeterHitStruct } = Vector{ CalorimeterHitStruct }(), @@ -398,14 +398,14 @@ function Cluster( shapeParameters::Vector{ Float32 } = Vector{ Float32 }([]), subdetectorEnergies::Vector{ Float32 } = Vector{ Float32 }([]), ) - return ClusterStruct{CalorimeterHitStruct,ParticleIDStruct,ClusterStruct}( - type, - energy, - energyError, + return ClusterStruct{CalorimeterHitStruct,ClusterStruct,ParticleIDStruct}( + Int32(type), + Float32(energy), + Float32(energyError), position, positionError, - iTheta, - phi, + Float32(iTheta), + Float32(phi), directionError, clusters, hits, @@ -415,26 +415,26 @@ function Cluster( ) end -ClusterCollection = Vector{ ClusterStruct{CalorimeterHitStruct,ParticleIDStruct,ClusterStruct} } +ClusterCollection = Vector{ ClusterStruct{CalorimeterHitStruct,ClusterStruct,ParticleIDStruct} } function TrackerHit( - cellID::UInt64 = UInt64(0), - type::Int32 = Int32(0), - quality::Int32 = Int32(0), - time::Float32 = Float32(0), - eDep::Float32 = Float32(0), - eDepError::Float32 = Float32(0), + cellID::Unsigned = UInt64(0), + type::Signed = Int32(0), + quality::Signed = Int32(0), + time::Real = Float32(0), + eDep::Real = Float32(0), + eDepError::Real = Float32(0), position::Vector3dStruct = Vector3d(), covMatrix::MVector{6, Float32} = MVector{6, Float32}(undef), rawHits::Vector{ ObjectIDStruct } = Vector{ ObjectIDStruct }([]), ) return TrackerHitStruct( - cellID, - type, - quality, - time, - eDep, - eDepError, + UInt64(cellID), + Int32(type), + Int32(quality), + Float32(time), + Float32(eDep), + Float32(eDepError), position, covMatrix, rawHits, @@ -444,31 +444,31 @@ end TrackerHitCollection = Vector{ TrackerHitStruct } function TrackerHitPlane( - cellID::UInt64 = UInt64(0), - type::Int32 = Int32(0), - quality::Int32 = Int32(0), - time::Float32 = Float32(0), - eDep::Float32 = Float32(0), - eDepError::Float32 = Float32(0), + cellID::Unsigned = UInt64(0), + type::Signed = Int32(0), + quality::Signed = Int32(0), + time::Real = Float32(0), + eDep::Real = Float32(0), + eDepError::Real = Float32(0), u::Vector2fStruct = Vector2f(), v::Vector2fStruct = Vector2f(), - du::Float32 = Float32(0), - dv::Float32 = Float32(0), + du::Real = Float32(0), + dv::Real = Float32(0), position::Vector3dStruct = Vector3d(), covMatrix::MVector{6, Float32} = MVector{6, Float32}(undef), rawHits::Vector{ ObjectIDStruct } = Vector{ ObjectIDStruct }([]), ) return TrackerHitPlaneStruct( - cellID, - type, - quality, - time, - eDep, - eDepError, + UInt64(cellID), + Int32(type), + Int32(quality), + Float32(time), + Float32(eDep), + Float32(eDepError), u, v, - du, - dv, + Float32(du), + Float32(dv), position, covMatrix, rawHits, @@ -478,19 +478,19 @@ end TrackerHitPlaneCollection = Vector{ TrackerHitPlaneStruct } function RawTimeSeries( - cellID::UInt64 = UInt64(0), - quality::Int32 = Int32(0), - time::Float32 = Float32(0), - charge::Float32 = Float32(0), - interval::Float32 = Float32(0), + cellID::Unsigned = UInt64(0), + quality::Signed = Int32(0), + time::Real = Float32(0), + charge::Real = Float32(0), + interval::Real = Float32(0), adcCounts::Vector{ Int32 } = Vector{ Int32 }([]), ) return RawTimeSeriesStruct( - cellID, - quality, - time, - charge, - interval, + UInt64(cellID), + Int32(quality), + Float32(time), + Float32(charge), + Float32(interval), adcCounts, ) end @@ -498,12 +498,12 @@ end RawTimeSeriesCollection = Vector{ RawTimeSeriesStruct } function Track( - type::Int32 = Int32(0), - chi2::Float32 = Float32(0), - ndf::Int32 = Int32(0), - dEdx::Float32 = Float32(0), - dEdxError::Float32 = Float32(0), - radiusOfInnermostHit::Float32 = Float32(0), + type::Signed = Int32(0), + chi2::Real = Float32(0), + ndf::Signed = Int32(0), + dEdx::Real = Float32(0), + dEdxError::Real = Float32(0), + radiusOfInnermostHit::Real = Float32(0), trackerHits::Vector{ TrackerHitStruct } = Vector{ TrackerHitStruct }(), tracks::Vector{ TrackStruct } = Vector{ TrackStruct }(), subdetectorHitNumbers::Vector{ Int32 } = Vector{ Int32 }([]), @@ -511,12 +511,12 @@ function Track( dxQuantities::Vector{ QuantityStruct } = Vector{ QuantityStruct }([]), ) return TrackStruct{TrackStruct,TrackerHitStruct}( - type, - chi2, - ndf, - dEdx, - dEdxError, - radiusOfInnermostHit, + Int32(type), + Float32(chi2), + Int32(ndf), + Float32(dEdx), + Float32(dEdxError), + Float32(radiusOfInnermostHit), trackerHits, tracks, subdetectorHitNumbers, @@ -528,22 +528,22 @@ end TrackCollection = Vector{ TrackStruct{TrackStruct,TrackerHitStruct} } function Vertex( - primary::Int32 = Int32(0), - chi2::Float32 = Float32(0), - probability::Float32 = Float32(0), + primary::Signed = Int32(0), + chi2::Real = Float32(0), + probability::Real = Float32(0), position::Vector3fStruct = Vector3f(), covMatrix::MVector{6, Float32} = MVector{6, Float32}(undef), - algorithmType::Int32 = Int32(0), + algorithmType::Signed = Int32(0), associatedParticle::Union{Nothing, ReconstructedParticleStruct } = nothing, parameters::Vector{ Float32 } = Vector{ Float32 }([]), ) return VertexStruct{ReconstructedParticleStruct}( - primary, - chi2, - probability, + Int32(primary), + Float32(chi2), + Float32(probability), position, covMatrix, - algorithmType, + Int32(algorithmType), associatedParticle, parameters, ) @@ -552,13 +552,13 @@ end VertexCollection = Vector{ VertexStruct{ReconstructedParticleStruct} } function ReconstructedParticle( - type::Int32 = Int32(0), - energy::Float32 = Float32(0), + type::Signed = Int32(0), + energy::Real = Float32(0), momentum::Vector3fStruct = Vector3f(), referencePoint::Vector3fStruct = Vector3f(), - charge::Float32 = Float32(0), - mass::Float32 = Float32(0), - goodnessOfPID::Float32 = Float32(0), + charge::Real = Float32(0), + mass::Real = Float32(0), + goodnessOfPID::Real = Float32(0), covMatrix::MVector{10, Float32} = MVector{10, Float32}(undef), clusters::Vector{ ClusterStruct } = Vector{ ClusterStruct }(), tracks::Vector{ TrackStruct } = Vector{ TrackStruct }(), @@ -567,14 +567,14 @@ function ReconstructedParticle( startVertex::Union{Nothing, VertexStruct } = nothing, particleIDUsed::Union{Nothing, ParticleIDStruct } = nothing, ) - return ReconstructedParticleStruct{ReconstructedParticleStruct,TrackStruct,ClusterStruct,ParticleIDStruct,VertexStruct}( - type, - energy, + return ReconstructedParticleStruct{ClusterStruct,ParticleIDStruct,ReconstructedParticleStruct,TrackStruct,VertexStruct}( + Int32(type), + Float32(energy), momentum, referencePoint, - charge, - mass, - goodnessOfPID, + Float32(charge), + Float32(mass), + Float32(goodnessOfPID), covMatrix, clusters, tracks, @@ -585,15 +585,15 @@ function ReconstructedParticle( ) end -ReconstructedParticleCollection = Vector{ ReconstructedParticleStruct{ReconstructedParticleStruct,TrackStruct,ClusterStruct,ParticleIDStruct,VertexStruct} } +ReconstructedParticleCollection = Vector{ ReconstructedParticleStruct{ClusterStruct,ParticleIDStruct,ReconstructedParticleStruct,TrackStruct,VertexStruct} } function MCRecoParticleAssociation( - weight::Float32 = Float32(0), + weight::Real = Float32(0), rec::Union{Nothing, ReconstructedParticleStruct } = nothing, sim::Union{Nothing, MCParticleStruct } = nothing, ) return MCRecoParticleAssociationStruct{MCParticleStruct,ReconstructedParticleStruct}( - weight, + Float32(weight), rec, sim, ) @@ -602,40 +602,40 @@ end MCRecoParticleAssociationCollection = Vector{ MCRecoParticleAssociationStruct{MCParticleStruct,ReconstructedParticleStruct} } function MCRecoCaloAssociation( - weight::Float32 = Float32(0), + weight::Real = Float32(0), rec::Union{Nothing, CalorimeterHitStruct } = nothing, sim::Union{Nothing, SimCalorimeterHitStruct } = nothing, ) - return MCRecoCaloAssociationStruct{SimCalorimeterHitStruct,CalorimeterHitStruct}( - weight, + return MCRecoCaloAssociationStruct{CalorimeterHitStruct,SimCalorimeterHitStruct}( + Float32(weight), rec, sim, ) end -MCRecoCaloAssociationCollection = Vector{ MCRecoCaloAssociationStruct{SimCalorimeterHitStruct,CalorimeterHitStruct} } +MCRecoCaloAssociationCollection = Vector{ MCRecoCaloAssociationStruct{CalorimeterHitStruct,SimCalorimeterHitStruct} } function MCRecoTrackerAssociation( - weight::Float32 = Float32(0), + weight::Real = Float32(0), rec::Union{Nothing, TrackerHitStruct } = nothing, sim::Union{Nothing, SimTrackerHitStruct } = nothing, ) - return MCRecoTrackerAssociationStruct{TrackerHitStruct,SimTrackerHitStruct}( - weight, + return MCRecoTrackerAssociationStruct{SimTrackerHitStruct,TrackerHitStruct}( + Float32(weight), rec, sim, ) end -MCRecoTrackerAssociationCollection = Vector{ MCRecoTrackerAssociationStruct{TrackerHitStruct,SimTrackerHitStruct} } +MCRecoTrackerAssociationCollection = Vector{ MCRecoTrackerAssociationStruct{SimTrackerHitStruct,TrackerHitStruct} } function MCRecoTrackerHitPlaneAssociation( - weight::Float32 = Float32(0), + weight::Real = Float32(0), rec::Union{Nothing, TrackerHitPlaneStruct } = nothing, sim::Union{Nothing, SimTrackerHitStruct } = nothing, ) return MCRecoTrackerHitPlaneAssociationStruct{SimTrackerHitStruct,TrackerHitPlaneStruct}( - weight, + Float32(weight), rec, sim, ) @@ -644,40 +644,40 @@ end MCRecoTrackerHitPlaneAssociationCollection = Vector{ MCRecoTrackerHitPlaneAssociationStruct{SimTrackerHitStruct,TrackerHitPlaneStruct} } function MCRecoCaloParticleAssociation( - weight::Float32 = Float32(0), + weight::Real = Float32(0), rec::Union{Nothing, CalorimeterHitStruct } = nothing, sim::Union{Nothing, MCParticleStruct } = nothing, ) - return MCRecoCaloParticleAssociationStruct{MCParticleStruct,CalorimeterHitStruct}( - weight, + return MCRecoCaloParticleAssociationStruct{CalorimeterHitStruct,MCParticleStruct}( + Float32(weight), rec, sim, ) end -MCRecoCaloParticleAssociationCollection = Vector{ MCRecoCaloParticleAssociationStruct{MCParticleStruct,CalorimeterHitStruct} } +MCRecoCaloParticleAssociationCollection = Vector{ MCRecoCaloParticleAssociationStruct{CalorimeterHitStruct,MCParticleStruct} } function MCRecoClusterParticleAssociation( - weight::Float32 = Float32(0), + weight::Real = Float32(0), rec::Union{Nothing, ClusterStruct } = nothing, sim::Union{Nothing, MCParticleStruct } = nothing, ) - return MCRecoClusterParticleAssociationStruct{MCParticleStruct,ClusterStruct}( - weight, + return MCRecoClusterParticleAssociationStruct{ClusterStruct,MCParticleStruct}( + Float32(weight), rec, sim, ) end -MCRecoClusterParticleAssociationCollection = Vector{ MCRecoClusterParticleAssociationStruct{MCParticleStruct,ClusterStruct} } +MCRecoClusterParticleAssociationCollection = Vector{ MCRecoClusterParticleAssociationStruct{ClusterStruct,MCParticleStruct} } function MCRecoTrackParticleAssociation( - weight::Float32 = Float32(0), + weight::Real = Float32(0), rec::Union{Nothing, TrackStruct } = nothing, sim::Union{Nothing, MCParticleStruct } = nothing, ) return MCRecoTrackParticleAssociationStruct{MCParticleStruct,TrackStruct}( - weight, + Float32(weight), rec, sim, ) @@ -686,12 +686,12 @@ end MCRecoTrackParticleAssociationCollection = Vector{ MCRecoTrackParticleAssociationStruct{MCParticleStruct,TrackStruct} } function RecoParticleVertexAssociation( - weight::Float32 = Float32(0), + weight::Real = Float32(0), rec::Union{Nothing, ReconstructedParticleStruct } = nothing, vertex::Union{Nothing, VertexStruct } = nothing, ) return RecoParticleVertexAssociationStruct{ReconstructedParticleStruct,VertexStruct}( - weight, + Float32(weight), rec, vertex, ) @@ -700,10 +700,10 @@ end RecoParticleVertexAssociationCollection = Vector{ RecoParticleVertexAssociationStruct{ReconstructedParticleStruct,VertexStruct} } function SimPrimaryIonizationCluster( - cellID::UInt64 = UInt64(0), - time::Float32 = Float32(0), + cellID::Unsigned = UInt64(0), + time::Real = Float32(0), position::Vector3dStruct = Vector3d(), - type::Int16 = Int16(0), + type::Signed = Int16(0), MCParticle::Union{Nothing, MCParticleStruct } = nothing, electronCellID::Vector{ UInt64 } = Vector{ UInt64 }([]), electronTime::Vector{ Float32 } = Vector{ Float32 }([]), @@ -712,10 +712,10 @@ function SimPrimaryIonizationCluster( pulseAmplitude::Vector{ Float32 } = Vector{ Float32 }([]), ) return SimPrimaryIonizationClusterStruct{MCParticleStruct}( - cellID, - time, + UInt64(cellID), + Float32(time), position, - type, + Int16(type), MCParticle, electronCellID, electronTime, @@ -728,18 +728,18 @@ end SimPrimaryIonizationClusterCollection = Vector{ SimPrimaryIonizationClusterStruct{MCParticleStruct} } function TrackerPulse( - cellID::UInt64 = UInt64(0), - time::Float32 = Float32(0), - charge::Float32 = Float32(0), - quality::Int16 = Int16(0), + cellID::Unsigned = UInt64(0), + time::Real = Float32(0), + charge::Real = Float32(0), + quality::Signed = Int16(0), covMatrix::MVector{3, Float32} = MVector{3, Float32}(undef), timeSeries::Union{Nothing, TimeSeriesStruct } = nothing, ) return TrackerPulseStruct{TimeSeriesStruct}( - cellID, - time, - charge, - quality, + UInt64(cellID), + Float32(time), + Float32(charge), + Int16(quality), covMatrix, timeSeries, ) @@ -748,15 +748,15 @@ end TrackerPulseCollection = Vector{ TrackerPulseStruct{TimeSeriesStruct} } function RecIonizationCluster( - cellID::UInt64 = UInt64(0), - significance::Float32 = Float32(0), - type::Int16 = Int16(0), + cellID::Unsigned = UInt64(0), + significance::Real = Float32(0), + type::Signed = Int16(0), trackerPulse::Vector{ TrackerPulseStruct } = Vector{ TrackerPulseStruct }(), ) return RecIonizationClusterStruct{TrackerPulseStruct}( - cellID, - significance, - type, + UInt64(cellID), + Float32(significance), + Int16(type), trackerPulse, ) end @@ -764,15 +764,15 @@ end RecIonizationClusterCollection = Vector{ RecIonizationClusterStruct{TrackerPulseStruct} } function TimeSeries( - cellID::UInt64 = UInt64(0), - time::Float32 = Float32(0), - interval::Float32 = Float32(0), + cellID::Unsigned = UInt64(0), + time::Real = Float32(0), + interval::Real = Float32(0), amplitude::Vector{ Float32 } = Vector{ Float32 }([]), ) return TimeSeriesStruct( - cellID, - time, - interval, + UInt64(cellID), + Float32(time), + Float32(interval), amplitude, ) end @@ -781,16 +781,16 @@ TimeSeriesCollection = Vector{ TimeSeriesStruct } function RecDqdx( dQdx::QuantityStruct = Quantity(), - particleType::Int16 = Int16(0), - type::Int16 = Int16(0), + particleType::Signed = Int16(0), + type::Signed = Int16(0), hypotheses::MVector{5, HypothesisStruct} = MVector{5, HypothesisStruct}(undef), track::Union{Nothing, TrackStruct } = nothing, hitData::Vector{ HitLevelDataStruct } = Vector{ HitLevelDataStruct }([]), ) return RecDqdxStruct{TrackStruct}( dQdx, - particleType, - type, + Int16(particleType), + Int16(type), hypotheses, track, hitData, diff --git a/src/EventHeaderStruct.jl b/src/EventHeaderStruct.jl index 7f2a36b..d666b8b 100644 --- a/src/EventHeaderStruct.jl +++ b/src/EventHeaderStruct.jl @@ -1,3 +1,4 @@ + mutable struct EventHeaderStruct eventNumber::Int32 runNumber::Int32 diff --git a/src/HitLevelDataStruct.jl b/src/HitLevelDataStruct.jl index bc579be..966fd9a 100644 --- a/src/HitLevelDataStruct.jl +++ b/src/HitLevelDataStruct.jl @@ -3,4 +3,4 @@ mutable struct HitLevelDataStruct N::UInt32 eDep::Float32 pathLength::Float32 -end \ No newline at end of file +end diff --git a/src/HypothesisStruct.jl b/src/HypothesisStruct.jl index 0fa3ebd..c006974 100644 --- a/src/HypothesisStruct.jl +++ b/src/HypothesisStruct.jl @@ -2,4 +2,4 @@ mutable struct HypothesisStruct chi2::Float32 expected::Float32 sigma::Float32 -end \ No newline at end of file +end diff --git a/src/MCParticleStruct.jl b/src/MCParticleStruct.jl index c70fa1f..5bacbec 100644 --- a/src/MCParticleStruct.jl +++ b/src/MCParticleStruct.jl @@ -1,6 +1,7 @@ + +include("Vector2iStruct.jl") include("Vector3dStruct.jl") include("Vector3fStruct.jl") -include("Vector2iStruct.jl") mutable struct MCParticleStruct{MCParticleT} PDG::Int32 generatorStatus::Int32 diff --git a/src/MCRecoCaloAssociationStruct.jl b/src/MCRecoCaloAssociationStruct.jl index 6efd748..4f0549e 100644 --- a/src/MCRecoCaloAssociationStruct.jl +++ b/src/MCRecoCaloAssociationStruct.jl @@ -1,5 +1,6 @@ -mutable struct MCRecoCaloAssociationStruct{SimCalorimeterHitT,CalorimeterHitT} + +mutable struct MCRecoCaloAssociationStruct{CalorimeterHitT,SimCalorimeterHitT} weight::Float32 rec::Union{Nothing, CalorimeterHitT } sim::Union{Nothing, SimCalorimeterHitT } -end \ No newline at end of file +end diff --git a/src/MCRecoCaloParticleAssociationStruct.jl b/src/MCRecoCaloParticleAssociationStruct.jl index ec87400..9afd08c 100644 --- a/src/MCRecoCaloParticleAssociationStruct.jl +++ b/src/MCRecoCaloParticleAssociationStruct.jl @@ -1,4 +1,5 @@ -mutable struct MCRecoCaloParticleAssociationStruct{MCParticleT,CalorimeterHitT} + +mutable struct MCRecoCaloParticleAssociationStruct{CalorimeterHitT,MCParticleT} weight::Float32 rec::Union{Nothing, CalorimeterHitT } sim::Union{Nothing, MCParticleT } diff --git a/src/MCRecoClusterParticleAssociationStruct.jl b/src/MCRecoClusterParticleAssociationStruct.jl index 8519b0e..01952f8 100644 --- a/src/MCRecoClusterParticleAssociationStruct.jl +++ b/src/MCRecoClusterParticleAssociationStruct.jl @@ -1,4 +1,5 @@ -mutable struct MCRecoClusterParticleAssociationStruct{MCParticleT,ClusterT} + +mutable struct MCRecoClusterParticleAssociationStruct{ClusterT,MCParticleT} weight::Float32 rec::Union{Nothing, ClusterT } sim::Union{Nothing, MCParticleT } diff --git a/src/MCRecoParticleAssociationStruct.jl b/src/MCRecoParticleAssociationStruct.jl index 670471b..5fc23b7 100644 --- a/src/MCRecoParticleAssociationStruct.jl +++ b/src/MCRecoParticleAssociationStruct.jl @@ -1,3 +1,4 @@ + mutable struct MCRecoParticleAssociationStruct{MCParticleT,ReconstructedParticleT} weight::Float32 rec::Union{Nothing, ReconstructedParticleT } diff --git a/src/MCRecoTrackParticleAssociationStruct.jl b/src/MCRecoTrackParticleAssociationStruct.jl index 2933d01..67be7a7 100644 --- a/src/MCRecoTrackParticleAssociationStruct.jl +++ b/src/MCRecoTrackParticleAssociationStruct.jl @@ -1,3 +1,4 @@ + mutable struct MCRecoTrackParticleAssociationStruct{MCParticleT,TrackT} weight::Float32 rec::Union{Nothing, TrackT } diff --git a/src/MCRecoTrackerAssociationStruct.jl b/src/MCRecoTrackerAssociationStruct.jl index 01a5300..546c20e 100644 --- a/src/MCRecoTrackerAssociationStruct.jl +++ b/src/MCRecoTrackerAssociationStruct.jl @@ -1,4 +1,5 @@ -mutable struct MCRecoTrackerAssociationStruct{TrackerHitT,SimTrackerHitT} + +mutable struct MCRecoTrackerAssociationStruct{SimTrackerHitT,TrackerHitT} weight::Float32 rec::Union{Nothing, TrackerHitT } sim::Union{Nothing, SimTrackerHitT } diff --git a/src/MCRecoTrackerHitPlaneAssociationStruct.jl b/src/MCRecoTrackerHitPlaneAssociationStruct.jl index ae9210a..7ddf37d 100644 --- a/src/MCRecoTrackerHitPlaneAssociationStruct.jl +++ b/src/MCRecoTrackerHitPlaneAssociationStruct.jl @@ -1,5 +1,6 @@ + mutable struct MCRecoTrackerHitPlaneAssociationStruct{SimTrackerHitT,TrackerHitPlaneT} weight::Float32 rec::Union{Nothing, TrackerHitPlaneT } sim::Union{Nothing, SimTrackerHitT } -end \ No newline at end of file +end diff --git a/src/ParticleIDStruct.jl b/src/ParticleIDStruct.jl index 472b37a..80d3d68 100644 --- a/src/ParticleIDStruct.jl +++ b/src/ParticleIDStruct.jl @@ -1,3 +1,4 @@ + mutable struct ParticleIDStruct type::Int32 PDG::Int32 diff --git a/src/QuantityStruct.jl b/src/QuantityStruct.jl index 9dc61d2..dcb0ed0 100644 --- a/src/QuantityStruct.jl +++ b/src/QuantityStruct.jl @@ -2,4 +2,4 @@ mutable struct QuantityStruct type::Int16 value::Float32 error::Float32 -end +end \ No newline at end of file diff --git a/src/RawCalorimeterHitStruct.jl b/src/RawCalorimeterHitStruct.jl index caf9f56..f061cb3 100644 --- a/src/RawCalorimeterHitStruct.jl +++ b/src/RawCalorimeterHitStruct.jl @@ -1,3 +1,4 @@ + mutable struct RawCalorimeterHitStruct cellID::UInt64 amplitude::Int32 diff --git a/src/RawTimeSeriesStruct.jl b/src/RawTimeSeriesStruct.jl index 4010f1e..bed7477 100644 --- a/src/RawTimeSeriesStruct.jl +++ b/src/RawTimeSeriesStruct.jl @@ -1,3 +1,4 @@ + mutable struct RawTimeSeriesStruct cellID::UInt64 quality::Int32 diff --git a/src/RecDqdxStruct.jl b/src/RecDqdxStruct.jl index 0fc80fe..ca57e1a 100644 --- a/src/RecDqdxStruct.jl +++ b/src/RecDqdxStruct.jl @@ -1,8 +1,8 @@ -using StaticArrays -include("QuantityStruct.jl") include("HitLevelDataStruct.jl") include("HypothesisStruct.jl") +include("QuantityStruct.jl") +using StaticArrays mutable struct RecDqdxStruct{TrackT} dQdx::QuantityStruct particleType::Int16 diff --git a/src/RecIonizationClusterStruct.jl b/src/RecIonizationClusterStruct.jl index 0f5ad12..8fa4363 100644 --- a/src/RecIonizationClusterStruct.jl +++ b/src/RecIonizationClusterStruct.jl @@ -1,7 +1,7 @@ + mutable struct RecIonizationClusterStruct{TrackerPulseT} cellID::UInt64 significance::Float32 type::Int16 trackerPulse::Vector{ TrackerPulseT } end - diff --git a/src/RecoParticleVertexAssociationStruct.jl b/src/RecoParticleVertexAssociationStruct.jl index 9123f08..1d4365d 100644 --- a/src/RecoParticleVertexAssociationStruct.jl +++ b/src/RecoParticleVertexAssociationStruct.jl @@ -1,6 +1,6 @@ + mutable struct RecoParticleVertexAssociationStruct{ReconstructedParticleT,VertexT} weight::Float32 rec::Union{Nothing, ReconstructedParticleT } vertex::Union{Nothing, VertexT } end - diff --git a/src/ReconstructedParticleStruct.jl b/src/ReconstructedParticleStruct.jl index 5dd5fcc..f95211a 100644 --- a/src/ReconstructedParticleStruct.jl +++ b/src/ReconstructedParticleStruct.jl @@ -1,7 +1,7 @@ -using StaticArrays include("Vector3fStruct.jl") -mutable struct ReconstructedParticleStruct{ReconstructedParticleT,TrackT,ClusterT,ParticleIDT,VertexT} +using StaticArrays +mutable struct ReconstructedParticleStruct{ClusterT,ParticleIDT,ReconstructedParticleT,TrackT,VertexT} type::Int32 energy::Float32 momentum::Vector3fStruct diff --git a/src/SimCalorimeterHitStruct.jl b/src/SimCalorimeterHitStruct.jl index 424fee7..2299e67 100644 --- a/src/SimCalorimeterHitStruct.jl +++ b/src/SimCalorimeterHitStruct.jl @@ -1,7 +1,8 @@ + include("Vector3fStruct.jl") mutable struct SimCalorimeterHitStruct{CaloHitContributionT} cellID::UInt64 energy::Float32 position::Vector3fStruct contributions::Vector{ CaloHitContributionT } -end +end \ No newline at end of file diff --git a/src/SimPrimaryIonizationClusterStruct.jl b/src/SimPrimaryIonizationClusterStruct.jl index 5adbe62..a8cb9c5 100644 --- a/src/SimPrimaryIonizationClusterStruct.jl +++ b/src/SimPrimaryIonizationClusterStruct.jl @@ -1,3 +1,4 @@ + include("Vector3dStruct.jl") mutable struct SimPrimaryIonizationClusterStruct{MCParticleT} cellID::UInt64 diff --git a/src/SimTrackerHitStruct.jl b/src/SimTrackerHitStruct.jl index 4ff7882..9b95b21 100644 --- a/src/SimTrackerHitStruct.jl +++ b/src/SimTrackerHitStruct.jl @@ -1,3 +1,4 @@ + include("Vector3dStruct.jl") include("Vector3fStruct.jl") mutable struct SimTrackerHitStruct{MCParticleT} diff --git a/src/TimeSeriesStruct.jl b/src/TimeSeriesStruct.jl index cd73a19..9bdd7a5 100644 --- a/src/TimeSeriesStruct.jl +++ b/src/TimeSeriesStruct.jl @@ -1,3 +1,4 @@ + mutable struct TimeSeriesStruct cellID::UInt64 time::Float32 diff --git a/src/TrackStateStruct.jl b/src/TrackStateStruct.jl index 19e3e7b..9cd78ee 100644 --- a/src/TrackStateStruct.jl +++ b/src/TrackStateStruct.jl @@ -1,5 +1,5 @@ -using StaticArrays include("Vector3fStruct.jl") +using StaticArrays mutable struct TrackStateStruct location::Int32 D0::Float32 @@ -10,4 +10,4 @@ mutable struct TrackStateStruct time::Float32 referencePoint::Vector3fStruct covMatrix::MVector{21, Float32} -end +end \ No newline at end of file diff --git a/src/TrackStruct.jl b/src/TrackStruct.jl index 45bb34a..0ac9a8c 100644 --- a/src/TrackStruct.jl +++ b/src/TrackStruct.jl @@ -1,3 +1,4 @@ + include("QuantityStruct.jl") include("TrackStateStruct.jl") mutable struct TrackStruct{TrackT,TrackerHitT} diff --git a/src/TrackerHitPlaneStruct.jl b/src/TrackerHitPlaneStruct.jl index 52b29fb..e5ddb7b 100644 --- a/src/TrackerHitPlaneStruct.jl +++ b/src/TrackerHitPlaneStruct.jl @@ -1,8 +1,8 @@ -using StaticArrays -include("Vector3dStruct.jl") -include("Vector2fStruct.jl") include("ObjectIDStruct.jl") +include("Vector2fStruct.jl") +include("Vector3dStruct.jl") +using StaticArrays mutable struct TrackerHitPlaneStruct cellID::UInt64 type::Int32 diff --git a/src/TrackerHitStruct.jl b/src/TrackerHitStruct.jl index cd42ff9..ee839f5 100644 --- a/src/TrackerHitStruct.jl +++ b/src/TrackerHitStruct.jl @@ -1,7 +1,7 @@ -using StaticArrays -include("Vector3dStruct.jl") include("ObjectIDStruct.jl") +include("Vector3dStruct.jl") +using StaticArrays mutable struct TrackerHitStruct cellID::UInt64 type::Int32 diff --git a/src/TrackerPulseStruct.jl b/src/TrackerPulseStruct.jl index c4e5d20..f801ae2 100644 --- a/src/TrackerPulseStruct.jl +++ b/src/TrackerPulseStruct.jl @@ -1,5 +1,4 @@ using StaticArrays - mutable struct TrackerPulseStruct{TimeSeriesT} cellID::UInt64 time::Float32 diff --git a/src/VertexStruct.jl b/src/VertexStruct.jl index 0585d51..9f02843 100644 --- a/src/VertexStruct.jl +++ b/src/VertexStruct.jl @@ -1,6 +1,6 @@ -using StaticArrays include("Vector3fStruct.jl") +using StaticArrays mutable struct VertexStruct{ReconstructedParticleT} primary::Int32 chi2::Float32