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

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
 
bool hasAbilityToProduceInLumis () const final
 
bool hasAbilityToProduceInRuns () const final
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

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
 

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