CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes
TotemTimingLocalTrackFitter< T > Class Template Reference
Inheritance diagram for TotemTimingLocalTrackFitter< T >:
edm::stream::EDProducer<>

Public Member Functions

template<>
void fillDescriptions (edm::ConfigurationDescriptions &descr)
 
template<>
void fillDescriptions (edm::ConfigurationDescriptions &descr)
 
 TotemTimingLocalTrackFitter (const edm::ParameterSet &)
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Member Functions

void produce (edm::Event &, const edm::EventSetup &) override
 

Static Private Member Functions

static edm::ParameterSetDescription fillDescriptionsShared (edm::ConfigurationDescriptions &)
 

Private Attributes

const int maxPlaneActiveChannels_
 
const edm::EDGetTokenT
< edm::DetSetVector
< TotemTimingRecHit > > 
recHitsToken_
 
std::map< CTPPSDetId,
TotemTimingTrackRecognition
trk_algo_map_
 
const edm::ParameterSet trk_algo_params_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

template<typename T>
class TotemTimingLocalTrackFitter< T >

Definition at line 32 of file TotemTimingLocalTrackFitter.cc.

Constructor & Destructor Documentation

template<typename T >
TotemTimingLocalTrackFitter< T >::TotemTimingLocalTrackFitter ( const edm::ParameterSet iConfig)
explicit

Definition at line 48 of file TotemTimingLocalTrackFitter.cc.

50  maxPlaneActiveChannels_(iConfig.getParameter<int>("maxPlaneActiveChannels")),
51  trk_algo_params_(iConfig.getParameter<edm::ParameterSet>("trackingAlgorithmParams")) {
52  produces<edm::DetSetVector<TotemTimingLocalTrack> >();
53 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
const edm::ParameterSet trk_algo_params_
const edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > recHitsToken_

Member Function Documentation

template<typename T >
static void TotemTimingLocalTrackFitter< T >::fillDescriptions ( edm::ConfigurationDescriptions )
static
template<>
void TotemTimingLocalTrackFitter< TotemTimingDetId >::fillDescriptions ( edm::ConfigurationDescriptions descr)

Definition at line 149 of file TotemTimingLocalTrackFitter.cc.

References edm::ConfigurationDescriptions::add(), and submitPVResolutionJobs::desc.

149  {
150  auto desc = fillDescriptionsShared(descr);
151  descr.add("totemTimingLocalTracks", desc);
152 }
static edm::ParameterSetDescription fillDescriptionsShared(edm::ConfigurationDescriptions &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<>
void TotemTimingLocalTrackFitter< CTPPSDiamondDetId >::fillDescriptions ( edm::ConfigurationDescriptions descr)

Definition at line 155 of file TotemTimingLocalTrackFitter.cc.

References edm::ConfigurationDescriptions::add(), and submitPVResolutionJobs::desc.

155  {
156  auto desc = fillDescriptionsShared(descr);
157  descr.add("diamondSampicLocalTracks", desc);
158 }
static edm::ParameterSetDescription fillDescriptionsShared(edm::ConfigurationDescriptions &)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
template<typename T >
edm::ParameterSetDescription TotemTimingLocalTrackFitter< T >::fillDescriptionsShared ( edm::ConfigurationDescriptions descr)
staticprivate

Definition at line 106 of file TotemTimingLocalTrackFitter.cc.

References edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, edm::ParameterDescriptionNode::setComment(), and AlCaHLTBitMon_QueryRunRegistry::string.

107  {
109  desc.add<edm::InputTag>("recHitsTag", edm::InputTag("totemTimingRecHits"))
110  ->setComment("input rechits collection to retrieve");
111  desc.add<int>("maxPlaneActiveChannels", 2)->setComment("threshold for discriminating noisy planes");
112 
113  edm::ParameterSetDescription trackingAlgoParams;
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 /* mm */)
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 /* mm */)
123  ->setComment("tolerance used for checking if the track contains certain hit");
124 
125  trackingAlgoParams.add<std::string>("pixelEfficiencyFunction", "(x>[0]-0.5*[1]-0.05)*(x<[0]+0.5*[1]-0.05)+0*[2]")
126  ->setComment(
127  "efficiency function for single pixel\n"
128  "can be defined as:\n"
129  " * Precise: "
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"
131  " * Fast: "
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"
137  "with:\n"
138  " [0]: centre of pad\n"
139  " [1]: width of pad\n"
140  " [2]: sigma: distance between efficiency ~100 -> 0 outside width");
141 
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");
144  desc.add<edm::ParameterSetDescription>("trackingAlgorithmParams", trackingAlgoParams)
145  ->setComment("list of parameters associated to the track recognition algorithm");
146  return desc;
147 }
void setComment(std::string const &value)
ParameterDescriptionBase * add(U const &iLabel, T const &value)
template<typename T >
void TotemTimingLocalTrackFitter< T >::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 55 of file TotemTimingLocalTrackFitter.cc.

References edm::Event::getByToken(), eostools::move(), submitPVResolutionJobs::out, edm::Event::put(), and HLT_FULL_cff::recHits.

55  {
56  auto pOut = std::make_unique<edm::DetSetVector<TotemTimingLocalTrack> >();
57 
59  iEvent.getByToken(recHitsToken_, recHits);
60 
61  std::map<T, int> planeActivityMap;
62 
63  auto motherId = [](const edm::det_id_type& detid) {
64  T out(detid);
65  out.setChannel(0);
66  return out;
67  };
68 
69  for (const auto& vec : *recHits)
70  planeActivityMap[motherId(vec.detId())] += vec.size();
71 
72  // feed hits to the track producers
73  for (const auto& vec : *recHits) {
74  const CTPPSDetId raw_detid(vec.detId());
75  T detid(raw_detid.arm(), raw_detid.station(), raw_detid.rp());
76  // if algorithm is not found, build it
77  if (trk_algo_map_.count(detid) == 0)
78  trk_algo_map_.insert(std::make_pair(detid, trk_algo_params_));
79 
80  auto detId = motherId(vec.detId());
81  if (planeActivityMap[detId] > maxPlaneActiveChannels_)
82  continue;
83 
84  detId.setPlane(0);
85  for (const auto& hit : vec) {
86  if (trk_algo_map_.find(detId) == trk_algo_map_.end())
87  throw cms::Exception("TotemTimingLocalTrackFitter")
88  << "Invalid detId for rechit: arm=" << detId.arm() << ", rp=" << detId.rp();
89  trk_algo_map_.find(detId)->second.addHit(hit);
90  }
91  }
92 
93  // retrieves tracks for all hit sets
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));
97  }
98 
99  iEvent.put(std::move(pOut));
100 
101  // remove all hits from the track producers to prepare for the next event
102  for (auto& trk_algo_entry : trk_algo_map_)
103  trk_algo_entry.second.clear();
104 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
def move
Definition: eostools.py:511
uint32_t det_id_type
Definition: DetSet.h:20
const edm::ParameterSet trk_algo_params_
Base class for CTPPS detector IDs.
Definition: CTPPSDetId.h:32
long double T
const edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > recHitsToken_
std::map< CTPPSDetId, TotemTimingTrackRecognition > trk_algo_map_

Member Data Documentation

template<typename T >
const int TotemTimingLocalTrackFitter< T >::maxPlaneActiveChannels_
private

Definition at line 43 of file TotemTimingLocalTrackFitter.cc.

template<typename T >
const edm::EDGetTokenT<edm::DetSetVector<TotemTimingRecHit> > TotemTimingLocalTrackFitter< T >::recHitsToken_
private

Definition at line 42 of file TotemTimingLocalTrackFitter.cc.

template<typename T >
std::map<CTPPSDetId, TotemTimingTrackRecognition> TotemTimingLocalTrackFitter< T >::trk_algo_map_
private

Definition at line 45 of file TotemTimingLocalTrackFitter.cc.

template<typename T >
const edm::ParameterSet TotemTimingLocalTrackFitter< T >::trk_algo_params_
private

Definition at line 44 of file TotemTimingLocalTrackFitter.cc.