CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
CTPPSLocalTrackLiteProducer Class Reference

Distills the essential track data from all RPs. More...

Inheritance diagram for CTPPSLocalTrackLiteProducer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CTPPSLocalTrackLiteProducer (const edm::ParameterSet &)
 
virtual void produce (edm::Event &, const edm::EventSetup &) override
 
virtual ~CTPPSLocalTrackLiteProducer ()
 
- 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
 
 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 & itemsToGetFromEvent () 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)
 

Private Attributes

edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > diamondTrackToken_
 
bool doNothing_
 
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > siStripTrackToken_
 

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
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Distills the essential track data from all RPs.

Definition at line 27 of file CTPPSLocalTrackLiteProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 46 of file CTPPSLocalTrackLiteProducer.cc.

References diamondTrackToken_, doNothing_, edm::ParameterSet::getParameter(), and siStripTrackToken_.

46  :
47  doNothing_( iConfig.getParameter<bool>( "doNothing" ) )
48 {
49  if ( doNothing_ ) return;
50 
51  siStripTrackToken_ = consumes< edm::DetSetVector<TotemRPLocalTrack> > ( iConfig.getParameter<edm::InputTag>("tagSiStripTrack") );
52  diamondTrackToken_ = consumes< edm::DetSetVector<CTPPSDiamondLocalTrack> >( iConfig.getParameter<edm::InputTag>("tagDiamondTrack") );
53 
54  produces< std::vector<CTPPSLocalTrackLite> >();
55 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > diamondTrackToken_
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > siStripTrackToken_
virtual CTPPSLocalTrackLiteProducer::~CTPPSLocalTrackLiteProducer ( )
inlinevirtual

Definition at line 31 of file CTPPSLocalTrackLiteProducer.cc.

References produce().

31 {}

Member Function Documentation

void CTPPSLocalTrackLiteProducer::produce ( edm::Event iEvent,
const edm::EventSetup  
)
overridevirtual

Definition at line 60 of file CTPPSLocalTrackLiteProducer.cc.

References DEFINE_FWK_MODULE, diamondTrackToken_, doNothing_, edm::Event::getByToken(), eostools::move(), edm::Event::put(), and siStripTrackToken_.

Referenced by ~CTPPSLocalTrackLiteProducer().

61 {
62  if ( doNothing_ )
63  return;
64 
65  // prepare output
66  std::unique_ptr< std::vector<CTPPSLocalTrackLite> > pOut( new std::vector<CTPPSLocalTrackLite>() );
67 
68  //----- TOTEM strips
69 
70  // get input from Si strips
72  iEvent.getByToken( siStripTrackToken_, inputSiStripTracks );
73 
74  // process tracks from Si strips
75  for ( const auto& rpv : *inputSiStripTracks ) {
76  const uint32_t rpId = rpv.detId();
77  for ( const auto& trk : rpv ) {
78  if ( !trk.isValid() ) continue;
79  pOut->emplace_back( rpId, trk.getX0(), trk.getX0Sigma(), trk.getY0(), trk.getY0Sigma() );
80  }
81  }
82 
83  //----- diamond detectors
84 
85  // get input from diamond detectors
87  iEvent.getByToken( diamondTrackToken_, inputDiamondTracks );
88 
89  // process tracks from diamond detectors
90  for ( const auto& rpv : *inputDiamondTracks ) {
91  const unsigned int rpId = rpv.detId();
92  for ( const auto& trk : rpv ) {
93  if ( !trk.isValid() ) continue;
94  pOut->emplace_back( rpId, trk.getX0(), trk.getX0Sigma(), trk.getY0(), trk.getY0Sigma(), trk.getT() );
95  }
96  }
97 
98  // save output to event
99  iEvent.put( std::move( pOut ) );
100 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:122
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:457
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > diamondTrackToken_
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > siStripTrackToken_
def move(src, dest)
Definition: eostools.py:510

Member Data Documentation

edm::EDGetTokenT< edm::DetSetVector<CTPPSDiamondLocalTrack> > CTPPSLocalTrackLiteProducer::diamondTrackToken_
private

Definition at line 37 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

bool CTPPSLocalTrackLiteProducer::doNothing_
private

if true, this module will do nothing needed for consistency with CTPPS-less workflows

Definition at line 41 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

edm::EDGetTokenT< edm::DetSetVector<TotemRPLocalTrack> > CTPPSLocalTrackLiteProducer::siStripTrackToken_
private

Definition at line 36 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().