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_
 
bool includeDiamonds_
 
bool includePixels_
 
bool includeStrips_
 
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 56 of file CTPPSLocalTrackLiteProducer.cc.

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

56  :
57  doNothing_( iConfig.getParameter<bool>( "doNothing" ) )
58 {
59  if ( doNothing_ ) return;
60 
61  includeStrips_ = iConfig.getParameter<bool>("includeStrips");
62  siStripTrackToken_ = consumes< edm::DetSetVector<TotemRPLocalTrack> > ( iConfig.getParameter<edm::InputTag>("tagSiStripTrack") );
63 
64  includeDiamonds_ = iConfig.getParameter<bool>("includeDiamonds");
65  diamondTrackToken_ = consumes< edm::DetSetVector<CTPPSDiamondLocalTrack> >( iConfig.getParameter<edm::InputTag>("tagDiamondTrack") );
66 
67  includePixels_ = iConfig.getParameter<bool>("includePixels");
68  auto tagPixelTrack = iConfig.getParameter<edm::InputTag>("tagPixelTrack");
69  if (not tagPixelTrack.label().empty()){
70  pixelTrackToken_ = consumes< edm::DetSetVector<CTPPSPixelLocalTrack> > (tagPixelTrack);
71  }
72 
73  pixelTrackTxRange_ = iConfig.getParameter<std::vector<double> >("pixelTrackTxRange");
74  pixelTrackTyRange_ = iConfig.getParameter<std::vector<double> >("pixelTrackTyRange");
75  produces< std::vector<CTPPSLocalTrackLite> >();
76 }
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 157 of file CTPPSLocalTrackLiteProducer.cc.

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

Referenced by ~CTPPSLocalTrackLiteProducer().

158 {
160 
161  desc.add<bool>("includeStrips", true)->setComment("whether tracks from Si strips should be included");
162  desc.add<edm::InputTag>( "tagSiStripTrack", edm::InputTag( "totemRPLocalTrackFitter" ) )
163  ->setComment( "input TOTEM strips' local tracks collection to retrieve" );
164 
165  desc.add<bool>("includeDiamonds", true)->setComment("whether tracks from diamonds strips should be included");
166  desc.add<edm::InputTag>( "tagDiamondTrack", edm::InputTag( "ctppsDiamondLocalTracks" ) )
167  ->setComment( "input diamond detectors' local tracks collection to retrieve" );
168 
169  desc.add<bool>("includePixels", true)->setComment("whether tracks from pixels should be included");
170  desc.add<edm::InputTag>( "tagPixelTrack" , edm::InputTag( "ctppsPixelLocalTracks" ) )
171  ->setComment( "input pixel detectors' local tracks collection to retrieve" );
172  desc.add<bool>( "doNothing", true ) // disable the module by default
173  ->setComment( "disable the module" );
174 
175  desc.add<std::vector<double> >("pixelTrackTxRange",std::vector<double>({-0.03,0.03}) );
176  desc.add<std::vector<double> >("pixelTrackTyRange",std::vector<double>({-0.04,0.04}) );
177 
178  descr.add( "ctppsLocalTrackLiteDefaultProducer", desc );
179 }
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 81 of file CTPPSLocalTrackLiteProducer.cc.

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

Referenced by ~CTPPSLocalTrackLiteProducer().

82 {
83  if ( doNothing_ )
84  return;
85 
86  // prepare output
87  std::unique_ptr< std::vector<CTPPSLocalTrackLite> > pOut( new std::vector<CTPPSLocalTrackLite>() );
88 
89  //----- TOTEM strips
90 
91  // get input from Si strips
92  if (includeStrips_)
93  {
95  iEvent.getByToken( siStripTrackToken_, inputSiStripTracks );
96 
97  // process tracks from Si strips
98  for ( const auto& rpv : *inputSiStripTracks ) {
99  const uint32_t 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() );
103  }
104  }
105  }
106 
107  //----- diamond detectors
108 
109  if (includeDiamonds_)
110  {
111  // get input from diamond detectors
113  iEvent.getByToken( diamondTrackToken_, inputDiamondTracks );
114 
115  // process tracks from diamond detectors
116  for ( const auto& rpv : *inputDiamondTracks ) {
117  const unsigned int rpId = rpv.detId();
118  for ( const auto& trk : rpv ) {
119  if ( !trk.isValid() ) continue;
120  pOut->emplace_back( rpId, trk.getX0(), trk.getX0Sigma(), trk.getY0(), trk.getY0Sigma(), trk.getT() );
121  }
122  }
123  }
124 
125 
126  //----- pixel detectors
127 
128  if (includePixels_)
129  {
130  // get input from pixel detectors
131  if(pixelTrackTxRange_.size() != 2 || pixelTrackTyRange_.size() != 2) throw cms::Exception("CTPPSLocalTrackLiteProducer")
132  << "Wrong number of parameters in pixel track Tx/Ty range";
135  iEvent.getByToken( pixelTrackToken_, inputPixelTracks );
136 
137  // process tracks from pixels
138  for ( const auto& rpv : *inputPixelTracks ) {
139  const uint32_t rpId = rpv.detId();
140  for ( const auto& trk : rpv ) {
141  if ( !trk.isValid() ) continue;
142  if(trk.getTx()>pixelTrackTxRange_.at(0) && trk.getTx()<pixelTrackTxRange_.at(1)
143  && trk.getTy()>pixelTrackTyRange_.at(0) && trk.getTy()<pixelTrackTyRange_.at(1) )
144  pOut->emplace_back( rpId, trk.getX0(), trk.getX0Sigma(), trk.getY0(), trk.getY0Sigma() );
145  }
146  }
147  }
148  }
149 
150  // save output to event
151  iEvent.put( std::move( pOut ) );
152 }
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:511

Member Data Documentation

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

Definition at line 42 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 51 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

bool CTPPSLocalTrackLiteProducer::includeDiamonds_
private

Definition at line 41 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

bool CTPPSLocalTrackLiteProducer::includePixels_
private

Definition at line 44 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

bool CTPPSLocalTrackLiteProducer::includeStrips_
private

Definition at line 38 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

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

Definition at line 45 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

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

Definition at line 47 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

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

Definition at line 48 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

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

Definition at line 39 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().