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 &)
 
 ~CTPPSDiamondLocalTrackFitter () override
 
- 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_
 
CTPPSDiamondTrackRecognition trk_algo_45_
 
CTPPSDiamondTrackRecognition trk_algo_56_
 

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

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

◆ ~CTPPSDiamondLocalTrackFitter()

CTPPSDiamondLocalTrackFitter::~CTPPSDiamondLocalTrackFitter ( )
override

Definition at line 51 of file CTPPSDiamondLocalTrackFitter.cc.

51 {}

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 100 of file CTPPSDiamondLocalTrackFitter.cc.

100  {
102  desc.add<edm::InputTag>("recHitsTag", edm::InputTag("ctppsDiamondRecHits"))
103  ->setComment("input rechits collection to retrieve");
104 
105  edm::ParameterSetDescription trackingAlgoParams;
106  trackingAlgoParams.add<double>("threshold", 1.5)
107  ->setComment("minimal number of rechits to be observed before launching the track recognition algorithm");
108  trackingAlgoParams.add<double>("thresholdFromMaximum", 0.5);
109  trackingAlgoParams.add<double>("resolution", 0.01 /* mm */)
110  ->setComment("spatial resolution on the horizontal coordinate (in mm)");
111  trackingAlgoParams.add<double>("sigma", 0.1);
112  trackingAlgoParams.add<double>("startFromX", -0.5 /* mm */)
113  ->setComment("starting horizontal coordinate of rechits for the track recognition");
114  trackingAlgoParams.add<double>("stopAtX", 19.5 /* mm */)
115  ->setComment("ending horizontal coordinate of rechits for the track recognition");
116  trackingAlgoParams.add<double>("tolerance", 0.1 /* mm */)
117  ->setComment("tolerance used for checking if the track contains certain hit");
118 
119  trackingAlgoParams.add<std::string>("pixelEfficiencyFunction", "(x>[0]-0.5*[1])*(x<[0]+0.5*[1])+0*[2]")
120  ->setComment(
121  "efficiency function for single pixel\n"
122  "can be defined as:\n"
123  " * Precise: (TMath::Erf((x-[0]+0.5*[1])/([2]/4)+2)+1)*TMath::Erfc((x-[0]-0.5*[1])/([2]/4)-2)/4\n"
124  " * Fast: "
125  "(x>[0]-0.5*[1])*(x<[0]+0.5*[1])+((x-[0]+0.5*[1]+[2])/"
126  "[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"
127  " * Legacy: (1/(1+exp(-(x-[0]+0.5*[1])/[2])))*(1/(1+exp((x-[0]-0.5*[1])/[2])))\n"
128  " * Default (sigma ignored): (x>[0]-0.5*[1])*(x<[0]+0.5*[1])+0*[2]\n"
129  "with:\n"
130  " [0]: centre of pad\n"
131  " [1]: width of pad\n"
132  " [2]: sigma: distance between efficiency ~100 -> 0 outside width");
133 
134  trackingAlgoParams.add<double>("yPosition", 0.0)->setComment("vertical offset of the outcoming track centre");
135  trackingAlgoParams.add<double>("yWidth", 0.0)->setComment("vertical track width");
136  trackingAlgoParams.add<bool>("excludeSingleEdgeHits", true)
137  ->setComment("exclude rechits with missing leading/trailing edge");
138 
139  desc.add<edm::ParameterSetDescription>("trackingAlgorithmParams", trackingAlgoParams)
140  ->setComment("list of parameters associated to the track recognition algorithm");
141 
142  descr.add("ctppsDiamondLocalTracks", desc);
143 }

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

53  {
54  auto pOut = std::make_unique<edm::DetSetVector<CTPPSDiamondLocalTrack> >();
55 
57  iEvent.getByToken(recHitsToken_, recHits);
58 
59  const CTPPSDiamondDetId id_45(0, 1, 6, 0, 0), id_56(1, 1, 6, 0, 0);
60 
61  pOut->find_or_insert(id_45); // tracks in 4-5
62  edm::DetSet<CTPPSDiamondLocalTrack>& tracks56 = pOut->find_or_insert(id_56); // tracks in 5-6
63 
64  // workaround to retrieve the detset for 4-5 without losing the reference
65  edm::DetSet<CTPPSDiamondLocalTrack>& tracks45 = pOut->operator[](id_45);
66 
67  // feed hits to the track producers
68  for (const auto& vec : *recHits) {
69  const CTPPSDiamondDetId detid(vec.detId());
70  for (const auto& hit : vec) {
71  // skip hits without a leading edge
73  continue;
74 
75  switch (detid.arm()) {
76  case 0: {
78  } break;
79  case 1: {
81  } break;
82  default:
83  edm::LogWarning("CTPPSDiamondLocalTrackFitter") << "Invalid arm for rechit: " << detid.arm();
84  break;
85  }
86  }
87  }
88 
89  // retrieve the tracks for both arms
90  trk_algo_45_.produceTracks(tracks45);
91  trk_algo_56_.produceTracks(tracks56);
92 
93  iEvent.put(std::move(pOut));
94 
95  // remove all hits from the track producers to prepare for the next event
98 }

References CTPPSDiamondTrackRecognition::addHit(), CTPPSDiamondTrackRecognition::clear(), iEvent, eostools::move(), CTPPSDiamondTrackRecognition::produceTracks(), FastTrackerRecHitMaskProducer_cfi::recHits, recHitsToken_, CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING, trk_algo_45_, and trk_algo_56_.

Member Data Documentation

◆ recHitsToken_

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

Definition at line 44 of file CTPPSDiamondLocalTrackFitter.cc.

Referenced by produce().

◆ trk_algo_45_

CTPPSDiamondTrackRecognition CTPPSDiamondLocalTrackFitter::trk_algo_45_
private

Definition at line 45 of file CTPPSDiamondLocalTrackFitter.cc.

Referenced by produce().

◆ trk_algo_56_

CTPPSDiamondTrackRecognition CTPPSDiamondLocalTrackFitter::trk_algo_56_
private

Definition at line 46 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
edm::DetSet
Definition: DetSet.h:23
CTPPSDiamondLocalTrackFitter::trk_algo_56_
CTPPSDiamondTrackRecognition trk_algo_56_
Definition: CTPPSDiamondLocalTrackFitter.cc:46
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89287
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
edm::Handle
Definition: AssociativeIterator.h:50
edm::LogWarning
Log< level::Warning, false > LogWarning
Definition: MessageLogger.h:122
CTPPSDiamondTrackRecognition::addHit
void addHit(const CTPPSDiamondRecHit &recHit) override
Feed a new hit to the tracks recognition algorithm.
Definition: CTPPSDiamondTrackRecognition.cc:27
CTPPSDiamondTrackRecognition::clear
void clear() override
Reset internal state of a class instance.
Definition: CTPPSDiamondTrackRecognition.cc:20
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
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_45_
CTPPSDiamondTrackRecognition trk_algo_45_
Definition: CTPPSDiamondLocalTrackFitter.cc:45
CTPPSDiamondLocalTrackFitter::recHitsToken_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > recHitsToken_
Definition: CTPPSDiamondLocalTrackFitter.cc:44
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
CTPPSDiamondTrackRecognition::produceTracks
int produceTracks(edm::DetSet< CTPPSDiamondLocalTrack > &tracks) override
Produce a collection of tracks for the current station, given its hits collection.
Definition: CTPPSDiamondTrackRecognition.cc:36
edm::ParameterDescriptionNode::setComment
void setComment(std::string const &value)
Definition: ParameterDescriptionNode.cc:106
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88