Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 13:09:59

0001 #ifndef RecoSummaryTask_H
0002 #define RecoSummaryTask_H
0003 
0004 #include "DQWorkerTask.h"
0005 
0006 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
0007 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
0008 #include "DataFormats/CaloRecHit/interface/CaloCluster.h"
0009 #include "DataFormats/Common/interface/View.h"
0010 
0011 namespace ecaldqm {
0012 
0013   class RecoSummaryTask : public DQWorkerTask {
0014   public:
0015     RecoSummaryTask();
0016     ~RecoSummaryTask() override {}
0017 
0018     bool filterRunType(short const*) override;
0019 
0020     void addDependencies(DependencySet&) override;
0021 
0022     bool analyze(void const*, Collections) override;
0023     void endEvent(edm::Event const&, edm::EventSetup const&) override;
0024 
0025     void runOnRecHits(EcalRecHitCollection const&, Collections);
0026     void runOnReducedRecHits(EcalRecHitCollection const&, Collections);
0027     void runOnBasicClusters(edm::View<reco::CaloCluster> const&, Collections);
0028 
0029   private:
0030     void setParams(edm::ParameterSet const&) override;
0031 
0032     float rechitThresholdEB_;
0033     float rechitThresholdEE_;
0034     EcalRecHitCollection const* ebHits_;
0035     EcalRecHitCollection const* eeHits_;
0036     bool fillRecoFlagReduced_;
0037   };
0038 
0039   inline bool RecoSummaryTask::analyze(void const* _p, Collections _collection) {
0040     switch (_collection) {
0041       case kEBRecHit:
0042       case kEERecHit:
0043         if (_p)
0044           runOnRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
0045         return true;
0046         break;
0047       case kEBReducedRecHit:
0048       case kEEReducedRecHit:
0049         if (_p && fillRecoFlagReduced_)
0050           runOnReducedRecHits(*static_cast<EcalRecHitCollection const*>(_p), _collection);
0051         return fillRecoFlagReduced_;
0052         break;
0053       case kEBBasicCluster:
0054       case kEEBasicCluster:
0055         if (_p)
0056           runOnBasicClusters(*static_cast<edm::View<reco::CaloCluster> const*>(_p), _collection);
0057         return true;
0058         break;
0059       default:
0060         break;
0061     }
0062     return false;
0063   }
0064 
0065 }  // namespace ecaldqm
0066 
0067 #endif