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_
 
std::vector< double > pixelTrackTxRange_
 
std::vector< double > pixelTrackTyRange_
 
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 51 of file CTPPSLocalTrackLiteProducer.cc.

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

51  :
52  doNothing_( iConfig.getParameter<bool>( "doNothing" ) )
53 {
54  if ( doNothing_ ) return;
55 
56  siStripTrackToken_ = consumes< edm::DetSetVector<TotemRPLocalTrack> > ( iConfig.getParameter<edm::InputTag>("tagSiStripTrack") );
57  diamondTrackToken_ = consumes< edm::DetSetVector<CTPPSDiamondLocalTrack> >( iConfig.getParameter<edm::InputTag>("tagDiamondTrack") );
58  auto tagPixelTrack = iConfig.getParameter<edm::InputTag>("tagPixelTrack");
59  if (not tagPixelTrack.label().empty()){
60  pixelTrackToken_ = consumes< edm::DetSetVector<CTPPSPixelLocalTrack> > (tagPixelTrack);
61  }
62 
63  pixelTrackTxRange_ = iConfig.getParameter<std::vector<double> >("pixelTrackTxRange");
64  pixelTrackTyRange_ = iConfig.getParameter<std::vector<double> >("pixelTrackTyRange");
65  produces< std::vector<CTPPSLocalTrackLite> >();
66 }
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 137 of file CTPPSLocalTrackLiteProducer.cc.

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

Referenced by ~CTPPSLocalTrackLiteProducer().

138 {
140 
141  desc.add<edm::InputTag>( "tagSiStripTrack", edm::InputTag( "totemRPLocalTrackFitter" ) )
142  ->setComment( "input TOTEM strips' local tracks collection to retrieve" );
143  desc.add<edm::InputTag>( "tagDiamondTrack", edm::InputTag( "ctppsDiamondLocalTracks" ) )
144  ->setComment( "input diamond detectors' local tracks collection to retrieve" );
145  desc.add<edm::InputTag>( "tagPixelTrack" , edm::InputTag( "ctppsPixelLocalTracks" ) )
146  ->setComment( "input pixel detectors' local tracks collection to retrieve" );
147  desc.add<bool>( "doNothing", true ) // disable the module by default
148  ->setComment( "disable the module" );
149 
150  desc.add<std::vector<double> >("pixelTrackTxRange",std::vector<double>({-0.03,0.03}) );
151  desc.add<std::vector<double> >("pixelTrackTyRange",std::vector<double>({-0.04,0.04}) );
152 
153  descr.add( "ctppsLocalTrackLiteDefaultProducer", desc );
154 }
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 71 of file CTPPSLocalTrackLiteProducer.cc.

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

Referenced by ~CTPPSLocalTrackLiteProducer().

72 {
73  if ( doNothing_ )
74  return;
75 
76 // prepare output
77  std::unique_ptr< std::vector<CTPPSLocalTrackLite> > pOut( new std::vector<CTPPSLocalTrackLite>() );
78 
79 //----- TOTEM strips
80 
81 // get input from Si strips
83  iEvent.getByToken( siStripTrackToken_, inputSiStripTracks );
84 
85 // process tracks from Si strips
86  for ( const auto& rpv : *inputSiStripTracks ) {
87  const uint32_t rpId = rpv.detId();
88  for ( const auto& trk : rpv ) {
89  if ( !trk.isValid() ) continue;
90  pOut->emplace_back( rpId, trk.getX0(), trk.getX0Sigma(), trk.getY0(), trk.getY0Sigma() );
91  }
92  }
93 
94 //----- diamond detectors
95 
96 // get input from diamond detectors
98  iEvent.getByToken( diamondTrackToken_, inputDiamondTracks );
99 
100 // process tracks from diamond detectors
101  for ( const auto& rpv : *inputDiamondTracks ) {
102  const unsigned int rpId = rpv.detId();
103  for ( const auto& trk : rpv ) {
104  if ( !trk.isValid() ) continue;
105  pOut->emplace_back( rpId, trk.getX0(), trk.getX0Sigma(), trk.getY0(), trk.getY0Sigma(), trk.getT() );
106  }
107  }
108 
109 
110 //----- pixel detectors
111 
112 // get input from pixel detectors
113  if(pixelTrackTxRange_.size() != 2 || pixelTrackTyRange_.size() != 2) throw cms::Exception("CTPPSLocalTrackLiteProducer")
114  << "Wrong number of parameters in pixel track Tx/Ty range";
117  iEvent.getByToken( pixelTrackToken_, inputPixelTracks );
118 
119  // process tracks from pixels
120  for ( const auto& rpv : *inputPixelTracks ) {
121  const uint32_t rpId = rpv.detId();
122  for ( const auto& trk : rpv ) {
123  if ( !trk.isValid() ) continue;
124  if(trk.getTx()>pixelTrackTxRange_.at(0) && trk.getTx()<pixelTrackTxRange_.at(1)
125  && trk.getTy()>pixelTrackTyRange_.at(0) && trk.getTy()<pixelTrackTyRange_.at(1) )
126  pOut->emplace_back( rpId, trk.getX0(), trk.getX0Sigma(), trk.getY0(), trk.getY0Sigma() );
127  }
128  }
129  }
130 // save output to event
131  iEvent.put( std::move( pOut ) );
132 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:137
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:579
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 46 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().

std::vector<double> CTPPSLocalTrackLiteProducer::pixelTrackTxRange_
private

Definition at line 42 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

std::vector<double> CTPPSLocalTrackLiteProducer::pixelTrackTyRange_
private

Definition at line 43 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().