CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes
TotemTimingLocalTrackFitter Class Reference
Inheritance diagram for TotemTimingLocalTrackFitter:
edm::stream::EDProducer<>

Public Member Functions

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

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Member Functions

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

Private Attributes

const int maxPlaneActiveChannels_
 
const edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > recHitsToken_
 
std::map< TotemTimingDetId, TotemTimingTrackRecognitiontrk_algo_map_
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
typedef CacheContexts< T... > CacheTypes
 
typedef CacheTypes::GlobalCache GlobalCache
 
typedef AbilityChecker< T... > HasAbility
 
typedef CacheTypes::LuminosityBlockCache LuminosityBlockCache
 
typedef LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCacheLuminosityBlockContext
 
typedef CacheTypes::LuminosityBlockSummaryCache LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache, GlobalCacheRunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 

Detailed Description

Definition at line 30 of file TotemTimingLocalTrackFitter.cc.

Constructor & Destructor Documentation

◆ TotemTimingLocalTrackFitter()

TotemTimingLocalTrackFitter::TotemTimingLocalTrackFitter ( const edm::ParameterSet iConfig)
explicit

Definition at line 44 of file TotemTimingLocalTrackFitter.cc.

46  maxPlaneActiveChannels_(iConfig.getParameter<int>("maxPlaneActiveChannels")) {
47  produces<edm::DetSetVector<TotemTimingLocalTrack> >();
48 
49  for (unsigned short armNo = 0; armNo < 2; armNo++)
50  for (unsigned short rpNo = 0; rpNo < 2; rpNo++) {
51  TotemTimingDetId id(armNo, 1, rpNo, 0, 0);
52  TotemTimingTrackRecognition trk_algo(iConfig.getParameter<edm::ParameterSet>("trackingAlgorithmParams"));
53  trk_algo_map_.insert(std::make_pair(id, trk_algo));
54  }
55 }

Member Function Documentation

◆ fillDescriptions()

void TotemTimingLocalTrackFitter::fillDescriptions ( edm::ConfigurationDescriptions descr)
static

Definition at line 104 of file TotemTimingLocalTrackFitter.cc.

104  {
106  desc.add<edm::InputTag>("recHitsTag", edm::InputTag("totemTimingRecHits"))
107  ->setComment("input rechits collection to retrieve");
108  desc.add<int>("maxPlaneActiveChannels", 2)->setComment("threshold for discriminating noisy planes");
109 
110  edm::ParameterSetDescription trackingAlgoParams;
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 /* mm */)
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 /* mm */)
120  ->setComment("tolerance used for checking if the track contains certain hit");
121 
122  trackingAlgoParams.add<std::string>("pixelEfficiencyFunction", "(x>[0]-0.5*[1]-0.05)*(x<[0]+0.5*[1]-0.05)+0*[2]")
123  ->setComment(
124  "efficiency function for single pixel\n"
125  "can be defined as:\n"
126  " * Precise: "
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"
128  " * Fast: "
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"
134  "with:\n"
135  " [0]: centre of pad\n"
136  " [1]: width of pad\n"
137  " [2]: sigma: distance between efficiency ~100 -> 0 outside width");
138 
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");
141  desc.add<edm::ParameterSetDescription>("trackingAlgorithmParams", trackingAlgoParams)
142  ->setComment("list of parameters associated to the track recognition algorithm");
143 
144  descr.add("totemTimingLocalTracks", desc);
145 }

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

◆ produce()

void TotemTimingLocalTrackFitter::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 57 of file TotemTimingLocalTrackFitter.cc.

57  {
58  auto pOut = std::make_unique<edm::DetSetVector<TotemTimingLocalTrack> >();
59 
61  iEvent.getByToken(recHitsToken_, recHits);
62 
63  for (const auto& trk_algo_entry : trk_algo_map_)
64  pOut->find_or_insert(trk_algo_entry.first);
65 
66  std::map<TotemTimingDetId, int> planeActivityMap;
67 
68  auto motherId = [](const edm::det_id_type& detid) {
69  TotemTimingDetId out(detid);
70  out.setStation(1);
71  out.setChannel(0);
72  return out;
73  };
74 
75  for (const auto& vec : *recHits)
76  planeActivityMap[motherId(vec.detId())] += vec.size();
77 
78  // feed hits to the track producers
79  for (const auto& vec : *recHits) {
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  trk_algo_entry.second.produceTracks(pOut->operator[](trk_algo_entry.first));
96 
97  iEvent.put(std::move(pOut));
98 
99  // remove all hits from the track producers to prepare for the next event
100  for (auto& trk_algo_entry : trk_algo_map_)
101  trk_algo_entry.second.clear();
102 }

References iEvent, maxPlaneActiveChannels_, objects.autophobj::motherId, eostools::move(), MillePedeFileConverter_cfg::out, FastTrackerRecHitMaskProducer_cfi::recHits, recHitsToken_, and trk_algo_map_.

Member Data Documentation

◆ maxPlaneActiveChannels_

const int TotemTimingLocalTrackFitter::maxPlaneActiveChannels_
private

Definition at line 47 of file TotemTimingLocalTrackFitter.cc.

Referenced by produce().

◆ recHitsToken_

const edm::EDGetTokenT<edm::DetSetVector<TotemTimingRecHit> > TotemTimingLocalTrackFitter::recHitsToken_
private

Definition at line 46 of file TotemTimingLocalTrackFitter.cc.

Referenced by produce().

◆ trk_algo_map_

std::map<TotemTimingDetId, TotemTimingTrackRecognition> TotemTimingLocalTrackFitter::trk_algo_map_
private

Definition at line 48 of file TotemTimingLocalTrackFitter.cc.

Referenced by produce().

edm::DetSetVector
Definition: DetSetVector.h:61
edm::ParameterSetDescription::add
ParameterDescriptionBase * add(U const &iLabel, T const &value)
Definition: ParameterSetDescription.h:95
TotemTimingTrackRecognition
Definition: TotemTimingTrackRecognition.h:23
TotemTimingLocalTrackFitter::maxPlaneActiveChannels_
const int maxPlaneActiveChannels_
Definition: TotemTimingLocalTrackFitter.cc:47
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle
Definition: AssociativeIterator.h:50
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
FastTrackerRecHitMaskProducer_cfi.recHits
recHits
Definition: FastTrackerRecHitMaskProducer_cfi.py:8
TotemTimingDetId
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...
Definition: TotemTimingDetId.h:26
edm::ParameterSet
Definition: ParameterSet.h:47
iEvent
int iEvent
Definition: GenABIO.cc:224
objects.autophobj.motherId
motherId
Definition: autophobj.py:237
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
triggerObjects_cff.id
id
Definition: triggerObjects_cff.py:31
TotemTimingLocalTrackFitter::trk_algo_map_
std::map< TotemTimingDetId, TotemTimingTrackRecognition > trk_algo_map_
Definition: TotemTimingLocalTrackFitter.cc:48
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
TotemTimingLocalTrackFitter::recHitsToken_
const edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > recHitsToken_
Definition: TotemTimingLocalTrackFitter.cc:46
MillePedeFileConverter_cfg.out
out
Definition: MillePedeFileConverter_cfg.py:31
cms::Exception
Definition: Exception.h:70
edm::det_id_type
uint32_t det_id_type
Definition: DetSet.h:20
edm::ParameterDescriptionNode::setComment
void setComment(std::string const &value)
Definition: ParameterDescriptionNode.cc:106
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88