Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:32:47

0001 #ifndef GlobalHitsHistogrammer_h
0002 #define GlobalHitsHistogrammer_h
0003 
0004 /** \class GlobalHitsHistogrammer
0005  *
0006  *  Class to fill dqm monitor elements from existing EDM file
0007  *
0008  *  \author M. Strang SUNY-Buffalo
0009  */
0010 
0011 // framework & common header files
0012 #include "DataFormats/Common/interface/Handle.h"
0013 #include "DataFormats/Provenance/interface/Provenance.h"
0014 #include "FWCore/Framework/interface/ESHandle.h"
0015 #include "FWCore/Framework/interface/Event.h"
0016 #include "FWCore/Framework/interface/EventSetup.h"
0017 #include "FWCore/Framework/interface/Frameworkfwd.h"
0018 #include "FWCore/Framework/interface/MakerMacros.h"
0019 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0020 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0021 //#include "Geometry/CommonDetUnit/interface/GeomDet.h"
0022 //#include "DataFormats/DetId/interface/DetId.h"
0023 
0024 // DQM services
0025 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0026 #include "DQMServices/Core/interface/DQMStore.h"
0027 #include "FWCore/ServiceRegistry/interface/Service.h"
0028 
0029 // tracker info
0030 //#include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0031 //#include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0032 //#include "DataFormats/SiStripDetId/interface/StripSubdetector.h"
0033 //#include "DataFormats/SiPixelDetId/interface/PixelSubdetector.h"
0034 
0035 // muon info
0036 //#include "Geometry/Records/interface/MuonGeometryRecord.h"
0037 //#include "Geometry/CSCGeometry/interface/CSCGeometry.h"
0038 //#include "Geometry/DTGeometry/interface/DTGeometry.h"
0039 //#include "Geometry/RPCGeometry/interface/RPCGeometry.h"
0040 //#include "DataFormats/MuonDetId/interface/MuonSubdetId.h"
0041 //#include "DataFormats/MuonDetId/interface/RPCDetId.h"
0042 //#include "DataFormats/MuonDetId/interface/DTWireId.h"
0043 
0044 // calorimeter info
0045 //#include "Geometry/Records/interface/IdealGeometryRecord.h"
0046 //#include "Geometry/CaloGeometry/interface/CaloGeometry.h"
0047 //#include "Geometry/CaloGeometry/interface/CaloSubdetectorGeometry.h"
0048 //#include "Geometry/CaloGeometry/interface/CaloCellGeometry.h"
0049 //#include "DataFormats/EcalDetId/interface/EcalSubdetector.h"
0050 //#include "DataFormats/HcalDetId/interface/HcalSubdetector.h"
0051 
0052 // data in edm::event
0053 //#include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0054 //#include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
0055 //#include "SimDataFormats/Track/interface/SimTrackContainer.h"
0056 //#include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
0057 //#include "SimDataFormats/CaloHit/interface/PCaloHitContainer.h"
0058 #include "SimDataFormats/ValidationFormats/interface/PValidationFormats.h"
0059 
0060 // helper files
0061 //#include <CLHEP/Vector/LorentzVector.h>
0062 #include "CLHEP/Units/GlobalSystemOfUnits.h"
0063 #include "DataFormats/Math/interface/LorentzVector.h"
0064 
0065 #include <cstdlib>
0066 #include <iostream>
0067 #include <memory>
0068 #include <string>
0069 #include <vector>
0070 
0071 #include "TString.h"
0072 
0073 class GlobalHitsHistogrammer : public DQMEDAnalyzer {
0074 public:
0075   // typedef std::vector<float> FloatVector;
0076 
0077   explicit GlobalHitsHistogrammer(const edm::ParameterSet &);
0078   ~GlobalHitsHistogrammer() override;
0079   void analyze(const edm::Event &, const edm::EventSetup &) override;
0080   void bookHistograms(DQMStore::IBooker &, edm::Run const &, edm::EventSetup const &) override;
0081 
0082 private:
0083   //  parameter information
0084   std::string fName;
0085   int verbosity;
0086   int frequency;
0087   int vtxunit;
0088   std::string label;
0089   bool getAllProvenances;
0090   bool printProvenanceInfo;
0091 
0092   std::string outputfile;
0093   bool doOutput;
0094 
0095   edm::InputTag GlobalHitSrc_;
0096   edm::EDGetTokenT<PGlobalSimHit> GlobalHitSrc_Token_;
0097 
0098   // G4MC info
0099   MonitorElement *meMCRGP[2];
0100   MonitorElement *meMCG4Vtx[2];
0101   MonitorElement *meGeantVtxX[2];
0102   MonitorElement *meGeantVtxY[2];
0103   MonitorElement *meGeantVtxZ[2];
0104   MonitorElement *meMCG4Trk[2];
0105   MonitorElement *meGeantTrkPt;
0106   MonitorElement *meGeantTrkE;
0107 
0108   // Electromagnetic info
0109   // ECal info
0110   MonitorElement *meCaloEcal[2];
0111   MonitorElement *meCaloEcalE[2];
0112   MonitorElement *meCaloEcalToF[2];
0113   MonitorElement *meCaloEcalPhi;
0114   MonitorElement *meCaloEcalEta;
0115 
0116   // Preshower info
0117   MonitorElement *meCaloPreSh[2];
0118   MonitorElement *meCaloPreShE[2];
0119   MonitorElement *meCaloPreShToF[2];
0120   MonitorElement *meCaloPreShPhi;
0121   MonitorElement *meCaloPreShEta;
0122 
0123   // Hadronic info
0124   // HCal info
0125   MonitorElement *meCaloHcal[2];
0126   MonitorElement *meCaloHcalE[2];
0127   MonitorElement *meCaloHcalToF[2];
0128   MonitorElement *meCaloHcalPhi;
0129   MonitorElement *meCaloHcalEta;
0130 
0131   // Tracker info
0132   // Pixel info
0133   int nPxlBrlHits;
0134   int nPxlFwdHits;
0135   int nPxlHits;
0136   MonitorElement *meTrackerPx[2];
0137   MonitorElement *meTrackerPxPhi;
0138   MonitorElement *meTrackerPxEta;
0139   MonitorElement *meTrackerPxBToF;
0140   MonitorElement *meTrackerPxBR;
0141   MonitorElement *meTrackerPxFToF;
0142   MonitorElement *meTrackerPxFZ;
0143 
0144   // Strip info
0145   int nSiHits;
0146   int nSiBrlHits;
0147   int nSiFwdHits;
0148   MonitorElement *meTrackerSi[2];
0149   MonitorElement *meTrackerSiPhi;
0150   MonitorElement *meTrackerSiEta;
0151   MonitorElement *meTrackerSiBToF;
0152   MonitorElement *meTrackerSiBR;
0153   MonitorElement *meTrackerSiFToF;
0154   MonitorElement *meTrackerSiFZ;
0155 
0156   // Muon info
0157   MonitorElement *meMuon[2];
0158   MonitorElement *meMuonPhi;
0159   MonitorElement *meMuonEta;
0160   int nMuonHits;
0161 
0162   // DT info
0163   int nMuonDtHits;
0164   MonitorElement *meMuonDtToF[2];
0165   MonitorElement *meMuonDtR;
0166 
0167   // CSC info
0168   int nMuonCscHits;
0169   MonitorElement *meMuonCscToF[2];
0170   MonitorElement *meMuonCscZ;
0171 
0172   // RPC info
0173   int nMuonRpcBrlHits;
0174   int nMuonRpcFwdHits;
0175   MonitorElement *meMuonRpcFToF[2];
0176   MonitorElement *meMuonRpcFZ;
0177   MonitorElement *meMuonRpcBToF[2];
0178   MonitorElement *meMuonRpcBR;
0179 
0180   // private statistics information
0181   unsigned int count;
0182 
0183 };  // end class declaration
0184 
0185 #endif