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  theRootFileName_(iConfig.getUntrackedParameter<std::string>("OutputFileName")),
28  iConfig.getUntrackedParameter<std::string>("OutputGenInfoFileName", "genSimRecoPlots.root")),
29  debug_(iConfig.getUntrackedParameter<int>("debug", 0)) {}
31 
32 protected:
34  void fillHistoMap(TFile* outputFile, unsigned int iLoop);
36  void clearHistoMap();
38  void writeHistoMap(const unsigned int iLoop);
39 
42 
45 
50 
51  int debug_;
52 
55  public:
56  ProbForIntegral(const double& massResol, const int iRes, const int iY, const bool isZ)
57  : massResol_(massResol), iRes_(iRes), iY_(iY), isZ_(isZ) {}
58  double operator()(const double* mass, const double*) {
59  if (isZ_) {
62  }
63  return (
65  }
66 
67  protected:
68  double massResol_;
69  int iRes_, iY_;
70  bool isZ_;
71  };
72 
74  std::vector<TFile*> theFiles_;
75 
77  std::map<std::string, Histograms*> mapHisto_;
78 
80  std::vector<MuonPair> muonPairs_;
82  std::vector<GenMuonPair> genMuonPairs_;
83 };
84 
85 #endif
MuScleFitBase(const edm::ParameterSet &iConfig)
Definition: MuScleFitBase.h:20
static double GLValue[6][1001][1001]
std::vector< GenMuonPair > genMuonPairs_
Stores the genMuon pairs and the motherId prior to the creation of the internal tree.
Definition: MuScleFitBase.h:82
edm::InputTag theMuonLabel_
Definition: MuScleFitBase.h:47
ProbForIntegral(const double &massResol, const int iRes, const int iY, const bool isZ)
Definition: MuScleFitBase.h:56
std::map< std::string, Histograms * > mapHisto_
The map of histograms.
Definition: MuScleFitBase.h:77
std::string theGenInfoRootFileName_
Definition: MuScleFitBase.h:49
static double GLZNorm[40][1001]
void clearHistoMap()
Clean the histograms map.
double operator()(const double *mass, const double *)
Definition: MuScleFitBase.h:58
static double GLZValue[40][1001][1001]
#define noexcept
void writeHistoMap(const unsigned int iLoop)
Save the histograms map to file.
std::string theRootFileName_
Definition: MuScleFitBase.h:48
void fillHistoMap(TFile *outputFile, unsigned int iLoop)
Create the histograms map.
Definition: MuScleFitBase.cc:9
Functor used to compute the normalization integral of probability functions.
Definition: MuScleFitBase.h:54
std::vector< TFile * > theFiles_
The files were the histograms are saved.
Definition: MuScleFitBase.h:74
static double GLNorm[6][1001]
virtual ~MuScleFitBase()(false)
Definition: MuScleFitBase.h:30
HLT enums.
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:80
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...
void readProbabilityDistributionsFromFile()
Read probability distributions from a local root file.
std::string probabilitiesFileInPath_
Definition: MuScleFitBase.h:43
std::string probabilitiesFile_
Definition: MuScleFitBase.h:44