37 for (
size_t hitNr = 0; hitNr <
seed.hitInfo().size(); hitNr++) {
38 int subDetBit = 0x1 << hitNr;
44 int layerBit = 0x1 << layerOffset <<
seed.layerOrDiskNr(hitNr);
47 int nrLayersAlongTrajShifted =
seed.nrLayersAlongTraj() << 12;
48 info |= nrLayersAlongTrajShifted;
62 valMap_ = std::make_unique<reco::RecoEcalCandidateIsolationMap>(candHandle);
63 valInfoMap_ = std::make_unique<reco::RecoEcalCandidateIsolationMap>(candHandle);
93 std::unique_ptr<reco::RecoEcalCandidateIsolationMap>
valMap_;
94 std::unique_ptr<reco::RecoEcalCandidateIsolationMap>
valInfoMap_;
126 : recoEcalCandidateToken_(
133 productsToWrite_(
config.getParameter<
int>(
"productsToWrite")),
138 produces<reco::RecoEcalCandidateIsolationMap>(
"s2");
140 produces<reco::RecoEcalCandidateIsolationMap>(
"dPhi1BestS2");
141 produces<reco::RecoEcalCandidateIsolationMap>(
"dPhi2BestS2");
142 produces<reco::RecoEcalCandidateIsolationMap>(
"dzBestS2");
146 for (
size_t hitNr = 1; hitNr <=
nrHits_; hitNr++) {
147 produces<reco::RecoEcalCandidateIsolationMap>(
"dPhi" +
std::to_string(hitNr));
148 produces<reco::RecoEcalCandidateIsolationMap>(
"dPhi" +
std::to_string(hitNr) +
"Info");
149 produces<reco::RecoEcalCandidateIsolationMap>(
"dRZ" +
std::to_string(hitNr));
150 produces<reco::RecoEcalCandidateIsolationMap>(
"dRZ" +
std::to_string(hitNr) +
"Info");
152 produces<reco::RecoEcalCandidateIsolationMap>(
"nrClus");
153 produces<reco::RecoEcalCandidateIsolationMap>(
"seedClusEFrac");
154 produces<reco::RecoEcalCandidateIsolationMap>(
"phiWidth");
155 produces<reco::RecoEcalCandidateIsolationMap>(
"etaWidth");
190 varParamDesc.addVPSet(
"bins", binParamDesc);
191 desc.add(
"dPhi1SParams", varParamDesc);
192 desc.add(
"dPhi2SParams", varParamDesc);
193 desc.add(
"dRZ2SParams", varParamDesc);
194 desc.add<
int>(
"productsToWrite", 0);
195 descriptions.
add((
"hltEgammaHLTPixelMatchVarProducer"),
desc);
204 if (!recoEcalCandHandle.isValid())
206 else if (!pixelSeedsHandle.isValid()) {
207 auto s2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
208 for (
unsigned int candNr = 0; candNr < recoEcalCandHandle->size(); candNr++) {
210 s2Map->insert(candRef, 0);
216 auto dPhi1BestS2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
217 auto dPhi2BestS2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
218 auto dzBestS2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
219 auto s2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
221 auto nrClusMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
222 auto seedClusEFracMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
223 auto phiWidthMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
224 auto etaWidthMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
226 std::vector<PixelData> pixelData;
227 for (
size_t hitNr = 0; hitNr <
nrHits_; hitNr++) {
232 for (
unsigned int candNr = 0; candNr < recoEcalCandHandle->size(); candNr++) {
240 for (
auto&
seed : *pixelSeedsHandle) {
243 if (&(*candSCRef) == &(*pixelSCRef)) {
244 std::array<float, 4> s2Data =
calS2(
seed, -1);
245 std::array<float, 4> s2DataPos =
calS2(
seed, +1);
246 if (s2Data[0] < bestS2[0])
248 if (s2DataPos[0] < bestS2[0])
252 for (
auto& pixelDatum : pixelData) {
253 pixelDatum.fill(
seed);
259 s2Map->insert(candRef, bestS2[0]);
261 dPhi1BestS2Map->insert(candRef, bestS2[1]);
262 dPhi2BestS2Map->insert(candRef, bestS2[2]);
263 dzBestS2Map->insert(candRef, bestS2[3]);
266 nrClusMap->insert(candRef, candSCRef->clustersSize());
267 float seedClusEFrac = candSCRef->rawEnergy() > 0 ? candSCRef->seed()->energy() / candSCRef->rawEnergy() : 0.;
270 seedClusEFracMap->insert(candRef, seedClusEFrac);
271 float phiWidth = candSCRef->phiWidth();
272 float etaWidth = candSCRef->etaWidth();
273 phiWidthMap->insert(candRef,
phiWidth);
274 etaWidthMap->insert(candRef,
etaWidth);
276 for (
auto& pixelDatum : pixelData) {
277 pixelDatum.fill(candRef);
289 for (
auto& pixelDatum : pixelData) {
290 pixelDatum.putInto(
iEvent);
304 float dPhi1 = (
charge < 0 ?
seed.dPhiNeg(0) :
seed.dPhiPos(0)) / dPhi1Const;
305 float dPhi2 = (
charge < 0 ?
seed.dPhiNeg(1) :
seed.dPhiPos(1)) / dPhi2Const;
306 float dRz2 = (
charge < 0 ?
seed.dRZNeg(1) :
seed.dRZPos(1)) / dRZ2Const;
308 float s2 = dPhi1 * dPhi1 + dPhi2 * dPhi2 + dRz2 * dRz2;
309 return std::array<float, 4>{{s2, dPhi1, dPhi2, dRz2}};
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T >> cases)
void produce(edm::Event &, const edm::EventSetup &) override
egPM::Param< reco::ElectronSeed > dPhi2Para_
egPM::Param< reco::ElectronSeed > dPhi1Para_
std::string to_string(const V &value)
std::array< float, 4 > calS2(const reco::ElectronSeed &seed, int charge) const
void putInto(edm::Event &event)
egPM::Param< reco::ElectronSeed > dRZ2Para_
void fill(const reco::ElectronSeed &seed)
The Signals That Services Can Subscribe To This is based on ActivityRegistry and is current per Services can connect to the signals distributed by the ActivityRegistry in order to monitor the activity of the application Each possible callback has some defined which we here list in angle e< void, edm::EventID const &, edm::Timestamp const & > We also list in braces which AR_WATCH_USING_METHOD_ is used for those or
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Abs< T >::type abs(const T &t)
#define DEFINE_FWK_MODULE(type)
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateToken_
std::unique_ptr< reco::RecoEcalCandidateIsolationMap > valInfoMap_
float dPhiBest(size_t hitNr) const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::unique_ptr< reco::RecoEcalCandidateIsolationMap > valMap_
~EgammaHLTPixelMatchVarProducer() override
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects
const edm::EDGetTokenT< reco::ElectronSeedCollection > pixelSeedsToken_
EgammaHLTPixelMatchVarProducer(const edm::ParameterSet &)
PixelData(std::string name, size_t hitNr, float(reco::ElectronSeed::*func)(size_t) const, const edm::Handle< reco::RecoEcalCandidateCollection > &candHandle)
float dRZBest(size_t hitNr) const
float(reco::ElectronSeed::* func_)(size_t) const
void fill(const reco::RecoEcalCandidateRef &candRef)