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 {
20 public:
21  MuScleFitBase(const edm::ParameterSet& iConfig) :
22  probabilitiesFileInPath_( iConfig.getUntrackedParameter<std::string>( "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") ),
27  theGenInfoRootFileName_( iConfig.getUntrackedParameter<std::string>("OutputGenInfoFileName", "genSimRecoPlots.root") ),
28  debug_( iConfig.getUntrackedParameter<int>("debug",0) )
29  {}
31 protected:
33  void fillHistoMap(TFile* outputFile, unsigned int iLoop);
35  void clearHistoMap();
37  void writeHistoMap( const unsigned int iLoop );
38 
41 
44 
49 
50  int debug_;
51 
54  {
55  public:
56  ProbForIntegral( const double & massResol, const int iRes, const int iY, const bool isZ ) :
57  massResol_(massResol),
58  iRes_(iRes), iY_(iY), isZ_(isZ)
59  {}
60  double operator()(const double * mass, const double *)
61  {
62  if( isZ_ ) {
64  }
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:21
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:46
ProbForIntegral(const double &massResol, const int iRes, const int iY, const bool isZ)
Definition: MuScleFitBase.h:56
#define noexcept
std::map< std::string, Histograms * > mapHisto_
The map of histograms.
Definition: MuScleFitBase.h:77
std::string theGenInfoRootFileName_
Definition: MuScleFitBase.h:48
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:47
void fillHistoMap(TFile *outputFile, unsigned int iLoop)
Create the histograms map.
Definition: MuScleFitBase.cc:7
Functor used to compute the normalization integral of probability functions.
Definition: MuScleFitBase.h:53
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:42
std::string probabilitiesFile_
Definition: MuScleFitBase.h:43