CSCGainsStudy

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 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119
#ifndef CSCObjects_CSCGainsStudy_h
#define CSCObjects_CSCGainsStudy_h

/** \class CSCGainsStudy
 * 
 * Reads in CSC database and computes average strip gain "G" for whole CSC system.
 * For each strip i, it computes a factor G/g_i, where g_i is the gain for strip i.
 * The correction factors are then plotted for each chamber.
 *
 * \author Dominique Fortin - UCR
 *
 */

#include "FWCore/Framework/interface/one/EDAnalyzer.h"
#include "DataFormats/Common/interface/Handle.h"

#include "FWCore/ParameterSet/interface/ParameterSet.h"

#include "CondFormats/CSCObjects/interface/CSCGains.h"
#include "CondFormats/DataRecord/interface/CSCGainsRcd.h"

#include <CondFormats/CSCObjects/interface/CSCReadoutMappingFromFile.h>
#include <CondFormats/CSCObjects/interface/CSCReadoutMappingForSliceTest.h>

#include "CSCGainsStudyHistograms.h"

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

namespace edm {
  class ParameterSet;
  class Event;
  class EventSetup;
}  // namespace edm

class TFile;

class CSCGainsStudy : public edm::one::EDAnalyzer<> {
public:
  /// configurable parameters
  explicit CSCGainsStudy(const edm::ParameterSet& p);

  ~CSCGainsStudy();

  // Operations

  /// Perform the real analysis
  void analyze(const edm::Event& event, const edm::EventSetup& eventSetup);

  /// Compute average Gain for all CSC chambers
  float getStripGainAvg();

private:
  // Pointers to histograms
  HCSCGains* All_CSC;
  // ME+1/1
  HCSCGains* ME_11_27;
  HCSCGains* ME_11_28;
  HCSCGains* ME_11_29;
  HCSCGains* ME_11_30;
  HCSCGains* ME_11_31;
  HCSCGains* ME_11_32;
  // ME+1/2
  HCSCGains* ME_12_27;
  HCSCGains* ME_12_28;
  HCSCGains* ME_12_29;
  HCSCGains* ME_12_30;
  HCSCGains* ME_12_31;
  HCSCGains* ME_12_32;
  // ME+1/3
  HCSCGains* ME_13_27;
  HCSCGains* ME_13_28;
  HCSCGains* ME_13_29;
  HCSCGains* ME_13_30;
  HCSCGains* ME_13_31;
  HCSCGains* ME_13_32;
  // ME+2/1
  HCSCGains* ME_21_14;
  HCSCGains* ME_21_15;
  HCSCGains* ME_21_16;
  // ME+2/2
  HCSCGains* ME_22_27;
  HCSCGains* ME_22_28;
  HCSCGains* ME_22_29;
  HCSCGains* ME_22_30;
  HCSCGains* ME_22_31;
  HCSCGains* ME_22_32;
  // ME+3/1
  HCSCGains* ME_31_14;
  HCSCGains* ME_31_15;
  HCSCGains* ME_31_16;
  // ME+3/2
  HCSCGains* ME_32_27;
  HCSCGains* ME_32_28;
  HCSCGains* ME_32_29;
  HCSCGains* ME_32_30;
  HCSCGains* ME_32_31;
  HCSCGains* ME_32_32;

  // Mapping file stuff
  std::string CSCMapFile;
  CSCReadoutMappingFromFile theCSCMap;

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

  // Switch for debug output
  bool debug;

  // Root file name
  std::string rootFileName;

  // Store in memory the Gains
  const edm::ESGetToken<CSCGains, CSCGainsRcd> gainsToken;
  const CSCGains* pGains;
};

#endif