50 maxPlaneActiveChannels_(iConfig.getParameter<
int>(
"maxPlaneActiveChannels")),
51 trk_algo_params_(iConfig.getParameter<
edm::
ParameterSet>(
"trackingAlgorithmParams")) {
52 produces<edm::DetSetVector<TotemTimingLocalTrack> >();
56 auto pOut = std::make_unique<edm::DetSetVector<TotemTimingLocalTrack> >();
61 std::map<T, int> planeActivityMap;
69 for (
const auto& vec : *
recHits)
70 planeActivityMap[
motherId(vec.detId())] += vec.size();
73 for (
const auto& vec : *
recHits) {
75 T detid(raw_detid.arm(), raw_detid.station(), raw_detid.rp());
77 if (trk_algo_map_.count(
detid) == 0)
78 trk_algo_map_.insert(std::make_pair(
detid, trk_algo_params_));
81 if (planeActivityMap[
detId] > maxPlaneActiveChannels_)
85 for (
const auto&
hit : vec) {
86 if (trk_algo_map_.find(
detId) == trk_algo_map_.end())
88 <<
"Invalid detId for rechit: arm=" <<
detId.arm() <<
", rp=" <<
detId.rp();
89 trk_algo_map_.find(
detId)->second.addHit(
hit);
94 for (
auto& trk_algo_entry : trk_algo_map_) {
95 pOut->find_or_insert(trk_algo_entry.first);
96 trk_algo_entry.second.produceTracks(pOut->operator[](trk_algo_entry.first));
102 for (
auto& trk_algo_entry : trk_algo_map_)
103 trk_algo_entry.second.clear();
105 template <
typename T>
110 ->setComment(
"input rechits collection to retrieve");
111 desc.add<
int>(
"maxPlaneActiveChannels", 2)->setComment(
"threshold for discriminating noisy planes");
114 trackingAlgoParams.
add<
double>(
"threshold", 1.5)
115 ->
setComment(
"minimal number of rechits to be observed before launching the track recognition algorithm");
116 trackingAlgoParams.
add<
double>(
"thresholdFromMaximum", 0.5)
117 ->
setComment(
"threshold relative to hit profile function local maximum for determining the width of the track");
118 trackingAlgoParams.
add<
double>(
"resolution", 0.01 )
119 ->setComment(
"spatial resolution on the horizontal coordinate (in mm)");
120 trackingAlgoParams.
add<
double>(
"sigma", 0.)
121 ->
setComment(
"pixel efficiency function parameter determining the smoothness of the step");
122 trackingAlgoParams.
add<
double>(
"tolerance", 0.1 )
123 ->setComment(
"tolerance used for checking if the track contains certain hit");
125 trackingAlgoParams.
add<
std::string>(
"pixelEfficiencyFunction",
"(x>[0]-0.5*[1]-0.05)*(x<[0]+0.5*[1]-0.05)+0*[2]")
127 "efficiency function for single pixel\n" 128 "can be defined as:\n" 130 "(TMath::Erf((x-[0]+0.5*([1]-0.05))/([2]/4)+2)+1)*TMath::Erfc((x-[0]-0.5*([1]-0.05))/([2]/4)-2)/4\n" 132 "(x>[0]-0.5*([1]-0.05))*(x<[0]+0.5*([1]-0.05))+((x-[0]+0.5*([1]-0.05)+[2])/" 133 "[2])*(x>[0]-0.5*([1]-0.05)-[2])*(x<[0]-0.5*([1]-0.05))+(2-(x-[0]-0.5*([1]-0.05)+[2])/" 134 "[2])*(x>[0]+0.5*([1]-0.05))*(x<[0]+0.5*([1]-0.05)+[2])\n" 135 " * Legacy: (1/(1+exp(-(x-[0]+0.5*([1]-0.05))/[2])))*(1/(1+exp((x-[0]-0.5*([1]-0.05))/[2])))\n" 136 " * Default (sigma ignored): (x>[0]-0.5*[1]-0.05)*(x<[0]+0.5*[1]-0.05)+0*[2]\n" 138 " [0]: centre of pad\n" 139 " [1]: width of pad\n" 140 " [2]: sigma: distance between efficiency ~100 -> 0 outside width");
142 trackingAlgoParams.
add<
double>(
"yPosition", 0.0)->
setComment(
"vertical offset of the outcoming track centre");
143 trackingAlgoParams.
add<
double>(
"yWidth", 0.0)->
setComment(
"vertical track width");
145 ->setComment(
"list of parameters associated to the track recognition algorithm");
150 auto desc = fillDescriptionsShared(descr);
151 descr.
add(
"totemTimingLocalTracks",
desc);
156 auto desc = fillDescriptionsShared(descr);
157 descr.
add(
"diamondSampicLocalTracks",
desc);
void setComment(std::string const &value)
static edm::ParameterSetDescription fillDescriptionsShared(edm::ConfigurationDescriptions &)
#define DEFINE_FWK_MODULE(type)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
TotemTimingLocalTrackFitter(const edm::ParameterSet &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
const int maxPlaneActiveChannels_
const edm::ParameterSet trk_algo_params_
Base class for CTPPS detector IDs.
void produce(edm::Event &, const edm::EventSetup &) override
const edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > recHitsToken_
static void fillDescriptions(edm::ConfigurationDescriptions &)
std::map< CTPPSDetId, TotemTimingTrackRecognition > trk_algo_map_