41 std::map<TotemTimingDetId, TotemTimingTrackRecognition>
trk_algo_map_;
46 maxPlaneActiveChannels_(iConfig.getParameter<
int>(
"maxPlaneActiveChannels")) {
47 produces<edm::DetSetVector<TotemTimingLocalTrack> >();
49 for (
unsigned short armNo = 0; armNo < 2; armNo++)
50 for (
unsigned short rpNo = 0; rpNo < 2; rpNo++) {
53 trk_algo_map_.insert(std::make_pair(
id, trk_algo));
58 auto pOut = std::make_unique<edm::DetSetVector<TotemTimingLocalTrack> >();
64 pOut->find_or_insert(trk_algo_entry.first);
66 std::map<TotemTimingDetId, int> planeActivityMap;
75 for (
const auto& vec : *
recHits)
76 planeActivityMap[
motherId(vec.detId())] += vec.size();
79 for (
const auto& vec : *
recHits) {
85 for (
const auto&
hit : vec) {
88 <<
"Invalid detId for rechit: arm=" << detId.arm() <<
", rp=" << detId.rp();
95 trk_algo_entry.second.produceTracks(pOut->operator[](trk_algo_entry.first));
101 trk_algo_entry.second.clear();
107 ->setComment(
"input rechits collection to retrieve");
108 desc.add<
int>(
"maxPlaneActiveChannels", 2)->setComment(
"threshold for discriminating noisy planes");
111 trackingAlgoParams.
add<
double>(
"threshold", 1.5)
112 ->
setComment(
"minimal number of rechits to be observed before launching the track recognition algorithm");
113 trackingAlgoParams.
add<
double>(
"thresholdFromMaximum", 0.5)
114 ->
setComment(
"threshold relative to hit profile function local maximum for determining the width of the track");
115 trackingAlgoParams.
add<
double>(
"resolution", 0.01 )
116 ->setComment(
"spatial resolution on the horizontal coordinate (in mm)");
117 trackingAlgoParams.
add<
double>(
"sigma", 0.)
118 ->
setComment(
"pixel efficiency function parameter determining the smoothness of the step");
119 trackingAlgoParams.
add<
double>(
"tolerance", 0.1 )
120 ->setComment(
"tolerance used for checking if the track contains certain hit");
122 trackingAlgoParams.
add<
std::string>(
"pixelEfficiencyFunction",
"(x>[0]-0.5*[1]-0.05)*(x<[0]+0.5*[1]-0.05)+0*[2]")
124 "efficiency function for single pixel\n"
125 "can be defined as:\n"
127 "(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"
129 "(x>[0]-0.5*([1]-0.05))*(x<[0]+0.5*([1]-0.05))+((x-[0]+0.5*([1]-0.05)+[2])/"
130 "[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])/"
131 "[2])*(x>[0]+0.5*([1]-0.05))*(x<[0]+0.5*([1]-0.05)+[2])\n"
132 " * Legacy: (1/(1+exp(-(x-[0]+0.5*([1]-0.05))/[2])))*(1/(1+exp((x-[0]-0.5*([1]-0.05))/[2])))\n"
133 " * Default (sigma ignored): (x>[0]-0.5*[1]-0.05)*(x<[0]+0.5*[1]-0.05)+0*[2]\n"
135 " [0]: centre of pad\n"
136 " [1]: width of pad\n"
137 " [2]: sigma: distance between efficiency ~100 -> 0 outside width");
139 trackingAlgoParams.
add<
double>(
"yPosition", 0.0)->
setComment(
"vertical offset of the outcoming track centre");
140 trackingAlgoParams.
add<
double>(
"yWidth", 0.0)->
setComment(
"vertical track width");
142 ->setComment(
"list of parameters associated to the track recognition algorithm");
144 descr.
add(
"totemTimingLocalTracks",
desc);