CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_4/src/CalibMuon/DTCalibration/plugins/DTNoiseComputation.h

Go to the documentation of this file.
00001 #ifndef DTNoiseComputation_H
00002 #define DTNoiseComputation_H
00003 
00004 /*
00005  * \file DTNoiseComputation.h
00006  *
00007  * $Date: 2010/01/19 09:51:31 $
00008  * $Revision: 1.4 $
00009  * \author G. Mila - INFN Torino
00010  *
00011 */
00012 
00013 #include <FWCore/Framework/interface/EDAnalyzer.h>
00014 #include <FWCore/Framework/interface/EventSetup.h>
00015 #include "DataFormats/MuonDetId/interface/DTLayerId.h"
00016 #include "DataFormats/MuonDetId/interface/DTWireId.h"
00017 #include "DataFormats/MuonDetId/interface/DTChamberId.h"
00018 #include <FWCore/Framework/interface/ESHandle.h>
00019 
00020 
00021 
00022 #include <string>
00023 #include <map>
00024 #include <vector>
00025 
00026 namespace edm {
00027   class ParameterSet;
00028   class Event;
00029   class EventSetup;
00030 }
00031 
00032 class DTGeometry;
00033 class TFile;
00034 class TH2F;
00035 class TH1F;
00036 
00037 class DTNoiseComputation: public edm::EDAnalyzer{
00038   
00039  public:
00040   
00042   DTNoiseComputation(const edm::ParameterSet& ps);
00043   
00045   virtual ~DTNoiseComputation();
00046 
00048   void beginJob() {}
00049 
00050   void beginRun(const edm::Run&, const edm::EventSetup& setup);
00051 
00052   void analyze(const edm::Event& event, const edm::EventSetup& setup) {}
00053 
00055   void endJob();
00056 
00057 
00058 protected:
00059 
00060 private:
00061 
00062   bool debug;
00063   int counter;
00064   int MaxEvents;
00065   bool fastAnalysis;
00066   
00067   // Get the DT Geometry
00068   edm::ESHandle<DTGeometry> dtGeom;
00069 
00070   // The file which contain the occupancy plot and the digi event plot
00071   TFile *theFile;
00072   
00073   // The file which will contain the occupancy plot and the digi event plot
00074   TFile *theNewFile;
00075 
00076   // Map of label to compute the average noise per layer
00077   std::map<DTLayerId , bool> toComputeNoiseAverage;
00078 
00079   // Map of the average noise per layer
00080   std::map<DTWireId , double>  theAverageNoise;
00081 
00082    // Map of the histograms with the number of events per evt per wire
00083   std::map<DTLayerId, std::vector<TH2F*> > theEvtMap;
00084 
00085   // map of histos with the distance of event per wire
00086   std::map<DTWireId, TH1F*> theHistoEvtDistancePerWire;
00087   
00088   // Map of label for analysis histos
00089   std::map<DTWireId , bool> toDel;
00090 
00091   // Map of the Time Constants per wire
00092   std::map<DTWireId , double> theTimeConstant;
00093 
00095   std::string getLayerName(const DTLayerId& lId) const;
00096 
00098   std::string getSuperLayerName(const DTSuperLayerId& slId) const;
00099 
00101   std::string getChamberName(const DTLayerId& lId) const;
00102   
00103   // map of histos with the average noise per chamber
00104   std::map<DTChamberId, TH1F*> AvNoisePerChamber;
00105 
00106   // map of histos with the average integrated noise per chamber
00107   std::map<DTChamberId, TH1F*> AvNoiseIntegratedPerChamber;
00108 
00109   // map of histos with the average noise per SuperLayer
00110   std::map<DTSuperLayerId, TH1F*> AvNoisePerSuperLayer;
00111 
00112   // map of histos with the average integrated noise per SuperLayer
00113   std::map<DTSuperLayerId, TH1F*> AvNoiseIntegratedPerSuperLayer;
00114 
00115   // get the maximum bin number
00116   int getMaxNumBins(const DTChamberId& chId) const;
00117   
00118   // get the Y axis maximum
00119   double getYMaximum(const DTSuperLayerId& slId) const;
00120 
00121   // map of noisy cell occupancy
00122   std::map< std::pair<int,int> , TH1F*> noisyC;
00123 
00124   // map of somehow noisy cell occupancy
00125   std::map< std::pair<int,int> , TH1F*> someHowNoisyC;
00126 
00127 };
00128 #endif