Go to the documentation of this file.00001 #ifndef ClusterTask_H
00002 #define ClusterTask_H
00003
00004 #include "DQM/EcalCommon/interface/DQWorkerTask.h"
00005
00006 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00007 #include "DataFormats/EgammaReco/interface/BasicClusterFwd.h"
00008 #include "DataFormats/EgammaReco/interface/SuperClusterFwd.h"
00009
00010 class CaloTopology;
00011 class CaloSubdetectorGeometry;
00012
00013 namespace ecaldqm {
00014
00015 class ClusterTask : public DQWorkerTask {
00016 public:
00017 ClusterTask(const edm::ParameterSet &, const edm::ParameterSet&);
00018 ~ClusterTask();
00019
00020 void bookMEs();
00021
00022 bool filterRunType(const std::vector<short>&);
00023
00024 void beginRun(const edm::Run &, const edm::EventSetup &);
00025 void beginEvent(const edm::Event &, const edm::EventSetup &);
00026
00027 void analyze(const void*, Collections);
00028
00029 void runOnRecHits(const EcalRecHitCollection &, Collections);
00030 void runOnBasicClusters(const reco::BasicClusterCollection &, Collections);
00031 void runOnSuperClusters(const reco::SuperClusterCollection &, Collections);
00032
00033 enum MESets {
00034 kBCEMap,
00035 kBCEMapProjEta,
00036 kBCEMapProjPhi,
00037 kBCOccupancy,
00038 kBCOccupancyProjEta,
00039 kBCOccupancyProjPhi,
00040 kBCSizeMap,
00041 kBCSizeMapProjEta,
00042 kBCSizeMapProjPhi,
00043 kBCE,
00044 kBCNum,
00045 kBCSize,
00046 kSCE,
00047 kSCELow,
00048 kSCSeedEnergy,
00049 kSCClusterVsSeed,
00050 kSCSeedOccupancy,
00051 kSingleCrystalCluster,
00052 kSCNum,
00053 kSCNBCs,
00054 kSCNcrystals,
00055 kSCR9,
00056 kPi0,
00057 kJPsi,
00058 kZ,
00059 kHighMass,
00060 nMESets
00061 };
00062
00063
00064 static void setMEData(std::vector<MEData>&);
00065
00066 private:
00067 const CaloTopology *topology_;
00068 const CaloSubdetectorGeometry* ebGeometry_;
00069 const CaloSubdetectorGeometry* eeGeometry_;
00070 const EcalRecHitCollection *ebHits_, *eeHits_;
00071 int ievt_;
00072 float lowEMax_;
00073 int massCalcPrescale_;
00074 };
00075
00076 inline void ClusterTask::analyze(const void* _p, Collections _collection){
00077 switch(_collection){
00078 case kEBRecHit:
00079 case kEERecHit:
00080 runOnRecHits(*static_cast<const EcalRecHitCollection*>(_p), _collection);
00081 break;
00082 case kEBBasicCluster:
00083 case kEEBasicCluster:
00084 runOnBasicClusters(*static_cast<const reco::BasicClusterCollection*>(_p), _collection);
00085 break;
00086 case kEBSuperCluster:
00087 case kEESuperCluster:
00088 runOnSuperClusters(*static_cast<const reco::SuperClusterCollection*>(_p), _collection);
00089 break;
00090 default:
00091 break;
00092 }
00093 }
00094
00095 }
00096
00097 #endif
00098