CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_4_4_5_patch3/src/DQM/DTMonitorModule/interface/DTDigiTask.h

Go to the documentation of this file.
00001 #ifndef DTDigiTask_H
00002 #define DTDigiTask_H
00003 
00004 /*
00005  * \file DTDigiTask.h
00006  *
00007  * $Date: 2011/06/10 13:23:25 $
00008  * $Revision: 1.33 $
00009  * \author M. Zanetti - INFN Padova
00010  *
00011 */
00012 
00013 #include "FWCore/Framework/interface/Frameworkfwd.h"
00014 #include <FWCore/Framework/interface/EDAnalyzer.h>
00015 #include <DataFormats/Common/interface/Handle.h>
00016 #include <FWCore/Framework/interface/ESHandle.h>
00017 #include <FWCore/Framework/interface/Event.h>
00018 #include <FWCore/Framework/interface/MakerMacros.h>
00019 #include "FWCore/ParameterSet/interface/ParameterSet.h"
00020 
00021 #include "DataFormats/LTCDigi/interface/LTCDigi.h"
00022 
00023 #include <FWCore/Framework/interface/LuminosityBlock.h>
00024 #include "FWCore/Utilities/interface/InputTag.h"
00025 
00026 #include <memory>
00027 #include <iostream>
00028 #include <fstream>
00029 #include <string>
00030 #include <vector>
00031 #include <map>
00032 
00033 class DTGeometry;
00034 class DTSuperLayerId;
00035 class DTLayerId;
00036 class DTChamberId;
00037 class DTTtrig;
00038 class DTT0;
00039 
00040 class DQMStore;
00041 class MonitorElement;
00042 
00043 class DTDigiTask: public edm::EDAnalyzer{
00044 
00045 public:
00046 
00048   DTDigiTask(const edm::ParameterSet& ps);
00049   
00051   virtual ~DTDigiTask();
00052 
00053 protected:
00054 
00056   void beginJob();
00057 
00058   void beginRun(const edm::Run&, const edm::EventSetup&);
00059 
00061   void bookHistos(const DTSuperLayerId& dtSL, std::string folder, std::string histoTag);
00062   void bookHistos(const DTChamberId& dtCh, std::string folder, std::string histoTag);
00063   void bookHistos(const int wheelId, std::string folder, std::string histoTag);
00064 
00066   void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) ;
00067   void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& setup);
00068 
00070   void analyze(const edm::Event& e, const edm::EventSetup& c);
00071 
00073   void endJob();
00074 
00076   std::string triggerSource();
00077 
00078 private:
00079   
00080   std::string topFolder() const;
00081 
00082   int nevents;
00083 
00085   int tMax;
00086   int maxTDCHits;
00087 
00089   float tTrig;
00090   float tTrigRMS;
00091   float kFactor;
00092 
00093   //check for sync noise
00094   //  bool newChamber;
00095   //  DTChamberId chDone;
00096   std::map<DTChamberId,int> hitMap;
00097   std::set<DTChamberId> syncNoisyChambers;
00098   int syncNumTot;
00099   int syncNum;
00100 
00101   edm::Handle<LTCDigiCollection> ltcdigis;
00102 
00103   DQMStore* dbe;
00104 
00105   edm::ESHandle<DTGeometry> muonGeom;
00106 
00107   edm::ESHandle<DTTtrig> tTrigMap;
00108   edm::ESHandle<DTT0> t0Map;
00109 
00110   std::map<std::string, std::map<uint32_t, MonitorElement*> > digiHistos;
00111   std::map<std::string, std::map<int, MonitorElement*> > wheelHistos;
00112 
00113   // Parameters from config file
00114 
00115   // The label to retrieve the digis 
00116   edm::InputTag dtDigiLabel;
00117   // Set to true to read the ttrig from DB (useful to determine in-time and out-of-time hits)
00118   bool readTTrigDB;
00119   // Set to true to subtract t0 from test pulses
00120   bool subtractT0;
00121   // Tmax value (TDC counts)
00122   int defaultTmax;
00123   // Switch from static (all histo at the beginninig of the job) to
00124   // dynamic (book when needed) histo booking
00125   bool doStaticBooking;
00126   // Switch for local/global runs
00127   bool isLocalRun;
00128   // Setting for the reset of the ME after n (= ResetCycle) luminosity sections
00129   int resetCycle;
00130   // Check the DB of noisy channels
00131   bool checkNoisyChannels;
00132   // Default TTrig to be used when not reading the TTrig DB
00133   int defaultTTrig;
00134 
00135   int inTimeHitsLowerBound;
00136   int inTimeHitsUpperBound;
00137   int timeBoxGranularity;
00138   int maxTDCCounts;
00139   bool doAllHitsOccupancies;
00140   bool doNoiseOccupancies;
00141   bool doInTimeOccupancies;
00142 
00143   bool tpMode;
00144   bool lookForSyncNoise;
00145   bool filterSyncNoise;
00146 
00147   bool doLayerTimeBoxes;
00148 
00149   std::map<DTChamberId, int> nSynchNoiseEvents;
00150   MonitorElement* nEventMonitor;
00151 
00152 
00153 };
00154 
00155 #endif