diff --git a/ControlPlots.cc b/ControlPlots.cc index b48f81d..e205917 100644 --- a/ControlPlots.cc +++ b/ControlPlots.cc @@ -238,6 +238,8 @@ ControlPlotsFunction::Function ControlPlots::findTwoJetsPtBalanceEventFunction(c return &ControlPlotsFunction::twoJetsPtBalanceEventJetMeanMoment; if( varName == "ThirdJetFraction" ) return &ControlPlotsFunction::twoJetsPtBalanceEventThirdJetFraction; + if( varName == "ThirdJetFractionPlain" ) + return &ControlPlotsFunction::twoJetsPtBalanceEventThirdJetFractionPlain; if( varName == "Asymmetry" && type == ControlPlotsConfig::Uncorrected ) return &ControlPlotsFunction::twoJetsPtBalanceEventAsymmetry; if( varName == "Asymmetry" && type == ControlPlotsConfig::Kalibri ) diff --git a/ControlPlotsConfig.cc b/ControlPlotsConfig.cc index 79a2543..65188b4 100644 --- a/ControlPlotsConfig.cc +++ b/ControlPlotsConfig.cc @@ -1,4 +1,4 @@ -// $Id: ControlPlotsConfig.cc,v 1.17 2010/10/12 08:40:53 stadie Exp $ +// $Id: ControlPlotsConfig.cc,v 1.18 2010/12/13 10:38:28 stadie Exp $ #include "ControlPlotsConfig.h" @@ -516,6 +516,9 @@ void ControlPlotsConfig::init() { outDirName_ = config_->read("plots output directory","controlPlots"); gSystem->MakeDirectory(outDirName_.c_str()); + // Store whether plots are only exported to root-file + outOnlyRoot_= config_->read("plots only to root-file",0); + outFileType_ = config_->read("plots format","eps"); // Define style for different correction types // This should become configurable via config file @@ -644,6 +647,8 @@ std::string ControlPlotsConfig::varTitle(const std::string &varName) const { title = "(p_{T,1} - p_{T,2})/(p_{T,1} + p_{T,2})"; else if( varName == "ThirdJetFraction") title = "p_{3}^{proj.}/#bar p_{T}"; + else if( varName == "ThirdJetFractionPlain") + title = "p_{3}/#bar p_{T}"; return title; } diff --git a/ControlPlotsConfig.h b/ControlPlotsConfig.h index 6be54b4..ee9a47a 100644 --- a/ControlPlotsConfig.h +++ b/ControlPlotsConfig.h @@ -1,4 +1,4 @@ -// $Id: ControlPlotsConfig.h,v 1.7 2010/10/12 08:40:53 stadie Exp $ +// $Id: ControlPlotsConfig.h,v 1.8 2010/12/13 10:38:28 stadie Exp $ #ifndef CONTROLPLOTS_CONFIG_H #define CONTROLPLOTS_CONFIG_H @@ -52,7 +52,7 @@ class ConfigFile; //! //! \author Matthias Schroeder //! \date 2009/12/18 -//! $Id: ControlPlotsConfig.h,v 1.7 2010/10/12 08:40:53 stadie Exp $ +//! $Id: ControlPlotsConfig.h,v 1.8 2010/12/13 10:38:28 stadie Exp $ // ---------------------------------------------------------------- class ControlPlotsConfig { public: @@ -185,6 +185,8 @@ class ControlPlotsConfig { std::string outDirName() const { return outDirName_; } //! Returns the file ending ("eps") of the control plots std::string outFileType() const { return outFileType_; } + //! Specifies whether the plots are only saved in a root-file. + bool outOnlyRoot() const { return outOnlyRoot_; } //! Writes a \p obj to ROOT file void toRootFile(TObject *obj) const; @@ -218,6 +220,7 @@ class ControlPlotsConfig { std::string outDirName_; std::string outFileType_; + bool outOnlyRoot_; std::map colors_; std::map markerStyles_; diff --git a/ControlPlotsFunction.cc b/ControlPlotsFunction.cc index 274dffd..ce5b489 100644 --- a/ControlPlotsFunction.cc +++ b/ControlPlotsFunction.cc @@ -1,4 +1,4 @@ -// $Id: ControlPlotsFunction.cc,v 1.14 2010/10/20 11:28:04 stadie Exp $ +// $Id: ControlPlotsFunction.cc,v 1.15 2010/12/13 10:38:28 stadie Exp $ #include "ControlPlotsFunction.h" @@ -240,12 +240,28 @@ double ControlPlotsFunction::twoJetsPtBalanceEventJetAbsEta(const Event *evt) co double ControlPlotsFunction::twoJetsPtBalanceEventThirdJetFraction(const Event *evt) const { const TwoJetsPtBalanceEvent * tjpbe = static_cast(evt); if (! tjpbe->hasJet3()) return 0; - + if(tjpbe->getJet1()->pt() < 8) return 0; // Phi of dijet axis double pPhi = TVector2::Phi_mpi_pi(0.5*(tjpbe->getJet1()->phi() + tjpbe->getJet2()->phi()) + M_PI/2.); double pJ3 = tjpbe->getJet3()->corFactors().getL2L3() * tjpbe->getJet3()->pt() * cos(TVector2::Phi_mpi_pi(pPhi-tjpbe->getJet3()->phi())); + if(tjpbe->getJet1()->pt() < 8) return 0; + if(pJ3 < 6) return 0; + return pJ3/tjpbe->ptDijetCorrL2L3(); +} + +//! \brief Returns fraction of momentum of third jet and average dijet momentum +//! +//! The \p Event \p evt has to be of type \p TwoJetsPtBalanceEvent. +//! Implements \p Function. +// ---------------------------------------------------------------- +double ControlPlotsFunction::twoJetsPtBalanceEventThirdJetFractionPlain(const Event *evt) const { + const TwoJetsPtBalanceEvent * tjpbe = static_cast(evt); + if (! tjpbe->hasJet3()) return 0; + if(tjpbe->getJet1()->pt() < 8) return 0; + double pJ3 = tjpbe->getJet3()->corFactors().getL2L3() * tjpbe->getJet3()->pt(); + if(pJ3 < 6) return 0; return pJ3/tjpbe->ptDijetCorrL2L3(); } diff --git a/ControlPlotsFunction.h b/ControlPlotsFunction.h index 4e417d3..dbe2627 100644 --- a/ControlPlotsFunction.h +++ b/ControlPlotsFunction.h @@ -1,4 +1,4 @@ -// $Id: ControlPlotsFunction.h,v 1.14 2010/10/20 11:28:16 stadie Exp $ +// $Id: ControlPlotsFunction.h,v 1.15 2010/12/13 10:38:28 stadie Exp $ #ifndef CONTROLPLOTS_FUNCTION_H #define CONTROLPLOTS_FUNCTION_H @@ -24,7 +24,7 @@ class Event; //! //! \author Matthias Schroeder //! \date 2009/12/18 -//! $Id: ControlPlotsFunction.h,v 1.14 2010/10/20 11:28:16 stadie Exp $ +//! $Id: ControlPlotsFunction.h,v 1.15 2010/12/13 10:38:28 stadie Exp $ // ---------------------------------------------------------------- class ControlPlotsFunction { public: @@ -83,6 +83,7 @@ class ControlPlotsFunction { double twoJetsPtBalanceEventMeanPt(const Event *evt) const; double twoJetsPtBalanceEventJetEMF(const Event *evt) const; double twoJetsPtBalanceEventThirdJetFraction(const Event *evt) const; + double twoJetsPtBalanceEventThirdJetFractionPlain(const Event *evt) const; double twoJetsPtBalanceEventJetMomentPhiPhi(const Event *evt) const; double twoJetsPtBalanceEventJetMomentEtaEta(const Event *evt) const; double twoJetsPtBalanceEventJetMeanMoment(const Event *evt) const; diff --git a/ControlPlotsProfile.cc b/ControlPlotsProfile.cc index e882199..b1a8e59 100644 --- a/ControlPlotsProfile.cc +++ b/ControlPlotsProfile.cc @@ -1,4 +1,4 @@ -// $Id: ControlPlotsProfile.cc,v 1.17 2010/12/13 10:38:28 stadie Exp $ +// $Id: ControlPlotsProfile.cc,v 1.18 2011/02/18 15:33:39 stadie Exp $ #include "ControlPlotsProfile.h" @@ -95,6 +95,9 @@ void ControlPlotsProfile::draw() { c1->cd(); std::string fileName; + Bool_t only_to_root = config_->outOnlyRoot(); + // std::cout << "only to root: " << only_to_root << std::endl; + // Draw 2D histograms for(std::vector::iterator binIt = bins_.begin(); binIt != bins_.end(); binIt++) { @@ -109,7 +112,7 @@ void ControlPlotsProfile::draw() { config_->toRootFile(h); fileName = config_->outDirName() + "/"; fileName += (*binIt)->hist2DFileName(*it) + "." + config_->outFileType(); - c1->SaveAs(fileName.c_str(),(config_->outFileType()).c_str()); + if(!only_to_root)c1->SaveAs(fileName.c_str(),(config_->outFileType()).c_str()); } } @@ -163,7 +166,7 @@ void ControlPlotsProfile::draw() { p2->DrawClone(); fileName = config_->outDirName() + "/"; fileName += (*binIt)->profileFileName(*profTypeIt) + "." + config_->outFileType(); - c1->SaveAs(fileName.c_str(),(config_->outFileType()).c_str()); + if(!only_to_root)c1->SaveAs(fileName.c_str(),(config_->outFileType()).c_str()); } } @@ -209,7 +212,7 @@ void ControlPlotsProfile::draw() { p2->DrawClone(); fileName = config_->outDirName() + "/"; fileName += (*binIt)->profileFileName(*profTypeIt) + "_zoom." + config_->outFileType(); - c1->SaveAs(fileName.c_str(),(config_->outFileType()).c_str()); + if(!only_to_root)c1->SaveAs(fileName.c_str(),(config_->outFileType()).c_str()); } } delete leg; @@ -273,10 +276,10 @@ void ControlPlotsProfile::draw() { p2->DrawClone(); fileName = config_->outDirName() + "/"; fileName += config_->name() +"_Special_"+config_->binName((*binIt)->id())+ "_zoom." + config_->outFileType(); - c1->SaveAs(fileName.c_str(),(config_->outFileType()).c_str()); + if(!only_to_root)c1->SaveAs(fileName.c_str(),(config_->outFileType()).c_str()); delete leg; } - + // Draw distributions for(std::vector::iterator binIt = bins_.begin(); binIt != bins_.end(); binIt++) { @@ -291,7 +294,7 @@ void ControlPlotsProfile::draw() { config_->toRootFile(h); fileName = config_->outDirName() + "/"; fileName += (*binIt)->distributionFileName(n,*tagsIt) + "." + config_->outFileType(); - c1->SaveAs(fileName.c_str(),(config_->outFileType()).c_str()); + if(!only_to_root)c1->SaveAs(fileName.c_str(),(config_->outFileType()).c_str()); } } } @@ -310,7 +313,7 @@ void ControlPlotsProfile::draw() { fileName = config_->outDirName() + "/"; fileName += hXSpectrum_[0]->GetName(); fileName += "." + config_->outFileType(); - c1->SaveAs(fileName.c_str(),(config_->outFileType()).c_str()); + if(!only_to_root)c1->SaveAs(fileName.c_str(),(config_->outFileType()).c_str()); config_->toRootFile(hXSpectrum_[0]); if(hXSpectrum_[1]) config_->toRootFile(hXSpectrum_[1]); if(hXSpectrum_[2]) config_->toRootFile(hXSpectrum_[2]);