![]() |
![]() |
#include <BeamSpotHistogramMaker.h>
Public Member Functions | |
BeamSpotHistogramMaker () | |
BeamSpotHistogramMaker (const edm::ParameterSet &iConfig) | |
void | beginRun (const unsigned int nrun) |
void | book (const std::string dirname="") |
void | fill (const unsigned int orbit, const reco::BeamSpot &bs) |
~BeamSpotHistogramMaker () | |
Private Attributes | |
TFileDirectory * | _currdir |
TH1F ** | _hbssigmaxrun |
TProfile ** | _hbssigmaxvsorbrun |
TH1F ** | _hbssigmayrun |
TProfile ** | _hbssigmayvsorbrun |
TH1F ** | _hbssigmazrun |
TProfile ** | _hbssigmazvsorbrun |
TH1F ** | _hbsxrun |
TProfile ** | _hbsxvsorbrun |
TH1F ** | _hbsyrun |
TProfile ** | _hbsyvsorbrun |
TH1F ** | _hbszrun |
TProfile ** | _hbszvsorbrun |
const edm::ParameterSet | _histoParameters |
RunHistogramManager | _rhm |
Definition at line 20 of file BeamSpotHistogramMaker.h.
BeamSpotHistogramMaker::BeamSpotHistogramMaker | ( | ) |
Definition at line 12 of file BeamSpotHistogramMaker.cc.
: _currdir(0), _histoParameters(), _rhm() { }
BeamSpotHistogramMaker::BeamSpotHistogramMaker | ( | const edm::ParameterSet & | iConfig | ) |
Definition at line 15 of file BeamSpotHistogramMaker.cc.
: _currdir(0), _histoParameters(iConfig.getUntrackedParameter<edm::ParameterSet>("histoParameters",edm::ParameterSet())), _rhm() { }
BeamSpotHistogramMaker::~BeamSpotHistogramMaker | ( | ) |
void BeamSpotHistogramMaker::beginRun | ( | const unsigned int | nrun | ) |
Definition at line 80 of file BeamSpotHistogramMaker.cc.
References _currdir, _rhm, and RunHistogramManager::beginRun().
Referenced by AnotherBeamSpotAnalyzer::beginRun().
{ char runname[100]; sprintf(runname,"run_%d",nrun); TFileDirectory* currdir = _currdir; if(currdir==0) { edm::Service<TFileService> tfserv; currdir = &(*tfserv); } _rhm.beginRun(nrun,*currdir); (*_hbsxrun)->GetXaxis()->SetTitle("X [cm]"); (*_hbsxrun)->GetYaxis()->SetTitle("Events"); (*_hbsyrun)->GetXaxis()->SetTitle("Y [cm]"); (*_hbsyrun)->GetYaxis()->SetTitle("Events"); (*_hbszrun)->GetXaxis()->SetTitle("Z [cm]"); (*_hbszrun)->GetYaxis()->SetTitle("Events"); (*_hbssigmaxrun)->GetXaxis()->SetTitle("sigmaX [cm]"); (*_hbssigmaxrun)->GetYaxis()->SetTitle("Events"); (*_hbssigmayrun)->GetXaxis()->SetTitle("sigmaY [cm]"); (*_hbssigmayrun)->GetYaxis()->SetTitle("Events"); (*_hbssigmazrun)->GetXaxis()->SetTitle("sigmaZ [cm]"); (*_hbssigmazrun)->GetYaxis()->SetTitle("Events"); (*_hbsxvsorbrun)->GetXaxis()->SetTitle("time [orbit#]"); (*_hbsxvsorbrun)->GetYaxis()->SetTitle("X [cm]"); (*_hbsxvsorbrun)->SetBit(TH1::kCanRebin); (*_hbsyvsorbrun)->GetXaxis()->SetTitle("time [orbit#]"); (*_hbsyvsorbrun)->GetYaxis()->SetTitle("Y [cm]"); (*_hbsyvsorbrun)->SetBit(TH1::kCanRebin); (*_hbszvsorbrun)->GetXaxis()->SetTitle("time [orbit#]"); (*_hbszvsorbrun)->GetYaxis()->SetTitle("Z [cm]"); (*_hbszvsorbrun)->SetBit(TH1::kCanRebin); (*_hbssigmaxvsorbrun)->GetXaxis()->SetTitle("time [orbit#]"); (*_hbssigmaxvsorbrun)->GetYaxis()->SetTitle("sigmaX [cm]"); (*_hbssigmaxvsorbrun)->SetBit(TH1::kCanRebin); (*_hbssigmayvsorbrun)->GetXaxis()->SetTitle("time [orbit#]"); (*_hbssigmayvsorbrun)->GetYaxis()->SetTitle("sigmaY [cm]"); (*_hbssigmayvsorbrun)->SetBit(TH1::kCanRebin); (*_hbssigmazvsorbrun)->GetXaxis()->SetTitle("time [orbit#]"); (*_hbssigmazvsorbrun)->GetYaxis()->SetTitle("sigmaZ [cm]"); (*_hbssigmazvsorbrun)->SetBit(TH1::kCanRebin); }
void BeamSpotHistogramMaker::book | ( | const std::string | dirname = "" | ) |
Definition at line 29 of file BeamSpotHistogramMaker.cc.
References _currdir, _hbssigmaxrun, _hbssigmaxvsorbrun, _hbssigmayrun, _hbssigmayvsorbrun, _hbssigmazrun, _hbssigmazvsorbrun, _hbsxrun, _hbsxvsorbrun, _hbsyrun, _hbsyvsorbrun, _hbszrun, _hbszvsorbrun, _histoParameters, _rhm, edm::ParameterSet::getUntrackedParameter(), RunHistogramManager::makeTH1F(), and RunHistogramManager::makeTProfile().
Referenced by AnotherBeamSpotAnalyzer::AnotherBeamSpotAnalyzer().
{ edm::Service<TFileService> tfserv; TFileDirectory* currdir = &(*tfserv); if(dirname!="") { currdir = new TFileDirectory(tfserv->mkdir(dirname)); _currdir = currdir; } edm::LogInfo("HistogramBooking") << "BeamSpot histogram booking in directory " << dirname; _hbsxrun = _rhm.makeTH1F("bsxrun","BeamSpot X position", _histoParameters.getUntrackedParameter<unsigned int>("nBinX",200), _histoParameters.getUntrackedParameter<double>("xMin",-1.), _histoParameters.getUntrackedParameter<double>("xMax",1.)); _hbsyrun = _rhm.makeTH1F("bsyrun","BeamSpot Y position", _histoParameters.getUntrackedParameter<unsigned int>("nBinY",200), _histoParameters.getUntrackedParameter<double>("yMin",-1.), _histoParameters.getUntrackedParameter<double>("yMax",1.)); _hbszrun = _rhm.makeTH1F("bszrun","BeamSpot Z position", _histoParameters.getUntrackedParameter<unsigned int>("nBinZ",200), _histoParameters.getUntrackedParameter<double>("zMin",-1.), _histoParameters.getUntrackedParameter<double>("zMax",1.)); _hbssigmaxrun = _rhm.makeTH1F("bssigmaxrun","BeamSpot sigmaX", _histoParameters.getUntrackedParameter<unsigned int>("nBinSigmaX",200), _histoParameters.getUntrackedParameter<double>("sigmaXMin",0.), _histoParameters.getUntrackedParameter<double>("sigmaXMax",0.025)); _hbssigmayrun = _rhm.makeTH1F("bssigmayrun","BeamSpot sigmaY", _histoParameters.getUntrackedParameter<unsigned int>("nBinSigmaY",200), _histoParameters.getUntrackedParameter<double>("sigmaYMin",0.), _histoParameters.getUntrackedParameter<double>("sigmaYMax",0.025)); _hbssigmazrun = _rhm.makeTH1F("bssigmazrun","BeamSpot sigmaZ", _histoParameters.getUntrackedParameter<unsigned int>("nBinSigmaZ",200), _histoParameters.getUntrackedParameter<double>("sigmaZMin",0.), _histoParameters.getUntrackedParameter<double>("sigmaZMax",15.)); _hbsxvsorbrun = _rhm.makeTProfile("bsxvsorbrun","BeamSpot X position vs orbit number",1600,0.5,1600.*16384+0.5); _hbsyvsorbrun = _rhm.makeTProfile("bsyvsorbrun","BeamSpot Y position vs orbit number",1600,0.5,1600.*16384+0.5); _hbszvsorbrun = _rhm.makeTProfile("bszvsorbrun","BeamSpot Z position vs orbit number",1600,0.5,1600.*16384+0.5); _hbssigmaxvsorbrun = _rhm.makeTProfile("bssigmaxvsorbrun","BeamSpot sigmaX vs orbit number",1600,0.5,1600.*16384+0.5); _hbssigmayvsorbrun = _rhm.makeTProfile("bssigmayvsorbrun","BeamSpot sigmaY vs orbit number",1600,0.5,1600.*16384+0.5); _hbssigmazvsorbrun = _rhm.makeTProfile("bssigmazvsorbrun","BeamSpot sigmaZ vs orbit number",1600,0.5,1600.*16384+0.5); }
void BeamSpotHistogramMaker::fill | ( | const unsigned int | orbit, |
const reco::BeamSpot & | bs | ||
) |
Definition at line 116 of file BeamSpotHistogramMaker.cc.
References _hbssigmaxrun, _hbssigmaxvsorbrun, _hbssigmayrun, _hbssigmayvsorbrun, _hbssigmazrun, _hbssigmazvsorbrun, _hbsxrun, _hbsxvsorbrun, _hbsyrun, _hbsyvsorbrun, _hbszrun, _hbszvsorbrun, reco::BeamSpot::BeamWidthX(), reco::BeamSpot::BeamWidthY(), reco::BeamSpot::sigmaZ(), reco::BeamSpot::x0(), reco::BeamSpot::y0(), and reco::BeamSpot::z0().
Referenced by AnotherBeamSpotAnalyzer::analyze().
{ if(_hbsxrun && *_hbsxrun ) (*_hbsxrun)->Fill(bs.x0()); if(_hbsxvsorbrun && *_hbsxvsorbrun ) (*_hbsxvsorbrun)->Fill(orbit,bs.x0()); if(_hbsyrun && *_hbsyrun ) (*_hbsyrun)->Fill(bs.y0()); if(_hbsyvsorbrun && *_hbsyvsorbrun ) (*_hbsyvsorbrun)->Fill(orbit,bs.y0()); if(_hbszrun && *_hbszrun ) (*_hbszrun)->Fill(bs.z0()); if(_hbszvsorbrun && *_hbszvsorbrun ) (*_hbszvsorbrun)->Fill(orbit,bs.z0()); if(_hbssigmaxrun && *_hbssigmaxrun ) (*_hbssigmaxrun)->Fill(bs.BeamWidthX()); if(_hbssigmayrun && *_hbssigmayrun ) (*_hbssigmayrun)->Fill(bs.BeamWidthY()); if(_hbssigmazrun && *_hbssigmazrun ) (*_hbssigmazrun)->Fill(bs.sigmaZ()); if(_hbssigmaxvsorbrun && *_hbssigmaxvsorbrun ) (*_hbssigmaxvsorbrun)->Fill(orbit,bs.BeamWidthX()); if(_hbssigmayvsorbrun && *_hbssigmayvsorbrun ) (*_hbssigmayvsorbrun)->Fill(orbit,bs.BeamWidthY()); if(_hbssigmazvsorbrun && *_hbssigmazvsorbrun ) (*_hbssigmazvsorbrun)->Fill(orbit,bs.sigmaZ()); }
TFileDirectory* BeamSpotHistogramMaker::_currdir [private] |
Definition at line 34 of file BeamSpotHistogramMaker.h.
Referenced by beginRun(), book(), and ~BeamSpotHistogramMaker().
TH1F** BeamSpotHistogramMaker::_hbssigmaxrun [private] |
Definition at line 41 of file BeamSpotHistogramMaker.h.
TProfile** BeamSpotHistogramMaker::_hbssigmaxvsorbrun [private] |
Definition at line 47 of file BeamSpotHistogramMaker.h.
TH1F** BeamSpotHistogramMaker::_hbssigmayrun [private] |
Definition at line 42 of file BeamSpotHistogramMaker.h.
TProfile** BeamSpotHistogramMaker::_hbssigmayvsorbrun [private] |
Definition at line 48 of file BeamSpotHistogramMaker.h.
TH1F** BeamSpotHistogramMaker::_hbssigmazrun [private] |
Definition at line 43 of file BeamSpotHistogramMaker.h.
TProfile** BeamSpotHistogramMaker::_hbssigmazvsorbrun [private] |
Definition at line 49 of file BeamSpotHistogramMaker.h.
TH1F** BeamSpotHistogramMaker::_hbsxrun [private] |
Definition at line 38 of file BeamSpotHistogramMaker.h.
TProfile** BeamSpotHistogramMaker::_hbsxvsorbrun [private] |
Definition at line 44 of file BeamSpotHistogramMaker.h.
TH1F** BeamSpotHistogramMaker::_hbsyrun [private] |
Definition at line 39 of file BeamSpotHistogramMaker.h.
TProfile** BeamSpotHistogramMaker::_hbsyvsorbrun [private] |
Definition at line 45 of file BeamSpotHistogramMaker.h.
TH1F** BeamSpotHistogramMaker::_hbszrun [private] |
Definition at line 40 of file BeamSpotHistogramMaker.h.
TProfile** BeamSpotHistogramMaker::_hbszvsorbrun [private] |
Definition at line 46 of file BeamSpotHistogramMaker.h.
const edm::ParameterSet BeamSpotHistogramMaker::_histoParameters [private] |
Definition at line 35 of file BeamSpotHistogramMaker.h.
Referenced by book().
Definition at line 37 of file BeamSpotHistogramMaker.h.
Referenced by beginRun(), and book().