10 #ifndef RecoPixelVertexing_PixelTriplets_src_CACut_h
11 #define RecoPixelVertexing_PixelTriplets_src_CACut_h
18 explicit CACut(
const double defaultCut,
const std::vector<edm::ParameterSet> &tripletCuts)
20 if (tripletCuts.size() == 1 && tripletCuts[0].getParameter<
double>(
"cut") == -1.) {
22 LogDebug(
"Configuration") <<
"No CACut VPSet. Using default cut value of " << defaultCut
23 <<
" for all layer triplets";
34 for (
const auto &thisTriplet : tripletCuts) {
38 thisCACut.tripletName_ = thisTriplet.getParameter<
std::string>(
"seedingLayers");
39 thisCACut.cutValue_ = thisTriplet.getParameter<
double>(
"cut");
56 for (
int thisLayer = 0; thisLayer < 3; thisLayer++) {
58 std::size_t layerPos = layersToSet.find(
"+");
59 if ((thisLayer < 2 && layerPos == std::string::npos) || (thisLayer == 2 && layerPos != std::string::npos)) {
61 <<
"Please enter a valid triplet name in the CACuts parameter set; e.g. 'BPix1+BPix2+BPix3'";
64 std::string layerName = layersToSet.substr(0, layerPos);
65 layersToSet = layersToSet.substr(layerPos + 1);
68 thisCACut.layerIds_.emplace_back(caLayers.
getLayerId(layerName));
69 if (thisCACut.layerIds_.back() == -1) {
72 <<
"' not found in the CAGraph. Please check CACuts parameter set if this "
73 "warning is present for all events";
78 thisCACut.cutValue_ = thisTriplet.cutValue_;
79 thisCACut.hasValueByInnerLayerId_ =
false;
87 if (thisTriplet.hasValueByInnerLayerId_)
89 auto it =
std::find(thisTriplet.layerIds_.begin(), thisTriplet.layerIds_.end(), -1);
90 if (it != thisTriplet.layerIds_.end())
93 bool foundOuterDoublet =
false;
96 if (thisOuterDoublet.outerDoubletIds_[0] == thisTriplet.layerIds_[1] &&
97 thisOuterDoublet.outerDoubletIds_[1] == thisTriplet.layerIds_[2]) {
98 thisOuterDoublet.innerLayerIds_.emplace_back(thisTriplet.layerIds_[0]);
99 thisOuterDoublet.cutValues_.emplace_back(thisTriplet.cutValue_);
100 foundOuterDoublet =
true;
105 if (!foundOuterDoublet) {
109 newOuterDoublet.outerDoubletIds_.emplace_back(thisTriplet.layerIds_[1]);
110 newOuterDoublet.outerDoubletIds_.emplace_back(thisTriplet.layerIds_[2]);
111 newOuterDoublet.innerLayerIds_.emplace_back(thisTriplet.layerIds_[0]);
112 newOuterDoublet.cutValues_.emplace_back(thisTriplet.cutValue_);
115 thisTriplet.hasValueByInnerLayerId_ =
true;
122 float at(
int layerId)
const {
123 for (
size_t thisLayer = 0; thisLayer <
innerLayerIds_.size(); thisLayer++) {
141 if (thisCut.outerDoubletIds_[0] == layerIds1 && thisCut.outerDoubletIds_[1] == layerIds2) {
147 return emptyCutsByInnerLayer;