Skip to content
Open
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
19 changes: 9 additions & 10 deletions DataProducts/inc/SurfaceId.hh
Original file line number Diff line number Diff line change
Expand Up @@ -38,12 +38,10 @@ namespace mu2e {
CRV_StrongBack=280, // CRV module Al strongback (tracker-side support plate)
DS_HatchConcrete=300 // detector-area hatch concrete block approximation
};

// Update this counter whenever you add/remove surface IDs from the enum above.
static constexpr std::size_t nSurfaceIds = 64;

static std::string const& typeName();
static std::map<enum_type,std::string> const& names();
// Update this counter whenever you add/remove surface IDs from the enum above.
static constexpr std::size_t nSurfaceIds = 64;
static std::string const& typeName();
static std::map<enum_type,std::string> const& names();
};
using SurfaceIdEnum = EnumToStringSparse<SurfaceIdDetail>;
class SurfaceId {
Expand All @@ -59,14 +57,15 @@ namespace mu2e {
int index() const { return index_; }
auto const& name() const { return sid_.name(); }

bool indexMatch(SurfaceId const& other) const { return index_ == other.index_ || index_ < 0 || other.index_ < 0; }
bool indexCompare(SurfaceId const& other) const { return index_<0 || other.index_ < 0 ? false : index_ < other.index_; }
bool indexMatch(SurfaceId const& other) const { return index_ == other.index_ || index_ == allIndices_ || other.index_ == allIndices_; }
bool indexCompare(SurfaceId const& other) const { return index_== allIndices_ || other.index_ == allIndices_ ? false : index_ < other.index_; }
bool operator == (SurfaceId const& other ) const { return sid_ == other.sid_ && indexMatch(other) ; }
bool operator != (SurfaceId const& other ) const { return sid_ != other.sid_ || !indexMatch(other) ; }
bool operator < (SurfaceId const& other ) const { return sid_ == other.sid_ ? indexCompare(other) : sid_ < other.sid_; }
private:
static int allIndices_; // index wildcard
private:
SurfaceIdEnum sid_;
int index_; // index. Negative value is a wild card for matching
int index_; // index
};
using SurfaceIdCollection = std::vector<SurfaceId>;
// printout
Expand Down
1 change: 1 addition & 0 deletions DataProducts/src/SurfaceId.cc
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ namespace mu2e {
static const std::string type("SurfaceIdEnum");
return type;
}
int SurfaceId::allIndices_(-1); // wildcard for index comparison

namespace {
using SurfaceIdName = std::pair<SurfaceIdEnum::enum_type, char const*>;
Expand Down
1 change: 1 addition & 0 deletions KinKalGeom/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ cet_make_library(
src/KKStrawMaterial.cc
LIBRARIES PUBLIC
Offline::ConfigTools
Offline::DataProducts
KinKal::MatEnv
KinKal::Geometry
KinKal::Trajectory
Expand Down
1 change: 1 addition & 0 deletions KinKalGeom/src/SConscript
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ helper = mu2e_helper(env)

mainlib = helper.make_mainlib([
'mu2e_ConfigTools',
'mu2e_DataProducts',
'KinKal_MatEnv',
'KinKal_Geometry',
'KinKal_Trajectory',
Expand Down
2 changes: 1 addition & 1 deletion Mu2eKinKal/inc/KKFit.hh
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ namespace mu2e {
}
// surfaces to sample; this interface is deprecatecd and should be replaced with extrapolation TODO
for(auto const& sidname : fitconfig.sampleSurfaces()){
ssids_.push_back(SurfaceId(sidname,-1)); // match all elements
ssids_.push_back(SurfaceId(sidname,SurfaceId::allIndices_)); // match all elements
}
}

Expand Down
2 changes: 1 addition & 1 deletion Mu2eKinKal/src/CentralHelixFit_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -234,7 +234,7 @@ namespace mu2e {

// surfaces to sample; this interface is deprecatecd and should be replaced with extrapolation TODO
for(auto const& sidname : settings().modSettings().sampleSurfaces()) {
ssids_.push_back(SurfaceId(sidname,-1)); // match all elements
ssids_.push_back(SurfaceId(sidname,SurfaceId::allIndices_)); // match all elements
}
}

Expand Down
2 changes: 1 addition & 1 deletion Mu2eKinKal/src/KinematicLineFit_module.cc
Original file line number Diff line number Diff line change
Expand Up @@ -213,7 +213,7 @@ namespace mu2e {
throw cet::exception("RECO")<<"mu2e::KinematicLineFit: Parameter constraint configuration error"<< endl;
}
for(auto const& sidname : settings().modSettings().sampleSurfaces()) {
ssids_.push_back(SurfaceId(sidname,-1)); // match all elements
ssids_.push_back(SurfaceId(sidname,SurfaceId::allIndices_)); // match all elements
}
// setup extrapolation
if(settings().extrapSettings())extrap_ = make_unique<KKExtrap>(*settings().extrapSettings());
Expand Down
2 changes: 1 addition & 1 deletion Validation/src/ValKalSeed.cc
Original file line number Diff line number Diff line change
Expand Up @@ -164,7 +164,7 @@ namespace mu2e {
p = mom3.R();
rho = ikinter->position3().Rho();
}
auto stinters = ks.intersections(SurfaceId("ST_Foils",-1)); // match all foils
auto stinters = ks.intersections(SurfaceId("ST_Foils",SurfaceId::allIndices_)); // match all foils
_hNST->Fill(stinters.size());
for (auto stinter : stinters)
_hSTdP->Fill(stinter->dMom());
Expand Down