Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2024-04-06 12:32:51

0001 #ifndef Validation_MuonHits_MuonSimHitsValidAnalyzer_h
0002 #define Validation_MuonHits_MuonSimHitsValidAnalyzer_h
0003 
0004 /// framework & common header files
0005 #include "FWCore/Framework/interface/Frameworkfwd.h"
0006 #include "FWCore/Framework/interface/Event.h"
0007 #include "FWCore/Framework/interface/EventSetup.h"
0008 #include "DataFormats/Common/interface/Handle.h"
0009 #include "DataFormats/Provenance/interface/Provenance.h"
0010 #include "FWCore/Framework/interface/MakerMacros.h"
0011 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0012 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0013 #include "FWCore/ServiceRegistry/interface/Service.h"
0014 #include "DataFormats/GeometrySurface/interface/BoundPlane.h"
0015 
0016 #include "DQMServices/Core/interface/DQMStore.h"
0017 #include "DQMServices/Core/interface/DQMEDAnalyzer.h"
0018 
0019 /// muon CSC, DT and RPC geometry info
0020 #include "Geometry/Records/interface/MuonGeometryRecord.h"
0021 #include "Geometry/CSCGeometry/interface/CSCGeometry.h"
0022 #include "Geometry/DTGeometry/interface/DTGeometry.h"
0023 #include "Geometry/RPCGeometry/interface/RPCGeometry.h"
0024 #include "DataFormats/MuonDetId/interface/MuonSubdetId.h"
0025 
0026 /// data in edm::event
0027 #include "SimDataFormats/GeneratorProducts/interface/HepMCProduct.h"
0028 #include "SimDataFormats/Vertex/interface/SimVertexContainer.h"
0029 #include "SimDataFormats/Track/interface/SimTrackContainer.h"
0030 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
0031 
0032 #include <iostream>
0033 #include <cstdlib>
0034 #include <string>
0035 #include <memory>
0036 #include <vector>
0037 
0038 #include "TString.h"
0039 
0040 class TH1F;
0041 class TFile;
0042 
0043 namespace edm {
0044   class ParameterSet;
0045   class Event;
0046   class EventSetup;
0047 }  // namespace edm
0048 
0049 class MuonSimHitsValidAnalyzer : public DQMEDAnalyzer {
0050 public:
0051   typedef std::vector<float> FloatVector;
0052   typedef std::vector<int> IntegerVector;
0053   typedef std::vector<long int> LongIntegerVector;
0054   typedef std::vector<unsigned int> UnsigIntegerVector;
0055 
0056   explicit MuonSimHitsValidAnalyzer(const edm::ParameterSet&);
0057   ~MuonSimHitsValidAnalyzer() override;
0058   void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;
0059   void analyze(const edm::Event&, const edm::EventSetup&) override;
0060 
0061 private:
0062   void fillDT(const edm::Event&, const edm::EventSetup&);
0063 
0064 private:
0065   ///  parameter information
0066   std::string fName;
0067   int verbosity;
0068   std::string label;
0069   bool getAllProvenances;
0070   bool printProvenanceInfo;
0071 
0072   /// G4MC info
0073   int nRawGenPart;
0074 
0075   unsigned int iden;
0076   Int_t wheel, station, sector, superlayer, layer, wire;
0077   Int_t region, ring, subsector, roll;
0078   Int_t path, pathchamber;
0079   Int_t touch1, touch4, nummu_DT, nummu_RPC, nummu_CSC;
0080   Int_t touche1, touche4;
0081   Float_t pow6;
0082   Float_t mom1, mom4, mome1, mome4;
0083   Float_t costeta, radius, sinteta;
0084   Float_t globposx, globposy, globposz;
0085   Float_t globposphi, globposeta;
0086 
0087   /// Input tags
0088   edm::EDGetTokenT<edm::PSimHitContainer> DTHitsToken_;
0089   edm::ESGetToken<DTGeometry, MuonGeometryRecord> geomToken_;
0090 
0091   // Monitor elements
0092   // DT
0093   MonitorElement* meAllDTHits;
0094   MonitorElement* meMuDTHits;
0095   MonitorElement* meToF;
0096   MonitorElement* meEnergyLoss;
0097   MonitorElement* meMomentumMB1;
0098   MonitorElement* meMomentumMB4;
0099   MonitorElement* meLossMomIron;
0100   MonitorElement* meLocalXvsZ;
0101   MonitorElement* meLocalXvsY;
0102   MonitorElement* meGlobalXvsZ;
0103   MonitorElement* meGlobalXvsY;
0104   MonitorElement* meGlobalXvsZWm2;
0105   MonitorElement* meGlobalXvsZWm1;
0106   MonitorElement* meGlobalXvsZW0;
0107   MonitorElement* meGlobalXvsZWp1;
0108   MonitorElement* meGlobalXvsZWp2;
0109   MonitorElement* meGlobalXvsYWm2;
0110   MonitorElement* meGlobalXvsYWm1;
0111   MonitorElement* meGlobalXvsYW0;
0112   MonitorElement* meGlobalXvsYWp1;
0113   MonitorElement* meGlobalXvsYWp2;
0114   MonitorElement* meWheelOccup;
0115   MonitorElement* meStationOccup;
0116   MonitorElement* meSectorOccup;
0117   MonitorElement* meSuperLOccup;
0118   MonitorElement* meLayerOccup;
0119   MonitorElement* meWireOccup;
0120   MonitorElement* mePathMuon;
0121   MonitorElement* meChamberOccup;
0122   MonitorElement* meHitRadius;
0123   MonitorElement* meCosTheta;
0124   MonitorElement* meGlobalEta;
0125   MonitorElement* meGlobalPhi;
0126 
0127   /// private statistics information
0128   unsigned int count;
0129 
0130 };  /// end class declaration
0131 
0132 /// geometry mapping
0133 
0134 static const int dMuon = 2;
0135 
0136 static const int sdMuonDT = 1;
0137 static const int sdMuonCSC = 2;
0138 static const int sdMuonRPC = 3;
0139 
0140 #endif