Back to home page

Project CMSSW displayed by LXR

 
 

    


File indexing completed on 2021-07-03 01:57:39

0001 #ifndef CommonAlignmentMonitor_AlignmentStats_H
0002 #define CommonAlignmentMonitor_AlignmentStats_H
0003 
0004 #include "FWCore/Framework/interface/one/EDAnalyzer.h"
0005 #include "FWCore/Framework/interface/EventPrincipal.h"
0006 #include "FWCore/Framework/interface/Event.h"
0007 #include "FWCore/Framework/interface/EventSetup.h"
0008 #include "FWCore/Framework/interface/ESHandle.h"
0009 #include "FWCore/MessageLogger/interface/MessageLogger.h"
0010 #include "FWCore/ParameterSet/interface/ParameterSet.h"
0011 #include "FWCore/Utilities/interface/InputTag.h"
0012 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h"
0013 #include "DataFormats/TrackerCommon/interface/TrackerTopology.h"
0014 
0015 // #include <Riostream.h>
0016 #include <fstream>
0017 #include <string>
0018 #include <vector>
0019 #include <map>
0020 
0021 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h"
0022 
0023 #include "TFile.h"
0024 #include "TTree.h"
0025 
0026 //using namespace edm;
0027 
0028 class AlignmentStats : public edm::one::EDAnalyzer<> {
0029 public:
0030   AlignmentStats(const edm::ParameterSet &iConfig);
0031   ~AlignmentStats() override;
0032   void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup) override;
0033   void beginJob() override;
0034   void endJob() override;
0035 
0036 private:
0037   // esToken
0038   const edm::ESGetToken<TrackerTopology, TrackerTopologyRcd> esTokenTTopo_;
0039   const edm::ESGetToken<TrackerGeometry, TrackerDigiGeometryRecord> esTokenTkGeo_;
0040 
0041   //////inputs from config file
0042   edm::InputTag src_;
0043   edm::InputTag overlapAM_;
0044   bool keepTrackStats_;
0045   bool keepHitPopulation_;
0046   std::string statsTreeName_;
0047   std::string hitsTreeName_;
0048   uint32_t prescale_;
0049   //////
0050   uint32_t tmpPresc_;
0051 
0052   //Track stats
0053   TFile *treefile_;
0054   TTree *outtree_;
0055   static const int MAXTRKS_ = 200;
0056   int run_, event_;
0057   unsigned int ntracks;
0058   float P[MAXTRKS_], Pt[MAXTRKS_], Eta[MAXTRKS_], Phi[MAXTRKS_], Chi2n[MAXTRKS_];
0059   int Nhits[MAXTRKS_][7];  //0=total, 1-6=Subdets
0060 
0061   //Hit Population
0062   typedef std::map<uint32_t, uint32_t> DetHitMap;
0063   DetHitMap hitmap_;
0064   DetHitMap overlapmap_;
0065 
0066   std::unique_ptr<TrackerTopology> trackerTopology_;
0067   std::unique_ptr<TrackerGeometry> trackerGeometry_;
0068 };
0069 
0070 #endif