00001 #ifndef EcalMixingModuleValidation_H
00002 #define EcalMixingModuleValidation_H
00003
00004
00005
00006
00007
00008
00009
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/HepMCProduct/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/CaloSimAlgos/interface/CaloHitResponse.h"
00047 #include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00048 #include "CondFormats/EcalObjects/interface/EcalPedestals.h"
00049
00050 #include <iostream>
00051 #include <fstream>
00052 #include <vector>
00053 #include <map>
00054 #include "DQMServices/Core/interface/MonitorElement.h"
00055
00056 class EcalMixingModuleValidation: public edm::EDAnalyzer{
00057
00058 typedef std::map<uint32_t,float,std::less<uint32_t> > MapType;
00059
00060 public:
00061
00063 EcalMixingModuleValidation(const edm::ParameterSet& ps);
00064
00066 ~EcalMixingModuleValidation();
00067
00068 protected:
00069
00071 void analyze(const edm::Event& e, const edm::EventSetup& c);
00072
00073
00074 void beginJob(const edm::EventSetup& c);
00075
00076
00077 void endJob(void);
00078
00079 private:
00080
00081 void checkPedestals(const edm::EventSetup & c);
00082
00083 void findPedestal(const DetId & detId, int gainId, double & ped) const;
00084
00085 void checkCalibrations(const edm::EventSetup & c);
00086
00087 std::string HepMCLabel;
00088 std::string hitsProducer_;
00089
00090 bool verbose_;
00091
00092 DQMStore* dbe_;
00093
00094 std::string outputFile_;
00095
00096 edm::InputTag EBdigiCollection_;
00097 edm::InputTag EEdigiCollection_;
00098 edm::InputTag ESdigiCollection_;
00099
00100 std::map<int, double, std::less<int> > gainConv_;
00101
00102 double barrelADCtoGeV_;
00103 double endcapADCtoGeV_;
00104
00105 MonitorElement* meEBDigiMixRatiogt100ADC_;
00106 MonitorElement* meEEDigiMixRatiogt100ADC_;
00107
00108 MonitorElement* meEBDigiMixRatioOriggt50pc_;
00109 MonitorElement* meEEDigiMixRatioOriggt40pc_;
00110
00111 MonitorElement* meEBbunchCrossing_;
00112 MonitorElement* meEEbunchCrossing_;
00113 MonitorElement* meESbunchCrossing_;
00114
00115 static const int nBunch = 21;
00116
00117 MonitorElement* meEBBunchShape_[nBunch];
00118 MonitorElement* meEEBunchShape_[nBunch];
00119 MonitorElement* meESBunchShape_[nBunch];
00120
00121 MonitorElement* meEBShape_;
00122 MonitorElement* meEEShape_;
00123 MonitorElement* meESShape_;
00124
00125 MonitorElement* meEBShapeRatio_;
00126 MonitorElement* meEEShapeRatio_;
00127 MonitorElement* meESShapeRatio_;
00128
00129 const EcalSimParameterMap * theParameterMap;
00130 const CaloVShape * theEcalShape;
00131 const ESShape * theESShape;
00132
00133 CaloHitResponse * theEcalResponse;
00134 CaloHitResponse * theESResponse;
00135
00136 void computeSDBunchDigi(const edm::EventSetup & eventSetup, MixCollection<PCaloHit> & theHits, MapType & ebSignalSimMap, const EcalSubdetector & thisDet, const double & theSimThreshold);
00137
00138 void bunchSumTest(std::vector<MonitorElement *> & theBunches, MonitorElement* & theTotal, MonitorElement* & theRatio, int nSample);
00139
00140 double esBaseline_;
00141 double esADCtokeV_;
00142 double esThreshold_;
00143
00144 int theMinBunch;
00145 int theMaxBunch;
00146
00147 const CaloGeometry * theGeometry;
00148
00149
00150 const EcalPedestals * thePedestals;
00151
00152 };
00153
00154 #endif