Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:34:40

0001 //
0002 // Original Author:  Yetkin Yilmaz, Young Soo Park
0003 //         Created:  Wed Jun 11 15:31:41 CEST 2008
0004 //
0005 //
0006 
0007 // system include files
0008 #include <memory>
0009 #include <iostream>
0010 
0011 // user include files
0012 #include "FWCore/Framework/interface/Frameworkfwd.h"
0013 #include "FWCore/Framework/interface/global/EDProducer.h"
0014 #include "FWCore/Utilities/interface/StreamID.h"
0015 #include "FWCore/Framework/interface/Event.h"
0016 #include "FWCore/Framework/interface/EventSetup.h"
0017 
0018 #include "FWCore/Framework/interface/MakerMacros.h"
0019 #include "FWCore/Framework/interface/ESHandle.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 #include "FWCore/Utilities/interface/InputTag.h"
0022 #include "FWCore/Utilities/interface/ESGetToken.h"
0023 
0024 #include "DataFormats/Candidate/interface/Candidate.h"
0025 
0026 #include "DataFormats/HeavyIonEvent/interface/Centrality.h"
0027 #include "DataFormats/CaloTowers/interface/CaloTowerCollection.h"
0028 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
0029 
0030 #include "DataFormats/Common/interface/Ref.h"
0031 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHitCollection.h"
0032 #include "DataFormats/TrackerRecHit2D/interface/SiPixelRecHit.h"
0033 #include "DataFormats/TrackReco/interface/Track.h"
0034 #include "DataFormats/VertexReco/interface/Vertex.h"
0035 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0036 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0037 
0038 #include "Geometry/Records/interface/CaloGeometryRecord.h"
0039 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0040 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0041 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0042 #include "Geometry/CommonDetUnit/interface/PixelGeomDetUnit.h"
0043 
0044 using namespace std;
0045 using namespace edm;
0046 using namespace reco;
0047 
0048 //
0049 // class declaration
0050 //
0051 
0052 namespace reco {
0053   class CentralityProducer : public edm::global::EDProducer<> {
0054   public:
0055     explicit CentralityProducer(const edm::ParameterSet&);
0056     ~CentralityProducer() override = default;
0057     static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);
0058 
0059   private:
0060     void beginJob() override;
0061     void produce(edm::StreamID, edm::Event&, const edm::EventSetup&) const override;
0062     void endJob() override;
0063 
0064     // ----------member data ---------------------------
0065 
0066     const bool produceHFhits_;
0067     const bool produceHFtowers_;
0068     const bool produceEcalhits_;
0069     const bool produceZDChits_;
0070     const bool lowGainZDC_;
0071     const bool produceETmidRap_;
0072     const bool producePixelhits_;
0073     const bool doPixelCut_;
0074     const bool produceTracks_;
0075     const bool producePixelTracks_;
0076 
0077     const double midRapidityRange_;
0078     const double trackPtCut_;
0079     const double trackEtaCut_;
0080     const double hfEtaCut_;
0081 
0082     const bool reuseAny_;
0083     const bool useQuality_;
0084     const reco::TrackBase::TrackQuality trackQuality_;
0085 
0086     const edm::EDGetTokenT<HFRecHitCollection> srcHFhits_;
0087     const edm::EDGetTokenT<CaloTowerCollection> srcTowers_;
0088     const edm::EDGetTokenT<EcalRecHitCollection> srcEBhits_;
0089     const edm::EDGetTokenT<EcalRecHitCollection> srcEEhits_;
0090     const edm::EDGetTokenT<ZDCRecHitCollection> srcZDChits_;
0091     const edm::EDGetTokenT<SiPixelRecHitCollection> srcPixelhits_;
0092     const edm::EDGetTokenT<TrackCollection> srcTracks_;
0093     const edm::EDGetTokenT<TrackCollection> srcPixelTracks_;
0094     const edm::EDGetTokenT<VertexCollection> srcVertex_;
0095     const edm::EDGetTokenT<Centrality> reuseTag_;
0096 
0097     const edm::ESGetToken<CaloGeometry, CaloGeometryRecord> caloGeom_;
0098     const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> trackerGeom_;
0099     const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> trackerTopo_;
0100   };
0101 
0102   //
0103   // constants, enums and typedefs
0104   //
0105 
0106   //
0107   // static data member definitions
0108   //
0109 
0110   //
0111   // constructors and destructor
0112   //
0113   CentralityProducer::CentralityProducer(const edm::ParameterSet& iConfig)
0114       : produceHFhits_(iConfig.getParameter<bool>("produceHFhits")),
0115         produceHFtowers_(iConfig.getParameter<bool>("produceHFtowers")),
0116         produceEcalhits_(iConfig.getParameter<bool>("produceEcalhits")),
0117         produceZDChits_(iConfig.getParameter<bool>("produceZDChits")),
0118         lowGainZDC_(iConfig.getParameter<bool>("lowGainZDC")),
0119         produceETmidRap_(iConfig.getParameter<bool>("produceETmidRapidity")),
0120         producePixelhits_(iConfig.getParameter<bool>("producePixelhits")),
0121         doPixelCut_(iConfig.getParameter<bool>("doPixelCut")),
0122         produceTracks_(iConfig.getParameter<bool>("produceTracks")),
0123         producePixelTracks_(iConfig.getParameter<bool>("producePixelTracks")),
0124         midRapidityRange_(iConfig.getParameter<double>("midRapidityRange")),
0125         trackPtCut_(iConfig.getParameter<double>("trackPtCut")),
0126         trackEtaCut_(iConfig.getParameter<double>("trackEtaCut")),
0127         hfEtaCut_(iConfig.getParameter<double>("hfEtaCut")),
0128         reuseAny_(iConfig.getParameter<bool>("reUseCentrality")),
0129         useQuality_(iConfig.getParameter<bool>("useQuality")),
0130         trackQuality_(TrackBase::qualityByName(iConfig.getParameter<std::string>("trackQuality"))),
0131         srcHFhits_(produceHFhits_ ? consumes<HFRecHitCollection>(iConfig.getParameter<edm::InputTag>("srcHFhits"))
0132                                   : edm::EDGetTokenT<HFRecHitCollection>()),
0133         srcTowers_((produceHFtowers_ || produceETmidRap_)
0134                        ? consumes<CaloTowerCollection>(iConfig.getParameter<edm::InputTag>("srcTowers"))
0135                        : edm::EDGetTokenT<CaloTowerCollection>()),
0136         srcEBhits_(produceEcalhits_ ? consumes<EcalRecHitCollection>(iConfig.getParameter<edm::InputTag>("srcEBhits"))
0137                                     : edm::EDGetTokenT<EcalRecHitCollection>()),
0138         srcEEhits_(produceEcalhits_ ? consumes<EcalRecHitCollection>(iConfig.getParameter<edm::InputTag>("srcEEhits"))
0139                                     : edm::EDGetTokenT<EcalRecHitCollection>()),
0140         srcZDChits_(produceZDChits_ ? consumes<ZDCRecHitCollection>(iConfig.getParameter<edm::InputTag>("srcZDChits"))
0141                                     : edm::EDGetTokenT<ZDCRecHitCollection>()),
0142         srcPixelhits_(producePixelhits_
0143                           ? consumes<SiPixelRecHitCollection>(iConfig.getParameter<edm::InputTag>("srcPixelhits"))
0144                           : edm::EDGetTokenT<SiPixelRecHitCollection>()),
0145         srcTracks_(produceTracks_ ? consumes<TrackCollection>(iConfig.getParameter<edm::InputTag>("srcTracks"))
0146                                   : edm::EDGetTokenT<TrackCollection>()),
0147         srcPixelTracks_(producePixelTracks_
0148                             ? consumes<TrackCollection>(iConfig.getParameter<edm::InputTag>("srcPixelTracks"))
0149                             : edm::EDGetTokenT<TrackCollection>()),
0150         srcVertex_((produceTracks_ || producePixelTracks_)
0151                        ? consumes<VertexCollection>(iConfig.getParameter<edm::InputTag>("srcVertex"))
0152                        : edm::EDGetTokenT<VertexCollection>()),
0153         reuseTag_(reuseAny_ ? consumes<Centrality>(iConfig.getParameter<edm::InputTag>("srcReUse"))
0154                             : edm::EDGetTokenT<Centrality>()),
0155         caloGeom_(produceEcalhits_ ? esConsumes<CaloGeometry, CaloGeometryRecord>()
0156                                    : edm::ESGetToken<CaloGeometry, CaloGeometryRecord>()),
0157         trackerGeom_(producePixelhits_ ? esConsumes<TrackerGeometry, TrackerDigiGeometryRecord>()
0158                                        : edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord>()),
0159         trackerTopo_(producePixelhits_ ? esConsumes<TrackerTopology, TrackerTopologyRcd>()
0160                                        : edm::ESGetToken<TrackerTopology, TrackerTopologyRcd>()) {
0161     produces<Centrality>();
0162   }
0163 
0164   //
0165   // member functions
0166   //
0167 
0168   // ------------ method called to produce the data  ------------
0169   void CentralityProducer::produce(edm::StreamID sid, edm::Event& iEvent, const edm::EventSetup& iSetup) const {
0170     auto creco = std::make_unique<Centrality>();
0171     Handle<Centrality> inputCentrality;
0172     if (reuseAny_)
0173       iEvent.getByToken(reuseTag_, inputCentrality);
0174 
0175     if (produceHFhits_) {
0176       creco->etHFhitSumPlus_ = 0;
0177       creco->etHFhitSumMinus_ = 0;
0178       Handle<HFRecHitCollection> hits;
0179       iEvent.getByToken(srcHFhits_, hits);
0180       for (size_t ihit = 0; ihit < hits->size(); ++ihit) {
0181         const HFRecHit& rechit = (*hits)[ihit];
0182         if (rechit.id().ieta() > 0)
0183           creco->etHFhitSumPlus_ += rechit.energy();
0184         if (rechit.id().ieta() < 0)
0185           creco->etHFhitSumMinus_ += rechit.energy();
0186       }
0187     } else {
0188       if (reuseAny_) {
0189         creco->etHFhitSumMinus_ = inputCentrality->EtHFhitSumMinus();
0190         creco->etHFhitSumPlus_ = inputCentrality->EtHFhitSumPlus();
0191       }
0192     }
0193 
0194     if (produceHFtowers_ || produceETmidRap_) {
0195       creco->etHFtowerSumPlus_ = 0;
0196       creco->etHFtowerSumMinus_ = 0;
0197       creco->etHFtowerSumECutPlus_ = 0;
0198       creco->etHFtowerSumECutMinus_ = 0;
0199       creco->etMidRapiditySum_ = 0;
0200 
0201       Handle<CaloTowerCollection> towers;
0202       iEvent.getByToken(srcTowers_, towers);
0203 
0204       for (size_t i = 0; i < towers->size(); ++i) {
0205         const CaloTower& tower = (*towers)[i];
0206         double eta = tower.eta();
0207         if (produceHFtowers_) {
0208           bool isHF = tower.ietaAbs() > 29;
0209           if (isHF && eta > 0) {
0210             creco->etHFtowerSumPlus_ += tower.pt();
0211             if (tower.energy() > 1.5)
0212               creco->etHFtowerSumECutPlus_ += tower.pt();
0213             if (eta > hfEtaCut_)
0214               creco->etHFtruncatedPlus_ += tower.pt();
0215           } else if (isHF && eta < 0) {
0216             creco->etHFtowerSumMinus_ += tower.pt();
0217             if (tower.energy() > 1.5)
0218               creco->etHFtowerSumECutMinus_ += tower.pt();
0219             if (eta < -hfEtaCut_)
0220               creco->etHFtruncatedMinus_ += tower.pt();
0221           }
0222         } else {
0223           if (reuseAny_) {
0224             creco->etHFtowerSumMinus_ = inputCentrality->EtHFtowerSumMinus();
0225             creco->etHFtowerSumPlus_ = inputCentrality->EtHFtowerSumPlus();
0226             creco->etHFtowerSumECutMinus_ = inputCentrality->EtHFtowerSumECutMinus();
0227             creco->etHFtowerSumECutPlus_ = inputCentrality->EtHFtowerSumECutPlus();
0228             creco->etHFtruncatedMinus_ = inputCentrality->EtHFtruncatedMinus();
0229             creco->etHFtruncatedPlus_ = inputCentrality->EtHFtruncatedPlus();
0230           }
0231         }
0232         if (produceETmidRap_) {
0233           if (std::abs(eta) < midRapidityRange_)
0234             creco->etMidRapiditySum_ += tower.pt() / (midRapidityRange_ * 2.);
0235         } else if (reuseAny_)
0236           creco->etMidRapiditySum_ = inputCentrality->EtMidRapiditySum();
0237       }
0238     } else {
0239       if (reuseAny_) {
0240         creco->etHFtowerSumMinus_ = inputCentrality->EtHFtowerSumMinus();
0241         creco->etHFtowerSumPlus_ = inputCentrality->EtHFtowerSumPlus();
0242         creco->etHFtowerSumECutMinus_ = inputCentrality->EtHFtowerSumECutMinus();
0243         creco->etHFtowerSumECutPlus_ = inputCentrality->EtHFtowerSumECutPlus();
0244         creco->etMidRapiditySum_ = inputCentrality->EtMidRapiditySum();
0245       }
0246     }
0247 
0248     if (produceEcalhits_) {
0249       creco->etEESumPlus_ = 0;
0250       creco->etEESumMinus_ = 0;
0251       creco->etEBSum_ = 0;
0252 
0253       Handle<EcalRecHitCollection> ebHits;
0254       Handle<EcalRecHitCollection> eeHits;
0255       iEvent.getByToken(srcEBhits_, ebHits);
0256       iEvent.getByToken(srcEEhits_, eeHits);
0257 
0258       edm::ESHandle<CaloGeometry> cGeo = iSetup.getHandle(caloGeom_);
0259       for (unsigned int i = 0; i < ebHits->size(); ++i) {
0260         const EcalRecHit& hit = (*ebHits)[i];
0261         const GlobalPoint& pos = cGeo->getPosition(hit.id());
0262         double et = hit.energy() * (pos.perp() / pos.mag());
0263         creco->etEBSum_ += et;
0264       }
0265 
0266       for (unsigned int i = 0; i < eeHits->size(); ++i) {
0267         const EcalRecHit& hit = (*eeHits)[i];
0268         const GlobalPoint& pos = cGeo->getPosition(hit.id());
0269         double et = hit.energy() * (pos.perp() / pos.mag());
0270         if (pos.z() > 0) {
0271           creco->etEESumPlus_ += et;
0272         } else {
0273           creco->etEESumMinus_ += et;
0274         }
0275       }
0276     } else {
0277       if (reuseAny_) {
0278         creco->etEESumMinus_ = inputCentrality->EtEESumMinus();
0279         creco->etEESumPlus_ = inputCentrality->EtEESumPlus();
0280         creco->etEBSum_ = inputCentrality->EtEBSum();
0281       }
0282     }
0283 
0284     if (producePixelhits_) {
0285       edm::ESHandle<TrackerGeometry> tGeo = iSetup.getHandle(trackerGeom_);
0286       edm::ESHandle<TrackerTopology> topo = iSetup.getHandle(trackerTopo_);
0287       creco->pixelMultiplicity_ = 0;
0288       const SiPixelRecHitCollection* rechits;
0289       Handle<SiPixelRecHitCollection> rchts;
0290       iEvent.getByToken(srcPixelhits_, rchts);
0291       rechits = rchts.product();
0292       int nPixel = 0;
0293       int nPixel_plus = 0;
0294       int nPixel_minus = 0;
0295       for (SiPixelRecHitCollection::const_iterator it = rechits->begin(); it != rechits->end(); it++) {
0296         SiPixelRecHitCollection::DetSet hits = *it;
0297         DetId detId = DetId(hits.detId());
0298         SiPixelRecHitCollection::const_iterator recHitMatch = rechits->find(detId);
0299         const SiPixelRecHitCollection::DetSet recHitRange = *recHitMatch;
0300         for (SiPixelRecHitCollection::DetSet::const_iterator recHitIterator = recHitRange.begin();
0301              recHitIterator != recHitRange.end();
0302              ++recHitIterator) {
0303           // add selection if needed, now all hits.
0304           const SiPixelRecHit* recHit = &(*recHitIterator);
0305           const PixelGeomDetUnit* pixelLayer =
0306               dynamic_cast<const PixelGeomDetUnit*>(tGeo->idToDet(recHit->geographicalId()));
0307           GlobalPoint gpos = pixelLayer->toGlobal(recHit->localPosition());
0308           math::XYZVector rechitPos(gpos.x(), gpos.y(), gpos.z());
0309           double eta = rechitPos.eta();
0310           int clusterSize = recHit->cluster()->size();
0311           unsigned layer = topo->layer(detId);
0312           if (doPixelCut_) {
0313             if (detId.det() == DetId::Tracker && detId.subdetId() == PixelSubdetector::PixelBarrel) {
0314               double abeta = std::abs(eta);
0315               if (layer == 1) {
0316                 if (18 * abeta - 40 > clusterSize)
0317                   continue;
0318               } else if (layer == 2) {
0319                 if (6 * abeta - 7.2 > clusterSize)
0320                   continue;
0321               } else if (layer == 3 || layer == 4) {
0322                 if (4 * abeta - 2.4 > clusterSize)
0323                   continue;
0324               }
0325             }
0326           }
0327           nPixel++;
0328           if (eta >= 0)
0329             nPixel_plus++;
0330           else if (eta < 0)
0331             nPixel_minus++;
0332         }
0333       }
0334       creco->pixelMultiplicity_ = nPixel;
0335       creco->pixelMultiplicityPlus_ = nPixel_plus;
0336       creco->pixelMultiplicityMinus_ = nPixel_minus;
0337     } else {
0338       if (reuseAny_) {
0339         creco->pixelMultiplicity_ = inputCentrality->multiplicityPixel();
0340         creco->pixelMultiplicityPlus_ = inputCentrality->multiplicityPixelPlus();
0341         creco->pixelMultiplicityMinus_ = inputCentrality->multiplicityPixelMinus();
0342       }
0343     }
0344 
0345     if (produceTracks_) {
0346       double vx = -999.;
0347       double vy = -999.;
0348       double vz = -999.;
0349       double vxError = -999.;
0350       double vyError = -999.;
0351       double vzError = -999.;
0352       math::XYZVector vtxPos(0, 0, 0);
0353 
0354       Handle<VertexCollection> recoVertices;
0355       iEvent.getByToken(srcVertex_, recoVertices);
0356       unsigned int daughter = 0;
0357       int greatestvtx = 0;
0358 
0359       for (unsigned int i = 0; i < recoVertices->size(); ++i) {
0360         daughter = (*recoVertices)[i].tracksSize();
0361         if (daughter > (*recoVertices)[greatestvtx].tracksSize())
0362           greatestvtx = i;
0363       }
0364 
0365       if (!recoVertices->empty()) {
0366         vx = (*recoVertices)[greatestvtx].position().x();
0367         vy = (*recoVertices)[greatestvtx].position().y();
0368         vz = (*recoVertices)[greatestvtx].position().z();
0369         vxError = (*recoVertices)[greatestvtx].xError();
0370         vyError = (*recoVertices)[greatestvtx].yError();
0371         vzError = (*recoVertices)[greatestvtx].zError();
0372       }
0373 
0374       vtxPos = math::XYZVector(vx, vy, vz);
0375 
0376       Handle<TrackCollection> tracks;
0377       iEvent.getByToken(srcTracks_, tracks);
0378       int nTracks = 0;
0379 
0380       double trackCounter = 0;
0381       double trackCounterEta = 0;
0382       double trackCounterEtaPt = 0;
0383 
0384       for (unsigned int i = 0; i < tracks->size(); ++i) {
0385         const Track& track = (*tracks)[i];
0386         if (useQuality_ && !track.quality(trackQuality_))
0387           continue;
0388 
0389         if (track.pt() > trackPtCut_)
0390           trackCounter++;
0391         if (std::abs(track.eta()) < trackEtaCut_) {
0392           trackCounterEta++;
0393           if (track.pt() > trackPtCut_)
0394             trackCounterEtaPt++;
0395         }
0396 
0397         math::XYZPoint v1(vx, vy, vz);
0398         double dz = track.dz(v1);
0399         double dzsigma2 = track.dzError() * track.dzError() + vzError * vzError;
0400         double dxy = track.dxy(v1);
0401         double dxysigma2 = track.dxyError() * track.dxyError() + vxError * vyError;
0402 
0403         const double pterrcut = 0.1;
0404         const double dzrelcut = 3.0;
0405         const double dxyrelcut = 3.0;
0406 
0407         if (track.quality(trackQuality_) && track.pt() > 0.4 && std::abs(track.eta()) < 2.4 &&
0408             track.ptError() / track.pt() < pterrcut && dz * dz < dzrelcut * dzrelcut * dzsigma2 &&
0409             dxy * dxy < dxyrelcut * dxyrelcut * dxysigma2) {
0410           nTracks++;
0411         }
0412       }
0413 
0414       creco->trackMultiplicity_ = nTracks;
0415       creco->ntracksPtCut_ = trackCounter;
0416       creco->ntracksEtaCut_ = trackCounterEta;
0417       creco->ntracksEtaPtCut_ = trackCounterEtaPt;
0418 
0419     } else {
0420       if (reuseAny_) {
0421         creco->trackMultiplicity_ = inputCentrality->Ntracks();
0422         creco->ntracksPtCut_ = inputCentrality->NtracksPtCut();
0423         creco->ntracksEtaCut_ = inputCentrality->NtracksEtaCut();
0424         creco->ntracksEtaPtCut_ = inputCentrality->NtracksEtaPtCut();
0425       }
0426     }
0427 
0428     if (producePixelTracks_) {
0429       Handle<TrackCollection> pixeltracks;
0430       iEvent.getByToken(srcPixelTracks_, pixeltracks);
0431       int nPixelTracks = pixeltracks->size();
0432       int nPixelTracksPlus = 0;
0433       int nPixelTracksMinus = 0;
0434 
0435       for (auto const& track : *pixeltracks) {
0436         if (track.eta() < 0)
0437           nPixelTracksMinus++;
0438         else
0439           nPixelTracksPlus++;
0440       }
0441       creco->nPixelTracks_ = nPixelTracks;
0442       creco->nPixelTracksPlus_ = nPixelTracksPlus;
0443       creco->nPixelTracksMinus_ = nPixelTracksMinus;
0444     } else {
0445       if (reuseAny_) {
0446         creco->nPixelTracks_ = inputCentrality->NpixelTracks();
0447         creco->nPixelTracksPlus_ = inputCentrality->NpixelTracksPlus();
0448         creco->nPixelTracksMinus_ = inputCentrality->NpixelTracksMinus();
0449       }
0450     }
0451 
0452     if (produceZDChits_) {
0453       creco->zdcSumPlus_ = 0;
0454       creco->zdcSumMinus_ = 0;
0455 
0456       Handle<ZDCRecHitCollection> hits;
0457       bool zdcAvailable = iEvent.getByToken(srcZDChits_, hits);
0458       if (zdcAvailable) {
0459         for (size_t ihit = 0; ihit < hits->size(); ++ihit) {
0460           const ZDCRecHit& rechit = (*hits)[ihit];
0461           if (rechit.id().zside() > 0) {
0462             if (lowGainZDC_) {
0463               creco->zdcSumPlus_ += rechit.lowGainEnergy();
0464             } else {
0465               creco->zdcSumPlus_ += rechit.energy();
0466             }
0467           }
0468           if (rechit.id().zside() < 0) {
0469             if (lowGainZDC_) {
0470               creco->zdcSumMinus_ += rechit.lowGainEnergy();
0471             } else {
0472               creco->zdcSumMinus_ += rechit.energy();
0473             }
0474           }
0475         }
0476       } else {
0477         creco->zdcSumPlus_ = -9;
0478         creco->zdcSumMinus_ = -9;
0479       }
0480     } else {
0481       if (reuseAny_) {
0482         creco->zdcSumMinus_ = inputCentrality->zdcSumMinus();
0483         creco->zdcSumPlus_ = inputCentrality->zdcSumPlus();
0484       }
0485     }
0486 
0487     iEvent.put(std::move(creco));
0488   }
0489 
0490   void CentralityProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
0491     edm::ParameterSetDescription desc;
0492     desc.add<bool>("produceHFhits", true);
0493     desc.add<bool>("produceHFtowers", true);
0494     desc.add<bool>("produceEcalhits", true);
0495     desc.add<bool>("produceZDChits", true);
0496     desc.add<bool>("produceETmidRapidity", true);
0497     desc.add<bool>("producePixelhits", true);
0498     desc.add<bool>("produceTracks", true);
0499     desc.add<bool>("producePixelTracks", true);
0500     desc.add<bool>("reUseCentrality", false);
0501     desc.add<edm::InputTag>("srcHFhits", edm::InputTag("hfreco"));
0502     desc.add<edm::InputTag>("srcTowers", edm::InputTag("towerMaker"));
0503     desc.add<edm::InputTag>("srcEBhits", edm::InputTag("ecalRecHit", "EcalRecHitsEB"));
0504     desc.add<edm::InputTag>("srcEEhits", edm::InputTag("ecalRecHit", "EcalRecHitsEE"));
0505     desc.add<edm::InputTag>("srcZDChits", edm::InputTag("zdcreco"));
0506     desc.add<edm::InputTag>("srcPixelhits", edm::InputTag("siPixelRecHits"));
0507     desc.add<edm::InputTag>("srcTracks", edm::InputTag("hiGeneralTracks"));
0508     desc.add<edm::InputTag>("srcVertex", edm::InputTag("hiSelectedVertex"));
0509     desc.add<edm::InputTag>("srcReUse", edm::InputTag("hiCentrality"));
0510     desc.add<edm::InputTag>("srcPixelTracks", edm::InputTag("hiPixel3PrimTracks"));
0511     desc.add<bool>("doPixelCut", true);
0512     desc.add<bool>("useQuality", true);
0513     desc.add<string>("trackQuality", "highPurity");
0514     desc.add<double>("trackEtaCut", 2);
0515     desc.add<double>("trackPtCut", 1);
0516     desc.add<double>("hfEtaCut", 4)->setComment("hf above the absolute value of this cut is used");
0517     desc.add<double>("midRapidityRange", 1);
0518     desc.add<bool>("lowGainZDC", true);
0519 
0520     descriptions.addDefault(desc);
0521   }
0522 
0523   // ------------ method called once each job just before starting event loop  ------------
0524   void CentralityProducer::beginJob() {}
0525 
0526   // ------------ method called once each job just after ending the event loop  ------------
0527   void CentralityProducer::endJob() {}
0528 
0529   //define this as a plug-in
0530   DEFINE_FWK_MODULE(CentralityProducer);
0531 
0532 }  // namespace reco