CMS 3D CMS Logo

MuScleFitBase.h
Go to the documentation of this file.
1 #ifndef MUSCLEFITBASE_H
2 #define MUSCLEFITBASE_H
3 
8 #include <map>
9 #include <string>
10 #include "TFile.h"
11 #include "Histograms.h"
12 #include "MuScleFitUtils.h"
17 
19 public:
21  : probabilitiesFileInPath_(iConfig.getUntrackedParameter<std::string>(
22  "ProbabilitiesFileInPath", "MuonAnalysis/MomentumScaleCalibration/test/Probs_new_Horace_CTEQ_1000.root")),
23  probabilitiesFile_(iConfig.getUntrackedParameter<std::string>("ProbabilitiesFile", "")),
24  theMuonType_(iConfig.getParameter<int>("MuonType")),
25  theMuonLabel_(iConfig.getParameter<edm::InputTag>("MuonLabel")),
26  theCompressionSettings_(iConfig.getUntrackedParameter<int>("compressionSettings", -1)),
27  theRootFileName_(iConfig.getUntrackedParameter<std::string>("OutputFileName")),
29  iConfig.getUntrackedParameter<std::string>("OutputGenInfoFileName", "genSimRecoPlots.root")),
30  debug_(iConfig.getUntrackedParameter<int>("debug", 0)) {}
31  virtual ~MuScleFitBase() noexcept(false) {}
32 
33 protected:
35  void fillHistoMap(TFile* outputFile, unsigned int iLoop);
37  void clearHistoMap();
39  void writeHistoMap(const unsigned int iLoop);
40 
43 
46 
52 
53  int debug_;
54 
57  public:
58  ProbForIntegral(const double& massResol, const int iRes, const int iY, const bool isZ)
59  : massResol_(massResol), iRes_(iRes), iY_(iY), isZ_(isZ) {}
60  double operator()(const double* mass, const double*) {
61  if (isZ_) {
64  }
65  return (
67  }
68 
69  protected:
70  double massResol_;
71  int iRes_, iY_;
72  bool isZ_;
73  };
74 
76  std::vector<TFile*> theFiles_;
77 
79  std::map<std::string, Histograms*> mapHisto_;
80 
82  std::vector<MuonPair> muonPairs_;
84  std::vector<GenMuonPair> genMuonPairs_;
85 };
86 
87 #endif
MuScleFitUtils.h
MuScleFitBase::muonPairs_
std::vector< MuonPair > muonPairs_
Used to store the muon pairs plus run and event number prior to the creation of the internal tree.
Definition: MuScleFitBase.h:82
MuScleFitBase
Definition: MuScleFitBase.h:18
funct::false
false
Definition: Factorize.h:29
MuScleFitBase::genMuonPairs_
std::vector< GenMuonPair > genMuonPairs_
Stores the genMuon pairs and the motherId prior to the creation of the internal tree.
Definition: MuScleFitBase.h:84
MuScleFitBase::ProbForIntegral::ProbForIntegral
ProbForIntegral(const double &massResol, const int iRes, const int iY, const bool isZ)
Definition: MuScleFitBase.h:58
edm
HLT enums.
Definition: AlignableModifier.h:19
HLT_FULL_cff.InputTag
InputTag
Definition: HLT_FULL_cff.py:89281
MuScleFitBase::ProbForIntegral::massResol_
double massResol_
Definition: MuScleFitBase.h:70
MuScleFitBase::readProbabilityDistributionsFromFile
void readProbabilityDistributionsFromFile()
Read probability distributions from a local root file.
Definition: MuScleFitBase.cc:159
MuScleFitBase::theFiles_
std::vector< TFile * > theFiles_
The files were the histograms are saved.
Definition: MuScleFitBase.h:76
download_sqlite_cfg.outputFile
outputFile
Definition: download_sqlite_cfg.py:5
MuScleFitBase::probabilitiesFileInPath_
std::string probabilitiesFileInPath_
Definition: MuScleFitBase.h:44
MuScleFitBase::theMuonLabel_
edm::InputTag theMuonLabel_
Definition: MuScleFitBase.h:48
MuScleFitBase::theRootFileName_
std::string theRootFileName_
Definition: MuScleFitBase.h:50
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MuScleFitBase::ProbForIntegral
Functor used to compute the normalization integral of probability functions.
Definition: MuScleFitBase.h:56
MuScleFitBase::theMuonType_
int theMuonType_
Definition: MuScleFitBase.h:47
edm::ParameterSet
Definition: ParameterSet.h:47
Histograms.h
MuScleFitBase::fillHistoMap
void fillHistoMap(TFile *outputFile, unsigned int iLoop)
Create the histograms map.
Definition: MuScleFitBase.cc:9
MuScleFitBase::MuScleFitBase
MuScleFitBase(const edm::ParameterSet &iConfig)
Definition: MuScleFitBase.h:20
MuScleFitBase::probabilitiesFile_
std::string probabilitiesFile_
Definition: MuScleFitBase.h:45
createfilelist.int
int
Definition: createfilelist.py:10
MuonPair.h
MuScleFitBase::debug_
int debug_
Definition: MuScleFitBase.h:53
MuScleFitUtils::GLNorm
static double GLNorm[6][1001]
Definition: MuScleFitUtils.h:219
MuScleFitBase::theGenInfoRootFileName_
std::string theGenInfoRootFileName_
Definition: MuScleFitBase.h:51
MuScleFitUtils::GLZNorm
static double GLZNorm[40][1001]
Definition: MuScleFitUtils.h:217
MuScleFitUtils::probability
static double probability(const double &mass, const double &massResol, const double GLvalue[][1001][1001], const double GLnorm[][1001], const int iRes, const int iY)
Computes the probability given the mass, mass resolution and the arrays with the probabilities and th...
Definition: MuScleFitUtils.cc:750
MuScleFitBase::clearHistoMap
void clearHistoMap()
Clean the histograms map.
Definition: MuScleFitBase.cc:143
InputTag.h
MuScleFitBase::theCompressionSettings_
int theCompressionSettings_
Definition: MuScleFitBase.h:49
MuScleFitBase::ProbForIntegral::operator()
double operator()(const double *mass, const double *)
Definition: MuScleFitBase.h:60
std
Definition: JetResolutionObject.h:76
MuScleFitBase::ProbForIntegral::isZ_
bool isZ_
Definition: MuScleFitBase.h:72
MuScleFitUtils::GLZValue
static double GLZValue[40][1001][1001]
Definition: MuScleFitUtils.h:216
GenMuonPair.h
MuScleFitBase::ProbForIntegral::iY_
int iY_
Definition: MuScleFitBase.h:71
EgHLTOffHistBins_cfi.mass
mass
Definition: EgHLTOffHistBins_cfi.py:34
MuScleFitUtils::GLValue
static double GLValue[6][1001][1001]
Definition: MuScleFitUtils.h:218
MuScleFitBase::~MuScleFitBase
virtual ~MuScleFitBase() noexcept(false)
Definition: MuScleFitBase.h:31
MuScleFitBase::ProbForIntegral::iRes_
int iRes_
Definition: MuScleFitBase.h:71
MuScleFitBase::mapHisto_
std::map< std::string, Histograms * > mapHisto_
The map of histograms.
Definition: MuScleFitBase.h:79
ParameterSet.h
edm::InputTag
Definition: InputTag.h:15
MuScleFitBase::writeHistoMap
void writeHistoMap(const unsigned int iLoop)
Save the histograms map to file.
Definition: MuScleFitBase.cc:150