CMS 3D CMS Logo

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 30 of file CTPPSLocalTrackLiteProducer.cc.

Constructor & Destructor Documentation

◆ CTPPSLocalTrackLiteProducer()

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

Definition at line 56 of file CTPPSLocalTrackLiteProducer.cc.

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

Member Function Documentation

◆ fillDescriptions()

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

Definition at line 236 of file CTPPSLocalTrackLiteProducer.cc.

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

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

◆ produce()

void CTPPSLocalTrackLiteProducer::produce ( edm::Event iEvent,
const edm::EventSetup  
)
override

Definition at line 83 of file CTPPSLocalTrackLiteProducer.cc.

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

References diamondTrackToken_, HPTDC_TIME_SLICE_WIDTH, iEvent, includeDiamonds_, includePixels_, includeStrips_, invalid, edm::EDGetTokenT< T >::isUninitialized(), eostools::move(), pixelTrackToken_, pixelTrackTxMax_, pixelTrackTxMin_, pixelTrackTyMax_, pixelTrackTyMin_, L1TrackObjectNtupleMaker_cfg::pOut, profile_2016_postTS2_cff::rpId, siStripTrackToken_, and timingTrackTMax_.

Member Data Documentation

◆ diamondTrackToken_

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

Definition at line 51 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

◆ HPTDC_TIME_SLICE_WIDTH

constexpr float CTPPSLocalTrackLiteProducer::HPTDC_TIME_SLICE_WIDTH = 25.
staticconstexprprivate

HPTDC time slice width, in ns.

Definition at line 45 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

◆ includeDiamonds_

bool CTPPSLocalTrackLiteProducer::includeDiamonds_
private

Definition at line 50 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

◆ includePixels_

bool CTPPSLocalTrackLiteProducer::includePixels_
private

Definition at line 53 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

◆ includeStrips_

bool CTPPSLocalTrackLiteProducer::includeStrips_
private

Definition at line 47 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

◆ pixelTrackToken_

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

Definition at line 54 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

◆ pixelTrackTxMax_

double CTPPSLocalTrackLiteProducer::pixelTrackTxMax_
private

Definition at line 56 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

◆ pixelTrackTxMin_

double CTPPSLocalTrackLiteProducer::pixelTrackTxMin_
private

Definition at line 56 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

◆ pixelTrackTyMax_

double CTPPSLocalTrackLiteProducer::pixelTrackTyMax_
private

Definition at line 56 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

◆ pixelTrackTyMin_

double CTPPSLocalTrackLiteProducer::pixelTrackTyMin_
private

Definition at line 56 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

◆ siStripTrackToken_

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

Definition at line 48 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

◆ timingTrackTMax_

double CTPPSLocalTrackLiteProducer::timingTrackTMax_
private

Definition at line 57 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

◆ timingTrackTMin_

double CTPPSLocalTrackLiteProducer::timingTrackTMin_
private

Definition at line 57 of file CTPPSLocalTrackLiteProducer.cc.

edm::DetSetVector
Definition: DetSetVector.h:61
CTPPSLocalTrackLiteProducer::siStripTrackToken_
edm::EDGetTokenT< edm::DetSetVector< TotemRPLocalTrack > > siStripTrackToken_
Definition: CTPPSLocalTrackLiteProducer.cc:48
CTPPSLocalTrackLiteProducer::HPTDC_TIME_SLICE_WIDTH
static constexpr float HPTDC_TIME_SLICE_WIDTH
HPTDC time slice width, in ns.
Definition: CTPPSLocalTrackLiteProducer.cc:45
CTPPSLocalTrackLiteProducer::pixelTrackTxMin_
double pixelTrackTxMin_
Definition: CTPPSLocalTrackLiteProducer.cc:56
CTPPSLocalTrackLiteProducer::timingTrackTMax_
double timingTrackTMax_
Definition: CTPPSLocalTrackLiteProducer.cc:57
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89301
edm::ParameterSetDescription
Definition: ParameterSetDescription.h:52
CTPPSLocalTrackLiteProducer::diamondTrackToken_
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > diamondTrackToken_
Definition: CTPPSLocalTrackLiteProducer.cc:51
edm::EDGetTokenT::isUninitialized
constexpr bool isUninitialized() const noexcept
Definition: EDGetToken.h:99
L1TrackObjectNtupleMaker_cfg.pOut
pOut
Definition: L1TrackObjectNtupleMaker_cfg.py:172
CTPPSLocalTrackLiteProducer::pixelTrackTyMin_
double pixelTrackTyMin_
Definition: CTPPSLocalTrackLiteProducer.cc:56
CTPPSLocalTrackLiteProducer::includePixels_
bool includePixels_
Definition: CTPPSLocalTrackLiteProducer.cc:53
CTPPSpixelLocalTrackReconstructionInfo::invalid
CTPPSLocalTrackLiteProducer::timingTrackTMin_
double timingTrackTMin_
Definition: CTPPSLocalTrackLiteProducer.cc:57
edm::Handle
Definition: AssociativeIterator.h:50
ctppsLocalTrackLiteProducer_cff.tagPixelTrack
tagPixelTrack
Definition: ctppsLocalTrackLiteProducer_cff.py:18
edm::ConfigurationDescriptions::add
void add(std::string const &label, ParameterSetDescription const &psetDescription)
Definition: ConfigurationDescriptions.cc:57
CTPPSLocalTrackLiteProducer::pixelTrackToken_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > pixelTrackToken_
Definition: CTPPSLocalTrackLiteProducer.cc:54
CTPPSLocalTrackLiteProducer::includeStrips_
bool includeStrips_
Definition: CTPPSLocalTrackLiteProducer.cc:47
iEvent
int iEvent
Definition: GenABIO.cc:224
profile_2016_postTS2_cff.rpId
rpId
Definition: profile_2016_postTS2_cff.py:21
CTPPSLocalTrackLiteProducer::pixelTrackTxMax_
double pixelTrackTxMax_
Definition: CTPPSLocalTrackLiteProducer.cc:56
submitPVResolutionJobs.desc
string desc
Definition: submitPVResolutionJobs.py:251
eostools.move
def move(src, dest)
Definition: eostools.py:511
CTPPSLocalTrackLiteProducer::includeDiamonds_
bool includeDiamonds_
Definition: CTPPSLocalTrackLiteProducer.cc:50
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
edm::InputTag
Definition: InputTag.h:15
CTPPSLocalTrackLiteProducer::pixelTrackTyMax_
double pixelTrackTyMax_
Definition: CTPPSLocalTrackLiteProducer.cc:56