Skip to content

Commit

Permalink
Merge pull request #38797 from fabferro/cleanBadPot_124
Browse files Browse the repository at this point in the history
 [12_4] PPS clean code for bad pot
  • Loading branch information
cmsbuild authored Jul 23, 2022
2 parents ee62caf + 1272cf9 commit b305d23
Show file tree
Hide file tree
Showing 4 changed files with 26 additions and 39 deletions.
1 change: 0 additions & 1 deletion RecoPPS/Local/interface/RPixRoadFinder.h
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,6 @@ class RPixRoadFinder : public RPixDetPatternFinder {
unsigned int minRoadSize_;
unsigned int maxRoadSize_;
double roadRadiusBadPot_;
// bool isBadPot_;
void run(const edm::DetSetVector<CTPPSPixelRecHit> &input, const CTPPSGeometry &geometry, std::vector<Road> &roads);
};

Expand Down
58 changes: 25 additions & 33 deletions RecoPPS/Local/plugins/CTPPSPixelLocalTrackProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -57,39 +57,37 @@ class CTPPSPixelLocalTrackProducer : public edm::stream::EDProducer<> {
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions);

private:
int verbosity_;
int maxHitPerPlane_;
int maxHitPerRomanPot_;
int maxTrackPerRomanPot_;
int maxTrackPerPattern_;

edm::InputTag inputTag_;
edm::EDGetTokenT<edm::DetSetVector<CTPPSPixelRecHit>> tokenCTPPSPixelRecHit_;
edm::ESGetToken<CTPPSGeometry, VeryForwardRealGeometryRecord> tokenCTPPSGeometry_;
const int verbosity_;
const int maxHitPerPlane_;
const int maxHitPerRomanPot_;
const int maxTrackPerRomanPot_;
const int maxTrackPerPattern_;

const edm::EDGetTokenT<edm::DetSetVector<CTPPSPixelRecHit>> tokenCTPPSPixelRecHit_;
const edm::ESGetToken<CTPPSGeometry, VeryForwardRealGeometryRecord> tokenCTPPSGeometry_;
edm::ESWatcher<VeryForwardRealGeometryRecord> geometryWatcher_;

edm::ESGetToken<CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd> tokenCTPPSPixelAnalysisMask_;
const edm::ESGetToken<CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd> tokenCTPPSPixelAnalysisMask_;

uint32_t numberOfPlanesPerPot_;
std::vector<uint32_t> listOfAllPlanes_;
const uint32_t numberOfPlanesPerPot_;

std::unique_ptr<RPixDetPatternFinder> patternFinder_;
std::unique_ptr<RPixDetTrackFinder> trackFinder_;

// void run(const edm::DetSetVector<CTPPSPixelRecHit> &input, edm::DetSetVector<CTPPSPixelLocalTrack> &output);
};

//------------------------------------------------------------------------------------------------//

CTPPSPixelLocalTrackProducer::CTPPSPixelLocalTrackProducer(const edm::ParameterSet &parameterSet) {
inputTag_ = parameterSet.getParameter<edm::InputTag>("tag");
verbosity_ = parameterSet.getUntrackedParameter<int>("verbosity");
maxHitPerRomanPot_ = parameterSet.getParameter<int>("maxHitPerRomanPot");
maxHitPerPlane_ = parameterSet.getParameter<int>("maxHitPerPlane");
maxTrackPerRomanPot_ = parameterSet.getParameter<int>("maxTrackPerRomanPot");
maxTrackPerPattern_ = parameterSet.getParameter<int>("maxTrackPerPattern");
numberOfPlanesPerPot_ = parameterSet.getParameter<int>("numberOfPlanesPerPot");

CTPPSPixelLocalTrackProducer::CTPPSPixelLocalTrackProducer(const edm::ParameterSet &parameterSet)
: verbosity_(parameterSet.getUntrackedParameter<int>("verbosity")),
maxHitPerPlane_(parameterSet.getParameter<int>("maxHitPerPlane")),
maxHitPerRomanPot_(parameterSet.getParameter<int>("maxHitPerRomanPot")),
maxTrackPerRomanPot_(parameterSet.getParameter<int>("maxTrackPerRomanPot")),
maxTrackPerPattern_(parameterSet.getParameter<int>("maxTrackPerPattern")),
tokenCTPPSPixelRecHit_(
consumes<edm::DetSetVector<CTPPSPixelRecHit>>(parameterSet.getParameter<edm::InputTag>("tag"))),
tokenCTPPSGeometry_(esConsumes<CTPPSGeometry, VeryForwardRealGeometryRecord>()),
tokenCTPPSPixelAnalysisMask_(esConsumes<CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd>()),
numberOfPlanesPerPot_(parameterSet.getParameter<int>("numberOfPlanesPerPot")) {
std::string patternFinderAlgorithm = parameterSet.getParameter<std::string>("patternFinderAlgorithm");
std::string trackFitterAlgorithm = parameterSet.getParameter<std::string>("trackFinderAlgorithm");

Expand All @@ -101,9 +99,9 @@ CTPPSPixelLocalTrackProducer::CTPPSPixelLocalTrackProducer(const edm::ParameterS
<< "Pattern finder algorithm" << patternFinderAlgorithm << " does not exist";
}

listOfAllPlanes_.reserve(6);
std::vector<uint32_t> listOfAllPlanes;
for (uint32_t i = 0; i < numberOfPlanesPerPot_; ++i) {
listOfAllPlanes_.push_back(i);
listOfAllPlanes.push_back(i);
}

//tracking algorithm selector
Expand All @@ -113,13 +111,8 @@ CTPPSPixelLocalTrackProducer::CTPPSPixelLocalTrackProducer(const edm::ParameterS
throw cms::Exception("CTPPSPixelLocalTrackProducer")
<< "Tracking fitter algorithm" << trackFitterAlgorithm << " does not exist";
}
trackFinder_->setListOfPlanes(listOfAllPlanes_);
trackFinder_->setListOfPlanes(listOfAllPlanes);
trackFinder_->initialize();

tokenCTPPSPixelRecHit_ = consumes<edm::DetSetVector<CTPPSPixelRecHit>>(inputTag_);
tokenCTPPSGeometry_ = esConsumes<CTPPSGeometry, VeryForwardRealGeometryRecord>();
tokenCTPPSPixelAnalysisMask_ = esConsumes<CTPPSPixelAnalysisMask, CTPPSPixelAnalysisMaskRcd>();

produces<edm::DetSetVector<CTPPSPixelLocalTrack>>();
}

Expand Down Expand Up @@ -156,9 +149,8 @@ void CTPPSPixelLocalTrackProducer::fillDescriptions(edm::ConfigurationDescriptio
desc.add<double>("roadRadius", 1.0)->setComment("radius of pattern search window");
desc.add<int>("minRoadSize", 3)->setComment("minimum number of points in a pattern");
desc.add<int>("maxRoadSize", 20)->setComment("maximum number of points in a pattern");
//parameters for bad pot reconstruction patch 45-220-fr 2022
//parameter for bad pot reconstruction patch 45-220-fr 2022
desc.add<double>("roadRadiusBadPot", 0.5)->setComment("radius of pattern search window for bad Pot");
// desc.add<bool>("isBadPot", true)->setComment("flag to enable road search for bad pot");

descriptions.add("ctppsPixelLocalTracks", desc);
}
Expand Down
5 changes: 1 addition & 4 deletions RecoPPS/Local/python/ctppsPixelLocalReconstruction_cff.py
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,7 @@
# local track producer
from RecoPPS.Local.ctppsPixelLocalTracks_cfi import ctppsPixelLocalTracks

#from Configuration.Eras.Modifier_ctpps_2016_cff import ctpps_2016
#from Configuration.Eras.Modifier_ctpps_2017_cff import ctpps_2017
#from Configuration.Eras.Modifier_ctpps_2018_cff import ctpps_2018
#(ctpps_2016 | ctpps_2017 | ctpps_2018).toModify(ctppsPixelLocalTracks, isBadPot = cms.bool(False))


ctppsPixelLocalReconstructionTask = cms.Task(
ctppsPixelClusters,ctppsPixelRecHits,ctppsPixelLocalTracks
Expand Down
1 change: 0 additions & 1 deletion RecoPPS/Local/src/RPixRoadFinder.cc
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,6 @@ RPixRoadFinder::RPixRoadFinder(edm::ParameterSet const& parameterSet) : RPixDetP
minRoadSize_ = parameterSet.getParameter<int>("minRoadSize");
maxRoadSize_ = parameterSet.getParameter<int>("maxRoadSize");
roadRadiusBadPot_ = parameterSet.getParameter<double>("roadRadiusBadPot");
// isBadPot_ = parameterSet.getParameter<bool>("isBadPot");
}

//------------------------------------------------------------------------------------------------//
Expand Down

0 comments on commit b305d23

Please sign in to comment.