39 for(
size_t hitNr=0;hitNr<seed.
hitInfo().size();hitNr++){
40 int subDetBit = 0x1 <<hitNr;
44 int layerBit = 0x1 << layerOffset << seed.
layerOrDiskNr(hitNr) ;
48 info |=nrLayersAlongTrajShifted;
64 valMap_=std::make_unique<reco::RecoEcalCandidateIsolationMap>(candHandle);
65 valInfoMap_=std::make_unique<reco::RecoEcalCandidateIsolationMap>(candHandle);
92 std::unique_ptr<reco::RecoEcalCandidateIsolationMap>
valMap_;
93 std::unique_ptr<reco::RecoEcalCandidateIsolationMap>
valInfoMap_;
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");
177 edm::ParameterDescription<int>(
"yMax",99999,
true) and
182 edm::ParameterDescription<double>(
"xMax",3.0,
true) and
183 edm::ParameterDescription<int>(
"yMin",0,
true) and
184 edm::ParameterDescription<int>(
"yMax",99999,
true) and
185 edm::ParameterDescription<std::string>(
"funcType",
"pol0",
true) and
188 (edm::ParameterDescription<double>(
"xMin",0.0,
true) and
189 edm::ParameterDescription<double>(
"xMax",3.0,
true) and
190 edm::ParameterDescription<int>(
"yMin",0,
true) and
191 edm::ParameterDescription<int>(
"yMax",99999,
true) and
192 edm::ParameterDescription<std::string>(
"funcType",
"pol0",
true) and
195 binParamDesc.
ifValue(edm::ParameterDescription<std::string>(
"binType",
"AbsEtaClus",
true),
std::move(binDescCases));
198 varParamDesc.addVPSet(
"bins",binParamDesc);
199 desc.
add(
"dPhi1SParams",varParamDesc);
200 desc.
add(
"dPhi2SParams",varParamDesc);
201 desc.
add(
"dRZ2SParams",varParamDesc);
202 desc.
add<
int>(
"productsToWrite",0);
203 descriptions.
add((
"hltEgammaHLTPixelMatchVarProducer"), desc);
216 if(!recoEcalCandHandle.
isValid())
return;
217 else if(!pixelSeedsHandle.
isValid()){
218 auto s2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
219 for(
unsigned int candNr = 0; candNr<recoEcalCandHandle->size(); candNr++) {
221 s2Map->insert(candRef,0);
230 auto dPhi1BestS2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
231 auto dPhi2BestS2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
232 auto dzBestS2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
233 auto s2Map = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
235 auto nrClusMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
236 auto seedClusEFracMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
237 auto phiWidthMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
238 auto etaWidthMap = std::make_unique<reco::RecoEcalCandidateIsolationMap>(recoEcalCandHandle);
240 std::vector<PixelData> pixelData;
241 for(
size_t hitNr=0;hitNr<
nrHits_;hitNr++){
246 for(
unsigned int candNr = 0; candNr<recoEcalCandHandle->size(); candNr++) {
252 for(
auto & seed : *pixelSeedsHandle){
255 if(&(*candSCRef) == &(*pixelSCRef)){
257 std::array<float,4> s2Data =
calS2(seed,-1);
258 std::array<float,4> s2DataPos =
calS2(seed,+1);
259 if(s2Data[0]<bestS2[0]) bestS2=s2Data;
260 if(s2DataPos[0]<bestS2[0]) bestS2=s2DataPos;
263 for(
auto& pixelDatum : pixelData){
264 pixelDatum.fill(seed);
271 s2Map->insert(candRef,bestS2[0]);
273 dPhi1BestS2Map->insert(candRef,bestS2[1]);
274 dPhi2BestS2Map->insert(candRef,bestS2[2]);
275 dzBestS2Map->insert(candRef,bestS2[3]);
278 nrClusMap->insert(candRef,candSCRef->clustersSize());
279 float seedClusEFrac = candSCRef->rawEnergy()>0 ? candSCRef->seed()->energy() / candSCRef->rawEnergy() : 0.;
282 seedClusEFracMap->insert(candRef,seedClusEFrac);
283 float phiWidth = candSCRef->phiWidth();
284 float etaWidth = candSCRef->etaWidth();
285 phiWidthMap->insert(candRef,phiWidth);
286 etaWidthMap->insert(candRef,etaWidth);
288 for(
auto& pixelDatum : pixelData){
289 pixelDatum.fill(candRef);
301 for(
auto& pixelDatum : pixelData){
302 pixelDatum.putInto(iEvent);
305 iEvent.
put(
std::move(seedClusEFracMap),
"seedClusEFrac");
317 float dPhi1 = (charge <0 ? seed.
dPhiNeg(0) : seed.
dPhiPos(0))/dPhi1Const;
318 float dPhi2 = (charge <0 ? seed.
dPhiNeg(1) : seed.
dPhiPos(1))/dPhi2Const;
319 float dRz2 = (charge <0 ? seed.
dRZNeg(1) : seed.
dRZPos(1))/dRZ2Const;
321 float s2 = dPhi1*dPhi1+dPhi2*dPhi2+dRz2*dRz2;
322 return std::array<float,4>{{
s2,dPhi1,dPhi2,dRz2}};
OrphanHandle< PROD > put(std::unique_ptr< PROD > product)
Put a new product.
egPM::Param< reco::ElectronSeed > dPhi2Para_
bool getByToken(EDGetToken token, Handle< PROD > &result) const
#define DEFINE_FWK_MODULE(type)
egPM::Param< reco::ElectronSeed > dPhi1Para_
int subDet(size_t hitNr) const
const CaloClusterRef & caloCluster() const
void produce(edm::StreamID sid, edm::Event &, const edm::EventSetup &) const override
int nrLayersAlongTraj() const
float dRZPos(size_t hitNr) const
void putInto(edm::Event &event)
egPM::Param< reco::ElectronSeed > dRZ2Para_
~EgammaHLTPixelMatchVarProducer()
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
ParameterDescriptionNode * ifValue(ParameterDescription< T > const &switchParameter, std::unique_ptr< ParameterDescriptionCases< T > > cases)
static void fillDescriptions(edm::ConfigurationDescriptions &descriptions)
Abs< T >::type abs(const T &t)
std::vector< ElectronSeed > ElectronSeedCollection
collection of ElectronSeed objects
const edm::EDGetTokenT< reco::RecoEcalCandidateCollection > recoEcalCandidateToken_
ParameterDescriptionBase * add(U const &iLabel, T const &value)
float dPhiBest(size_t hitNr) const
std::unique_ptr< reco::RecoEcalCandidateIsolationMap > valInfoMap_
std::array< float, 4 > calS2(const reco::ElectronSeed &seed, int charge) const
int layerOrDiskNr(size_t hitNr) const
const std::vector< PMVars > & hitInfo() const
void add(std::string const &label, ParameterSetDescription const &psetDescription)
std::unique_ptr< reco::RecoEcalCandidateIsolationMap > valMap_
std::vector< RecoEcalCandidate > RecoEcalCandidateCollection
collectin of RecoEcalCandidate objects
float dRZBest(size_t hitNr) const
float(reco::ElectronSeed::* func_)(size_t) const
float dRZNeg(size_t hitNr) const
const edm::EDGetTokenT< reco::ElectronSeedCollection > pixelSeedsToken_
EgammaHLTPixelMatchVarProducer(const edm::ParameterSet &)
float dPhiNeg(size_t hitNr) const
PixelData(std::string name, size_t hitNr, float(reco::ElectronSeed::*func)(size_t) const, const edm::Handle< reco::RecoEcalCandidateCollection > &candHandle)
float dPhiPos(size_t hitNr) const
void fill(const reco::RecoEcalCandidateRef &candRef)