Skip to content

Commit

Permalink
Merge pull request #2 from kpedro88/update-HcalSeverityLevelComputer-…
Browse files Browse the repository at this point in the history
…phase1

Add filldescriptions and remove warning
  • Loading branch information
jaehyeok authored Jul 3, 2017
2 parents f1711c3 + ce952c0 commit 7f06d21
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 3 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@


import RecoLocalCalo.HcalRecAlgos.RemoveAddSevLevel as HcalRemoveAddSevLevel
HcalRemoveAddSevLevel.AddFlag(hcalRecAlgos,"HFDigiTime",11)
HcalRemoveAddSevLevel.AddFlag(hcalRecAlgos,"HFDigiTime",11,verbose=False)
HcalRemoveAddSevLevel.AddFlag(hcalRecAlgos,"HBHEFlatNoise",12)
HcalRemoveAddSevLevel.AddFlag(hcalRecAlgos,"HBHENegativeNoise",12)

Expand Down
9 changes: 9 additions & 0 deletions RecoLocalCalo/HcalRecAlgos/plugins/HcalRecAlgoESProducer.cc
Original file line number Diff line number Diff line change
Expand Up @@ -42,6 +42,8 @@ class HcalRecAlgoESProducer : public edm::ESProducer {

~HcalRecAlgoESProducer();

static void fillDescriptions(edm::ConfigurationDescriptions& descriptions);

typedef std::shared_ptr<HcalSeverityLevelComputer> ReturnType;

ReturnType produce(const HcalSeverityLevelComputerRcd&);
Expand Down Expand Up @@ -94,5 +96,12 @@ HcalRecAlgoESProducer::produce(const HcalSeverityLevelComputerRcd& iRecord)
return myComputer ;
}

void HcalRecAlgoESProducer::fillDescriptions(edm::ConfigurationDescriptions& descriptions) {
edm::ParameterSetDescription desc;
desc.setAllowAnything();
desc.add<uint32_t>("phase",0);
descriptions.add("hcalRecAlgos",desc);
}

//define this as a plug-in
DEFINE_FWK_EVENTSETUP_MODULE(HcalRecAlgoESProducer);
4 changes: 2 additions & 2 deletions RecoLocalCalo/HcalRecAlgos/python/RemoveAddSevLevel.py
Original file line number Diff line number Diff line change
Expand Up @@ -42,7 +42,7 @@ def PrintLevels(SLComp):
return


def AddFlag(sevLevelComputer,flag="UserDefinedBit0",severity=10):
def AddFlag(sevLevelComputer,flag="UserDefinedBit0",severity=10,verbose=True):
''' Adds specified flag to severity level computer using specified severity level.
If flag already exists at another severity level, it is removed from that level.
'''
Expand All @@ -58,7 +58,7 @@ def AddFlag(sevLevelComputer,flag="UserDefinedBit0",severity=10):
allowedflags.append(j)

#print "Allowed flags = ",allowedflags
if flag not in allowedflags:
if flag not in allowedflags and verbose:
print "\n\n"
for j in range(0,3):
print "###################################################"
Expand Down

0 comments on commit 7f06d21

Please sign in to comment.