DTResolutionAnalysisTask

Macros

Line Code
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83
#ifndef DTResolutionAnalysisTask_H
#define DTResolutionAnalysisTask_H

/** \class DTResolutionAnalysis
 *  DQM Analysis of 4D DT segments, it produces plots about: <br>
 *      - number of segments per event <br>
 *      - position of the segments in chamber RF <br>
 *      - direction of the segments (theta and phi projections) <br>
 *      - reduced chi-square <br>
 *  All histos are produce per Chamber
 *
 *
 *  \author G. Cerminara - INFN Torino
 */

#include "DQMServices/Core/interface/DQMOneEDAnalyzer.h"

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "DataFormats/MuonDetId/interface/DTSuperLayerId.h"
#include "FWCore/Framework/interface/ESHandle.h"

#include "DataFormats/DTRecHit/interface/DTRecSegment4DCollection.h"
#include "Geometry/Records/interface/MuonGeometryRecord.h"

#include "DQMServices/Core/interface/DQMStore.h"

#include <string>
#include <map>
#include <vector>

class DTGeometry;

class DTResolutionAnalysisTask : public DQMOneEDAnalyzer<> {
public:
  /// Constructor
  DTResolutionAnalysisTask(const edm::ParameterSet& pset);

  /// Destructor
  ~DTResolutionAnalysisTask() override;

  /// BookHistograms
  void bookHistograms(DQMStore::IBooker&, edm::Run const&, edm::EventSetup const&) override;

  /// BeginRun
  void dqmBeginRun(const edm::Run&, const edm::EventSetup&) override;

  /// To reset the MEs
  //  void beginLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) override;
  //  void endLuminosityBlock(edm::LuminosityBlock const& lumiSeg, edm::EventSetup const& context) final {}

  // Operations
  void analyze(const edm::Event& event, const edm::EventSetup& setup) override;

protected:
private:
  edm::ESGetToken<DTGeometry, MuonGeometryRecord> muonGeomToken_;
  const DTGeometry* dtGeom;

  int prescaleFactor;
  int resetCycle;

  u_int32_t thePhiHitsCut;
  u_int32_t theZHitsCut;

  // Lable of 4D segments in the event
  edm::EDGetTokenT<DTRecSegment4DCollection> recHits4DToken_;

  // Book a set of histograms for a give chamber
  void bookHistos(DQMStore::IBooker& ibooker, DTSuperLayerId slId);
  // Fill a set of histograms for a give chamber
  void fillHistos(DTSuperLayerId slId, float distExtr, float residual);

  std::map<DTSuperLayerId, std::vector<MonitorElement*> > histosPerSL;

  // top folder for the histograms in DQMStore
  std::string topHistoFolder;
};
#endif

/* Local Variables: */
/* show-trailing-whitespace: t */
/* truncate-lines: t */
/* End: */