Skip to content

Commit

Permalink
Merge pull request #13429 from kencall/EcalTPkSat
Browse files Browse the repository at this point in the history
Adds option to EcalDeadCellTriggerPrimitiveFilter to consider kTPSaturated flag
  • Loading branch information
davidlange6 committed Feb 27, 2016
2 parents fa06834 + 1bf1b9f commit 2973482
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 0 deletions.
18 changes: 18 additions & 0 deletions RecoMET/METFilters/plugins/EcalDeadCellTriggerPrimitiveFilter.cc
Expand Up @@ -140,6 +140,10 @@ class EcalDeadCellTriggerPrimitiveFilter : public edm::EDFilter {

const bool makeProfileRoot_;
const std::string profileRootName_;

const bool useTTsum_; //If set to true, the filter will compare the sum of the 5x5 tower to the provided energy threshold
const bool usekTPSaturated_; //If set to true, the filter will check the kTPSaturated flag

TFile *profFile;
TTree *profTree;

Expand Down Expand Up @@ -194,6 +198,8 @@ EcalDeadCellTriggerPrimitiveFilter::EcalDeadCellTriggerPrimitiveFilter(const edm
, tpDigiCollectionToken_(consumes<EcalTrigPrimDigiCollection>(tpDigiCollection_))
, makeProfileRoot_ (iConfig.getUntrackedParameter<bool>("makeProfileRoot") )
, profileRootName_ (iConfig.getUntrackedParameter<std::string>("profileRootName") )
, useTTsum_ (iConfig.getParameter<bool>("useTTsum") )
, usekTPSaturated_ (iConfig.getParameter<bool>("usekTPSaturated") )
{
getEventInfoForFilterOnce_ = false;
hastpDigiCollection_ = 0; hasReducedRecHits_ = 0;
Expand Down Expand Up @@ -408,6 +414,7 @@ int EcalDeadCellTriggerPrimitiveFilter::setEvtRecHitstatus(const double &tpValCu
int isPassCut =0;

EBRecHitCollection::const_iterator ebrechit;

for (ebrechit = HitecalEB.begin(); ebrechit != HitecalEB.end(); ebrechit++) {

EBDetId det = ebrechit->id();
Expand All @@ -433,8 +440,13 @@ int EcalDeadCellTriggerPrimitiveFilter::setEvtRecHitstatus(const double &tpValCu
if( !ebrechit->isRecovered() ) toDo = false;
// if( !ebrechit->checkFlag(EcalRecHit::kTowerRecovered) ) toDo = false;



if( toDo ){

//If we considerkTPSaturated and a recHit has a flag set, we can immediately flag the event.
if(ebrechit->checkFlag(EcalRecHit::kTPSaturated) && usekTPSaturated_) return 1;

EcalTrigTowerDetId ttDetId = ttItor->second;
int ttzside = ttDetId.zside();

Expand Down Expand Up @@ -496,6 +508,9 @@ int EcalDeadCellTriggerPrimitiveFilter::setEvtRecHitstatus(const double &tpValCu

if( toDo ){

//If we considerkTPSaturated and a recHit has a flag set, we can immediately flag the event.
if(eerechit->checkFlag(EcalRecHit::kTPSaturated) && usekTPSaturated_) return 1;

// vvvv= Only for debuging or testing purpose =vvvv
EcalTrigTowerDetId ttDetId = ttItor->second;
// int ttzside = ttDetId.zside();
Expand Down Expand Up @@ -533,6 +548,9 @@ int EcalDeadCellTriggerPrimitiveFilter::setEvtRecHitstatus(const double &tpValCu
}
} // loop over EE

//If we are not using the TT sum, then at this point we need not do anything further, we'll pass the event
if(!useTTsum_) return 0;

// Checking for EB
std::map<EcalTrigTowerDetId, double>::iterator ttetItor;
for( ttetItor = accuTTetMap.begin(); ttetItor != accuTTetMap.end(); ttetItor++){
Expand Down
Expand Up @@ -24,4 +24,6 @@
makeProfileRoot = cms.untracked.bool( False ),
profileRootName = cms.untracked.string("deadCellFilterProfile.root" ),

useTTsum = cms.bool ( True ),
usekTPSaturated = cms.bool ( False)
)

0 comments on commit 2973482

Please sign in to comment.