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 hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () 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 ( const edm::ParameterSet iConfig)
explicit

Definition at line 44 of file CTPPSDiamondLocalTrackFitter.cc.

44  :
45  recHitsToken_( 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 {
49  produces<edm::DetSetVector<CTPPSDiamondLocalTrack> >();
50 }
T getParameter(std::string const &) const
CTPPSDiamondTrackRecognition trk_algo_45_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > recHitsToken_
CTPPSDiamondTrackRecognition trk_algo_56_
CTPPSDiamondLocalTrackFitter::~CTPPSDiamondLocalTrackFitter ( )
override

Definition at line 52 of file CTPPSDiamondLocalTrackFitter.cc.

53 {}

Member Function Documentation

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

Definition at line 100 of file CTPPSDiamondLocalTrackFitter.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, AlCaHLTBitMon_QueryRunRegistry::string, and funct::true.

101 {
103  desc.add<edm::InputTag>( "recHitsTag", edm::InputTag( "ctppsDiamondRecHits" ) )
104  ->setComment( "input rechits collection to retrieve" );
105 
106  edm::ParameterSetDescription trackingAlgoParams;
107  trackingAlgoParams.add<double>( "threshold", 1.5 )
108  ->setComment( "minimal number of rechits to be observed before launching the track recognition algorithm" );
109  trackingAlgoParams.add<double>( "thresholdFromMaximum", 0.5 );
110  trackingAlgoParams.add<double>( "resolution", 0.01 /* mm */ )
111  ->setComment( "spatial resolution on the horizontal coordinate (in mm)" );
112  trackingAlgoParams.add<double>( "sigma", 0.1 );
113  trackingAlgoParams.add<double>( "startFromX", -0.5 /* mm */ )
114  ->setComment( "starting horizontal coordinate of rechits for the track recognition" );
115  trackingAlgoParams.add<double>( "stopAtX", 19.5 /* mm */ )
116  ->setComment( "ending horizontal coordinate of rechits for the track recognition" );
117  trackingAlgoParams.add<double>( "tolerance", 0.1 /* mm */)
118  ->setComment( "tolerance used for checking if the track contains certain hit" );
119 
120  trackingAlgoParams.add<std::string>( "pixelEfficiencyFunction", "(x>[0]-0.5*[1])*(x<[0]+0.5*[1])+0*[2]" )
121  ->setComment( "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: (x>[0]-0.5*[1])*(x<[0]+0.5*[1])+((x-[0]+0.5*[1]+[2])/[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"
125  " * Legacy: (1/(1+exp(-(x-[0]+0.5*[1])/[2])))*(1/(1+exp((x-[0]-0.5*[1])/[2])))\n"
126  " * Default (sigma ignored): (x>[0]-0.5*[1])*(x<[0]+0.5*[1])+0*[2]\n"
127  "with:\n"
128  " [0]: centre of pad\n"
129  " [1]: width of pad\n"
130  " [2]: sigma: distance between efficiency ~100 -> 0 outside width" );
131 
132  trackingAlgoParams.add<double>( "yPosition", 0.0 )
133  ->setComment( "vertical offset of the outcoming track centre" );
134  trackingAlgoParams.add<double>( "yWidth", 0.0 )
135  ->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 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void CTPPSDiamondLocalTrackFitter::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 56 of file CTPPSDiamondLocalTrackFitter.cc.

References CTPPSDiamondTrackRecognition::addHit(), CTPPSDiamondTrackRecognition::clear(), edm::Event::getByToken(), eostools::move(), CTPPSDiamondTrackRecognition::produceTracks(), edm::Event::put(), recHitsToken_, CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING, trk_algo_45_, and trk_algo_56_.

57 {
58  auto pOut = std::make_unique<edm::DetSetVector<CTPPSDiamondLocalTrack> >();
59 
61  iEvent.getByToken( recHitsToken_, recHits );
62 
63  const CTPPSDiamondDetId id_45( 0, 1, 6, 0, 0 ), id_56( 1, 1, 6, 0, 0 );
64 
65  pOut->find_or_insert( id_45 ); // tracks in 4-5
66  edm::DetSet<CTPPSDiamondLocalTrack>& tracks56 = pOut->find_or_insert( id_56 ); // tracks in 5-6
67 
68  // workaround to retrieve the detset for 4-5 without losing the reference
69  edm::DetSet<CTPPSDiamondLocalTrack>& tracks45 = pOut->operator[]( id_45 );
70 
71  // feed hits to the track producers
72  for ( const auto& vec : *recHits ) {
73  const CTPPSDiamondDetId detid( vec.detId() );
74  for ( const auto& hit : vec ) {
75  // skip hits without a leading edge
76  if ( hit.getOOTIndex() == CTPPSDiamondRecHit::TIMESLICE_WITHOUT_LEADING ) continue;
77 
78  switch ( detid.arm() ) {
79  case 0: { trk_algo_45_.addHit( hit ); } break;
80  case 1: { trk_algo_56_.addHit( hit ); } break;
81  default:
82  edm::LogWarning("CTPPSDiamondLocalTrackFitter") << "Invalid arm for rechit: " << detid.arm();
83  break;
84  }
85  }
86  }
87 
88  // retrieve the tracks for both arms
89  trk_algo_45_.produceTracks( tracks45 );
90  trk_algo_56_.produceTracks( tracks56 );
91 
92  iEvent.put( std::move( pOut ) );
93 
94  // remove all hits from the track producers to prepare for the next event
97 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
CTPPSDiamondTrackRecognition trk_algo_45_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > recHitsToken_
int produceTracks(edm::DetSet< CTPPSDiamondLocalTrack > &tracks) override
Produce a collection of tracks for the current station, given its hits collection.
CTPPSDiamondTrackRecognition trk_algo_56_
static constexpr int TIMESLICE_WITHOUT_LEADING
void addHit(const CTPPSDiamondRecHit &recHit) override
Feed a new hit to the tracks recognition algorithm.
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
void clear() override
Reset internal state of a class instance.
def move(src, dest)
Definition: eostools.py:511

Member Data Documentation

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

Definition at line 39 of file CTPPSDiamondLocalTrackFitter.cc.

Referenced by produce().

CTPPSDiamondTrackRecognition CTPPSDiamondLocalTrackFitter::trk_algo_45_
private

Definition at line 40 of file CTPPSDiamondLocalTrackFitter.cc.

Referenced by produce().

CTPPSDiamondTrackRecognition CTPPSDiamondLocalTrackFitter::trk_algo_56_
private

Definition at line 41 of file CTPPSDiamondLocalTrackFitter.cc.

Referenced by produce().