CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_6_1_2_SLHC2/src/Validation/GlobalDigis/interface/GlobalDigisProducer.h

Go to the documentation of this file.
00001 #ifndef GlobalDigisProducer_h
00002 #define GlobalDigisProducer_h
00003 
00015 // framework & common header files
00016 #include "FWCore/Framework/interface/EDProducer.h"
00017 #include "FWCore/Framework/interface/Frameworkfwd.h"
00018 #include "FWCore/Framework/interface/Event.h"
00019 #include "FWCore/Framework/interface/EventSetup.h"
00020 #include "DataFormats/Common/interface/Handle.h"
00021 #include "FWCore/Framework/interface/ESHandle.h"
00022 //#include "DataFormats/Common/interface/Provenance.h"
00023 #include "DataFormats/Provenance/interface/Provenance.h"
00024 #include "FWCore/Framework/interface/MakerMacros.h" 
00025 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00026 #include "FWCore/MessageLogger/interface/MessageLogger.h"
00027 
00028 //DQM services
00029 #include "DQMServices/Core/interface/DQMStore.h"
00030 #include "FWCore/ServiceRegistry/interface/Service.h"
00031 
00032 // ecal calorimeter info
00033 #include "DataFormats/EcalDigi/interface/EBDataFrame.h"
00034 #include "DataFormats/EcalDigi/interface/EEDataFrame.h"
00035 #include "DataFormats/EcalDigi/interface/ESDataFrame.h"
00036 #include "DataFormats/EcalDigi/interface/EcalDigiCollections.h"
00037 #include "DataFormats/EcalDetId/interface/EBDetId.h"
00038 #include "DataFormats/EcalDetId/interface/EEDetId.h"
00039 #include "DataFormats/EcalDetId/interface/ESDetId.h"
00040 #include "CalibCalorimetry/EcalTrivialCondModules/interface/EcalTrivialConditionRetriever.h"
00041 
00042 // hcal calorimeter info
00043 #include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
00044 #include "DataFormats/HcalDetId/interface/HcalElectronicsId.h"
00045 #include "DataFormats/HcalDetId/interface/HcalDetId.h"
00046 #include "DataFormats/HcalDigi/interface/HcalDigiCollections.h"
00047 #include "DataFormats/HcalDigi/interface/HcalQIESample.h"
00048 #include "CalibFormats/HcalObjects/interface/HcalDbRecord.h"
00049 #include "CalibFormats/HcalObjects/interface/HcalCoderDb.h"
00050 #include "CalibFormats/HcalObjects/interface/HcalCalibrations.h"
00051 #include "DataFormats/HcalDigi/interface/HBHEDataFrame.h"
00052 #include "DataFormats/HcalDigi/interface/HFDataFrame.h"
00053 #include "DataFormats/HcalDigi/interface/HODataFrame.h"
00054 //#include "Geometry/Records/interface/IdealGeometryRecord.h"
00055 //#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
00056 //#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
00057 //#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
00058 #include "CalibFormats/HcalObjects/interface/HcalDbService.h"
00059 
00060 // silicon strip info
00061 #include "DataFormats/Common/interface/DetSetVector.h"
00062 #include "DataFormats/SiStripDigi/interface/SiStripDigi.h"
00063 #include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
00064 #include "DataFormats/SiStripDetId/interface/TIBDetId.h"
00065 #include "DataFormats/SiStripDetId/interface/TOBDetId.h"
00066 #include "DataFormats/SiStripDetId/interface/TIDDetId.h"
00067 #include "DataFormats/SiStripDetId/interface/TECDetId.h"
00068 
00069 // silicon pixel info
00070 #include "DataFormats/SiPixelDigi/interface/PixelDigi.h"
00071 #include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
00072 #include "DataFormats/SiPixelDetId/interface/PXFDetId.h"
00073 #include "DataFormats/SiPixelDetId/interface/PXBDetId.h"
00074 
00075 // muon DT info
00076 #include "DataFormats/DTDigi/interface/DTDigi.h"
00077 #include "DataFormats/DTDigi/interface/DTDigiCollection.h"
00078 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00079 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
00080 
00081 // muon CSC Strip info
00082 #include "DataFormats/CSCDigi/interface/CSCStripDigi.h"
00083 #include "DataFormats/CSCDigi/interface/CSCStripDigiCollection.h"
00084 
00085 // muon CSC Wire info
00086 #include "DataFormats/CSCDigi/interface/CSCWireDigi.h"
00087 #include "DataFormats/CSCDigi/interface/CSCWireDigiCollection.h"
00088 
00089 // event info
00090 #include "SimDataFormats/ValidationFormats/interface/PValidationFormats.h"
00091 #include "SimDataFormats/CrossingFrame/interface/CrossingFrame.h"
00092 #include "SimDataFormats/CrossingFrame/interface/MixCollection.h"
00093 #include "SimDataFormats/CaloHit/interface/PCaloHit.h"
00094 #include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
00095 
00096 // helper files
00097 //#include <CLHEP/Vector/LorentzVector.h>
00098 //#include <CLHEP/Units/SystemOfUnits.h>
00099 
00100 #include <iostream>
00101 #include <stdlib.h>
00102 #include <string>
00103 #include <memory>
00104 #include <vector>
00105 #include <map>
00106 
00107 #include "TString.h"
00108 
00109 class PGlobalDigi;
00110 
00111 class GlobalDigisProducer : public edm::EDProducer
00112 {
00113 
00114  public:
00115 
00116   typedef std::vector<float> FloatVector;
00117   typedef std::vector<double> DoubleVector;
00118   typedef std::vector<int> IntVector;
00119   typedef std::map<uint32_t,float,std::less<uint32_t> > MapType;
00120 
00121   explicit GlobalDigisProducer(const edm::ParameterSet&);
00122   virtual ~GlobalDigisProducer();
00123   virtual void beginJob( void );
00124   virtual void endJob();  
00125   virtual void produce(edm::Event&, const edm::EventSetup&);
00126   
00127  private:
00128 
00129   // production related methods
00130   void fillECal(edm::Event&, const edm::EventSetup&);
00131   void storeECal(PGlobalDigi&);
00132   void fillHCal(edm::Event&, const edm::EventSetup&);
00133   void storeHCal(PGlobalDigi&);
00134   void fillTrk(edm::Event&, const edm::EventSetup&);
00135   void storeTrk(PGlobalDigi&);
00136   void fillMuon(edm::Event&, const edm::EventSetup&);
00137   void storeMuon(PGlobalDigi&);  
00138 
00139   void clear();
00140 
00141  private:
00142 
00143   //  parameter information
00144   std::string fName;
00145   int verbosity;
00146   int frequency;
00147   std::string label;
00148   bool getAllProvenances;
00149   bool printProvenanceInfo;
00150 
00151   // Electromagnetic info
00152   // ECal info
00153  
00154   IntVector EBCalmaxPos; 
00155   DoubleVector EBCalAEE; 
00156   FloatVector EBCalSHE;
00157 
00158   IntVector EECalmaxPos; 
00159   DoubleVector EECalAEE; 
00160   FloatVector EECalSHE;
00161 
00162   FloatVector ESCalADC0, ESCalADC1, ESCalADC2;
00163   FloatVector ESCalSHE;
00164 
00165   edm::InputTag ECalEBSrc_;
00166   edm::InputTag ECalEESrc_;
00167   edm::InputTag ECalESSrc_;
00168 
00169   std::map<int, double, std::less<int> > ECalgainConv_;
00170   double ECalbarrelADCtoGeV_;
00171   double ECalendcapADCtoGeV_;
00172 
00173   // HCal info
00174 
00175   FloatVector HBCalAEE;
00176   FloatVector HBCalSHE;
00177 
00178   FloatVector HECalAEE;
00179   FloatVector HECalSHE;
00180 
00181   FloatVector HOCalAEE;
00182   FloatVector HOCalSHE;
00183 
00184   FloatVector HFCalAEE;
00185   FloatVector HFCalSHE;
00186 
00187   edm::InputTag HCalSrc_;
00188   edm::InputTag HCalDigi_;
00189 
00190   // Tracker info
00191   // SiStrip
00192   
00193   FloatVector TIBL1ADC, TIBL2ADC, TIBL3ADC, TIBL4ADC;
00194   IntVector TIBL1Strip, TIBL2Strip, TIBL3Strip, TIBL4Strip;
00195 
00196   FloatVector TOBL1ADC, TOBL2ADC, TOBL3ADC, TOBL4ADC;
00197   IntVector TOBL1Strip, TOBL2Strip, TOBL3Strip, TOBL4Strip;
00198 
00199   FloatVector TIDW1ADC, TIDW2ADC, TIDW3ADC;
00200   IntVector TIDW1Strip, TIDW2Strip, TIDW3Strip;
00201 
00202   FloatVector TECW1ADC, TECW2ADC, TECW3ADC, TECW4ADC, TECW5ADC, TECW6ADC, 
00203     TECW7ADC, TECW8ADC;
00204   IntVector TECW1Strip, TECW2Strip, TECW3Strip, TECW4Strip, TECW5Strip, 
00205     TECW6Strip, TECW7Strip, TECW8Strip;
00206 
00207   edm::InputTag SiStripSrc_;
00208 
00209   // SiPxl
00210 
00211   FloatVector BRL1ADC, BRL2ADC, BRL3ADC;
00212   IntVector BRL1Row, BRL2Row, BRL3Row;
00213   IntVector BRL1Col, BRL2Col, BRL3Col;
00214 
00215   FloatVector FWD1pADC, FWD1nADC, FWD2pADC, FWD2nADC;
00216   IntVector FWD1pRow, FWD1nRow, FWD2pRow, FWD2nRow;
00217   IntVector FWD1pCol, FWD1nCol, FWD2pCol, FWD2nCol;
00218 
00219   edm::InputTag SiPxlSrc_;
00220 
00221   // Muon info
00222   // DT
00223 
00224   IntVector MB1SLayer, MB2SLayer, MB3SLayer, MB4SLayer;
00225   FloatVector MB1Time, MB2Time, MB3Time, MB4Time;
00226   IntVector MB1Layer, MB2Layer, MB3Layer, MB4Layer;
00227 
00228   edm::InputTag MuDTSrc_;
00229 
00230   // CSC Strip
00231 
00232   float theCSCStripPedestalSum;
00233   int theCSCStripPedestalCount;
00234 
00235   FloatVector CSCStripADC;
00236 
00237   edm::InputTag MuCSCStripSrc_;
00238 
00239   // CSC Wire
00240 
00241   FloatVector CSCWireTime;
00242 
00243   edm::InputTag MuCSCWireSrc_;
00244 
00245   // private statistics information
00246   unsigned int count;
00247 
00248 }; // end class declaration
00249 
00250 #endif
00251 
00252 #ifndef GlobalHitMap
00253 #define GlobalHitMap
00254 
00255 // geometry mapping
00256 static const int dTrk             = 1;
00257 static const int sdPxlBrl         = 1;
00258 static const int sdPxlFwd         = 2;
00259 static const int sdSiTIB          = 3;
00260 static const int sdSiTID          = 4;
00261 static const int sdSiTOB          = 5;
00262 static const int sdSiTEC          = 6;
00263 
00264 static const int dMuon            = 2;
00265 static const int sdMuonDT         = 1;
00266 static const int sdMuonCSC        = 2;
00267 static const int sdMuonRPC        = 3;
00268 static const int sdMuonRPCRgnBrl  = 0;
00269 static const int sdMuonRPCRgnFwdp = 1;
00270 static const int sdMuonRPCRgnFwdn = -1;
00271 
00272 static const int dEcal            = 3;
00273 static const int sdEcalBrl        = 1;
00274 static const int sdEcalFwd        = 2;
00275 static const int sdEcalPS         = 3;
00276 static const int sdEcalTT         = 4;
00277 static const int sdEcalLPnD       = 5;
00278 
00279 static const int dHcal            = 4;
00280 static const int sdHcalEmpty      = 0;
00281 static const int sdHcalBrl        = 1;
00282 static const int sdHcalEC         = 2;
00283 static const int sdHcalOut        = 3;
00284 static const int sdHcalFwd        = 4;
00285 static const int sdHcalTT         = 5;
00286 static const int sdHcalCalib      = 6;
00287 static const int sdHcalCompst     = 7;
00288 
00289 #endif //PGlobalDigisProducer_h