CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_5_3_14/src/Validation/HcalHits/interface/HcalSimHitsValidation.h

Go to the documentation of this file.
00001 #ifndef HcalSimHitsValidation_H
00002 #define HcalSimHitsValidation_H
00003 
00004 #include "FWCore/Framework/interface/Frameworkfwd.h"
00005 #include "FWCore/Framework/interface/EDAnalyzer.h"
00006 #include "FWCore/Framework/interface/Event.h"
00007 #include "FWCore/Framework/interface/EventSetup.h"
00008 #include "FWCore/Framework/interface/ESHandle.h"
00009 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00010 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00011 #include "FWCore/Framework/interface/MakerMacros.h"
00012 #include "FWCore/PluginManager/interface/ModuleDef.h"
00013 #include "FWCore/ServiceRegistry/interface/Service.h"
00014 
00015 #include "DQMServices/Core/interface/DQMStore.h"
00016 
00017 #include "DataFormats/HcalRecHit/interface/HcalRecHitCollections.h"
00018 #include "DataFormats/HcalRecHit/interface/HcalSourcePositionData.h"
00019 
00020 #include <DataFormats/EcalDetId/interface/EBDetId.h>
00021 #include <DataFormats/EcalDetId/interface/EEDetId.h>
00022 #include "DataFormats/EcalRecHit/interface/EcalRecHitCollections.h"
00023 
00024 #include "DataFormats/HcalDetId/interface/HcalElectronicsId.h"
00025 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00026 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00027 #include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00028 #include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
00029 
00030 #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
00031 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
00032 
00033 #include <vector>
00034 #include <utility>
00035 #include <ostream>
00036 #include <string>
00037 #include <algorithm>
00038 #include <cmath>
00039 #include "DQMServices/Core/interface/MonitorElement.h"
00040 
00041 
00042 class HcalSimHitsValidation : public edm::EDAnalyzer {
00043 
00044 public:
00045   HcalSimHitsValidation(edm::ParameterSet const& conf);
00046   ~HcalSimHitsValidation();
00047   virtual void analyze(edm::Event const& ev, edm::EventSetup const& c);
00048   virtual void beginJob() ;
00049   virtual void endJob() ;
00050 
00051 private:
00052   
00053   double dR(double eta1, double phi1, double eta2, double phi2);
00054   double phi12(double phi1, double en1, double phi2, double en2);
00055   double dPhiWsign(double phi1,double phi2);  
00056 
00057   DQMStore* dbe_;
00058   
00059   std::string outputFile_;
00060 
00061   // Hits counters
00062   MonitorElement* Nhb;
00063   MonitorElement* Nhe;
00064   MonitorElement* Nho;
00065   MonitorElement* Nhf;
00066 
00067   // In ALL other cases : 2D ieta-iphi maps 
00068   // without and with cuts (a la "Scheme B") on energy
00069   // - only in the cone around particle for single-part samples (mc = "yes")
00070   // - for all calls in milti-particle samples (mc = "no")
00071 
00072   MonitorElement* emean_vs_ieta_HB1;
00073   MonitorElement* emean_vs_ieta_HB2;
00074   MonitorElement* emean_vs_ieta_HE1;
00075   MonitorElement* emean_vs_ieta_HE2;
00076   MonitorElement* emean_vs_ieta_HE3;
00077   MonitorElement* emean_vs_ieta_HO;
00078   MonitorElement* emean_vs_ieta_HF1;
00079   MonitorElement* emean_vs_ieta_HF2;
00080 
00081   MonitorElement* occupancy_vs_ieta_HB1;
00082   MonitorElement* occupancy_vs_ieta_HB2;
00083   MonitorElement* occupancy_vs_ieta_HE1;
00084   MonitorElement* occupancy_vs_ieta_HE2;
00085   MonitorElement* occupancy_vs_ieta_HE3;
00086   MonitorElement* occupancy_vs_ieta_HO;
00087   MonitorElement* occupancy_vs_ieta_HF1;
00088   MonitorElement* occupancy_vs_ieta_HF2;
00089 
00090   // for single monoenergetic particles - cone collection profile vs ieta.
00091   MonitorElement* meEnConeEtaProfile;
00092   MonitorElement* meEnConeEtaProfile_E;
00093   MonitorElement* meEnConeEtaProfile_EH;
00094 
00095   // energy of rechits
00096   MonitorElement* meSimHitsEnergyHB;
00097   MonitorElement* meSimHitsEnergyHE;
00098   MonitorElement* meSimHitsEnergyHO;
00099   MonitorElement* meSimHitsEnergyHF;
00100 
00101   edm::ESHandle<CaloGeometry> geometry ;
00102 
00103   // counter
00104   int nevtot;
00105 
00106 };
00107 
00108 #endif