CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_13_patch3/src/DQM/EcalBarrelMonitorTasks/interface/ClusterTask.h

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, // profile2d
00035       kBCEMapProjEta, // profile
00036       kBCEMapProjPhi, // profile
00037       kBCOccupancy, // h2f
00038       kBCOccupancyProjEta, // h1f
00039       kBCOccupancyProjPhi, // h1f
00040       kBCSizeMap, // profile2d
00041       kBCSizeMapProjEta, // profile
00042       kBCSizeMapProjPhi, // profile
00043       kBCE, // h1f
00044       kBCNum, // h1f for EB & EE
00045       kBCSize, // h1f for EB & EE
00046       kSCE, // h1f
00047       kSCELow, // h1f
00048       kSCSeedEnergy, // h1f
00049       kSCClusterVsSeed, // h2f
00050       kSCSeedOccupancy, // h2f
00051       kSingleCrystalCluster, // h2f
00052       kSCNum, // h1f
00053       kSCNBCs, // h1f
00054       kSCNcrystals, // h1f
00055       kSCR9, // h1f
00056       kPi0, // h1f
00057       kJPsi, // h1f
00058       kZ, // h1f
00059       kHighMass, // h1f
00060       nMESets
00061     };
00062 
00063     // needs to be declared in each derived class
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