CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_10_patch2/src/Validation/EcalDigis/interface/EcalMixingModuleValidation.h

Go to the documentation of this file.
00001 #ifndef EcalMixingModuleValidation_H
00002 #define EcalMixingModuleValidation_H
00003 
00004 /*
00005  * \file EcalMixingModuleValidation.h
00006  *
00007  * $Date: 2010/03/29 01:30:40 $
00008  * $Revision: 1.12 $
00009  * \author F. Cossutti
00010  *
00011 */
00012 
00013 #include "FWCore/Framework/interface/Frameworkfwd.h"
00014 #include "FWCore/Framework/interface/EDAnalyzer.h"
00015 
00016 #include "FWCore/Framework/interface/Event.h"
00017 #include "FWCore/Framework/interface/EventSetup.h"
00018 #include "FWCore/Framework/interface/ESHandle.h"
00019 #include "FWCore/Framework/interface/MakerMacros.h"
00020 
00021 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00022 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00023 
00024 #include "DQMServices/Core/interface/DQMStore.h"
00025 #include "FWCore/ServiceRegistry/interface/Service.h"
00026 
00027 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
00028 #include "SimDataFormats/EncodedEventId/interface/EncodedEventId.h"
00029 #include "SimDataFormats/Track/interface/SimTrack.h"
00030 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
00031 #include "SimDataFormats/Vertex/interface/SimVertex.h"
00032 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
00033 #include "SimDataFormats/CaloHit/interface/PCaloHit.h"
00034 #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
00035 
00036 #include "DataFormats/EcalDigi/interface/EBDataFrame.h"
00037 #include "DataFormats/EcalDigi/interface/EEDataFrame.h"
00038 #include "DataFormats/EcalDigi/interface/ESDataFrame.h"
00039 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00040 #include "SimDataFormats/CrossingFrame/interface/CrossingFrame.h"
00041 #include "SimDataFormats/CrossingFrame/interface/MixCollection.h"
00042 
00043 #include "SimCalorimetry/EcalSimAlgos/interface/EcalSimParameterMap.h"
00044 //#include "SimCalorimetry/EcalSimAlgos/interface/EcalShape.h"
00045 #include "SimCalorimetry/EcalSimAlgos/interface/ESShape.h"
00046 #include "SimCalorimetry/EcalSimAlgos/interface/EBShape.h"
00047 #include "SimCalorimetry/EcalSimAlgos/interface/EEShape.h"
00048 #include "SimCalorimetry/CaloSimAlgos/interface/CaloHitResponse.h"
00049 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00050 #include "CondFormats/EcalObjects/interface/EcalPedestals.h"
00051 
00052 #include "CondFormats/ESObjects/interface/ESIntercalibConstants.h"
00053 #include "CondFormats/DataRecord/interface/ESIntercalibConstantsRcd.h"
00054 #include "CondFormats/ESObjects/interface/ESMIPToGeVConstant.h"
00055 #include "CondFormats/DataRecord/interface/ESMIPToGeVConstantRcd.h"
00056 #include "CondFormats/ESObjects/interface/ESGain.h"
00057 #include "CondFormats/DataRecord/interface/ESGainRcd.h"
00058 #include "CondFormats/ESObjects/interface/ESPedestals.h"
00059 #include "CondFormats/DataRecord/interface/ESPedestalsRcd.h"
00060 #include "CondFormats/ESObjects/interface/ESIntercalibConstants.h"
00061 
00062 #include <iostream>
00063 #include <fstream>
00064 #include <vector>
00065 #include <map>
00066 #include "DQMServices/Core/interface/MonitorElement.h"
00067 
00068 class EcalMixingModuleValidation: public edm::EDAnalyzer{
00069 
00070     typedef std::map<uint32_t,float,std::less<uint32_t> >  MapType;
00071 
00072 public:
00073 
00075 EcalMixingModuleValidation(const edm::ParameterSet& ps);
00076 
00078 ~EcalMixingModuleValidation();
00079 
00080 protected:
00081 
00083 void analyze(edm::Event const & e, edm::EventSetup const & c);
00084 
00085 // BeginRun
00086 void beginRun(edm::Run const &, edm::EventSetup const & c);
00087 
00088 // EndRun
00089 void endRun(const edm::Run& r, const edm::EventSetup& c);
00090 
00091 // EndJob
00092 void endJob(void);
00093 
00094 private:
00095 
00096  void checkPedestals(const edm::EventSetup & c);
00097 
00098  void findPedestal(const DetId & detId, int gainId, double & ped) const;
00099 
00100  void checkCalibrations(edm::EventSetup const & c);
00101  
00102  std::string HepMCLabel;
00103  std::string hitsProducer_;
00104 
00105  bool verbose_;
00106 
00107  DQMStore* dbe_;
00108  
00109  std::string outputFile_;
00110 
00111  edm::InputTag EBdigiCollection_;
00112  edm::InputTag EEdigiCollection_;
00113  edm::InputTag ESdigiCollection_;
00114  
00115  std::map<int, double, std::less<int> > gainConv_;
00116 
00117  double barrelADCtoGeV_;
00118  double endcapADCtoGeV_;
00119  
00120  MonitorElement* meEBDigiMixRatiogt100ADC_;
00121  MonitorElement* meEEDigiMixRatiogt100ADC_;
00122 
00123  MonitorElement* meEBDigiMixRatioOriggt50pc_;
00124  MonitorElement* meEEDigiMixRatioOriggt40pc_;
00125 
00126  MonitorElement* meEBbunchCrossing_;
00127  MonitorElement* meEEbunchCrossing_;
00128  MonitorElement* meESbunchCrossing_;
00129 
00130  static const int nBunch = 21;
00131 
00132  MonitorElement* meEBBunchShape_[nBunch];
00133  MonitorElement* meEEBunchShape_[nBunch];
00134  MonitorElement* meESBunchShape_[nBunch];
00135 
00136  MonitorElement* meEBShape_;
00137  MonitorElement* meEEShape_;
00138  MonitorElement* meESShape_;
00139 
00140  MonitorElement* meEBShapeRatio_;
00141  MonitorElement* meEEShapeRatio_;
00142  MonitorElement* meESShapeRatio_;
00143 
00144  const EcalSimParameterMap * theParameterMap;
00145  //const CaloVShape * theEcalShape;
00146  ESShape * theESShape;
00147  const EBShape *theEBShape;
00148  const EEShape *theEEShape;
00149 
00150 
00151  //CaloHitResponse * theEcalResponse;
00152  CaloHitResponse * theESResponse;
00153  CaloHitResponse * theEBResponse;
00154  CaloHitResponse * theEEResponse;
00155  
00156  void computeSDBunchDigi(const edm::EventSetup & eventSetup, MixCollection<PCaloHit> & theHits, MapType & ebSignalSimMap, const EcalSubdetector & thisDet, const double & theSimThreshold);
00157 
00158  void bunchSumTest(std::vector<MonitorElement *> & theBunches, MonitorElement* & theTotal, MonitorElement* & theRatio, int nSample);
00159 
00160  double esBaseline_;
00161  double esADCtokeV_;
00162  double esThreshold_;
00163 
00164  int theMinBunch;
00165  int theMaxBunch;
00166 
00167  const CaloGeometry * theGeometry;
00168  
00169  // the pedestals
00170  const EcalPedestals * thePedestals;
00171 
00172       int m_ESgain ;
00173       const ESPedestals* m_ESpeds ;
00174       const ESIntercalibConstants* m_ESmips ;
00175       double m_ESeffwei ;
00176 
00177 };
00178 
00179 #endif