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
 
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 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 float HPTDC_TIME_SLICE_WIDTH = 25.
 HPTDC time slice width, in ns. More...
 

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

Constructor & Destructor Documentation

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

Definition at line 58 of file CTPPSLocalTrackLiteProducer.cc.

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

60  : includeStrips_(iConfig.getParameter<bool>("includeStrips")),
61  includeDiamonds_(iConfig.getParameter<bool>("includeDiamonds")),
62  includePixels_(iConfig.getParameter<bool>("includePixels")),
63  pixelTrackTxMin_(iConfig.getParameter<double>("pixelTrackTxMin")),
64  pixelTrackTxMax_(iConfig.getParameter<double>("pixelTrackTxMax")),
65  pixelTrackTyMin_(iConfig.getParameter<double>("pixelTrackTyMin")),
66  pixelTrackTyMax_(iConfig.getParameter<double>("pixelTrackTyMax")),
67  timingTrackTMin_(iConfig.getParameter<double>("timingTrackTMin")),
68  timingTrackTMax_(iConfig.getParameter<double>("timingTrackTMax")) {
69  auto tagSiStripTrack = iConfig.getParameter<edm::InputTag>("tagSiStripTrack");
70  if (!tagSiStripTrack.label().empty())
72  consumes<edm::DetSetVector<TotemRPLocalTrack>>(tagSiStripTrack);
73 
74  auto tagDiamondTrack = iConfig.getParameter<edm::InputTag>("tagDiamondTrack");
75  if (!tagDiamondTrack.label().empty())
77  consumes<edm::DetSetVector<CTPPSDiamondLocalTrack>>(tagDiamondTrack);
78 
79  auto tagPixelTrack = iConfig.getParameter<edm::InputTag>("tagPixelTrack");
80  if (!tagPixelTrack.label().empty())
83 
84  produces<CTPPSLocalTrackLiteCollection>();
85 }
T getParameter(std::string const &) const
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > diamondTrackToken_
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 264 of file CTPPSLocalTrackLiteProducer.cc.

References edm::ConfigurationDescriptions::add(), edm::ParameterSetDescription::add(), DEFINE_FWK_MODULE, and edm::ParameterDescriptionNode::setComment().

265  {
267 
268  // By default: all includeXYZ flags set to false.
269  // The includeXYZ are switched on when the "ctpps_2016" era is declared in
270  // python config, see:
271  // RecoCTPPS/TotemRPLocal/python/ctppsLocalTrackLiteProducer_cff.py
272 
273  desc.add<bool>("includeStrips", false)
274  ->setComment("whether tracks from Si strips should be included");
275  desc.add<edm::InputTag>("tagSiStripTrack",
276  edm::InputTag("totemRPLocalTrackFitter"))
277  ->setComment("input TOTEM strips' local tracks collection to retrieve");
278 
279  desc.add<bool>("includeDiamonds", false)
280  ->setComment("whether tracks from diamonds strips should be included");
281  desc.add<edm::InputTag>("tagDiamondTrack",
282  edm::InputTag("ctppsDiamondLocalTracks"))
283  ->setComment(
284  "input diamond detectors' local tracks collection to retrieve");
285 
286  desc.add<bool>("includePixels", false)
287  ->setComment("whether tracks from pixels should be included");
288  desc.add<edm::InputTag>("tagPixelTrack",
289  edm::InputTag("ctppsPixelLocalTracks"))
290  ->setComment(
291  "input pixel detectors' local tracks collection to retrieve");
292  desc.add<double>("timingTrackTMin", -12.5)
293  ->setComment("minimal track time selection for timing detectors, in ns");
294  desc.add<double>("timingTrackTMax", +12.5)
295  ->setComment("maximal track time selection for timing detectors, in ns");
296 
297  desc.add<double>("pixelTrackTxMin", -10.0);
298  desc.add<double>("pixelTrackTxMax", 10.0);
299  desc.add<double>("pixelTrackTyMin", -10.0);
300  desc.add<double>("pixelTrackTyMax", 10.0);
301 
302  descr.add("ctppsLocalTrackLiteDefaultProducer", desc);
303 }
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 89 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_.

90  {
91  // prepare output
92  auto pOut = std::make_unique<CTPPSLocalTrackLiteCollection>();
93 
94  //----- TOTEM strips
95 
96  // get input from Si strips
97  if (includeStrips_) {
99  iEvent.getByToken(siStripTrackToken_, inputSiStripTracks);
100 
101  // process tracks from Si strips
102  for (const auto &rpv : *inputSiStripTracks) {
103  const uint32_t rpId = rpv.detId();
104  for (const auto &trk : rpv) {
105  if (!trk.isValid())
106  continue;
107 
108  float roundedX0 =
109  MiniFloatConverter::reduceMantissaToNbitsRounding<14>(trk.getX0());
110  float roundedX0Sigma =
111  MiniFloatConverter::reduceMantissaToNbitsRounding<8>(
112  trk.getX0Sigma());
113  float roundedY0 =
114  MiniFloatConverter::reduceMantissaToNbitsRounding<13>(trk.getY0());
115  float roundedY0Sigma =
116  MiniFloatConverter::reduceMantissaToNbitsRounding<8>(
117  trk.getY0Sigma());
118  float roundedTx =
119  MiniFloatConverter::reduceMantissaToNbitsRounding<11>(trk.getTx());
120  float roundedTxSigma =
121  MiniFloatConverter::reduceMantissaToNbitsRounding<8>(
122  trk.getTxSigma());
123  float roundedTy =
124  MiniFloatConverter::reduceMantissaToNbitsRounding<11>(trk.getTy());
125  float roundedTySigma =
126  MiniFloatConverter::reduceMantissaToNbitsRounding<8>(
127  trk.getTySigma());
128  float roundedChiSquaredOverNDF =
129  MiniFloatConverter::reduceMantissaToNbitsRounding<8>(
130  trk.getChiSquaredOverNDF());
131 
132  pOut->emplace_back(rpId, // detector info
133  // spatial info
134  roundedX0, roundedX0Sigma, roundedY0, roundedY0Sigma,
135  // angular info
136  roundedTx, roundedTxSigma, roundedTy, roundedTySigma,
137  // reconstruction info
138  roundedChiSquaredOverNDF,
140  trk.getNumberOfPointsUsedForFit(),
141  // timing info
142  0., 0.);
143  }
144  }
145  }
146 
147  //----- diamond detectors
148 
149  if (includeDiamonds_) {
150  // get input from diamond detectors
152  iEvent.getByToken(diamondTrackToken_, inputDiamondTracks);
153 
154  // process tracks from diamond detectors
155  for (const auto &rpv : *inputDiamondTracks) {
156  const unsigned int rpId = rpv.detId();
157  for (const auto &trk : rpv) {
158  if (!trk.isValid())
159  continue;
160 
161  const float abs_time =
162  trk.getT() + trk.getOOTIndex() * HPTDC_TIME_SLICE_WIDTH;
163  if (abs_time < timingTrackTMin_ || abs_time > timingTrackTMax_)
164  continue;
165 
166  float roundedX0 =
167  MiniFloatConverter::reduceMantissaToNbitsRounding<16>(trk.getX0());
168  float roundedX0Sigma =
169  MiniFloatConverter::reduceMantissaToNbitsRounding<8>(
170  trk.getX0Sigma());
171  float roundedY0 =
172  MiniFloatConverter::reduceMantissaToNbitsRounding<13>(trk.getY0());
173  float roundedY0Sigma =
174  MiniFloatConverter::reduceMantissaToNbitsRounding<8>(
175  trk.getY0Sigma());
176  float roundedT =
177  MiniFloatConverter::reduceMantissaToNbitsRounding<16>(abs_time);
178  float roundedTSigma =
179  MiniFloatConverter::reduceMantissaToNbitsRounding<13>(
180  trk.getTSigma());
181 
182  pOut->emplace_back(rpId, // detector info
183  // spatial info
184  roundedX0, roundedX0Sigma, roundedY0, roundedY0Sigma,
185  // angular info
186  0., 0., 0., 0.,
187  // reconstruction info
189  trk.getNumOfPlanes(),
190  // timing info
191  roundedT, roundedTSigma);
192  }
193  }
194  }
195 
196  //----- pixel detectors
197 
198  if (includePixels_) {
201  iEvent.getByToken(pixelTrackToken_, inputPixelTracks);
202 
203  // process tracks from pixels
204  for (const auto &rpv : *inputPixelTracks) {
205  const uint32_t rpId = rpv.detId();
206  for (const auto &trk : rpv) {
207  if (!trk.isValid())
208  continue;
209  if (trk.getTx() > pixelTrackTxMin_ &&
210  trk.getTx() < pixelTrackTxMax_ &&
211  trk.getTy() > pixelTrackTyMin_ &&
212  trk.getTy() < pixelTrackTyMax_) {
213  float roundedX0 =
214  MiniFloatConverter::reduceMantissaToNbitsRounding<16>(
215  trk.getX0());
216  float roundedX0Sigma =
217  MiniFloatConverter::reduceMantissaToNbitsRounding<8>(
218  trk.getX0Sigma());
219  float roundedY0 =
220  MiniFloatConverter::reduceMantissaToNbitsRounding<13>(
221  trk.getY0());
222  float roundedY0Sigma =
223  MiniFloatConverter::reduceMantissaToNbitsRounding<8>(
224  trk.getY0Sigma());
225  float roundedTx =
226  MiniFloatConverter::reduceMantissaToNbitsRounding<11>(
227  trk.getTx());
228  float roundedTxSigma =
229  MiniFloatConverter::reduceMantissaToNbitsRounding<8>(
230  trk.getTxSigma());
231  float roundedTy =
232  MiniFloatConverter::reduceMantissaToNbitsRounding<11>(
233  trk.getTy());
234  float roundedTySigma =
235  MiniFloatConverter::reduceMantissaToNbitsRounding<8>(
236  trk.getTySigma());
237  float roundedChiSquaredOverNDF =
238  MiniFloatConverter::reduceMantissaToNbitsRounding<8>(
239  trk.getChiSquaredOverNDF());
240 
241  pOut->emplace_back(
242  rpId, // detector info
243  // spatial info
244  roundedX0, roundedX0Sigma, roundedY0, roundedY0Sigma,
245  // angular info
246  roundedTx, roundedTxSigma, roundedTy, roundedTySigma,
247  // reconstruction info
248  roundedChiSquaredOverNDF, trk.getRecoInfo(),
249  trk.getNumberOfPointsUsedForFit(),
250  // timing info
251  0., 0.);
252  }
253  }
254  }
255  }
256  }
257 
258  // save output to event
259  iEvent.put(std::move(pOut));
260 }
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
Definition: Event.h:125
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
static float HPTDC_TIME_SLICE_WIDTH
HPTDC time slice width, in ns.
edm::EDGetTokenT< edm::DetSetVector< CTPPSDiamondLocalTrack > > diamondTrackToken_
edm::EDGetTokenT< edm::DetSetVector< CTPPSPixelLocalTrack > > pixelTrackToken_
bool isUninitialized() const
Definition: EDGetToken.h:70
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 47 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

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

Referenced by CTPPSLocalTrackLiteProducer(), and produce().

double CTPPSLocalTrackLiteProducer::pixelTrackTxMax_
private

Definition at line 52 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

double CTPPSLocalTrackLiteProducer::pixelTrackTxMin_
private

Definition at line 52 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

double CTPPSLocalTrackLiteProducer::pixelTrackTyMax_
private

Definition at line 52 of file CTPPSLocalTrackLiteProducer.cc.

Referenced by produce().

double CTPPSLocalTrackLiteProducer::pixelTrackTyMin_
private

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

Referenced by produce().

double CTPPSLocalTrackLiteProducer::timingTrackTMin_
private

Definition at line 53 of file CTPPSLocalTrackLiteProducer.cc.