191 auto creco = std::make_unique<Centrality>();
197 creco->etHFhitSumPlus_ = 0;
198 creco->etHFhitSumMinus_ = 0;
202 for(
size_t ihit = 0; ihit<hits->
size(); ++ ihit){
203 const HFRecHit & rechit = (*hits)[ ihit ];
204 if(rechit.
id().
ieta() > 0 )
205 creco->etHFhitSumPlus_ += rechit.
energy();
206 if(rechit.
id().
ieta() < 0)
207 creco->etHFhitSumMinus_ += rechit.
energy();
211 creco->etHFhitSumMinus_ = inputCentrality->EtHFhitSumMinus();
212 creco->etHFhitSumPlus_ = inputCentrality->EtHFhitSumPlus();
217 creco->etHFtowerSumPlus_ = 0;
218 creco->etHFtowerSumMinus_ = 0;
219 creco->etHFtowerSumECutPlus_ = 0;
220 creco->etHFtowerSumECutMinus_ = 0;
221 creco->etMidRapiditySum_ = 0;
227 for(
size_t i = 0;
i<towers->
size(); ++
i){
233 creco->etHFtowerSumPlus_ += tower.
pt();
234 if(tower.
energy() > 1.5) creco->etHFtowerSumECutPlus_ += tower.
pt();
235 if(eta >
hfEtaCut_) creco->etHFtruncatedPlus_ += tower.
pt();
238 creco->etHFtowerSumMinus_ += tower.
pt();
239 if(tower.
energy() > 1.5) creco->etHFtowerSumECutMinus_ += tower.
pt();
240 if(eta < -
hfEtaCut_) creco->etHFtruncatedMinus_ += tower.
pt();
244 creco->etHFtowerSumMinus_ = inputCentrality->EtHFtowerSumMinus();
245 creco->etHFtowerSumPlus_ = inputCentrality->EtHFtowerSumPlus();
246 creco->etHFtowerSumECutMinus_ = inputCentrality->EtHFtowerSumECutMinus();
247 creco->etHFtowerSumECutPlus_ = inputCentrality->EtHFtowerSumECutPlus();
248 creco->etHFtruncatedMinus_ = inputCentrality->EtHFtruncatedMinus();
249 creco->etHFtruncatedPlus_ = inputCentrality->EtHFtruncatedPlus();
254 }
else if(
reuseAny_) creco->etMidRapiditySum_ = inputCentrality->EtMidRapiditySum();
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();
267 creco->etEESumPlus_ = 0;
268 creco->etEESumMinus_ = 0;
277 for(
unsigned int i = 0;
i < ebHits->
size(); ++
i){
281 creco->etEBSum_ +=
et;
284 for(
unsigned int i = 0;
i < eeHits->
size(); ++
i){
289 creco->etEESumPlus_ +=
et;
291 creco->etEESumMinus_ +=
et;
296 creco->etEESumMinus_ = inputCentrality->EtEESumMinus();
297 creco->etEESumPlus_ = inputCentrality->EtEESumPlus();
298 creco->etEBSum_ = inputCentrality->EtEBSum();
303 creco->pixelMultiplicity_ = 0;
310 int nPixel_minus =0 ;
318 recHitIterator != recHitRange.
end(); ++recHitIterator) {
325 double eta = rechitPos.
eta();
326 double abeta =
std::abs(rechitPos.eta());
327 int clusterSize = recHit->
cluster()->size();
331 if (layer==1 && 18*abeta-40>clusterSize)
continue;
332 if (layer==2 && 6*abeta-7.2>clusterSize)
continue;
333 if ((layer==3 || layer==4) && 4*abeta-2.4>clusterSize)
continue;
337 if(eta>=0) nPixel_plus++;
338 if(eta<0) nPixel_minus++;
342 creco->pixelMultiplicity_ = nPixel;
343 creco->pixelMultiplicityPlus_ = nPixel_plus;
344 creco->pixelMultiplicityMinus_ = nPixel_minus;
347 creco->pixelMultiplicity_ = inputCentrality->multiplicityPixel();
348 creco->pixelMultiplicityPlus_ = inputCentrality->multiplicityPixelPlus();
349 creco->pixelMultiplicityMinus_ = inputCentrality->multiplicityPixelMinus();
358 double vxError=-999.;
359 double vyError=-999.;
360 double vzError=-999.;
365 unsigned int daughter = 0;
368 for (
unsigned int i = 0 ;
i< recoVertices->size(); ++
i){
369 daughter = (*recoVertices)[
i].tracksSize();
370 if( daughter > (*recoVertices)[greatestvtx].tracksSize()) greatestvtx =
i;
373 if(!recoVertices->empty()){
374 vx = (*recoVertices)[greatestvtx].position().x();
375 vy = (*recoVertices)[greatestvtx].position().y();
376 vz = (*recoVertices)[greatestvtx].position().z();
377 vxError = (*recoVertices)[greatestvtx].xError();
378 vyError = (*recoVertices)[greatestvtx].yError();
379 vzError = (*recoVertices)[greatestvtx].zError();
388 double trackCounter = 0;
389 double trackCounterEta = 0;
390 double trackCounterEtaPt = 0;
392 for(
unsigned int i = 0 ;
i < tracks->size(); ++
i){
403 double dz= track.
dz(v1);
404 double dzsigma2 = track.
dzError()*track.
dzError()+vzError*vzError;
405 double dxy= track.
dxy(v1);
408 const double pterrcut = 0.1;
409 const double dzrelcut = 3.0;
410 const double dxyrelcut = 3.0;
415 dz*dz < dzrelcut*dzrelcut * dzsigma2 &&
416 dxy*dxy < dxyrelcut*dxyrelcut * dxysigma2 ){
421 creco->trackMultiplicity_ =
nTracks;
422 creco->ntracksPtCut_ = trackCounter;
423 creco->ntracksEtaCut_ = trackCounterEta;
424 creco->ntracksEtaPtCut_ = trackCounterEtaPt;
428 creco->trackMultiplicity_ = inputCentrality->Ntracks();
429 creco->ntracksPtCut_= inputCentrality->NtracksPtCut();
430 creco->ntracksEtaCut_= inputCentrality->NtracksEtaCut();
431 creco->ntracksEtaPtCut_= inputCentrality->NtracksEtaPtCut();
438 int nPixelTracks = pixeltracks->size();
439 int nPixelTracksPlus = 0;
440 int nPixelTracksMinus = 0;
442 for (
auto const& track : *pixeltracks){
443 if(track.
eta()<0) nPixelTracksMinus++;
444 else nPixelTracksPlus++;
446 creco->nPixelTracks_ = nPixelTracks;
447 creco->nPixelTracksPlus_ = nPixelTracksPlus;
448 creco->nPixelTracksMinus_ = nPixelTracksMinus;
452 creco->nPixelTracks_ = inputCentrality->NpixelTracks();
453 creco->nPixelTracksPlus_ = inputCentrality->NpixelTracksPlus();
454 creco->nPixelTracksMinus_ = inputCentrality->NpixelTracksMinus();
459 creco->zdcSumPlus_ = 0;
460 creco->zdcSumMinus_ = 0;
465 for(
size_t ihit = 0; ihit<hits->
size(); ++ ihit){
466 const ZDCRecHit & rechit = (*hits)[ ihit ];
471 creco->zdcSumPlus_ += rechit.
energy();
478 creco->zdcSumMinus_ += rechit.
energy();
483 creco->zdcSumPlus_ = -9;
484 creco->zdcSumMinus_ = -9;
488 creco->zdcSumMinus_ = inputCentrality->zdcSumMinus();
489 creco->zdcSumPlus_ = inputCentrality->zdcSumPlus();
constexpr float energy() const
reco::TrackBase::TrackQuality trackQuality_
boost::transform_iterator< IterHelp, const_IdIter > const_iterator
const unsigned int nTracks(const reco::Vertex &sv)
const_iterator end(bool update=false) const
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
double eta() const final
momentum pseudorapidity
edm::EDGetTokenT< EcalRecHitCollection > srcEBhits_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
edm::EDGetTokenT< Centrality > reuseTag_
double dxyError() const
error on dxy
GlobalPoint toGlobal(const Local2DPoint &lp) const
Conversion to the global R.F. from the R.F. of the GeomDet.
int zside() const
get the z-side of the cell (1/-1)
double pt() const final
transverse momentum
edm::EDGetTokenT< VertexCollection > srcVertex_
edm::EDGetTokenT< CaloTowerCollection > srcTowers_
double eta() const
pseudorapidity of momentum vector
double pt() const
track transverse momentum
double ptError() const
error on Pt (set to 1000 TeV if charge==0 for safety)
int ieta() const
get the cell ieta
double energy() const final
energy
constexpr int subdetId() const
get the contents of the subdetector field (not cast into any detector's numbering enum) ...
edm::EDGetTokenT< HFRecHitCollection > srcHFhits_
GlobalPoint getPosition(const DetId &id) const
Get the position of a given detector id.
Abs< T >::type abs(const T &t)
float lowGainEnergy() const
double dz() const
dz parameter (= dsz/cos(lambda)). This is the track z0 w.r.t (0,0,0) only if the refPoint is close to...
double dzError() const
error on dz
DetId id() const
get the id
T const * product() const
XYZVectorD XYZVector
spatial vector with cartesian internal representation
XYZPointD XYZPoint
point in space with cartesian internal representation
edm::EDGetTokenT< ZDCRecHitCollection > srcZDChits_
ClusterRef cluster() const
bool isHF(int etabin, int depth)
edm::ESHandle< CaloGeometry > cGeo
et
define resolution functions of each parameter
bool quality(const TrackQuality) const
Track quality.
unsigned int layer(const DetId &id) const
const_iterator find(id_type i, bool update=false) const
edm::EDGetTokenT< SiPixelRecHitCollection > srcPixelhits_
edm::ESHandle< TrackerTopology > topo_
edm::EDGetTokenT< TrackCollection > srcPixelTracks_
edm::EDGetTokenT< TrackCollection > srcTracks_
const TrackerGeomDet * idToDet(DetId) const override
HcalZDCDetId id() const
get the id
LocalPoint localPosition() const final
edm::ESHandle< TrackerGeometry > tGeo
DetId geographicalId() const
edm::EDGetTokenT< EcalRecHitCollection > srcEEhits_
double dxy() const
dxy parameter. (This is the transverse impact parameter w.r.t. to (0,0,0) ONLY if refPoint is close t...
const_iterator begin(bool update=false) const
constexpr Detector det() const
get the detector field from this detid