CMS 3D CMS Logo

/data/refman/pasoursint/CMSSW_5_3_1/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/10/31 17:11:20 $
00008  * $Revision: 1.35 $
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 "CondFormats/DTObjects/interface/DTReadOutMapping.h"
00022 
00023 #include "DataFormats/LTCDigi/interface/LTCDigi.h"
00024 
00025 #include <FWCore/Framework/interface/LuminosityBlock.h>
00026 #include "FWCore/Utilities/interface/InputTag.h"
00027 
00028 #include <memory>
00029 #include <iostream>
00030 #include <fstream>
00031 #include <string>
00032 #include <vector>
00033 #include <map>
00034 
00035 class DTGeometry;
00036 class DTSuperLayerId;
00037 class DTLayerId;
00038 class DTChamberId;
00039 class DTTtrig;
00040 class DTT0;
00041 
00042 class DQMStore;
00043 class MonitorElement;
00044 
00045 class DTDigiTask: public edm::EDAnalyzer{
00046 
00047 public:
00048 
00050   DTDigiTask(const edm::ParameterSet& ps);
00051   
00053   virtual ~DTDigiTask();
00054 
00055 protected:
00056 
00058   void beginJob();
00059 
00060   void beginRun(const edm::Run&, const edm::EventSetup&);
00061 
00063   void bookHistos(const DTSuperLayerId& dtSL, std::string folder, std::string histoTag);
00064   void bookHistos(const DTChamberId& dtCh, std::string folder, std::string histoTag);
00065   void bookHistos(const int wheelId, std::string folder, std::string histoTag);
00066 
00068   void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) ;
00069   void endLuminosityBlock(const edm::LuminosityBlock& lumiSeg, const edm::EventSetup& setup);
00070 
00072   void channelsMap(const DTChamberId& dtCh, std::string histoTag);
00073 
00075   void analyze(const edm::Event& e, const edm::EventSetup& c);
00076 
00078   void endJob();
00079 
00081   std::string triggerSource();
00082 
00083 private:
00084   
00085   std::string topFolder() const;
00086 
00087   int nevents;
00088 
00090   int tMax;
00091   int maxTDCHits;
00092 
00094   float tTrig;
00095   float tTrigRMS;
00096   float kFactor;
00097 
00098   //check for sync noise
00099   //  bool newChamber;
00100   //  DTChamberId chDone;
00101   std::map<DTChamberId,int> hitMap;
00102   std::set<DTChamberId> syncNoisyChambers;
00103   int syncNumTot;
00104   int syncNum;
00105 
00106   edm::Handle<LTCDigiCollection> ltcdigis;
00107 
00108   DQMStore* dbe;
00109 
00110   edm::ESHandle<DTGeometry> muonGeom;
00111   edm::ESHandle<DTReadOutMapping> mapping;
00112 
00113   edm::ESHandle<DTTtrig> tTrigMap;
00114   edm::ESHandle<DTT0> t0Map;
00115 
00116   std::map<std::string, std::map<uint32_t, MonitorElement*> > digiHistos;
00117   std::map<std::string, std::map<int, MonitorElement*> > wheelHistos;
00118 
00119   // Parameters from config file
00120 
00121   // The label to retrieve the digis 
00122   edm::InputTag dtDigiLabel;
00123   // Set to true to read the ttrig from DB (useful to determine in-time and out-of-time hits)
00124   bool readTTrigDB;
00125   // Set to true to subtract t0 from test pulses
00126   bool subtractT0;
00127   // Tmax value (TDC counts)
00128   int defaultTmax;
00129   // Switch from static (all histo at the beginninig of the job) to
00130   // dynamic (book when needed) histo booking
00131   bool doStaticBooking;
00132   // Switch for local/global runs
00133   bool isLocalRun;
00134   // Setting for the reset of the ME after n (= ResetCycle) luminosity sections
00135   int resetCycle;
00136   // Check the DB of noisy channels
00137   bool checkNoisyChannels;
00138   // Default TTrig to be used when not reading the TTrig DB
00139   int defaultTTrig;
00140 
00141   int inTimeHitsLowerBound;
00142   int inTimeHitsUpperBound;
00143   int timeBoxGranularity;
00144   int maxTDCCounts;
00145   bool doAllHitsOccupancies;
00146   bool doNoiseOccupancies;
00147   bool doInTimeOccupancies;
00148 
00149   bool tpMode;
00150   bool lookForSyncNoise;
00151   bool filterSyncNoise;
00152 
00153   bool doLayerTimeBoxes;
00154 
00155   std::map<DTChamberId, int> nSynchNoiseEvents;
00156   MonitorElement* nEventMonitor;
00157 
00158 
00159 };
00160 
00161 #endif