CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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
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:84
edm::InputTag theMuonLabel_
Definition: MuScleFitBase.h:48
ProbForIntegral(const double &massResol, const int iRes, const int iY, const bool isZ)
Definition: MuScleFitBase.h:58
std::map< std::string, Histograms * > mapHisto_
The map of histograms.
Definition: MuScleFitBase.h:79
int theCompressionSettings_
Definition: MuScleFitBase.h:49
std::string theGenInfoRootFileName_
Definition: MuScleFitBase.h:51
static double GLZNorm[40][1001]
void clearHistoMap()
Clean the histograms map.
double operator()(const double *mass, const double *)
Definition: MuScleFitBase.h:60
static double GLZValue[40][1001][1001]
void writeHistoMap(const unsigned int iLoop)
Save the histograms map to file.
std::string theRootFileName_
Definition: MuScleFitBase.h:50
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:56
std::vector< TFile * > theFiles_
The files were the histograms are saved.
Definition: MuScleFitBase.h:76
static double GLNorm[6][1001]
virtual ~MuScleFitBase() noexcept(false)
Definition: MuScleFitBase.h:31
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
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:44
std::string probabilitiesFile_
Definition: MuScleFitBase.h:45