CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
List of all members | Public Member Functions | Static Public Member Functions | Private Attributes | Static 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
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
 EDProducer (const EDProducer &)=delete
 
bool hasAbilityToProduceInBeginLumis () const final
 
bool hasAbilityToProduceInBeginProcessBlocks () const final
 
bool hasAbilityToProduceInBeginRuns () const final
 
bool hasAbilityToProduceInEndLumis () const final
 
bool hasAbilityToProduceInEndProcessBlocks () const final
 
bool hasAbilityToProduceInEndRuns () const final
 
const EDProduceroperator= (const EDProducer &)=delete
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &)
 

Private Attributes

edm::EDGetTokenT
< edm::DetSetVector
< CTPPSDiamondLocalTrack > > 
diamondTrackToken_
 
bool includeDiamonds_
 
bool includePixels_
 
bool includeStrips_
 
edm::EDGetTokenT
< edm::DetSetVector
< CTPPSPixelLocalTrack > > 
pixelTrackToken_
 
double pixelTrackTxMax_
 
double pixelTrackTxMin_
 
double pixelTrackTyMax_
 
double pixelTrackTyMin_
 
edm::EDGetTokenT
< edm::DetSetVector
< TotemRPLocalTrack > > 
siStripTrackToken_
 
double timingTrackTMax_
 
double timingTrackTMin_
 

Static Private Attributes

static constexpr float HPTDC_TIME_SLICE_WIDTH = 25.
 HPTDC time slice width, in ns. More...
 

Additional Inherited Members

- Public Types inherited from edm::stream::EDProducer<>
using CacheTypes = CacheContexts< T...>
 
using GlobalCache = typename CacheTypes::GlobalCache
 
using HasAbility = AbilityChecker< T...>
 
using InputProcessBlockCache = typename CacheTypes::InputProcessBlockCache
 
using LuminosityBlockCache = typename CacheTypes::LuminosityBlockCache
 
using LuminosityBlockContext = LuminosityBlockContextT< LuminosityBlockCache, RunCache, GlobalCache >
 
using LuminosityBlockSummaryCache = typename CacheTypes::LuminosityBlockSummaryCache
 
using RunCache = typename CacheTypes::RunCache
 
using RunContext = RunContextT< RunCache, GlobalCache >
 
using RunSummaryCache = typename CacheTypes::RunSummaryCache
 

Detailed Description

Distills the essential track data from all RPs.

Definition at line 31 of file CTPPSLocalTrackLiteProducer.cc.

Constructor & Destructor Documentation

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

Definition at line 57 of file CTPPSLocalTrackLiteProducer.cc.

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

58  : includeStrips_(iConfig.getParameter<bool>("includeStrips")),
59  includeDiamonds_(iConfig.getParameter<bool>("includeDiamonds")),
60  includePixels_(iConfig.getParameter<bool>("includePixels")),
61  pixelTrackTxMin_(iConfig.getParameter<double>("pixelTrackTxMin")),
62  pixelTrackTxMax_(iConfig.getParameter<double>("pixelTrackTxMax")),
63  pixelTrackTyMin_(iConfig.getParameter<double>("pixelTrackTyMin")),
64  pixelTrackTyMax_(iConfig.getParameter<double>("pixelTrackTyMax")),
65  timingTrackTMin_(iConfig.getParameter<double>("timingTrackTMin")),
66  timingTrackTMax_(iConfig.getParameter<double>("timingTrackTMax")) {
67  auto tagSiStripTrack = iConfig.getParameter<edm::InputTag>("tagSiStripTrack");
68  if (!tagSiStripTrack.label().empty())
69  siStripTrackToken_ = consumes<edm::DetSetVector<TotemRPLocalTrack>>(tagSiStripTrack);
70 
71  auto tagDiamondTrack = iConfig.getParameter<edm::InputTag>("tagDiamondTrack");
72  if (!tagDiamondTrack.label().empty())
74 
75  auto tagPixelTrack = iConfig.getParameter<edm::InputTag>("tagPixelTrack");
76  if (!tagPixelTrack.label().empty())
78 
79  produces<CTPPSLocalTrackLiteCollection>();
80 }
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > diamondTrackToken_
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > pixelTrackToken_
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > siStripTrackToken_

Member Function Documentation

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

Definition at line 237 of file CTPPSLocalTrackLiteProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), submitPVResolutionJobs::desc, HLT_FULL_cff::InputTag, and edm::ParameterDescriptionNode::setComment().

237  {
239 
240  // By default: all includeXYZ flags set to false.
241  // The includeXYZ are switched on when the "ctpps" era modifier is declared in
242  // python config, see:
243  // RecoPPS/Local/python/ctppsLocalTrackLiteProducer_cff.py
244 
245  desc.add<bool>("includeStrips", false)->setComment("whether tracks from Si strips should be included");
246  desc.add<edm::InputTag>("tagSiStripTrack", edm::InputTag("totemRPLocalTrackFitter"))
247  ->setComment("input TOTEM strips' local tracks collection to retrieve");
248 
249  desc.add<bool>("includeDiamonds", false)->setComment("whether tracks from diamonds strips should be included");
250  desc.add<edm::InputTag>("tagDiamondTrack", edm::InputTag("ctppsDiamondLocalTracks"))
251  ->setComment("input diamond detectors' local tracks collection to retrieve");
252 
253  desc.add<bool>("includePixels", false)->setComment("whether tracks from pixels should be included");
254  desc.add<edm::InputTag>("tagPixelTrack", edm::InputTag("ctppsPixelLocalTracks"))
255  ->setComment("input pixel detectors' local tracks collection to retrieve");
256  desc.add<double>("timingTrackTMin", -12.5)->setComment("minimal track time selection for timing detectors, in ns");
257  desc.add<double>("timingTrackTMax", +12.5)->setComment("maximal track time selection for timing detectors, in ns");
258 
259  desc.add<double>("pixelTrackTxMin", -10.0);
260  desc.add<double>("pixelTrackTxMax", 10.0);
261  desc.add<double>("pixelTrackTyMin", -10.0);
262  desc.add<double>("pixelTrackTyMax", 10.0);
263 
264  descr.add("ctppsLocalTrackLiteDefaultProducer", desc);
265 }
void setComment(std::string const &value)
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 84 of file CTPPSLocalTrackLiteProducer.cc.

References diamondTrackToken_, edm::Event::getByToken(), HPTDC_TIME_SLICE_WIDTH, includeDiamonds_, includePixels_, includeStrips_, invalid, edm::EDGetTokenT< T >::isUninitialized(), eostools::move(), pixelTrackToken_, pixelTrackTxMax_, pixelTrackTxMin_, pixelTrackTyMax_, pixelTrackTyMin_, edm::Event::put(), siStripTrackToken_, and timingTrackTMax_.

84  {
85  // prepare output
86  auto pOut = std::make_unique<CTPPSLocalTrackLiteCollection>();
87 
88  //----- TOTEM strips
89 
90  // get input from Si strips
91  if (includeStrips_) {
93  iEvent.getByToken(siStripTrackToken_, inputSiStripTracks);
94 
95  // process tracks from Si strips
96  for (const auto &rpv : *inputSiStripTracks) {
97  const uint32_t rpId = rpv.detId();
98  for (const auto &trk : rpv) {
99  if (!trk.isValid())
100  continue;
101 
102  float roundedX0 = MiniFloatConverter::reduceMantissaToNbitsRounding<14>(trk.x0());
103  float roundedX0Sigma = MiniFloatConverter::reduceMantissaToNbitsRounding<8>(trk.x0Sigma());
104  float roundedY0 = MiniFloatConverter::reduceMantissaToNbitsRounding<13>(trk.y0());
105  float roundedY0Sigma = MiniFloatConverter::reduceMantissaToNbitsRounding<8>(trk.y0Sigma());
106  float roundedTx = MiniFloatConverter::reduceMantissaToNbitsRounding<11>(trk.tx());
107  float roundedTxSigma = MiniFloatConverter::reduceMantissaToNbitsRounding<8>(trk.txSigma());
108  float roundedTy = MiniFloatConverter::reduceMantissaToNbitsRounding<11>(trk.ty());
109  float roundedTySigma = MiniFloatConverter::reduceMantissaToNbitsRounding<8>(trk.tySigma());
110  float roundedChiSquaredOverNDF = MiniFloatConverter::reduceMantissaToNbitsRounding<8>(trk.chiSquaredOverNDF());
111 
112  pOut->emplace_back(rpId, // detector info
113  // spatial info
114  roundedX0,
115  roundedX0Sigma,
116  roundedY0,
117  roundedY0Sigma,
118  // angular info
119  roundedTx,
120  roundedTxSigma,
121  roundedTy,
122  roundedTySigma,
123  // reconstruction info
124  roundedChiSquaredOverNDF,
126  trk.numberOfPointsUsedForFit(),
127  // timing info
128  0.,
129  0.);
130  }
131  }
132  }
133 
134  //----- diamond detectors
135 
136  if (includeDiamonds_) {
137  // get input from diamond detectors
139  iEvent.getByToken(diamondTrackToken_, inputDiamondTracks);
140 
141  // process tracks from diamond detectors
142  for (const auto &rpv : *inputDiamondTracks) {
143  const unsigned int rpId = rpv.detId();
144  for (const auto &trk : rpv) {
145  if (!trk.isValid())
146  continue;
147 
148  const float abs_time = trk.time() + trk.ootIndex() * HPTDC_TIME_SLICE_WIDTH;
149  if (abs_time < timingTrackTMin_ || abs_time > timingTrackTMax_)
150  continue;
151 
152  float roundedX0 = MiniFloatConverter::reduceMantissaToNbitsRounding<16>(trk.x0());
153  float roundedX0Sigma = MiniFloatConverter::reduceMantissaToNbitsRounding<8>(trk.x0Sigma());
154  float roundedY0 = MiniFloatConverter::reduceMantissaToNbitsRounding<13>(trk.y0());
155  float roundedY0Sigma = MiniFloatConverter::reduceMantissaToNbitsRounding<8>(trk.y0Sigma());
156  float roundedT = MiniFloatConverter::reduceMantissaToNbitsRounding<16>(abs_time);
157  float roundedTSigma = MiniFloatConverter::reduceMantissaToNbitsRounding<13>(trk.timeSigma());
158 
159  pOut->emplace_back(rpId, // detector info
160  // spatial info
161  roundedX0,
162  roundedX0Sigma,
163  roundedY0,
164  roundedY0Sigma,
165  // angular info
166  0.,
167  0.,
168  0.,
169  0.,
170  // reconstruction info
171  0.,
173  trk.numberOfPlanes(),
174  // timing info
175  roundedT,
176  roundedTSigma);
177  }
178  }
179  }
180 
181  //----- pixel detectors
182 
183  if (includePixels_) {
186  iEvent.getByToken(pixelTrackToken_, inputPixelTracks);
187 
188  // process tracks from pixels
189  for (const auto &rpv : *inputPixelTracks) {
190  const uint32_t rpId = rpv.detId();
191  for (const auto &trk : rpv) {
192  if (!trk.isValid())
193  continue;
194  if (trk.tx() > pixelTrackTxMin_ && trk.tx() < pixelTrackTxMax_ && trk.ty() > pixelTrackTyMin_ &&
195  trk.ty() < pixelTrackTyMax_) {
196  float roundedX0 = MiniFloatConverter::reduceMantissaToNbitsRounding<16>(trk.x0());
197  float roundedX0Sigma = MiniFloatConverter::reduceMantissaToNbitsRounding<8>(trk.x0Sigma());
198  float roundedY0 = MiniFloatConverter::reduceMantissaToNbitsRounding<13>(trk.y0());
199  float roundedY0Sigma = MiniFloatConverter::reduceMantissaToNbitsRounding<8>(trk.y0Sigma());
200  float roundedTx = MiniFloatConverter::reduceMantissaToNbitsRounding<11>(trk.tx());
201  float roundedTxSigma = MiniFloatConverter::reduceMantissaToNbitsRounding<8>(trk.txSigma());
202  float roundedTy = MiniFloatConverter::reduceMantissaToNbitsRounding<11>(trk.ty());
203  float roundedTySigma = MiniFloatConverter::reduceMantissaToNbitsRounding<8>(trk.tySigma());
204  float roundedChiSquaredOverNDF =
205  MiniFloatConverter::reduceMantissaToNbitsRounding<8>(trk.chiSquaredOverNDF());
206 
207  pOut->emplace_back(rpId, // detector info
208  // spatial info
209  roundedX0,
210  roundedX0Sigma,
211  roundedY0,
212  roundedY0Sigma,
213  // angular info
214  roundedTx,
215  roundedTxSigma,
216  roundedTy,
217  roundedTySigma,
218  // reconstruction info
219  roundedChiSquaredOverNDF,
220  trk.recoInfo(),
221  trk.numberOfPointsUsedForFit(),
222  // timing info
223  0.,
224  0.);
225  }
226  }
227  }
228  }
229  }
230 
231  // save output to event
232  iEvent.put(std::move(pOut));
233 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:133
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:539
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:99
static constexpr float HPTDC_TIME_SLICE_WIDTH
HPTDC time slice width, in ns.
def move
Definition: eostools.py:511
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > diamondTrackToken_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > pixelTrackToken_
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > siStripTrackToken_

Member Data Documentation

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

Definition at line 46 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

constexpr float CTPPSLocalTrackLiteProducer::HPTDC_TIME_SLICE_WIDTH = 25.
staticprivate

HPTDC time slice width, in ns.

Definition at line 40 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

bool CTPPSLocalTrackLiteProducer::includeDiamonds_
private

Definition at line 45 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

bool CTPPSLocalTrackLiteProducer::includePixels_
private

Definition at line 48 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

bool CTPPSLocalTrackLiteProducer::includeStrips_
private

Definition at line 42 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

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

Definition at line 49 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

double CTPPSLocalTrackLiteProducer::pixelTrackTxMax_
private

Definition at line 51 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

double CTPPSLocalTrackLiteProducer::pixelTrackTxMin_
private

Definition at line 51 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

double CTPPSLocalTrackLiteProducer::pixelTrackTyMax_
private

Definition at line 51 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

double CTPPSLocalTrackLiteProducer::pixelTrackTyMin_
private

Definition at line 51 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

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

Definition at line 43 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

double CTPPSLocalTrackLiteProducer::timingTrackTMax_
private

Definition at line 52 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

double CTPPSLocalTrackLiteProducer::timingTrackTMin_
private

Definition at line 52 of file CTPPSLocalTrackLiteProducer.cc.