170 auto creco = std::make_unique<Centrality>();
176 creco->etHFhitSumPlus_ = 0;
177 creco->etHFhitSumMinus_ = 0;
180 for (
size_t ihit = 0; ihit <
hits->size(); ++ihit) {
181 const HFRecHit& rechit = (*hits)[ihit];
182 if (rechit.
id().
ieta() > 0)
183 creco->etHFhitSumPlus_ += rechit.
energy();
184 if (rechit.
id().
ieta() < 0)
185 creco->etHFhitSumMinus_ += rechit.
energy();
189 creco->etHFhitSumMinus_ = inputCentrality->EtHFhitSumMinus();
190 creco->etHFhitSumPlus_ = inputCentrality->EtHFhitSumPlus();
195 creco->etHFtowerSumPlus_ = 0;
196 creco->etHFtowerSumMinus_ = 0;
197 creco->etHFtowerSumECutPlus_ = 0;
198 creco->etHFtowerSumECutMinus_ = 0;
199 creco->etMidRapiditySum_ = 0;
204 for (
size_t i = 0;
i <
towers->size(); ++
i) {
210 creco->etHFtowerSumPlus_ +=
tower.pt();
211 if (
tower.energy() > 1.5)
212 creco->etHFtowerSumECutPlus_ +=
tower.pt();
214 creco->etHFtruncatedPlus_ +=
tower.pt();
216 creco->etHFtowerSumMinus_ +=
tower.pt();
217 if (
tower.energy() > 1.5)
218 creco->etHFtowerSumECutMinus_ +=
tower.pt();
220 creco->etHFtruncatedMinus_ +=
tower.pt();
224 creco->etHFtowerSumMinus_ = inputCentrality->EtHFtowerSumMinus();
225 creco->etHFtowerSumPlus_ = inputCentrality->EtHFtowerSumPlus();
226 creco->etHFtowerSumECutMinus_ = inputCentrality->EtHFtowerSumECutMinus();
227 creco->etHFtowerSumECutPlus_ = inputCentrality->EtHFtowerSumECutPlus();
228 creco->etHFtruncatedMinus_ = inputCentrality->EtHFtruncatedMinus();
229 creco->etHFtruncatedPlus_ = inputCentrality->EtHFtruncatedPlus();
236 creco->etMidRapiditySum_ = inputCentrality->EtMidRapiditySum();
240 creco->etHFtowerSumMinus_ = inputCentrality->EtHFtowerSumMinus();
241 creco->etHFtowerSumPlus_ = inputCentrality->EtHFtowerSumPlus();
242 creco->etHFtowerSumECutMinus_ = inputCentrality->EtHFtowerSumECutMinus();
243 creco->etHFtowerSumECutPlus_ = inputCentrality->EtHFtowerSumECutPlus();
244 creco->etMidRapiditySum_ = inputCentrality->EtMidRapiditySum();
249 creco->etEESumPlus_ = 0;
250 creco->etEESumMinus_ = 0;
259 for (
unsigned int i = 0;
i < ebHits->
size(); ++
i) {
262 double et =
hit.energy() * (
pos.perp() /
pos.mag());
263 creco->etEBSum_ +=
et;
266 for (
unsigned int i = 0;
i < eeHits->
size(); ++
i) {
269 double et =
hit.energy() * (
pos.perp() /
pos.mag());
271 creco->etEESumPlus_ +=
et;
273 creco->etEESumMinus_ +=
et;
278 creco->etEESumMinus_ = inputCentrality->EtEESumMinus();
279 creco->etEESumPlus_ = inputCentrality->EtEESumPlus();
280 creco->etEBSum_ = inputCentrality->EtEBSum();
287 creco->pixelMultiplicity_ = 0;
294 int nPixel_minus = 0;
301 recHitIterator != recHitRange.
end();
309 double eta = rechitPos.eta();
318 }
else if (
layer == 2) {
334 creco->pixelMultiplicity_ = nPixel;
335 creco->pixelMultiplicityPlus_ = nPixel_plus;
336 creco->pixelMultiplicityMinus_ = nPixel_minus;
339 creco->pixelMultiplicity_ = inputCentrality->multiplicityPixel();
340 creco->pixelMultiplicityPlus_ = inputCentrality->multiplicityPixelPlus();
341 creco->pixelMultiplicityMinus_ = inputCentrality->multiplicityPixelMinus();
349 double vxError = -999.;
350 double vyError = -999.;
351 double vzError = -999.;
356 unsigned int daughter = 0;
359 for (
unsigned int i = 0;
i < recoVertices->size(); ++
i) {
360 daughter = (*recoVertices)[
i].tracksSize();
361 if (daughter > (*recoVertices)[greatestvtx].tracksSize())
365 if (!recoVertices->empty()) {
366 vx = (*recoVertices)[greatestvtx].position().x();
367 vy = (*recoVertices)[greatestvtx].position().y();
368 vz = (*recoVertices)[greatestvtx].position().z();
369 vxError = (*recoVertices)[greatestvtx].xError();
370 vyError = (*recoVertices)[greatestvtx].yError();
371 vzError = (*recoVertices)[greatestvtx].zError();
380 double trackCounter = 0;
381 double trackCounterEta = 0;
382 double trackCounterEtaPt = 0;
384 for (
unsigned int i = 0;
i <
tracks->size(); ++
i) {
399 double dzsigma2 =
track.dzError() *
track.dzError() + vzError * vzError;
401 double dxysigma2 =
track.dxyError() *
track.dxyError() + vxError * vyError;
403 const double pterrcut = 0.1;
404 const double dzrelcut = 3.0;
405 const double dxyrelcut = 3.0;
408 track.ptError() /
track.pt() < pterrcut &&
dz *
dz < dzrelcut * dzrelcut * dzsigma2 &&
409 dxy *
dxy < dxyrelcut * dxyrelcut * dxysigma2) {
414 creco->trackMultiplicity_ =
nTracks;
415 creco->ntracksPtCut_ = trackCounter;
416 creco->ntracksEtaCut_ = trackCounterEta;
417 creco->ntracksEtaPtCut_ = trackCounterEtaPt;
421 creco->trackMultiplicity_ = inputCentrality->Ntracks();
422 creco->ntracksPtCut_ = inputCentrality->NtracksPtCut();
423 creco->ntracksEtaCut_ = inputCentrality->NtracksEtaCut();
424 creco->ntracksEtaPtCut_ = inputCentrality->NtracksEtaPtCut();
431 int nPixelTracks = pixeltracks->size();
432 int nPixelTracksPlus = 0;
433 int nPixelTracksMinus = 0;
435 for (
auto const&
track : *pixeltracks) {
441 creco->nPixelTracks_ = nPixelTracks;
442 creco->nPixelTracksPlus_ = nPixelTracksPlus;
443 creco->nPixelTracksMinus_ = nPixelTracksMinus;
446 creco->nPixelTracks_ = inputCentrality->NpixelTracks();
447 creco->nPixelTracksPlus_ = inputCentrality->NpixelTracksPlus();
448 creco->nPixelTracksMinus_ = inputCentrality->NpixelTracksMinus();
453 creco->zdcSumPlus_ = 0;
454 creco->zdcSumMinus_ = 0;
459 for (
size_t ihit = 0; ihit <
hits->size(); ++ihit) {
465 creco->zdcSumPlus_ += rechit.
energy();
472 creco->zdcSumMinus_ += rechit.
energy();
477 creco->zdcSumPlus_ = -9;
478 creco->zdcSumMinus_ = -9;
482 creco->zdcSumMinus_ = inputCentrality->zdcSumMinus();
483 creco->zdcSumPlus_ = inputCentrality->zdcSumPlus();
const bool producePixelTracks_
const edm::EDGetTokenT< EcalRecHitCollection > srcEEhits_
const bool producePixelhits_
const bool produceTracks_
const edm::ESGetToken< CaloGeometry, CaloGeometryRecord > caloGeom_
const edm::EDGetTokenT< TrackCollection > srcTracks_
const edm::EDGetTokenT< SiPixelRecHitCollection > srcPixelhits_
T const * product() const
const edm::EDGetTokenT< CaloTowerCollection > srcTowers_
const reco::TrackBase::TrackQuality trackQuality_
const edm::EDGetTokenT< VertexCollection > srcVertex_
unsigned int layer(const DetId &id) const
constexpr float energy() const
const bool produceZDChits_
const bool produceEcalhits_
constexpr HcalDetId id() const
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
const bool produceETmidRap_
float lowGainEnergy() const
constexpr int ieta() const
get the cell ieta
const edm::ESGetToken< TrackerTopology, TrackerTopologyRcd > trackerTopo_
const edm::EDGetTokenT< ZDCRecHitCollection > srcZDChits_
const edm::EDGetTokenT< TrackCollection > srcPixelTracks_
Abs< T >::type abs(const T &t)
const edm::ESGetToken< TrackerGeometry, TrackerDigiGeometryRecord > trackerGeom_
const edm::EDGetTokenT< HFRecHitCollection > srcHFhits_
ESHandle< T > getHandle(const ESGetToken< T, R > &iToken) const
const TrackerGeomDet * idToDet(DetId) const override
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
const bool produceHFtowers_
const edm::EDGetTokenT< Centrality > reuseTag_
bool isHF(int etabin, int depth)
HcalZDCDetId id() const
get the id
const double trackEtaCut_
const edm::EDGetTokenT< EcalRecHitCollection > srcEBhits_
const double midRapidityRange_
int zside() const
get the z-side of the cell (1/-1)
const bool produceHFhits_