CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Types | Private Member Functions | Private Attributes
GEDPhotonGSCrysFixer Class Reference

#include <GEDPhotonGSCrysFixer.h>

Inheritance diagram for GEDPhotonGSCrysFixer:
edm::stream::EDProducer<> edm::stream::EDProducerBase edm::ProducerBase edm::EDConsumerBase edm::ProductRegistryHelper

Public Member Functions

void beginLuminosityBlock (edm::LuminosityBlock const &, edm::EventSetup const &) override
 
 GEDPhotonGSCrysFixer (const edm::ParameterSet &)
 
void produce (edm::Event &, const edm::EventSetup &) override
 
 ~GEDPhotonGSCrysFixer ()
 
- Public Member Functions inherited from edm::stream::EDProducer<>
 EDProducer ()=default
 
- Public Member Functions inherited from edm::stream::EDProducerBase
 EDProducerBase ()
 
ModuleDescription const & moduleDescription () const
 
virtual ~EDProducerBase ()
 
- Public Member Functions inherited from edm::ProducerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 ProducerBase ()
 
void registerProducts (ProducerBase *, ProductRegistry *, ModuleDescription const &)
 
std::function< void(BranchDescription
const &)> 
registrationCallback () const
 used by the fwk to register list of products More...
 
virtual ~ProducerBase ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (std::string const &iProcessName, std::string const &iModuleLabel, bool iPrint, std::vector< char const * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Types

typedef edm::View< reco::PhotonPhotonView
 
typedef edm::ValueMap
< reco::SuperClusterRef
SCRefMap
 

Private Member Functions

template<typename T >
edm::Handle< TgetHandle (edm::Event const &iEvent, edm::EDGetTokenT< T > const &token, std::string const &name)
 
template<typename T >
void getToken (edm::EDGetTokenT< T > &token, edm::ParameterSet const &pset, std::string const &label, std::string const &instance="")
 

Private Attributes

edm::EDGetTokenT
< EcalRecHitCollection
ebHitsToken_
 
PhotonEnergyCorrector energyCorrector_
 
CaloGeometry const * geometry_ {0}
 
edm::EDGetTokenT< PhotonViewinputPhotonsToken_
 
edm::EDGetTokenT
< reco::PhotonCoreCollection
newCoresToken_
 
edm::EDGetTokenT< SCRefMapnewCoresToOldSCMapToken_
 
CaloTopology const * topology_ {0}
 
edm::EDGetTokenT
< reco::VertexCollection
verticesToken_
 

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, GlobalCache
LuminosityBlockContext
 
typedef
CacheTypes::LuminosityBlockSummaryCache 
LuminosityBlockSummaryCache
 
typedef CacheTypes::RunCache RunCache
 
typedef RunContextT< RunCache,
GlobalCache
RunContext
 
typedef CacheTypes::RunSummaryCache RunSummaryCache
 
- Public Types inherited from edm::stream::EDProducerBase
typedef EDProducerAdaptorBase ModuleType
 
- Public Types inherited from edm::ProducerBase
typedef
ProductRegistryHelper::TypeLabelList 
TypeLabelList
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::stream::EDProducerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, 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 ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

Detailed Description

Definition at line 20 of file GEDPhotonGSCrysFixer.h.

Member Typedef Documentation

Definition at line 53 of file GEDPhotonGSCrysFixer.h.

Definition at line 54 of file GEDPhotonGSCrysFixer.h.

Constructor & Destructor Documentation

GEDPhotonGSCrysFixer::GEDPhotonGSCrysFixer ( const edm::ParameterSet config)

Definition at line 36 of file GEDPhotonGSCrysFixer.cc.

References edm::EDConsumerBase::consumesCollector(), ebHitsToken_, energyCorrector_, edm::ParameterSet::existsAs(), PhotonEnergyCorrector::gedRegression(), getToken(), inputPhotonsToken_, newCoresToken_, newCoresToOldSCMapToken_, and verticesToken_.

36  :
38 {
39  getToken(inputPhotonsToken_, config, "photons");
40  getToken(newCoresToken_, config, "newCores");
41  getToken(newCoresToOldSCMapToken_, config, "newCores");
42  getToken(ebHitsToken_, config, "barrelEcalHits");
43  getToken(verticesToken_, config, "primaryVertexProducer");
44 
45  if(config.existsAs<edm::ParameterSet>("regressionConfig")) {
46  auto&& collector(consumesCollector());
47  energyCorrector_.gedRegression()->setConsumes(collector);
48  }
49 
50  // output photon collection
51  produces<reco::PhotonCollection>();
52  // new photon -> old photon
53  produces<PhotonRefMap>();
54 }
bool existsAs(std::string const &parameterName, bool trackiness=true) const
checks if a parameter exists as a given type
Definition: ParameterSet.h:186
PhotonEnergyCorrector energyCorrector_
edm::EDGetTokenT< reco::VertexCollection > verticesToken_
std::unique_ptr< ModifyObjectValueBase > & gedRegression()
edm::EDGetTokenT< EcalRecHitCollection > ebHitsToken_
ConsumesCollector consumesCollector()
Use a ConsumesCollector to gather consumes information from helper functions.
void getToken(edm::EDGetTokenT< T > &token, edm::ParameterSet const &pset, std::string const &label, std::string const &instance="")
edm::EDGetTokenT< SCRefMap > newCoresToOldSCMapToken_
edm::EDGetTokenT< PhotonView > inputPhotonsToken_
edm::EDGetTokenT< reco::PhotonCoreCollection > newCoresToken_
GEDPhotonGSCrysFixer::~GEDPhotonGSCrysFixer ( )

Definition at line 56 of file GEDPhotonGSCrysFixer.cc.

57 {
58 }

Member Function Documentation

void GEDPhotonGSCrysFixer::beginLuminosityBlock ( edm::LuminosityBlock const &  _lb,
edm::EventSetup const &  _setup 
)
overridevirtual

Reimplemented from edm::stream::EDProducerBase.

Definition at line 61 of file GEDPhotonGSCrysFixer.cc.

References energyCorrector_, geometry_, edm::EventSetup::get(), PhotonEnergyCorrector::init(), edm::ESHandle< class >::product(), and topology_.

62 {
63  energyCorrector_.init(_setup);
64 
65  edm::ESHandle<CaloGeometry> geometryHandle;
66  _setup.get<CaloGeometryRecord>().get(geometryHandle);
67  geometry_ = geometryHandle.product();
68 
69  edm::ESHandle<CaloTopology> topologyHandle;
70  _setup.get<CaloTopologyRecord>().get(topologyHandle);
71  topology_ = topologyHandle.product();
72 }
CaloGeometry const * geometry_
PhotonEnergyCorrector energyCorrector_
void init(const edm::EventSetup &theEventSetup)
T const * product() const
Definition: ESHandle.h:86
CaloTopology const * topology_
template<typename T >
edm::Handle<T> GEDPhotonGSCrysFixer::getHandle ( edm::Event const &  iEvent,
edm::EDGetTokenT< T > const &  token,
std::string const &  name 
)
inlineprivate

Definition at line 44 of file GEDPhotonGSCrysFixer.h.

References edm::Event::getByToken(), patZpeak::handle, and mergeVDriftHistosByStation::name.

Referenced by produce().

45  {
47  if (!iEvent.getByToken(token, handle))
48  throw cms::Exception("ProductNotFound") << name;
49 
50  return handle;
51  }
int iEvent
Definition: GenABIO.cc:230
tuple handle
Definition: patZpeak.py:22
template<typename T >
void GEDPhotonGSCrysFixer::getToken ( edm::EDGetTokenT< T > &  token,
edm::ParameterSet const &  pset,
std::string const &  label,
std::string const &  instance = "" 
)
inlineprivate

Definition at line 33 of file GEDPhotonGSCrysFixer.h.

References edm::ParameterSet::getParameter(), instance, and GlobalPosition_Frontier_DevDB_cff::tag.

Referenced by GEDPhotonGSCrysFixer().

34  {
35  auto tag(pset.getParameter<edm::InputTag>(label));
36  if (!instance.empty())
37  tag = edm::InputTag(tag.label(), instance, tag.process());
38 
39  token = consumes<T>(tag);
40  }
static PFTauRenderPlugin instance
void GEDPhotonGSCrysFixer::produce ( edm::Event _event,
const edm::EventSetup _setup 
)
overridevirtual

Implements edm::stream::EDProducerBase.

Definition at line 75 of file GEDPhotonGSCrysFixer.cc.

References PhotonEnergyCorrector::calculate(), EcalClusterToolsT< noZS >::covariances(), EcalClusterToolsT< noZS >::e1x3(), reco::Photon::ShowerShape::e1x3, EcalClusterToolsT< noZS >::e1x5(), reco::Photon::ShowerShape::e1x5, EcalClusterToolsT< noZS >::e2nd(), reco::Photon::ShowerShape::e2nd, EcalClusterToolsT< noZS >::e2x2(), reco::Photon::ShowerShape::e2x2, reco::Photon::ShowerShape::e2x5, EcalClusterToolsT< noZS >::e2x5Bottom(), reco::Photon::ShowerShape::e2x5Bottom, EcalClusterToolsT< noZS >::e2x5Left(), reco::Photon::ShowerShape::e2x5Left, EcalClusterToolsT< noZS >::e2x5Max(), reco::Photon::ShowerShape::e2x5Max, EcalClusterToolsT< noZS >::e2x5Right(), reco::Photon::ShowerShape::e2x5Right, EcalClusterToolsT< noZS >::e2x5Top(), reco::Photon::ShowerShape::e2x5Top, EcalClusterToolsT< noZS >::e3x3(), reco::Photon::ShowerShape::e3x3, EcalClusterToolsT< noZS >::e5x5(), reco::Photon::ShowerShape::e5x5, ebHitsToken_, EcalClusterToolsT< noZS >::eBottom(), reco::Photon::ShowerShape::eBottom, reco::Photon::IsolationVariables::ecalRecHitSumEt, reco::Photon::ShowerShape::effSigmaRR, EcalClusterToolsT< noZS >::eLeft(), reco::Photon::ShowerShape::eLeft, EcalClusterToolsT< noZS >::eMax(), energyCorrector_, EcalClusterToolsT< noZS >::eRight(), reco::Photon::ShowerShape::eRight, EcalClusterToolsT< noZS >::eTop(), reco::Photon::ShowerShape::eTop, reco::Photon::PflowIDVariables::etOutsideMustache, edm::helper::Filler< Map >::fill(), PhotonEnergyCorrector::gedRegression(), geometry_, getHandle(), GainSwitchTools::hasEBGainSwitchIn5x5(), reco::Photon::IsolationVariables::hcalDepth1TowerSumEt, reco::Photon::IsolationVariables::hcalDepth1TowerSumEtBc, reco::Photon::IsolationVariables::hcalDepth2TowerSumEt, reco::Photon::IsolationVariables::hcalDepth2TowerSumEtBc, reco::Photon::IsolationVariables::hcalTowerSumEt, reco::Photon::IsolationVariables::hcalTowerSumEtBc, PhotonEnergyCorrector::init(), inputPhotonsToken_, edm::helper::Filler< Map >::insert(), reco::Photon::FiducialFlags::isEB, edm::isFinite(), EcalClusterToolsT< noZS >::localCovariances(), reco::Photon::ShowerShape::maxEnergyXtal, reco::Photon::MIPVariables::mipChi2, reco::Photon::MIPVariables::mipIntercept, reco::Photon::MIPVariables::mipIsHalo, reco::Photon::MIPVariables::mipNhitCone, reco::Photon::MIPVariables::mipSlope, reco::Photon::MIPVariables::mipTotEnergy, reco::Photon::PflowIDVariables::mva, reco::Photon::PflowIDVariables::nClusterOutsideMustache, newCoresToken_, newCoresToOldSCMapToken_, reco::Photon::IsolationVariables::nTrkHollowCone, reco::Photon::IsolationVariables::nTrkSolidCone, p4, edm::Event::put(), reco::Photon::ShowerShape::sigmaEtaEta, reco::Photon::ShowerShape::sigmaIetaIeta, reco::Photon::ShowerShape::sigmaIetaIphi, reco::Photon::ShowerShape::sigmaIphiIphi, mathSSE::sqrt(), topology_, reco::Photon::IsolationVariables::trkSumPtHollowCone, reco::Photon::IsolationVariables::trkSumPtSolidCone, csvLumiCalc::unit, HLT_25ns10e33_v2_cff::vertices, and verticesToken_.

76 {
77  std::auto_ptr<reco::PhotonCollection> pOutput(new reco::PhotonCollection);
78 
79  auto&& inputPhotonsHandle(getHandle(_event, inputPhotonsToken_, "photons"));
80  auto& inputPhotons(*inputPhotonsHandle);
81  auto&& newCoresHandle(getHandle(_event, newCoresToken_, "newCores"));
82  auto& newCoresToOldSCMap(*getHandle(_event, newCoresToOldSCMapToken_, "newCores"));
83  auto& ebHits(*getHandle(_event, ebHitsToken_, "ebHits"));
84  auto& vertices(*getHandle(_event, verticesToken_, "vertices"));
85 
86  energyCorrector_.init(_setup);
88  energyCorrector_.gedRegression()->setEvent(_event);
89  energyCorrector_.gedRegression()->setEventContent(_setup);
90  }
91 
92  std::vector<reco::PhotonRef> oldPhotons;
93 
94  unsigned iP(0);
95  for (auto& inPhoton : inputPhotons) {
96  auto&& refToBase(inputPhotons.refAt(iP++));
97  oldPhotons.emplace_back(refToBase.id(), &inPhoton, refToBase.key());
98 
99  auto&& newCore(getNewCore(inPhoton, newCoresHandle, newCoresToOldSCMap));
100 
101  auto& oldSC(*inPhoton.photonCore()->superCluster());
102  auto& newSC(*newCore->superCluster());
103 
104  if (GainSwitchTools::hasEBGainSwitchIn5x5(oldSC, &ebHits, topology_)) {
105  auto&& caloPosition(newSC.position());
106 
107  // will fix p4 later, but we apparently need the direction right
108  auto&& direction((caloPosition - inPhoton.vertex()).unit());
109  math::XYZTLorentzVectorD p4(direction.x(), direction.y(), direction.z(), 1.);
110 
111  pOutput->emplace_back(p4, caloPosition, newCore, inPhoton.vertex());
112  auto& outPhoton(pOutput->back());
113 
115  fflags.isEB = inPhoton.isEB();
116  fflags.isEE = inPhoton.isEE();
117  fflags.isEBEtaGap = inPhoton.isEBEtaGap();
118  fflags.isEBPhiGap = inPhoton.isEBPhiGap();
119  fflags.isEERingGap = inPhoton.isEERingGap();
120  fflags.isEEDeeGap = inPhoton.isEEDeeGap();
121  fflags.isEBEEGap = inPhoton.isEBEEGap();
122 
123  outPhoton.setFiducialVolumeFlags(fflags);
124 
126  iso04.ecalRecHitSumEt = inPhoton.ecalRecHitSumEtConeDR04();
127  iso04.hcalTowerSumEt = inPhoton.hcalTowerSumEtConeDR04();
128  iso04.hcalDepth1TowerSumEt = inPhoton.hcalDepth1TowerSumEtConeDR04();
129  iso04.hcalDepth2TowerSumEt = inPhoton.hcalDepth2TowerSumEtConeDR04();
130  iso04.hcalTowerSumEtBc = inPhoton.hcalTowerSumEtBcConeDR04();
131  iso04.hcalDepth1TowerSumEtBc = inPhoton.hcalDepth1TowerSumEtBcConeDR04();
132  iso04.hcalDepth2TowerSumEtBc = inPhoton.hcalDepth2TowerSumEtBcConeDR04();
133  iso04.trkSumPtSolidCone = inPhoton.trkSumPtSolidConeDR04();
134  iso04.trkSumPtHollowCone = inPhoton.trkSumPtHollowConeDR04();
135  iso04.nTrkSolidCone = inPhoton.nTrkSolidConeDR04();
136  iso04.nTrkHollowCone = inPhoton.nTrkHollowConeDR04();
137 
139  iso03.ecalRecHitSumEt = inPhoton.ecalRecHitSumEtConeDR03();
140  iso03.hcalTowerSumEt = inPhoton.hcalTowerSumEtConeDR03();
141  iso03.hcalDepth1TowerSumEt = inPhoton.hcalDepth1TowerSumEtConeDR03();
142  iso03.hcalDepth2TowerSumEt = inPhoton.hcalDepth2TowerSumEtConeDR03();
143  iso03.hcalTowerSumEtBc = inPhoton.hcalTowerSumEtBcConeDR03();
144  iso03.hcalDepth1TowerSumEtBc = inPhoton.hcalDepth1TowerSumEtBcConeDR03();
145  iso03.hcalDepth2TowerSumEtBc = inPhoton.hcalDepth2TowerSumEtBcConeDR03();
146  iso03.trkSumPtSolidCone = inPhoton.trkSumPtSolidConeDR03();
147  iso03.trkSumPtHollowCone = inPhoton.trkSumPtHollowConeDR03();
148  iso03.nTrkSolidCone = inPhoton.nTrkSolidConeDR03();
149  iso03.nTrkHollowCone = inPhoton.nTrkHollowConeDR03();
150 
151  outPhoton.setIsolationVariables(iso04, iso03);
152 
153  auto& newSeed(*newSC.seed());
154 
155  auto&& cov(EcalClusterTools::covariances(newSeed, &ebHits, topology_, geometry_));
156  auto&& locCov(EcalClusterTools::localCovariances(newSeed, &ebHits, topology_));
157  auto&& cov55(noZS::EcalClusterTools::covariances(newSeed, &ebHits, topology_, geometry_));
158  auto&& locCov55(noZS::EcalClusterTools::localCovariances(newSeed, &ebHits, topology_));
159 
160  auto& oldSS(inPhoton.showerShapeVariables());
162 
163  newSS.e1x5 = EcalClusterTools::e1x5(newSeed, &ebHits, topology_);
164  newSS.e2x5 = EcalClusterTools::e2x5Max(newSeed, &ebHits, topology_);
165  newSS.e3x3 = EcalClusterTools::e3x3(newSeed, &ebHits, topology_);
166  newSS.e5x5 = EcalClusterTools::e5x5(newSeed, &ebHits, topology_);
167  newSS.maxEnergyXtal = EcalClusterTools::eMax(newSeed, &ebHits);
168  newSS.sigmaEtaEta = std::sqrt(cov[0]);
169  newSS.sigmaIetaIeta = std::sqrt(locCov[0]);
170  newSS.hcalDepth1OverEcal = oldSS.hcalDepth1OverEcal * oldSC.energy() / newSC.energy();
171  newSS.hcalDepth2OverEcal = oldSS.hcalDepth2OverEcal * oldSC.energy() / newSC.energy();
172  newSS.hcalDepth1OverEcalBc = oldSS.hcalDepth1OverEcalBc * oldSC.energy() / newSC.energy();
173  newSS.hcalDepth2OverEcalBc = oldSS.hcalDepth2OverEcalBc * oldSC.energy() / newSC.energy();
174  newSS.hcalTowersBehindClusters = oldSS.hcalTowersBehindClusters;
175  newSS.sigmaIetaIphi = locCov[1];
176  newSS.sigmaIphiIphi = (edm::isFinite(locCov[2]) ? std::sqrt(locCov[2]) : 0.);
177  newSS.e2nd = EcalClusterTools::e2nd(newSeed, &ebHits);
178  newSS.eTop = EcalClusterTools::eTop(newSeed, &ebHits, topology_);
179  newSS.eLeft = EcalClusterTools::eLeft(newSeed, &ebHits, topology_);
180  newSS.eRight = EcalClusterTools::eRight(newSeed, &ebHits, topology_);
181  newSS.eBottom = EcalClusterTools::eBottom(newSeed, &ebHits, topology_);
182  newSS.e1x3 = EcalClusterTools::e1x3(newSeed, &ebHits, topology_);
183  newSS.e2x2 = EcalClusterTools::e2x2(newSeed, &ebHits, topology_);
184  newSS.e2x5Max = EcalClusterTools::e2x5Max(newSeed, &ebHits, topology_);
185  newSS.e2x5Left = EcalClusterTools::e2x5Left(newSeed, &ebHits, topology_);
186  newSS.e2x5Right = EcalClusterTools::e2x5Right(newSeed, &ebHits, topology_);
187  newSS.e2x5Top = EcalClusterTools::e2x5Top(newSeed, &ebHits, topology_);
188  newSS.e2x5Bottom = EcalClusterTools::e2x5Bottom(newSeed, &ebHits, topology_);
189  newSS.effSigmaRR = oldSS.effSigmaRR;
190 
191  outPhoton.setShowerShapeVariables(newSS);
192 
194  new55SS.e1x5 = noZS::EcalClusterTools::e1x5(newSeed, &ebHits, topology_);
195  new55SS.e2x5 = noZS::EcalClusterTools::e2x5Max(newSeed, &ebHits, topology_);
196  new55SS.e3x3 = noZS::EcalClusterTools::e3x3(newSeed, &ebHits, topology_);
197  new55SS.e5x5 = noZS::EcalClusterTools::e5x5(newSeed, &ebHits, topology_);
198  new55SS.maxEnergyXtal = noZS::EcalClusterTools::eMax(newSeed, &ebHits);
199  new55SS.sigmaEtaEta = std::sqrt(cov55[0]);
200  new55SS.sigmaIetaIeta = std::sqrt(locCov55[0]);
201  new55SS.sigmaIetaIphi = locCov55[1];
202  new55SS.sigmaIphiIphi = (edm::isFinite(locCov55[2]) ? std::sqrt(locCov55[2]) : 0.);
203  new55SS.e2nd = noZS::EcalClusterTools::e2nd(newSeed, &ebHits);
204  new55SS.eTop = noZS::EcalClusterTools::eTop(newSeed, &ebHits, topology_);
205  new55SS.eLeft = noZS::EcalClusterTools::eLeft(newSeed, &ebHits, topology_);
206  new55SS.eRight = noZS::EcalClusterTools::eRight(newSeed, &ebHits, topology_);
207  new55SS.eBottom = noZS::EcalClusterTools::eBottom(newSeed, &ebHits, topology_);
208  new55SS.e1x3 = noZS::EcalClusterTools::e1x3(newSeed, &ebHits, topology_);
209  new55SS.e2x2 = noZS::EcalClusterTools::e2x2(newSeed, &ebHits, topology_);
210  new55SS.e2x5Max = noZS::EcalClusterTools::e2x5Max(newSeed, &ebHits, topology_);
211  new55SS.e2x5Left = noZS::EcalClusterTools::e2x5Left(newSeed, &ebHits, topology_);
212  new55SS.e2x5Right = noZS::EcalClusterTools::e2x5Right(newSeed, &ebHits, topology_);
213  new55SS.e2x5Top = noZS::EcalClusterTools::e2x5Top(newSeed, &ebHits, topology_);
214  new55SS.e2x5Bottom = noZS::EcalClusterTools::e2x5Bottom(newSeed, &ebHits, topology_);
215  new55SS.effSigmaRR = oldSS.effSigmaRR;
216 
217  outPhoton.full5x5_setShowerShapeVariables(new55SS);
218 
220  mipVars.mipChi2 = inPhoton.mipChi2();
221  mipVars.mipTotEnergy = inPhoton.mipTotEnergy();
222  mipVars.mipSlope = inPhoton.mipSlope();
223  mipVars.mipIntercept = inPhoton.mipIntercept();
224  mipVars.mipNhitCone = inPhoton.mipNhitCone();
225  mipVars.mipIsHalo = inPhoton.mipIsHalo();
226 
227  outPhoton.setMIPVariables(mipVars);
228 
229  outPhoton.setPflowIsolationVariables(inPhoton.getPflowIsolationVariables());
230 
232  pfid.nClusterOutsideMustache = inPhoton.nClusterOutsideMustache();
233  pfid.etOutsideMustache = inPhoton.etOutsideMustache();
234  pfid.mva = inPhoton.pfMVA();
235 
236  outPhoton.setPflowIDVariables(pfid);
237 
238  energyCorrector_.calculate(_event, outPhoton, newSeed.hitsAndFractions()[0].first.subdetId(), vertices, _setup);
239 
240  outPhoton.setP4(outPhoton.p4(inPhoton.getCandidateP4type()));
241  outPhoton.setCandidateP4type(inPhoton.getCandidateP4type());
242  }
243  else {
244  pOutput->emplace_back(inPhoton);
245  auto& outPhoton(pOutput->back());
246  outPhoton.setPhotonCore(newCore);
247  }
248  }
249 
250  edm::OrphanHandle<reco::PhotonCollection> newPhotonsHandle(_event.put(pOutput));
251 
252  std::auto_ptr<PhotonRefMap> pRefMap(new PhotonRefMap);
253  PhotonRefMap::Filler refMapFiller(*pRefMap);
254  refMapFiller.insert(newPhotonsHandle, oldPhotons.begin(), oldPhotons.end());
255  refMapFiller.fill();
256  _event.put(pRefMap);
257 }
CaloGeometry const * geometry_
static float e2x5Bottom(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
ROOT::Math::LorentzVector< ROOT::Math::PxPyPzE4D< double > > XYZTLorentzVectorD
Lorentz vector with cylindrical internal representation using pseudorapidity.
Definition: LorentzVector.h:14
static std::vector< float > covariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, const CaloGeometry *geometry, float w0=4.7)
static float eMax(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
PhotonEnergyCorrector energyCorrector_
edm::EDGetTokenT< reco::VertexCollection > verticesToken_
std::unique_ptr< ModifyObjectValueBase > & gedRegression()
static float e2x5Top(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
edm::EDGetTokenT< EcalRecHitCollection > ebHitsToken_
bool isFinite(T x)
static float e2x2(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
OrphanHandle< PROD > put(std::auto_ptr< PROD > product)
Put a new product.
Definition: Event.h:121
string unit
Definition: csvLumiCalc.py:46
T sqrt(T t)
Definition: SSEVec.h:18
double p4[4]
Definition: TauolaWrapper.h:92
static float e2nd(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits)
static float e2x5Max(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
static float eBottom(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
static float e2x5Right(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
void init(const edm::EventSetup &theEventSetup)
edm::Handle< T > getHandle(edm::Event const &iEvent, edm::EDGetTokenT< T > const &token, std::string const &name)
static float eTop(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
void calculate(edm::Event &evt, reco::Photon &, int subdet, const reco::VertexCollection &vtxcol, const edm::EventSetup &iSetup)
std::vector< Photon > PhotonCollection
collectin of Photon objects
Definition: PhotonFwd.h:9
static float e2x5Left(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
static bool hasEBGainSwitchIn5x5(const reco::SuperCluster &superClus, const EcalRecHitCollection *recHits, const CaloTopology *topology)
static float eRight(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
static float e3x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
static float e1x3(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
CaloTopology const * topology_
static float eLeft(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
static std::vector< float > localCovariances(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology, float w0=4.7)
edm::EDGetTokenT< SCRefMap > newCoresToOldSCMapToken_
static float e1x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)
edm::EDGetTokenT< PhotonView > inputPhotonsToken_
edm::EDGetTokenT< reco::PhotonCoreCollection > newCoresToken_
static float e5x5(const reco::BasicCluster &cluster, const EcalRecHitCollection *recHits, const CaloTopology *topology)

Member Data Documentation

edm::EDGetTokenT<EcalRecHitCollection> GEDPhotonGSCrysFixer::ebHitsToken_
private

Definition at line 59 of file GEDPhotonGSCrysFixer.h.

Referenced by GEDPhotonGSCrysFixer(), and produce().

PhotonEnergyCorrector GEDPhotonGSCrysFixer::energyCorrector_
private

Definition at line 62 of file GEDPhotonGSCrysFixer.h.

Referenced by beginLuminosityBlock(), GEDPhotonGSCrysFixer(), and produce().

CaloGeometry const* GEDPhotonGSCrysFixer::geometry_ {0}
private

Definition at line 65 of file GEDPhotonGSCrysFixer.h.

Referenced by beginLuminosityBlock(), and produce().

edm::EDGetTokenT<PhotonView> GEDPhotonGSCrysFixer::inputPhotonsToken_
private

Definition at line 56 of file GEDPhotonGSCrysFixer.h.

Referenced by GEDPhotonGSCrysFixer(), and produce().

edm::EDGetTokenT<reco::PhotonCoreCollection> GEDPhotonGSCrysFixer::newCoresToken_
private

Definition at line 57 of file GEDPhotonGSCrysFixer.h.

Referenced by GEDPhotonGSCrysFixer(), and produce().

edm::EDGetTokenT<SCRefMap> GEDPhotonGSCrysFixer::newCoresToOldSCMapToken_
private

Definition at line 58 of file GEDPhotonGSCrysFixer.h.

Referenced by GEDPhotonGSCrysFixer(), and produce().

CaloTopology const* GEDPhotonGSCrysFixer::topology_ {0}
private

Definition at line 64 of file GEDPhotonGSCrysFixer.h.

Referenced by beginLuminosityBlock(), and produce().

edm::EDGetTokenT<reco::VertexCollection> GEDPhotonGSCrysFixer::verticesToken_
private

Definition at line 60 of file GEDPhotonGSCrysFixer.h.

Referenced by GEDPhotonGSCrysFixer(), and produce().