DTTTrigAnalyzer

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
#ifndef DTTTrigAnalyzer_H
#define DTTTrigAnalyzer_H

/** \class DTTTrigAnalyzer
 *  Plot the ttrig from the DB
 *
 *  \author S. Bolognesi - INFN Torino
 */

#include "FWCore/Framework/interface/Frameworkfwd.h"
#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "FWCore/Framework/interface/ESHandle.h"
#include "DataFormats/MuonDetId/interface/DTWireId.h"
#include "CondFormats/DataRecord/interface/DTTtrigRcd.h"

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

class DTTtrig;
class TFile;
class TH1D;

class DTTTrigAnalyzer : public edm::one::EDAnalyzer<> {
public:
  /// Constructor
  DTTTrigAnalyzer(const edm::ParameterSet& pset);

  /// Destructor
  virtual ~DTTTrigAnalyzer();

  /// Operations
  //Read the DTGeometry and teh t0 DB
  virtual void beginRun(const edm::Run&, const edm::EventSetup& setup);
  void analyze(const edm::Event& event, const edm::EventSetup& setup) {}
  //Do the real work
  void endJob();

protected:
private:
  std::string getHistoName(const DTWireId& lId) const;
  std::string getDistribName(const DTWireId& wId) const;

  // The file which will contain the histos
  TFile* theFile;

  //The t0 map
  const DTTtrig* tTrigMap;

  //The k factor
  //double kfactor;

  // Map of the ttrig, tmean, sigma histos by wheel/sector/SL
  std::map<std::pair<int, int>, TH1D*> theTTrigHistoMap;
  std::map<std::pair<int, int>, TH1D*> theTMeanHistoMap;
  std::map<std::pair<int, int>, TH1D*> theSigmaHistoMap;
  std::map<std::pair<int, int>, TH1D*> theKFactorHistoMap;
  // Map of the ttrig, tmean, sigma distributions by wheel/station/SL
  std::map<std::vector<int>, TH1D*> theTTrigDistribMap;
  std::map<std::vector<int>, TH1D*> theTMeanDistribMap;
  std::map<std::vector<int>, TH1D*> theSigmaDistribMap;
  std::map<std::vector<int>, TH1D*> theKFactorDistribMap;

  edm::ESGetToken<DTTtrig, DTTtrigRcd> ttrigToken_;
};
#endif