CMS 3D CMS Logo

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

Public Member Functions

 CTPPSDiamondLocalTrackFitter (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

edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > recHitsToken_
 
std::unordered_map< CTPPSDetId, std::unique_ptr< CTPPSDiamondTrackRecognition > > trk_algo_
 
const edm::ParameterSet trk_algo_params_
 

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 28 of file CTPPSDiamondLocalTrackFitter.cc.

Constructor & Destructor Documentation

◆ CTPPSDiamondLocalTrackFitter()

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

Definition at line 42 of file CTPPSDiamondLocalTrackFitter.cc.

43  : recHitsToken_(
44  consumes<edm::DetSetVector<CTPPSDiamondRecHit> >(iConfig.getParameter<edm::InputTag>("recHitsTag"))),
45  trk_algo_params_(iConfig.getParameter<edm::ParameterSet>("trackingAlgorithmParams")) {
46  produces<edm::DetSetVector<CTPPSDiamondLocalTrack> >();
47 }

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 81 of file CTPPSDiamondLocalTrackFitter.cc.

81  {
83  desc.add<edm::InputTag>("recHitsTag", edm::InputTag("ctppsDiamondRecHits"))
84  ->setComment("input rechits collection to retrieve");
85 
86  edm::ParameterSetDescription trackingAlgoParams;
87  trackingAlgoParams.add<double>("threshold", 1.5)
88  ->setComment("minimal number of rechits to be observed before launching the track recognition algorithm");
89  trackingAlgoParams.add<double>("thresholdFromMaximum", 0.5);
90  trackingAlgoParams.add<double>("resolution", 0.01 /* mm */)
91  ->setComment("spatial resolution on the horizontal coordinate (in mm)");
92  trackingAlgoParams.add<double>("sigma", 0.1);
93  trackingAlgoParams.add<double>("startFromX", -0.5 /* mm */)
94  ->setComment("starting horizontal coordinate of rechits for the track recognition");
95  trackingAlgoParams.add<double>("stopAtX", 19.5 /* mm */)
96  ->setComment("ending horizontal coordinate of rechits for the track recognition");
97  trackingAlgoParams.add<double>("tolerance", 0.1 /* mm */)
98  ->setComment("tolerance used for checking if the track contains certain hit");
99 
100  trackingAlgoParams.add<std::string>("pixelEfficiencyFunction", "(x>[0]-0.5*[1])*(x<[0]+0.5*[1])+0*[2]")
101  ->setComment(
102  "efficiency function for single pixel\n"
103  "can be defined as:\n"
104  " * Precise: (TMath::Erf((x-[0]+0.5*[1])/([2]/4)+2)+1)*TMath::Erfc((x-[0]-0.5*[1])/([2]/4)-2)/4\n"
105  " * Fast: "
106  "(x>[0]-0.5*[1])*(x<[0]+0.5*[1])+((x-[0]+0.5*[1]+[2])/"
107  "[2])*(x>[0]-0.5*[1]-[2])*(x<[0]-0.5*[1])+(2-(x-[0]-0.5*[1]+[2])/[2])*(x>[0]+0.5*[1])*(x<[0]+0.5*[1]+[2])\n"
108  " * Legacy: (1/(1+exp(-(x-[0]+0.5*[1])/[2])))*(1/(1+exp((x-[0]-0.5*[1])/[2])))\n"
109  " * Default (sigma ignored): (x>[0]-0.5*[1])*(x<[0]+0.5*[1])+0*[2]\n"
110  "with:\n"
111  " [0]: centre of pad\n"
112  " [1]: width of pad\n"
113  " [2]: sigma: distance between efficiency ~100 -> 0 outside width");
114 
115  trackingAlgoParams.add<double>("yPosition", 0.0)->setComment("vertical offset of the outcoming track centre");
116  trackingAlgoParams.add<double>("yWidth", 0.0)->setComment("vertical track width");
117  trackingAlgoParams.add<bool>("excludeSingleEdgeHits", true)
118  ->setComment("exclude rechits with missing leading/trailing edge");
119 
120  desc.add<edm::ParameterSetDescription>("trackingAlgorithmParams", trackingAlgoParams)
121  ->setComment("list of parameters associated to the track recognition algorithm");
122 
123  descr.add("ctppsDiamondLocalTracks", desc);
124 }

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

◆ produce()

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

Definition at line 49 of file CTPPSDiamondLocalTrackFitter.cc.

49  {
50  // prepare the output
51  auto pOut = std::make_unique<edm::DetSetVector<CTPPSDiamondLocalTrack> >();
52 
54  iEvent.getByToken(recHitsToken_, recHits);
55 
56  // clear all hits possibly inherited from previous event
57  for (auto& algo_vs_id : trk_algo_)
58  algo_vs_id.second->clear();
59 
60  // feed hits to the track producers
61  for (const auto& vec : *recHits) {
62  const CTPPSDiamondDetId raw_detid(vec.detId()), detid(raw_detid.arm(), raw_detid.station(), raw_detid.rp());
63  // if algorithm is not found, build it
64  if (trk_algo_.count(detid) == 0)
65  trk_algo_[detid] = std::make_unique<CTPPSDiamondTrackRecognition>(trk_algo_params_);
66  for (const auto& hit : vec)
67  // skip hits without a leading edge
69  trk_algo_[detid]->addHit(hit);
70  }
71 
72  // build the tracks for all stations
73  for (auto& algo_vs_id : trk_algo_) {
74  auto& tracks = pOut->find_or_insert(algo_vs_id.first);
75  algo_vs_id.second->produceTracks(tracks);
76  }
77 
78  iEvent.put(std::move(pOut));
79 }

References iEvent, eostools::move(), FastTrackerRecHitMaskProducer_cfi::recHits, recHitsToken_, CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING, tracks, trk_algo_, and trk_algo_params_.

Member Data Documentation

◆ recHitsToken_

edm::EDGetTokenT<edm::DetSetVector<CTPPSDiamondRecHit> > CTPPSDiamondLocalTrackFitter::recHitsToken_
private

Definition at line 43 of file CTPPSDiamondLocalTrackFitter.cc.

Referenced by produce().

◆ trk_algo_

std::unordered_map<CTPPSDetId, std::unique_ptr<CTPPSDiamondTrackRecognition> > CTPPSDiamondLocalTrackFitter::trk_algo_
private

Definition at line 45 of file CTPPSDiamondLocalTrackFitter.cc.

Referenced by produce().

◆ trk_algo_params_

const edm::ParameterSet CTPPSDiamondLocalTrackFitter::trk_algo_params_
private

Definition at line 44 of file CTPPSDiamondLocalTrackFitter.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
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle
Definition: AssociativeIterator.h:50
CTPPSDiamondLocalTrackFitter::trk_algo_
std::unordered_map< CTPPSDetId, std::unique_ptr< CTPPSDiamondTrackRecognition > > trk_algo_
Definition: CTPPSDiamondLocalTrackFitter.cc:45
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
CTPPSDiamondDetId
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
Definition: CTPPSDiamondDetId.h:24
edm::ParameterSet
Definition: ParameterSet.h:47
tracks
const uint32_t *__restrict__ const HitContainer *__restrict__ TkSoA *__restrict__ tracks
Definition: CAHitNtupletGeneratorKernelsImpl.h:159
CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING
static constexpr int TIMESLICE_WITHOUT_LEADING
Definition: CTPPSDiamondRecHit.h:44
iEvent
int iEvent
Definition: GenABIO.cc:224
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
CTPPSDiamondLocalTrackFitter::trk_algo_params_
const edm::ParameterSet trk_algo_params_
Definition: CTPPSDiamondLocalTrackFitter.cc:44
CTPPSDiamondLocalTrackFitter::recHitsToken_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > recHitsToken_
Definition: CTPPSDiamondLocalTrackFitter.cc:43
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::ParameterDescriptionNode::setComment
void setComment(std::string const &value)
Definition: ParameterDescriptionNode.cc:106
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88