-
Notifications
You must be signed in to change notification settings - Fork 4.4k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Spike cleaner fix #17859
Spike cleaner fix #17859
Changes from 1 commit
ed7681a
883acd9
00676b2
d1ea66f
ef82214
1d42f02
88c30ee
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -117,10 +117,55 @@ clean(const edm::Handle<reco::PFRecHitCollection>& input, | |
} | ||
const spike_cleaning& clean = _thresholds.find(hitlayer)->second; | ||
if( rechit.energy() < clean._singleSpikeThresh ) continue; | ||
|
||
|
||
|
||
//Fix needed for HF | ||
float compsumE = 0.0; | ||
if ((hitlayer==12 or hitlayer==11)) | ||
{ | ||
int predphi =2; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Hello, I would put the declaration below together with the condition under which predphi is set to 4. All in all, I cannot understand what this code is doing, would be nice to add a few comments, in particular a general comment explaining the problem you want to solve and how you can solve it ("Fix needed for HF" is too generic). When I understand better, I'll be able to comment further. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Ok, in the next version there will be more verbose comments. This section checks if a rechit is from the HF region and if so it adds additional energy from the companion rechits (ie HF_Had <-> HF_EM) to the total surrounding energy |
||
|
||
int comp = std::abs(hitlayer-13); | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. "13" here is quite likely "12+1", where "12" can be extracted from some enum or configured list There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Sure, this is just selecting the Hcaldetid depth which is a statement that the HF_EM companion energy is from the HF_Had and vice versa. I will change this to an if statement as there are only two possible comp values |
||
const HcalDetId& detid = (HcalDetId)rechit.detId(); | ||
std::vector<uint32_t> RawDetIds; | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. use lower case initial for local variables There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Thanks, this will be included in the next version |
||
int heta = detid.ieta(); | ||
int hphi = detid.iphi(); | ||
|
||
if (std::abs(heta)>39) predphi=4; | ||
|
||
int curphiL = hphi-predphi; | ||
int curphiH = hphi+predphi; | ||
|
||
if (predphi>abs(hphi) or predphi>abs(72-hphi)) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Can this "72" magic number be get from some configuration? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is a product of the HF valid phi numbering range (1-72). I think this needs to be hardcoded as well There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Yes, let it hardcoded. But please extract it from the "HF valid phi numbering range", whenever it is stored/defined. So that if it gets ever modified you don't have to modify several hidden lines of code here and there. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. My frame of reference for this range (and most of these methods) is here Here, the "magic" numbers 39,4,72 are not from an exterior definition. I will look further however |
||
{ | ||
while (curphiL-predphi<0) curphiL+=72; | ||
while (curphiH+predphi>72) curphiH-=72; | ||
} | ||
|
||
std::pair<std::vector<int>, std::vector<int>> phietas({heta,heta+1,heta-1,heta,heta},{hphi,hphi,hphi,curphiL,curphiH}); | ||
for(int in=0;in<5;in++) | ||
{ | ||
HcalDetId TempID (HcalForward, phietas.first[in], phietas.second[in], comp); | ||
RawDetIds.push_back(TempID.rawId()); | ||
} | ||
|
||
for( const auto& jdx : ordered_hits ) | ||
{ | ||
const unsigned j = jdx; | ||
const reco::PFRecHit& matchrechit = hits[j]; | ||
for( const auto& iID : RawDetIds ) if (iID==matchrechit.detId())compsumE+=matchrechit.energy(); | ||
|
||
} | ||
|
||
} | ||
|
||
|
||
|
||
const double rhenergy = rechit.energy(); | ||
// single spike cleaning | ||
auto const & neighbours4 = rechit.neighbours4(); | ||
double surroundingEnergy = rechit.energy(); | ||
double surroundingEnergy = compsumE;//rechit.energy(); | ||
double neighbourEnergy = 0.0; | ||
double layerEnergy = 0.0; | ||
for( auto k : neighbours4 ) { | ||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can these magic numbers be get from some configuration?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This says to only apply the fix only to the HF layers. I think this should be hard coded, as any other values would be buggy
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
11 -> PFLayer::HF_EM
12 -> PFLayer::HF_HAD