Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-02-14 14:24:48

0001 #ifndef RecoLocalMuon_DTRecHitReader_H
0002 #define RecoLocalMuon_DTRecHitReader_H
0003 
0004 /** \class DTRecHitReader
0005  *  Basic analyzer class which accesses 1D DTRecHits
0006  *  and plot resolution comparing them with muon simhits
0007  *
0008  *  \author G. Cerminara - INFN Torino
0009  */
0010 
0011 #include "FWCore/Framework/interface/EDAnalyzer.h"
0012 #include "DataFormats/Common/interface/Handle.h"
0013 
0014 #include "SimDataFormats/TrackingHit/interface/PSimHitContainer.h"
0015 
0016 #include "DataFormats/MuonDetId/interface/DTWireId.h"
0017 
0018 #include "DTRecHitHistograms.h"
0019 
0020 #include <vector>
0021 #include <map>
0022 #include <string>
0023 
0024 namespace edm {
0025   class ParameterSet;
0026   class Event;
0027   class EventSetup;
0028 }  // namespace edm
0029 
0030 class PSimHit;
0031 class TFile;
0032 class DTLayer;
0033 class DTWireId;
0034 
0035 class DTRecHitReader : public edm::EDAnalyzer {
0036 public:
0037   /// Constructor
0038   DTRecHitReader(const edm::ParameterSet& pset);
0039 
0040   /// Destructor
0041   virtual ~DTRecHitReader();
0042 
0043   // Operations
0044 
0045   /// Perform the real analysis
0046   void analyze(const edm::Event& event, const edm::EventSetup& eventSetup);
0047 
0048 protected:
0049 private:
0050   // Select the mu simhit closest to the rechit
0051   const PSimHit* findBestMuSimHit(const DTLayer* layer,
0052                                   const DTWireId& wireId,
0053                                   const std::vector<const PSimHit*>& simhits,
0054                                   float recHitDistFromWire);
0055 
0056   // Map simhits per wireId
0057   std::map<DTWireId, std::vector<const PSimHit*> > mapSimHitsPerWire(const edm::Handle<edm::PSimHitContainer>& simhits);
0058 
0059   // Compute SimHit distance from wire
0060   double findSimHitDist(const DTLayer* layer, const DTWireId& wireId, const PSimHit* hit);
0061 
0062   // Histograms
0063   H1DRecHit* hRHitPhi;
0064   H1DRecHit* hRHitZ_W0;
0065   H1DRecHit* hRHitZ_W1;
0066   H1DRecHit* hRHitZ_W2;
0067   H1DRecHit* hRHitZ_All;
0068 
0069   // The file which will store the histos
0070   TFile* theFile;
0071   // Switch for debug output
0072   bool debug;
0073   // Root file name
0074   std::string rootFileName;
0075   std::string simHitLabel;
0076   std::string recHitLabel;
0077 };
0078 
0079 #endif