CMS 3D CMS Logo

/afs/cern.ch/work/a/aaltunda/public/www/CMSSW_6_2_5/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: 2012/09/24 16:08:06 $
00008  * $Revision: 1.36 $
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 
00124   edm::InputTag ltcDigiCollectionTag;
00125 
00126   // Set to true to read the ttrig from DB (useful to determine in-time and out-of-time hits)
00127   bool readTTrigDB;
00128   // Set to true to subtract t0 from test pulses
00129   bool subtractT0;
00130   // Tmax value (TDC counts)
00131   int defaultTmax;
00132   // Switch from static (all histo at the beginninig of the job) to
00133   // dynamic (book when needed) histo booking
00134   bool doStaticBooking;
00135   // Switch for local/global runs
00136   bool isLocalRun;
00137   // Setting for the reset of the ME after n (= ResetCycle) luminosity sections
00138   int resetCycle;
00139   // Check the DB of noisy channels
00140   bool checkNoisyChannels;
00141   // Default TTrig to be used when not reading the TTrig DB
00142   int defaultTTrig;
00143 
00144   int inTimeHitsLowerBound;
00145   int inTimeHitsUpperBound;
00146   int timeBoxGranularity;
00147   int maxTDCCounts;
00148   bool doAllHitsOccupancies;
00149   bool doNoiseOccupancies;
00150   bool doInTimeOccupancies;
00151 
00152   bool tpMode;
00153   bool lookForSyncNoise;
00154   bool filterSyncNoise;
00155 
00156   bool doLayerTimeBoxes;
00157 
00158   std::map<DTChamberId, int> nSynchNoiseEvents;
00159   MonitorElement* nEventMonitor;
00160 
00161 
00162 };
00163 
00164 #endif