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<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CTPPSDiamondLocalTrackFitter (const edm::ParameterSet &)
 
 ~CTPPSDiamondLocalTrackFitter ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, std::unordered_multimap< std::string, edm::ProductResolverIndex > const &iIndicies, std::string const &moduleLabel)
 
virtual ~ProducerBase () noexcept(false)
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

virtual 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
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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  :
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_
EDGetTokenT< ProductType > consumes(edm::InputTag const &tag)
CTPPSDiamondTrackRecognition trk_algo_56_
CTPPSDiamondLocalTrackFitter::~CTPPSDiamondLocalTrackFitter ( )

Definition at line 52 of file CTPPSDiamondLocalTrackFitter.cc.

53 {}

Member Function Documentation

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

Definition at line 103 of file CTPPSDiamondLocalTrackFitter.cc.

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

104 {
106  desc.add<edm::InputTag>( "recHitsTag", edm::InputTag( "ctppsDiamondRecHits" ) )
107  ->setComment( "input rechits collection to retrieve" );
108  desc.add<int>( "verbosity", 0 )
109  ->setComment( "general verbosity of this module" );
110 
111  edm::ParameterSetDescription trackingAlgoParams;
112  trackingAlgoParams.add<double>( "threshold", 1.5 )
113  ->setComment( "minimal number of rechits to be observed before launching the track recognition algorithm" );
114  trackingAlgoParams.add<double>( "thresholdFromMaximum", 0.5 );
115  trackingAlgoParams.add<double>( "resolution", 0.01 /* mm */ )
116  ->setComment( "spatial resolution on the horizontal coordinate (in mm)" );
117  trackingAlgoParams.add<double>( "sigma", 0.1 );
118  trackingAlgoParams.add<double>( "startFromX", -0.5 /* mm */ )
119  ->setComment( "starting horizontal coordinate of rechits for the track recognition" );
120  trackingAlgoParams.add<double>( "stopAtX", 19.5 /* mm */ )
121  ->setComment( "ending horizontal coordinate of rechits for the track recognition" );
122 
123  trackingAlgoParams.add<std::string>( "pixelEfficiencyFunction", "(TMath::Erf((x-[0]+0.5*[1])/([2]/4)+2)+1)*TMath::Erfc((x-[0]-0.5*[1])/([2]/4)-2)/4" )
124  ->setComment( "efficiency function for single pixel\n"
125  "can be defined as:\n"
126  " * Precise: (TMath::Erf((x-[0]+0.5*[1])/([2]/4)+2)+1)*TMath::Erfc((x-[0]-0.5*[1])/([2]/4)-2)/4\n"
127  " * 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"
128  " * Legacy: (1/(1+exp(-(x-[0]+0.5*[1])/[2])))*(1/(1+exp((x-[0]-0.5*[1])/[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 )
135  ->setComment( "vertical offset of the outcoming track centre" );
136  trackingAlgoParams.add<double>( "yWidth", 0.0 )
137  ->setComment( "vertical track width" );
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 
)
overrideprivatevirtual

Definition at line 56 of file CTPPSDiamondLocalTrackFitter.cc.

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

57 {
58  std::unique_ptr< edm::DetSetVector<CTPPSDiamondLocalTrack> > pOut( new 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 ( edm::DetSetVector<CTPPSDiamondRecHit>::const_iterator vec = recHits->begin(); vec != recHits->end(); ++vec )
73  {
74  const CTPPSDiamondDetId detid( vec->detId() );
75 
76  if (detid.arm()==0)
77  {
78  for ( edm::DetSet<CTPPSDiamondRecHit>::const_iterator hit = vec->begin(); hit != vec->end(); ++hit )
79  {
81  }
82  } else
83  {
84  for ( edm::DetSet<CTPPSDiamondRecHit>::const_iterator hit = vec->begin(); hit != vec->end(); ++hit )
85  {
87  }
88  }
89  }
90 
91  // retrieve the tracks for both arms
92  trk_algo_45_.produceTracks( tracks45 );
93  trk_algo_56_.produceTracks( tracks56 );
94 
95  iEvent.put( std::move( pOut ) );
96 
97  // remove all hits from the track producers to prepare for the next event
100 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
void clear()
Reset the list of hits.
CTPPSDiamondTrackRecognition trk_algo_45_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:460
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondRecHit > > recHitsToken_
CTPPSDiamondTrackRecognition trk_algo_56_
void addHit(const CTPPSDiamondRecHit &recHit)
Feed a new hit to the tracks recognition algorithm.
int produceTracks(edm::DetSet< CTPPSDiamondLocalTrack > &tracks)
Produce a collection of tracks for the current station, given its hits collection.
Detector ID class for CTPPS Timing Diamond detectors. Bits [19:31] : Assigend in CTPPSDetId Calss Bit...
collection_type::const_iterator const_iterator
Definition: DetSet.h:33
collection_type::const_iterator const_iterator
Definition: DetSetVector.h:104
def move(src, dest)
Definition: eostools.py:510

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().