00001 #ifndef CommonAlignmentMonitor_AlignmentStats_H 00002 #define CommonAlignmentMonitor_AlignmentStats_H 00003 00004 00005 #include <Riostream.h> 00006 #include <fstream> 00007 #include <string> 00008 #include <vector> 00009 #include <map> 00010 00011 #include "FWCore/Framework/interface/EDAnalyzer.h" 00012 #include "FWCore/Framework/interface/EventPrincipal.h" 00013 #include "FWCore/Framework/interface/Event.h" 00014 #include "FWCore/Framework/interface/EventSetup.h" 00015 #include "FWCore/Framework/interface/ESHandle.h" 00016 #include "FWCore/MessageLogger/interface/MessageLogger.h" 00017 #include "FWCore/ParameterSet/interface/ParameterSet.h" 00018 #include "FWCore/Utilities/interface/InputTag.h" 00019 #include "Geometry/TrackerGeometryBuilder/interface/TrackerGeometry.h" 00020 #include "Geometry/Records/interface/TrackerDigiGeometryRecord.h" 00021 00022 #include "TFile.h" 00023 #include "TTree.h" 00024 00025 //using namespace edm; 00026 00027 class AlignmentStats: public edm::EDAnalyzer{ 00028 public: 00029 AlignmentStats(const edm::ParameterSet &iConfig); 00030 ~AlignmentStats(); 00031 virtual void analyze(const edm::Event &iEvent, const edm::EventSetup &iSetup); 00032 void beginJob( ); 00033 void endJob(); 00034 00035 private: 00036 00037 00039 edm::InputTag src_; 00040 edm::InputTag overlapAM_; 00041 bool keepTrackStats_; 00042 bool keepHitPopulation_; 00043 std::string statsTreeName_; 00044 std::string hitsTreeName_; 00045 uint32_t prescale_; 00047 uint32_t tmpPresc_; 00048 bool firstEvent_; 00049 00050 //Track stats 00051 TFile *treefile_; 00052 TTree *outtree_; 00053 static const int MAXTRKS_=200; 00054 int run_, event_; 00055 unsigned int ntracks; 00056 float P[MAXTRKS_],Pt[MAXTRKS_],Eta[MAXTRKS_],Phi[MAXTRKS_],Chi2n[MAXTRKS_]; 00057 int Nhits[MAXTRKS_][7];//0=total, 1-6=Subdets 00058 00059 //Hit Population 00060 typedef map<uint32_t,uint32_t>DetHitMap; 00061 DetHitMap hitmap_; 00062 DetHitMap overlapmap_; 00063 00064 // edm::ESHandle<TrackerGeometry> trackerGeometry_; 00065 const TrackerGeometry* trackerGeometry_; 00066 }; 00067 00068 00069 #endif