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

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

Definition at line 45 of file TotemTimingLocalTrackFitter.cc.

References edm::ParameterSet::getParameter(), triggerObjects_cff::id, and trk_algo_map_.

45  :
46  recHitsToken_( consumes<edm::DetSetVector<TotemTimingRecHit> >( iConfig.getParameter<edm::InputTag>( "recHitsTag" ) ) ),
47  maxPlaneActiveChannels_( iConfig.getParameter<int>( "maxPlaneActiveChannels" ) )
48 {
49  produces<edm::DetSetVector<TotemTimingLocalTrack> >();
50 
51  for ( unsigned short armNo = 0; armNo < 2; armNo++ )
52  for ( unsigned short rpNo = 0; rpNo < 2; rpNo++ ) {
53  TotemTimingDetId id( armNo, 1, rpNo, 0, 0 );
54  TotemTimingTrackRecognition trk_algo( iConfig.getParameter<edm::ParameterSet>( "trackingAlgorithmParams" ) );
55  trk_algo_map_.insert( std::make_pair( id, trk_algo ) );
56  }
57 }
T getParameter(std::string const &) const
const edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > recHitsToken_
std::map< TotemTimingDetId, TotemTimingTrackRecognition > trk_algo_map_
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...

Member Function Documentation

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

Definition at line 109 of file TotemTimingLocalTrackFitter.cc.

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

110 {
112  desc.add<edm::InputTag>( "recHitsTag", edm::InputTag( "totemTimingRecHits" ) )
113  ->setComment( "input rechits collection to retrieve" );
114  desc.add<int>( "maxPlaneActiveChannels", 2 )
115  ->setComment( "threshold for discriminating noisy planes" );
116 
117  edm::ParameterSetDescription trackingAlgoParams;
118  trackingAlgoParams.add<double>( "threshold", 1.5 )
119  ->setComment( "minimal number of rechits to be observed before launching the track recognition algorithm" );
120  trackingAlgoParams.add<double>( "thresholdFromMaximum", 0.5 )
121  ->setComment( "threshold relative to hit profile function local maximum for determining the width of the track" );
122  trackingAlgoParams.add<double>( "resolution", 0.01 /* mm */ )
123  ->setComment( "spatial resolution on the horizontal coordinate (in mm)" );
124  trackingAlgoParams.add<double>( "sigma", 0. )
125  ->setComment( "pixel efficiency function parameter determining the smoothness of the step" );
126  trackingAlgoParams.add<double>( "tolerance", 0.1 /* mm */)
127  ->setComment( "tolerance used for checking if the track contains certain hit" );
128 
129  trackingAlgoParams.add<std::string>( "pixelEfficiencyFunction", "(x>[0]-0.5*[1]-0.05)*(x<[0]+0.5*[1]-0.05)+0*[2]" )
130  ->setComment( "efficiency function for single pixel\n"
131  "can be defined as:\n"
132  " * Precise: (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"
133  " * Fast: (x>[0]-0.5*([1]-0.05))*(x<[0]+0.5*([1]-0.05))+((x-[0]+0.5*([1]-0.05)+[2])/[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])/[2])*(x>[0]+0.5*([1]-0.05))*(x<[0]+0.5*([1]-0.05)+[2])\n"
134  " * Legacy: (1/(1+exp(-(x-[0]+0.5*([1]-0.05))/[2])))*(1/(1+exp((x-[0]-0.5*([1]-0.05))/[2])))\n"
135  " * Default (sigma ignored): (x>[0]-0.5*[1]-0.05)*(x<[0]+0.5*[1]-0.05)+0*[2]\n"
136  "with:\n"
137  " [0]: centre of pad\n"
138  " [1]: width of pad\n"
139  " [2]: sigma: distance between efficiency ~100 -> 0 outside width" );
140 
141  trackingAlgoParams.add<double>( "yPosition", 0.0 )
142  ->setComment( "vertical offset of the outcoming track centre" );
143  trackingAlgoParams.add<double>( "yWidth", 0.0 )
144  ->setComment( "vertical track width" );
145  desc.add<edm::ParameterSetDescription>( "trackingAlgorithmParams", trackingAlgoParams )
146  ->setComment( "list of parameters associated to the track recognition algorithm" );
147 
148  descr.add( "totemTimingLocalTracks", desc );
149 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void TotemTimingLocalTrackFitter::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 60 of file TotemTimingLocalTrackFitter.cc.

References edm::Event::getByToken(), maxPlaneActiveChannels_, objects.autophobj::motherId, eostools::move(), MillePedeFileConverter_cfg::out, edm::Event::put(), recHitsToken_, TotemTimingDetId::setChannel(), CTPPSDetId::setStation(), and trk_algo_map_.

61 {
62  auto pOut = std::make_unique<edm::DetSetVector<TotemTimingLocalTrack> >();
63 
65  iEvent.getByToken( recHitsToken_, recHits );
66 
67  for ( const auto& trk_algo_entry : trk_algo_map_ )
68  pOut->find_or_insert( trk_algo_entry.first );
69 
70  std::map<TotemTimingDetId,int> planeActivityMap;
71 
72  auto motherId = []( const edm::det_id_type& detid ) {
73  TotemTimingDetId out( detid );
74  out.setStation( 1 );
75  out.setChannel( 0 );
76  return out;
77  };
78 
79  for ( const auto& vec: *recHits )
80  planeActivityMap[motherId(vec.detId())] += vec.size();
81 
82  // feed hits to the track producers
83  for ( const auto& vec : *recHits ) {
84  auto detId = motherId( vec.detId() );
85  if ( planeActivityMap[detId] > maxPlaneActiveChannels_ )
86  continue;
87 
88  detId.setPlane( 0 );
89  for ( const auto& hit : vec ) {
90  if ( trk_algo_map_.find( detId ) == trk_algo_map_.end() )
91  throw cms::Exception("TotemTimingLocalTrackFitter")
92  << "Invalid detId for rechit: arm=" << detId.arm() << ", rp=" << detId.rp();
93  trk_algo_map_.find( detId )->second.addHit( hit );
94  }
95  }
96 
97  // retrieves tracks for all hit sets
98  for ( auto& trk_algo_entry : trk_algo_map_ )
99  trk_algo_entry.second.produceTracks( pOut->operator[]( trk_algo_entry.first ) );
100 
101  iEvent.put( std::move( pOut ) );
102 
103  // remove all hits from the track producers to prepare for the next event
104  for ( auto& trk_algo_entry : trk_algo_map_ )
105  trk_algo_entry.second.clear();
106 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
uint32_t det_id_type
Definition: DetSet.h:21
const edm::EDGetTokenT< edm::DetSetVector< TotemTimingRecHit > > recHitsToken_
def move(src, dest)
Definition: eostools.py:511
std::map< TotemTimingDetId, TotemTimingTrackRecognition > trk_algo_map_
Detector ID class for CTPPS Totem Timing detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bits ...

Member Data Documentation

const int TotemTimingLocalTrackFitter::maxPlaneActiveChannels_
private

Definition at line 41 of file TotemTimingLocalTrackFitter.cc.

Referenced by produce().

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

Definition at line 40 of file TotemTimingLocalTrackFitter.cc.

Referenced by produce().

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

Definition at line 42 of file TotemTimingLocalTrackFitter.cc.

Referenced by produce(), and TotemTimingLocalTrackFitter().