CMS 3D CMS Logo

List of all members | Public Member Functions | Private Member Functions | Private Attributes
reco::CentralityProducer Class Reference
Inheritance diagram for reco::CentralityProducer:
edm::EDProducer edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

 CentralityProducer (const edm::ParameterSet &)
 
 ~CentralityProducer () override
 
- Public Member Functions inherited from edm::EDProducer
 EDProducer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
 ~EDProducer () override
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
std::vector< edm::ProductResolverIndex > const & indiciesForPutProducts (BranchType iBranchType) const
 
 ProducerBase ()
 
std::vector< edm::ProductResolverIndex > const & putTokenIndexToProductResolverIndex () const
 
std::vector< bool > const & recordProvenanceList () const
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription const &)> registrationCallback () const
 used by the fwk to register list of products More...
 
void resolvePutIndicies (BranchType iBranchType, ModuleToResolverIndicies const &iIndicies, std::string const &moduleLabel)
 
TypeLabelList const & typeLabelList () const
 used by the fwk to register the list of products of this module More...
 
 ~ProducerBase () noexcept(false) override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Member Functions

void beginJob () override
 
void endJob () override
 
void produce (edm::Event &, const edm::EventSetup &) override
 

Private Attributes

edm::ESHandle< CaloGeometrycGeo
 
bool doPixelCut_
 
double hfEtaCut_
 
bool lowGainZDC_
 
double midRapidityRange_
 
bool produceEcalhits_
 
bool produceETmidRap_
 
bool produceHFhits_
 
bool produceHFtowers_
 
bool producePixelhits_
 
bool producePixelTracks_
 
bool produceTracks_
 
bool produceZDChits_
 
bool recoLevel_
 
bool reuseAny_
 
edm::EDGetTokenT< CentralityreuseTag_
 
edm::EDGetTokenT< EcalRecHitCollectionsrcEBhits_
 
edm::EDGetTokenT< EcalRecHitCollectionsrcEEhits_
 
edm::EDGetTokenT< HFRecHitCollectionsrcHFhits_
 
edm::EDGetTokenT< SiPixelRecHitCollectionsrcPixelhits_
 
edm::EDGetTokenT< TrackCollectionsrcPixelTracks_
 
edm::EDGetTokenT< CaloTowerCollectionsrcTowers_
 
edm::EDGetTokenT< TrackCollectionsrcTracks_
 
edm::EDGetTokenT< VertexCollectionsrcVertex_
 
edm::EDGetTokenT< ZDCRecHitCollectionsrcZDChits_
 
edm::ESHandle< TrackerGeometrytGeo
 
edm::ESHandle< TrackerTopologytopo_
 
double trackEtaCut_
 
double trackPtCut_
 
reco::TrackBase::TrackQuality trackQuality_
 
bool useQuality_
 

Additional Inherited Members

- Public Types inherited from edm::EDProducer
typedef EDProducer ModuleType
 
- Public Types inherited from edm::ProducerBase
using ModuleToResolverIndicies = std::unordered_multimap< std::string, std::tuple< edm::TypeID const *, const char *, edm::ProductResolverIndex > >
 
typedef ProductRegistryHelper::TypeLabelList TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDProducer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::ProducerBase
template<class ProductType >
BranchAliasSetterT< ProductType > produces ()
 declare what type of product will make and with which optional label More...
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces ()
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces ()
 
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<BranchType B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<Transition B>
BranchAliasSetter produces (const TypeID &id, std::string instanceName=std::string(), bool recordProvenance=true)
 
template<typename ProductType , Transition B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<class ProductType >
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
template<typename ProductType , BranchType B>
BranchAliasSetterT< ProductType > produces (std::string instanceName)
 
ProducesCollector producesCollector ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 51 of file CentralityProducer.cc.

Constructor & Destructor Documentation

◆ CentralityProducer()

reco::CentralityProducer::CentralityProducer ( const edm::ParameterSet iConfig)
explicit

Definition at line 114 of file CentralityProducer.cc.

114  {
115  //register your products
116  produceHFhits_ = iConfig.getParameter<bool>("produceHFhits");
117  produceHFtowers_ = iConfig.getParameter<bool>("produceHFtowers");
118  produceEcalhits_ = iConfig.getParameter<bool>("produceEcalhits");
119  produceZDChits_ = iConfig.getParameter<bool>("produceZDChits");
120  produceETmidRap_ = iConfig.getParameter<bool>("produceETmidRapidity");
121  producePixelhits_ = iConfig.getParameter<bool>("producePixelhits");
122  produceTracks_ = iConfig.getParameter<bool>("produceTracks");
123  producePixelTracks_ = iConfig.getParameter<bool>("producePixelTracks");
124 
125  midRapidityRange_ = iConfig.getParameter<double>("midRapidityRange");
126  trackPtCut_ = iConfig.getParameter<double>("trackPtCut");
127  trackEtaCut_ = iConfig.getParameter<double>("trackEtaCut");
128 
129  hfEtaCut_ = iConfig.getParameter<double>("hfEtaCut");
130 
131  if (produceHFhits_)
132  srcHFhits_ = consumes<HFRecHitCollection>(iConfig.getParameter<edm::InputTag>("srcHFhits"));
134  srcTowers_ = consumes<CaloTowerCollection>(iConfig.getParameter<edm::InputTag>("srcTowers"));
135 
136  if (produceEcalhits_) {
137  srcEBhits_ = consumes<EcalRecHitCollection>(iConfig.getParameter<edm::InputTag>("srcEBhits"));
138  srcEEhits_ = consumes<EcalRecHitCollection>(iConfig.getParameter<edm::InputTag>("srcEEhits"));
139  }
140  if (produceZDChits_) {
141  srcZDChits_ = consumes<ZDCRecHitCollection>(iConfig.getParameter<edm::InputTag>("srcZDChits"));
142  lowGainZDC_ = iConfig.getParameter<bool>("lowGainZDC");
143  }
144  if (producePixelhits_) {
145  srcPixelhits_ = consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("srcPixelhits"));
146  doPixelCut_ = iConfig.getParameter<bool>("doPixelCut");
147  srcVertex_ = consumes<VertexCollection>(iConfig.getParameter<edm::InputTag>("srcVertex"));
148  }
149  if (produceTracks_) {
150  srcTracks_ = consumes<TrackCollection>(iConfig.getParameter<edm::InputTag>("srcTracks"));
151  srcVertex_ = consumes<VertexCollection>(iConfig.getParameter<edm::InputTag>("srcVertex"));
152  }
154  srcPixelTracks_ = consumes<TrackCollection>(iConfig.getParameter<edm::InputTag>("srcPixelTracks"));
155 
156  reuseAny_ = iConfig.getParameter<bool>("reUseCentrality");
157  if (reuseAny_)
158  reuseTag_ = consumes<Centrality>(iConfig.getParameter<edm::InputTag>("srcReUse"));
159 
160  useQuality_ = iConfig.getParameter<bool>("UseQuality");
162 
163  produces<Centrality>();
164  }

References edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~CentralityProducer()

reco::CentralityProducer::~CentralityProducer ( )
override

Definition at line 166 of file CentralityProducer.cc.

166  {
167  // do anything here that needs to be done at desctruction time
168  // (e.g. close files, deallocate resources etc.)
169  }

Member Function Documentation

◆ beginJob()

void reco::CentralityProducer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 503 of file CentralityProducer.cc.

503 {}

◆ endJob()

void reco::CentralityProducer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDProducer.

Definition at line 506 of file CentralityProducer.cc.

506 {}

◆ produce()

void reco::CentralityProducer::produce ( edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivatevirtual

Implements edm::EDProducer.

Definition at line 176 of file CentralityProducer.cc.

176  {
177  if (producePixelhits_)
179  if (produceEcalhits_)
180  iSetup.get<CaloGeometryRecord>().get(cGeo);
181  if (producePixelhits_)
182  iSetup.get<TrackerTopologyRcd>().get(topo_);
183 
184  auto creco = std::make_unique<Centrality>();
185  Handle<Centrality> inputCentrality;
186 
187  if (reuseAny_)
188  iEvent.getByToken(reuseTag_, inputCentrality);
189 
190  if (produceHFhits_) {
191  creco->etHFhitSumPlus_ = 0;
192  creco->etHFhitSumMinus_ = 0;
193 
195  iEvent.getByToken(srcHFhits_, hits);
196  for (size_t ihit = 0; ihit < hits->size(); ++ihit) {
197  const HFRecHit& rechit = (*hits)[ihit];
198  if (rechit.id().ieta() > 0)
199  creco->etHFhitSumPlus_ += rechit.energy();
200  if (rechit.id().ieta() < 0)
201  creco->etHFhitSumMinus_ += rechit.energy();
202  }
203  } else {
204  if (reuseAny_) {
205  creco->etHFhitSumMinus_ = inputCentrality->EtHFhitSumMinus();
206  creco->etHFhitSumPlus_ = inputCentrality->EtHFhitSumPlus();
207  }
208  }
209 
211  creco->etHFtowerSumPlus_ = 0;
212  creco->etHFtowerSumMinus_ = 0;
213  creco->etHFtowerSumECutPlus_ = 0;
214  creco->etHFtowerSumECutMinus_ = 0;
215  creco->etMidRapiditySum_ = 0;
216 
218 
219  iEvent.getByToken(srcTowers_, towers);
220 
221  for (size_t i = 0; i < towers->size(); ++i) {
222  const CaloTower& tower = (*towers)[i];
223  double eta = tower.eta();
224  bool isHF = tower.ietaAbs() > 29;
225  if (produceHFtowers_) {
226  if (isHF && eta > 0) {
227  creco->etHFtowerSumPlus_ += tower.pt();
228  if (tower.energy() > 1.5)
229  creco->etHFtowerSumECutPlus_ += tower.pt();
230  if (eta > hfEtaCut_)
231  creco->etHFtruncatedPlus_ += tower.pt();
232  }
233  if (isHF && eta < 0) {
234  creco->etHFtowerSumMinus_ += tower.pt();
235  if (tower.energy() > 1.5)
236  creco->etHFtowerSumECutMinus_ += tower.pt();
237  if (eta < -hfEtaCut_)
238  creco->etHFtruncatedMinus_ += tower.pt();
239  }
240  } else {
241  if (reuseAny_) {
242  creco->etHFtowerSumMinus_ = inputCentrality->EtHFtowerSumMinus();
243  creco->etHFtowerSumPlus_ = inputCentrality->EtHFtowerSumPlus();
244  creco->etHFtowerSumECutMinus_ = inputCentrality->EtHFtowerSumECutMinus();
245  creco->etHFtowerSumECutPlus_ = inputCentrality->EtHFtowerSumECutPlus();
246  creco->etHFtruncatedMinus_ = inputCentrality->EtHFtruncatedMinus();
247  creco->etHFtruncatedPlus_ = inputCentrality->EtHFtruncatedPlus();
248  }
249  }
250  if (produceETmidRap_) {
252  creco->etMidRapiditySum_ += tower.pt() / (midRapidityRange_ * 2.);
253  } else if (reuseAny_)
254  creco->etMidRapiditySum_ = inputCentrality->EtMidRapiditySum();
255  }
256  } else {
257  if (reuseAny_) {
258  creco->etHFtowerSumMinus_ = inputCentrality->EtHFtowerSumMinus();
259  creco->etHFtowerSumPlus_ = inputCentrality->EtHFtowerSumPlus();
260  creco->etHFtowerSumECutMinus_ = inputCentrality->EtHFtowerSumECutMinus();
261  creco->etHFtowerSumECutPlus_ = inputCentrality->EtHFtowerSumECutPlus();
262  creco->etMidRapiditySum_ = inputCentrality->EtMidRapiditySum();
263  }
264  }
265 
266  if (produceEcalhits_) {
267  creco->etEESumPlus_ = 0;
268  creco->etEESumMinus_ = 0;
269  creco->etEBSum_ = 0;
270 
273 
274  iEvent.getByToken(srcEBhits_, ebHits);
275  iEvent.getByToken(srcEEhits_, eeHits);
276 
277  for (unsigned int i = 0; i < ebHits->size(); ++i) {
278  const EcalRecHit& hit = (*ebHits)[i];
279  const GlobalPoint& pos = cGeo->getPosition(hit.id());
280  double et = hit.energy() * (pos.perp() / pos.mag());
281  creco->etEBSum_ += et;
282  }
283 
284  for (unsigned int i = 0; i < eeHits->size(); ++i) {
285  const EcalRecHit& hit = (*eeHits)[i];
286  const GlobalPoint& pos = cGeo->getPosition(hit.id());
287  double et = hit.energy() * (pos.perp() / pos.mag());
288  if (pos.z() > 0) {
289  creco->etEESumPlus_ += et;
290  } else {
291  creco->etEESumMinus_ += et;
292  }
293  }
294  } else {
295  if (reuseAny_) {
296  creco->etEESumMinus_ = inputCentrality->EtEESumMinus();
297  creco->etEESumPlus_ = inputCentrality->EtEESumPlus();
298  creco->etEBSum_ = inputCentrality->EtEBSum();
299  }
300  }
301 
302  if (producePixelhits_) {
303  creco->pixelMultiplicity_ = 0;
306  iEvent.getByToken(srcPixelhits_, rchts);
307  rechits = rchts.product();
308  int nPixel = 0;
309  int nPixel_plus = 0;
310  int nPixel_minus = 0;
311  for (SiPixelRecHitCollection::const_iterator it = rechits->begin(); it != rechits->end(); it++) {
313  DetId detId = DetId(hits.detId());
314  SiPixelRecHitCollection::const_iterator recHitMatch = rechits->find(detId);
315  const SiPixelRecHitCollection::DetSet recHitRange = *recHitMatch;
316  for (SiPixelRecHitCollection::DetSet::const_iterator recHitIterator = recHitRange.begin();
317  recHitIterator != recHitRange.end();
318  ++recHitIterator) {
319  // add selection if needed, now all hits.
320  const SiPixelRecHit* recHit = &(*recHitIterator);
321  const PixelGeomDetUnit* pixelLayer =
322  dynamic_cast<const PixelGeomDetUnit*>(tGeo->idToDet(recHit->geographicalId()));
323  GlobalPoint gpos = pixelLayer->toGlobal(recHit->localPosition());
324  math::XYZVector rechitPos(gpos.x(), gpos.y(), gpos.z());
325  double eta = rechitPos.eta();
326  double abeta = std::abs(rechitPos.eta());
327  int clusterSize = recHit->cluster()->size();
328  unsigned layer = topo_->layer(detId);
329  if (doPixelCut_) {
330  if (detId.det() == DetId::Tracker && detId.subdetId() == PixelSubdetector::PixelBarrel) {
331  if (layer == 1 && 18 * abeta - 40 > clusterSize)
332  continue;
333  if (layer == 2 && 6 * abeta - 7.2 > clusterSize)
334  continue;
335  if ((layer == 3 || layer == 4) && 4 * abeta - 2.4 > clusterSize)
336  continue;
337  }
338  }
339  nPixel++;
340  if (eta >= 0)
341  nPixel_plus++;
342  if (eta < 0)
343  nPixel_minus++;
344  }
345  }
346  creco->pixelMultiplicity_ = nPixel;
347  creco->pixelMultiplicityPlus_ = nPixel_plus;
348  creco->pixelMultiplicityMinus_ = nPixel_minus;
349  } else {
350  if (reuseAny_) {
351  creco->pixelMultiplicity_ = inputCentrality->multiplicityPixel();
352  creco->pixelMultiplicityPlus_ = inputCentrality->multiplicityPixelPlus();
353  creco->pixelMultiplicityMinus_ = inputCentrality->multiplicityPixelMinus();
354  }
355  }
356 
357  if (produceTracks_) {
358  double vx = -999.;
359  double vy = -999.;
360  double vz = -999.;
361  double vxError = -999.;
362  double vyError = -999.;
363  double vzError = -999.;
364  math::XYZVector vtxPos(0, 0, 0);
365 
366  Handle<VertexCollection> recoVertices;
367  iEvent.getByToken(srcVertex_, recoVertices);
368  unsigned int daughter = 0;
369  int greatestvtx = 0;
370 
371  for (unsigned int i = 0; i < recoVertices->size(); ++i) {
372  daughter = (*recoVertices)[i].tracksSize();
373  if (daughter > (*recoVertices)[greatestvtx].tracksSize())
374  greatestvtx = i;
375  }
376 
377  if (!recoVertices->empty()) {
378  vx = (*recoVertices)[greatestvtx].position().x();
379  vy = (*recoVertices)[greatestvtx].position().y();
380  vz = (*recoVertices)[greatestvtx].position().z();
381  vxError = (*recoVertices)[greatestvtx].xError();
382  vyError = (*recoVertices)[greatestvtx].yError();
383  vzError = (*recoVertices)[greatestvtx].zError();
384  }
385 
386  vtxPos = math::XYZVector(vx, vy, vz);
387 
389  iEvent.getByToken(srcTracks_, tracks);
390  int nTracks = 0;
391 
392  double trackCounter = 0;
393  double trackCounterEta = 0;
394  double trackCounterEtaPt = 0;
395 
396  for (unsigned int i = 0; i < tracks->size(); ++i) {
397  const Track& track = (*tracks)[i];
398  if (useQuality_ && !track.quality(trackQuality_))
399  continue;
400 
401  if (track.pt() > trackPtCut_)
402  trackCounter++;
403  if (std::abs(track.eta()) < trackEtaCut_) {
404  trackCounterEta++;
405  if (track.pt() > trackPtCut_)
406  trackCounterEtaPt++;
407  }
408 
409  math::XYZPoint v1(vx, vy, vz);
410  double dz = track.dz(v1);
411  double dzsigma2 = track.dzError() * track.dzError() + vzError * vzError;
412  double dxy = track.dxy(v1);
413  double dxysigma2 = track.dxyError() * track.dxyError() + vxError * vyError;
414 
415  const double pterrcut = 0.1;
416  const double dzrelcut = 3.0;
417  const double dxyrelcut = 3.0;
418 
419  if (track.quality(trackQuality_) && track.pt() > 0.4 && std::abs(track.eta()) < 2.4 &&
420  track.ptError() / track.pt() < pterrcut && dz * dz < dzrelcut * dzrelcut * dzsigma2 &&
421  dxy * dxy < dxyrelcut * dxyrelcut * dxysigma2) {
422  nTracks++;
423  }
424  }
425 
426  creco->trackMultiplicity_ = nTracks;
427  creco->ntracksPtCut_ = trackCounter;
428  creco->ntracksEtaCut_ = trackCounterEta;
429  creco->ntracksEtaPtCut_ = trackCounterEtaPt;
430 
431  } else {
432  if (reuseAny_) {
433  creco->trackMultiplicity_ = inputCentrality->Ntracks();
434  creco->ntracksPtCut_ = inputCentrality->NtracksPtCut();
435  creco->ntracksEtaCut_ = inputCentrality->NtracksEtaCut();
436  creco->ntracksEtaPtCut_ = inputCentrality->NtracksEtaPtCut();
437  }
438  }
439 
440  if (producePixelTracks_) {
441  Handle<TrackCollection> pixeltracks;
442  iEvent.getByToken(srcPixelTracks_, pixeltracks);
443  int nPixelTracks = pixeltracks->size();
444  int nPixelTracksPlus = 0;
445  int nPixelTracksMinus = 0;
446 
447  for (auto const& track : *pixeltracks) {
448  if (track.eta() < 0)
449  nPixelTracksMinus++;
450  else
451  nPixelTracksPlus++;
452  }
453  creco->nPixelTracks_ = nPixelTracks;
454  creco->nPixelTracksPlus_ = nPixelTracksPlus;
455  creco->nPixelTracksMinus_ = nPixelTracksMinus;
456  } else {
457  if (reuseAny_) {
458  creco->nPixelTracks_ = inputCentrality->NpixelTracks();
459  creco->nPixelTracksPlus_ = inputCentrality->NpixelTracksPlus();
460  creco->nPixelTracksMinus_ = inputCentrality->NpixelTracksMinus();
461  }
462  }
463 
464  if (produceZDChits_) {
465  creco->zdcSumPlus_ = 0;
466  creco->zdcSumMinus_ = 0;
467 
469  bool zdcAvailable = iEvent.getByToken(srcZDChits_, hits);
470  if (zdcAvailable) {
471  for (size_t ihit = 0; ihit < hits->size(); ++ihit) {
472  const ZDCRecHit& rechit = (*hits)[ihit];
473  if (rechit.id().zside() > 0) {
474  if (lowGainZDC_) {
475  creco->zdcSumPlus_ += rechit.lowGainEnergy();
476  } else {
477  creco->zdcSumPlus_ += rechit.energy();
478  }
479  }
480  if (rechit.id().zside() < 0) {
481  if (lowGainZDC_) {
482  creco->zdcSumMinus_ += rechit.lowGainEnergy();
483  } else {
484  creco->zdcSumMinus_ += rechit.energy();
485  }
486  }
487  }
488  } else {
489  creco->zdcSumPlus_ = -9;
490  creco->zdcSumMinus_ = -9;
491  }
492  } else {
493  if (reuseAny_) {
494  creco->zdcSumMinus_ = inputCentrality->zdcSumMinus();
495  creco->zdcSumPlus_ = inputCentrality->zdcSumPlus();
496  }
497  }
498 
499  iEvent.put(std::move(creco));
500  }

References funct::abs(), edmNew::DetSet< T >::begin(), DetId::det(), PVValHelper::dxy, PVValHelper::dz, edmNew::DetSet< T >::end(), CaloRecHit::energy(), EgHLTOffHistBins_cfi::et, PVValHelper::eta, reco::Centrality::EtEBSum(), reco::Centrality::EtEESumMinus(), reco::Centrality::EtEESumPlus(), reco::Centrality::EtHFhitSumMinus(), reco::Centrality::EtHFhitSumPlus(), reco::Centrality::EtHFtowerSumECutMinus(), reco::Centrality::EtHFtowerSumECutPlus(), reco::Centrality::EtHFtowerSumMinus(), reco::Centrality::EtHFtowerSumPlus(), reco::Centrality::EtHFtruncatedMinus(), reco::Centrality::EtHFtruncatedPlus(), reco::Centrality::EtMidRapiditySum(), edm::EventSetup::get(), get, hfClusterShapes_cfi::hits, mps_fire::i, ZDCRecHit::id(), HFRecHit::id(), hit::id, HcalDetId::ieta(), iEvent, HcalObjRepresent::isHF(), ZDCRecHit::lowGainEnergy(), eostools::move(), reco::Centrality::multiplicityPixel(), reco::Centrality::multiplicityPixelMinus(), reco::Centrality::multiplicityPixelPlus(), reco::Centrality::NpixelTracks(), reco::Centrality::NpixelTracksMinus(), reco::Centrality::NpixelTracksPlus(), nTracks(), reco::Centrality::Ntracks(), reco::Centrality::NtracksEtaCut(), reco::Centrality::NtracksEtaPtCut(), reco::Centrality::NtracksPtCut(), PixelSubdetector::PixelBarrel, edm::Handle< T >::product(), rpcPointValidation_cfi::recHit, TrackInfoProducer_cfi::rechits, edm::SortedCollection< T, SORT >::size(), DetId::subdetId(), GeomDet::toGlobal(), hgcalTowerProducer_cfi::tower, HLT_2018_cff::towers, HLT_2018_cff::track, DetId::Tracker, PDWG_EXOHSCP_cff::tracks, reco::Centrality::zdcSumMinus(), reco::Centrality::zdcSumPlus(), and HcalZDCDetId::zside().

Member Data Documentation

◆ cGeo

edm::ESHandle<CaloGeometry> reco::CentralityProducer::cGeo
private

Definition at line 99 of file CentralityProducer.cc.

◆ doPixelCut_

bool reco::CentralityProducer::doPixelCut_
private

Definition at line 75 of file CentralityProducer.cc.

◆ hfEtaCut_

double reco::CentralityProducer::hfEtaCut_
private

Definition at line 80 of file CentralityProducer.cc.

◆ lowGainZDC_

bool reco::CentralityProducer::lowGainZDC_
private

Definition at line 82 of file CentralityProducer.cc.

◆ midRapidityRange_

double reco::CentralityProducer::midRapidityRange_
private

Definition at line 77 of file CentralityProducer.cc.

◆ produceEcalhits_

bool reco::CentralityProducer::produceEcalhits_
private

Definition at line 67 of file CentralityProducer.cc.

◆ produceETmidRap_

bool reco::CentralityProducer::produceETmidRap_
private

Definition at line 69 of file CentralityProducer.cc.

◆ produceHFhits_

bool reco::CentralityProducer::produceHFhits_
private

Definition at line 65 of file CentralityProducer.cc.

◆ produceHFtowers_

bool reco::CentralityProducer::produceHFtowers_
private

Definition at line 66 of file CentralityProducer.cc.

◆ producePixelhits_

bool reco::CentralityProducer::producePixelhits_
private

Definition at line 70 of file CentralityProducer.cc.

◆ producePixelTracks_

bool reco::CentralityProducer::producePixelTracks_
private

Definition at line 73 of file CentralityProducer.cc.

◆ produceTracks_

bool reco::CentralityProducer::produceTracks_
private

Definition at line 71 of file CentralityProducer.cc.

◆ produceZDChits_

bool reco::CentralityProducer::produceZDChits_
private

Definition at line 68 of file CentralityProducer.cc.

◆ recoLevel_

bool reco::CentralityProducer::recoLevel_
private

Definition at line 63 of file CentralityProducer.cc.

◆ reuseAny_

bool reco::CentralityProducer::reuseAny_
private

Definition at line 72 of file CentralityProducer.cc.

◆ reuseTag_

edm::EDGetTokenT<Centrality> reco::CentralityProducer::reuseTag_
private

Definition at line 93 of file CentralityProducer.cc.

◆ srcEBhits_

edm::EDGetTokenT<EcalRecHitCollection> reco::CentralityProducer::srcEBhits_
private

Definition at line 87 of file CentralityProducer.cc.

◆ srcEEhits_

edm::EDGetTokenT<EcalRecHitCollection> reco::CentralityProducer::srcEEhits_
private

Definition at line 86 of file CentralityProducer.cc.

◆ srcHFhits_

edm::EDGetTokenT<HFRecHitCollection> reco::CentralityProducer::srcHFhits_
private

Definition at line 84 of file CentralityProducer.cc.

◆ srcPixelhits_

edm::EDGetTokenT<SiPixelRecHitCollection> reco::CentralityProducer::srcPixelhits_
private

Definition at line 89 of file CentralityProducer.cc.

◆ srcPixelTracks_

edm::EDGetTokenT<TrackCollection> reco::CentralityProducer::srcPixelTracks_
private

Definition at line 91 of file CentralityProducer.cc.

◆ srcTowers_

edm::EDGetTokenT<CaloTowerCollection> reco::CentralityProducer::srcTowers_
private

Definition at line 85 of file CentralityProducer.cc.

◆ srcTracks_

edm::EDGetTokenT<TrackCollection> reco::CentralityProducer::srcTracks_
private

Definition at line 90 of file CentralityProducer.cc.

◆ srcVertex_

edm::EDGetTokenT<VertexCollection> reco::CentralityProducer::srcVertex_
private

Definition at line 92 of file CentralityProducer.cc.

◆ srcZDChits_

edm::EDGetTokenT<ZDCRecHitCollection> reco::CentralityProducer::srcZDChits_
private

Definition at line 88 of file CentralityProducer.cc.

◆ tGeo

edm::ESHandle<TrackerGeometry> reco::CentralityProducer::tGeo
private

Definition at line 98 of file CentralityProducer.cc.

◆ topo_

edm::ESHandle<TrackerTopology> reco::CentralityProducer::topo_
private

Definition at line 100 of file CentralityProducer.cc.

◆ trackEtaCut_

double reco::CentralityProducer::trackEtaCut_
private

Definition at line 79 of file CentralityProducer.cc.

◆ trackPtCut_

double reco::CentralityProducer::trackPtCut_
private

Definition at line 78 of file CentralityProducer.cc.

◆ trackQuality_

reco::TrackBase::TrackQuality reco::CentralityProducer::trackQuality_
private

Definition at line 96 of file CentralityProducer.cc.

◆ useQuality_

bool reco::CentralityProducer::useQuality_
private

Definition at line 95 of file CentralityProducer.cc.

reco::CentralityProducer::srcTowers_
edm::EDGetTokenT< CaloTowerCollection > srcTowers_
Definition: CentralityProducer.cc:85
TrackerGeometry::idToDet
const TrackerGeomDet * idToDet(DetId) const override
Definition: TrackerGeometry.cc:193
reco::CentralityProducer::produceHFhits_
bool produceHFhits_
Definition: CentralityProducer.cc:65
nTracks
const unsigned int nTracks(const reco::Vertex &sv)
Definition: TemplatedVertexArbitrator.h:44
EcalRecHit
Definition: EcalRecHit.h:15
PDWG_EXOHSCP_cff.tracks
tracks
Definition: PDWG_EXOHSCP_cff.py:28
mps_fire.i
i
Definition: mps_fire.py:355
reco::CentralityProducer::srcTracks_
edm::EDGetTokenT< TrackCollection > srcTracks_
Definition: CentralityProducer.cc:90
reco::Centrality::EtHFhitSumPlus
double EtHFhitSumPlus() const
Definition: Centrality.h:22
hit::id
unsigned int id
Definition: SiStripHitEffFromCalibTree.cc:92
CaloRecHit::energy
constexpr float energy() const
Definition: CaloRecHit.h:29
PixelSubdetector::PixelBarrel
Definition: PixelSubdetector.h:11
edm::Handle::product
T const * product() const
Definition: Handle.h:70
reco::CentralityProducer::lowGainZDC_
bool lowGainZDC_
Definition: CentralityProducer.cc:82
hfClusterShapes_cfi.hits
hits
Definition: hfClusterShapes_cfi.py:5
reco::CentralityProducer::produceTracks_
bool produceTracks_
Definition: CentralityProducer.cc:71
reco::CentralityProducer::trackQuality_
reco::TrackBase::TrackQuality trackQuality_
Definition: CentralityProducer.cc:96
PV3DBase::x
T x() const
Definition: PV3DBase.h:59
CaloGeometry::getPosition
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Definition: CaloGeometry.cc:50
CaloGeometryRecord
Definition: CaloGeometryRecord.h:30
reco::CentralityProducer::tGeo
edm::ESHandle< TrackerGeometry > tGeo
Definition: CentralityProducer.cc:98
reco::Centrality::NpixelTracksPlus
double NpixelTracksPlus() const
Definition: Centrality.h:51
DetId::det
constexpr Detector det() const
get the detector field from this detid
Definition: DetId.h:46
pos
Definition: PixelAliasList.h:18
hgcalTowerProducer_cfi.tower
tower
Definition: hgcalTowerProducer_cfi.py:3
edmNew::DetSetVector::const_iterator
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
Definition: DetSetVectorNew.h:231
reco::CentralityProducer::reuseTag_
edm::EDGetTokenT< Centrality > reuseTag_
Definition: CentralityProducer.cc:93
HFRecHit::id
constexpr HcalDetId id() const
Definition: HFRecHit.h:26
reco::Centrality::EtEESumPlus
double EtEESumPlus() const
Definition: Centrality.h:34
TrackerTopology::layer
unsigned int layer(const DetId &id) const
Definition: TrackerTopology.cc:47
edm::SortedCollection::size
size_type size() const
Definition: SortedCollection.h:215
reco::CentralityProducer::srcEBhits_
edm::EDGetTokenT< EcalRecHitCollection > srcEBhits_
Definition: CentralityProducer.cc:87
reco::CentralityProducer::cGeo
edm::ESHandle< CaloGeometry > cGeo
Definition: CentralityProducer.cc:99
reco::Centrality::EtMidRapiditySum
double EtMidRapiditySum() const
Definition: Centrality.h:57
reco::Centrality::NpixelTracksMinus
double NpixelTracksMinus() const
Definition: Centrality.h:52
reco::CentralityProducer::producePixelhits_
bool producePixelhits_
Definition: CentralityProducer.cc:70
edm::Handle
Definition: AssociativeIterator.h:50
reco::CentralityProducer::producePixelTracks_
bool producePixelTracks_
Definition: CentralityProducer.cc:73
reco::CentralityProducer::srcPixelTracks_
edm::EDGetTokenT< TrackCollection > srcPixelTracks_
Definition: CentralityProducer.cc:91
reco::CentralityProducer::trackEtaCut_
double trackEtaCut_
Definition: CentralityProducer.cc:79
rpcPointValidation_cfi.recHit
recHit
Definition: rpcPointValidation_cfi.py:7
SiPixelRecHit
Our base class.
Definition: SiPixelRecHit.h:23
reco::Centrality::NtracksPtCut
double NtracksPtCut() const
Definition: Centrality.h:47
reco::CentralityProducer::trackPtCut_
double trackPtCut_
Definition: CentralityProducer.cc:78
reco::CentralityProducer::midRapidityRange_
double midRapidityRange_
Definition: CentralityProducer.cc:77
PV3DBase::z
T z() const
Definition: PV3DBase.h:61
DetId
Definition: DetId.h:17
edmNew::DetSet::end
iterator end()
Definition: DetSetNew.h:56
reco::CentralityProducer::doPixelCut_
bool doPixelCut_
Definition: CentralityProducer.cc:75
HFRecHit
Definition: HFRecHit.h:11
edm::EventSetup::get
T get() const
Definition: EventSetup.h:73
PVValHelper::eta
Definition: PVValidationHelpers.h:69
reco::Centrality::EtEBSum
double EtEBSum() const
Definition: Centrality.h:39
reco::Centrality::EtHFtowerSumPlus
double EtHFtowerSumPlus() const
Definition: Centrality.h:25
HcalObjRepresent::isHF
bool isHF(int etabin, int depth)
Definition: HcalObjRepresent.h:880
PixelGeomDetUnit
Definition: PixelGeomDetUnit.h:15
TrackerDigiGeometryRecord
Definition: TrackerDigiGeometryRecord.h:15
reco::Centrality::EtHFtruncatedMinus
double EtHFtruncatedMinus() const
Definition: Centrality.h:32
reco::CentralityProducer::useQuality_
bool useQuality_
Definition: CentralityProducer.cc:95
reco::Track
Definition: Track.h:27
edmNew::DetSet
Definition: DetSetNew.h:22
reco::Centrality::zdcSumPlus
double zdcSumPlus() const
Definition: Centrality.h:55
Point3DBase< float, GlobalTag >
reco::Centrality::EtHFhitSumMinus
double EtHFhitSumMinus() const
Definition: Centrality.h:23
reco::Centrality::multiplicityPixelMinus
double multiplicityPixelMinus() const
Definition: Centrality.h:45
DetId::subdetId
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum)
Definition: DetId.h:48
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
reco::CentralityProducer::topo_
edm::ESHandle< TrackerTopology > topo_
Definition: CentralityProducer.cc:100
reco::Centrality::EtHFtowerSumECutPlus
double EtHFtowerSumECutPlus() const
Definition: Centrality.h:28
HcalZDCDetId::zside
int zside() const
get the z-side of the cell (1/-1)
Definition: HcalZDCDetId.h:39
HcalDetId::ieta
constexpr int ieta() const
get the cell ieta
Definition: HcalDetId.h:155
GeomDet::toGlobal
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
Definition: GeomDet.h:49
math::XYZPoint
XYZPointD XYZPoint
point in space with cartesian internal representation
Definition: Point3D.h:12
DetId::Tracker
Definition: DetId.h:25
reco::Centrality::NtracksEtaPtCut
double NtracksEtaPtCut() const
Definition: Centrality.h:49
reco::CentralityProducer::produceETmidRap_
bool produceETmidRap_
Definition: CentralityProducer.cc:69
TrackInfoProducer_cfi.rechits
rechits
Definition: TrackInfoProducer_cfi.py:9
math::XYZVector
XYZVectorD XYZVector
spatial vector with cartesian internal representation
Definition: Vector3D.h:31
reco::Centrality::multiplicityPixelPlus
double multiplicityPixelPlus() const
Definition: Centrality.h:44
PV3DBase::y
T y() const
Definition: PV3DBase.h:60
iEvent
int iEvent
Definition: GenABIO.cc:224
CaloTower
Definition: CaloTower.h:26
reco::CentralityProducer::srcPixelhits_
edm::EDGetTokenT< SiPixelRecHitCollection > srcPixelhits_
Definition: CentralityProducer.cc:89
reco::CentralityProducer::produceZDChits_
bool produceZDChits_
Definition: CentralityProducer.cc:68
ZDCRecHit::id
HcalZDCDetId id() const
get the id
Definition: ZDCRecHit.h:18
reco::Centrality::EtHFtruncatedPlus
double EtHFtruncatedPlus() const
Definition: Centrality.h:31
edmNew::DetSet::begin
iterator begin()
Definition: DetSetNew.h:54
EgHLTOffHistBins_cfi.et
et
Definition: EgHLTOffHistBins_cfi.py:8
reco::Centrality::NtracksEtaCut
double NtracksEtaCut() const
Definition: Centrality.h:48
reco::CentralityProducer::srcZDChits_
edm::EDGetTokenT< ZDCRecHitCollection > srcZDChits_
Definition: CentralityProducer.cc:88
reco::Centrality::EtEESumMinus
double EtEESumMinus() const
Definition: Centrality.h:35
reco::get
T get(const Candidate &c)
Definition: component.h:60
reco::TrackBase::qualityByName
static TrackQuality qualityByName(const std::string &name)
Definition: TrackBase.cc:126
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
HLT_2018_cff.towers
towers
Definition: HLT_2018_cff.py:35030
edmNew::DetSetVector
Definition: DetSetNew.h:13
reco::CentralityProducer::produceHFtowers_
bool produceHFtowers_
Definition: CentralityProducer.cc:66
reco::Centrality::NpixelTracks
double NpixelTracks() const
Definition: Centrality.h:50
eostools.move
def move(src, dest)
Definition: eostools.py:511
PVValHelper::dxy
Definition: PVValidationHelpers.h:47
PVValHelper::dz
Definition: PVValidationHelpers.h:50
reco::CentralityProducer::hfEtaCut_
double hfEtaCut_
Definition: CentralityProducer.cc:80
reco::Centrality::zdcSumMinus
double zdcSumMinus() const
Definition: Centrality.h:56
reco::Centrality::multiplicityPixel
double multiplicityPixel() const
Definition: Centrality.h:43
ZDCRecHit
Definition: ZDCRecHit.h:11
ZDCRecHit::lowGainEnergy
float lowGainEnergy() const
Definition: ZDCRecHit.h:20
reco::CentralityProducer::produceEcalhits_
bool produceEcalhits_
Definition: CentralityProducer.cc:67
HLT_2018_cff.track
track
Definition: HLT_2018_cff.py:10352
reco::Centrality::EtHFtowerSumECutMinus
double EtHFtowerSumECutMinus() const
Definition: Centrality.h:29
funct::abs
Abs< T >::type abs(const T &t)
Definition: Abs.h:22
TrackerTopologyRcd
Definition: TrackerTopologyRcd.h:10
reco::CentralityProducer::srcEEhits_
edm::EDGetTokenT< EcalRecHitCollection > srcEEhits_
Definition: CentralityProducer.cc:86
reco::CentralityProducer::reuseAny_
bool reuseAny_
Definition: CentralityProducer.cc:72
reco::CentralityProducer::srcVertex_
edm::EDGetTokenT< VertexCollection > srcVertex_
Definition: CentralityProducer.cc:92
reco::Centrality::Ntracks
double Ntracks() const
Definition: Centrality.h:46
edm::InputTag
Definition: InputTag.h:15
hit
Definition: SiStripHitEffFromCalibTree.cc:88
reco::CentralityProducer::srcHFhits_
edm::EDGetTokenT< HFRecHitCollection > srcHFhits_
Definition: CentralityProducer.cc:84
reco::Centrality::EtHFtowerSumMinus
double EtHFtowerSumMinus() const
Definition: Centrality.h:26