CMS 3D CMS Logo

List of all members | Public Member Functions | Static 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 &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~CTPPSLocalTrackLiteProducer () override
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducerBase () override
 
- 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 ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
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, ModuleToResolverIndicies 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
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) 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 Attributes

edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > diamondTrackToken_
 
bool doNothing_
 
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > pixelTrackToken_
 
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
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex >>
 
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

Distills the essential track data from all RPs.

Definition at line 28 of file CTPPSLocalTrackLiteProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 49 of file CTPPSLocalTrackLiteProducer.cc.

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

49  :
50  doNothing_( iConfig.getParameter<bool>( "doNothing" ) )
51 {
52  if ( doNothing_ ) return;
53 
54  siStripTrackToken_ = consumes< edm::DetSetVector<TotemRPLocalTrack> > ( iConfig.getParameter<edm::InputTag>("tagSiStripTrack") );
55  diamondTrackToken_ = consumes< edm::DetSetVector<CTPPSDiamondLocalTrack> >( iConfig.getParameter<edm::InputTag>("tagDiamondTrack") );
56  auto tagPixelTrack = iConfig.getParameter<edm::InputTag>("tagPixelTrack");
57  if (not tagPixelTrack.label().empty()){
58  pixelTrackToken_ = consumes< edm::DetSetVector<CTPPSPixelLocalTrack> > (tagPixelTrack);
59  }
60 
61 
62  produces< std::vector<CTPPSLocalTrackLite> >();
63 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > pixelTrackToken_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > diamondTrackToken_
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > siStripTrackToken_
CTPPSLocalTrackLiteProducer::~CTPPSLocalTrackLiteProducer ( )
inlineoverride

Definition at line 32 of file CTPPSLocalTrackLiteProducer.cc.

References fillDescriptions(), and produce().

32 {}

Member Function Documentation

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

Definition at line 130 of file CTPPSLocalTrackLiteProducer.cc.

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

Referenced by ~CTPPSLocalTrackLiteProducer().

131 {
133 
134  desc.add<edm::InputTag>( "tagSiStripTrack", edm::InputTag( "totemRPLocalTrackFitter" ) )
135  ->setComment( "input TOTEM strips' local tracks collection to retrieve" );
136  desc.add<edm::InputTag>( "tagDiamondTrack", edm::InputTag( "ctppsDiamondLocalTracks" ) )
137  ->setComment( "input diamond detectors' local tracks collection to retrieve" );
138  desc.add<edm::InputTag>( "tagPixelTrack" , edm::InputTag( "ctppsPixelLocalTracks" ) )
139  ->setComment( "input pixel detectors' local tracks collection to retrieve" );
140  desc.add<bool>( "doNothing", true ) // disable the module by default
141  ->setComment( "disable the module" );
142 
143  descr.add( "ctppsLocalTrackLiteDefaultProducer", desc );
144 }
ParameterDescriptionBase * add(U const &iLabel, T const &value)
void add(std::string const &label, ParameterSetDescription const &psetDescription)
void CTPPSLocalTrackLiteProducer::produce ( edm::Event iEvent,
const edm::EventSetup  
)
override

Definition at line 68 of file CTPPSLocalTrackLiteProducer.cc.

References diamondTrackToken_, doNothing_, edm::Event::getByToken(), edm::EDGetTokenT< T >::isUninitialized(), eostools::move(), pixelTrackToken_, edm::Event::put(), and siStripTrackToken_.

Referenced by ~CTPPSLocalTrackLiteProducer().

69 {
70  if ( doNothing_ )
71  return;
72 
73 // prepare output
74  std::unique_ptr< std::vector<CTPPSLocalTrackLite> > pOut( new std::vector<CTPPSLocalTrackLite>() );
75 
76 //----- TOTEM strips
77 
78 // get input from Si strips
80  iEvent.getByToken( siStripTrackToken_, inputSiStripTracks );
81 
82 // process tracks from Si strips
83  for ( const auto& rpv : *inputSiStripTracks ) {
84  const uint32_t rpId = rpv.detId();
85  for ( const auto& trk : rpv ) {
86  if ( !trk.isValid() ) continue;
87  pOut->emplace_back( rpId, trk.getX0(), trk.getX0Sigma(), trk.getY0(), trk.getY0Sigma() );
88  }
89  }
90 
91 //----- diamond detectors
92 
93 // get input from diamond detectors
95  iEvent.getByToken( diamondTrackToken_, inputDiamondTracks );
96 
97 // process tracks from diamond detectors
98  for ( const auto& rpv : *inputDiamondTracks ) {
99  const unsigned int rpId = rpv.detId();
100  for ( const auto& trk : rpv ) {
101  if ( !trk.isValid() ) continue;
102  pOut->emplace_back( rpId, trk.getX0(), trk.getX0Sigma(), trk.getY0(), trk.getY0Sigma(), trk.getT() );
103  }
104  }
105 
106 
107 //----- pixel detectors
108 
109 // get input from pixel detectors
112  iEvent.getByToken( pixelTrackToken_, inputPixelTracks );
113 
114  // process tracks from pixels
115  for ( const auto& rpv : *inputPixelTracks ) {
116  const uint32_t rpId = rpv.detId();
117  for ( const auto& trk : rpv ) {
118  if ( !trk.isValid() ) continue;
119  pOut->emplace_back( rpId, trk.getX0(), trk.getX0Sigma(), trk.getY0(), trk.getY0Sigma() );
120  }
121  }
122  }
123 // save output to event
124  iEvent.put( std::move( pOut ) );
125 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:136
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:519
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > pixelTrackToken_
bool isUninitialized() const
Definition: EDGetToken.h:73
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 39 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 44 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

edm::EDGetTokenT< edm::DetSetVector<CTPPSPixelLocalTrack> > CTPPSLocalTrackLiteProducer::pixelTrackToken_
private

Definition at line 40 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

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

Definition at line 38 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().