CMS 3D CMS Logo

Functions
PFEnergyCalibration.cc File Reference
#include "RecoParticleFlow/PFClusterTools/interface/PFEnergyCalibration.h"
#include "CondFormats/PhysicsToolsObjects/interface/PerformancePayloadFromTFormula.h"
#include "CondFormats/ESObjects/interface/ESEEIntercalibConstants.h"
#include <TMath.h>
#include <cmath>
#include <vector>
#include <TF1.h>
#include <map>
#include <algorithm>
#include <numeric>

Go to the source code of this file.

Functions

std::ostream & operator<< (std::ostream &out, const PFEnergyCalibration &calib)
 

Function Documentation

std::ostream& operator<< ( std::ostream &  out,
const PFEnergyCalibration calib 
)

Definition at line 633 of file PFEnergyCalibration.cc.

References gather_cfg::cout, PFEnergyCalibration::faBarrel, PFEnergyCalibration::faEndcap, PFEnergyCalibration::faEtaBarrelEH, PFEnergyCalibration::faEtaBarrelH, PFEnergyCalibration::faEtaEndcapEH, PFEnergyCalibration::faEtaEndcapH, PFEnergyCalibration::fbBarrel, PFEnergyCalibration::fbEndcap, PFEnergyCalibration::fbEtaBarrelEH, PFEnergyCalibration::fbEtaBarrelH, PFEnergyCalibration::fbEtaEndcapEH, PFEnergyCalibration::fbEtaEndcapH, PFEnergyCalibration::fcBarrel, PFEnergyCalibration::fcEndcap, jets_cff::func, MillePedeFileConverter_cfg::out, PFEnergyCalibration::pfCalibrations, PerformanceResult::PFfa_BARREL, PerformanceResult::PFfa_ENDCAP, PerformanceResult::PFfaEta_BARRELEH, PerformanceResult::PFfaEta_BARRELH, PerformanceResult::PFfaEta_ENDCAPEH, PerformanceResult::PFfaEta_ENDCAPH, PerformanceResult::PFfb_BARREL, PerformanceResult::PFfb_ENDCAP, PerformanceResult::PFfbEta_BARRELEH, PerformanceResult::PFfbEta_BARRELH, PerformanceResult::PFfbEta_ENDCAPEH, PerformanceResult::PFfbEta_ENDCAPH, PerformanceResult::PFfc_BARREL, PerformanceResult::PFfc_ENDCAP, PerformanceResult::PFfcEta_BARRELEH, PerformanceResult::PFfcEta_BARRELH, PerformanceResult::PFfcEta_ENDCAPEH, PerformanceResult::PFfcEta_ENDCAPH, PerformanceResult::PFfdEta_ENDCAPEH, PerformanceResult::PFfdEta_ENDCAPH, and PerformancePayloadFromTFormula::printFormula().

634  {
635 
636  if(!out ) return out;
637 
638  out<<"PFEnergyCalibration -- "<<endl;
639 
640  if ( calib.pfCalibrations ) {
641 
642  static const std::map<std::string, PerformanceResult::ResultType> functType = {
643  {"PFfa_BARREL", PerformanceResult::PFfa_BARREL},
644  {"PFfa_ENDCAP", PerformanceResult::PFfa_ENDCAP},
645  {"PFfb_BARREL", PerformanceResult::PFfb_BARREL},
646  {"PFfb_ENDCAP", PerformanceResult::PFfb_ENDCAP},
647  {"PFfc_BARREL", PerformanceResult::PFfc_BARREL},
648  {"PFfc_ENDCAP", PerformanceResult::PFfc_ENDCAP},
649  {"PFfaEta_BARRELH", PerformanceResult::PFfaEta_BARRELH},
650  {"PFfaEta_ENDCAPH", PerformanceResult::PFfaEta_ENDCAPH},
651  {"PFfbEta_BARRELH", PerformanceResult::PFfbEta_BARRELH},
652  {"PFfbEta_ENDCAPH", PerformanceResult::PFfbEta_ENDCAPH},
653  {"PFfaEta_BARRELEH", PerformanceResult::PFfaEta_BARRELEH},
654  {"PFfaEta_ENDCAPEH", PerformanceResult::PFfaEta_ENDCAPEH},
655  {"PFfbEta_BARRELEH", PerformanceResult::PFfbEta_BARRELEH},
656  {"PFfbEta_ENDCAPEH", PerformanceResult::PFfbEta_ENDCAPEH},
657  {"PFfcEta_BARRELH", PerformanceResult::PFfcEta_BARRELH},
658  {"PFfcEta_ENDCAPH", PerformanceResult::PFfcEta_ENDCAPH},
659  {"PFfdEta_ENDCAPH", PerformanceResult::PFfdEta_ENDCAPH},
660  {"PFfcEta_BARRELEH", PerformanceResult::PFfcEta_BARRELEH},
661  {"PFfcEta_ENDCAPEH", PerformanceResult::PFfcEta_ENDCAPEH},
662  {"PFfdEta_ENDCAPEH", PerformanceResult::PFfdEta_ENDCAPEH}
663 
664  };
665 
666 
667  for(std::map<std::string,PerformanceResult::ResultType>::const_iterator
668  func = functType.begin();
669  func != functType.end();
670  ++func) {
671 
672  cout << "Function: " << func->first << endl;
673  PerformanceResult::ResultType fType = func->second;
674  calib.pfCalibrations->printFormula(fType);
675  }
676 
677  } else {
678 
679  std::cout << "Default calibration functions : " << std::endl;
680 
681  calib.faBarrel->Print();
682  calib.fbBarrel->Print();
683  calib.fcBarrel->Print();
684  calib.faEtaBarrelEH->Print();
685  calib.fbEtaBarrelEH->Print();
686  calib.faEtaBarrelH->Print();
687  calib.fbEtaBarrelH->Print();
688  calib.faEndcap->Print();
689  calib.fbEndcap->Print();
690  calib.fcEndcap->Print();
691  calib.faEtaEndcapEH->Print();
692  calib.fbEtaEndcapEH->Print();
693  calib.faEtaEndcapH->Print();
694  calib.fbEtaEndcapH->Print();
695  //
696 
697  }
698 
699  return out;
700 }
std::unique_ptr< TF1 > faEtaBarrelH
const PerformancePayloadFromTFormula * pfCalibrations
std::unique_ptr< TF1 > faEtaBarrelEH
std::unique_ptr< TF1 > fbEtaBarrelEH
std::unique_ptr< TF1 > fbBarrel
std::unique_ptr< TF1 > faEtaEndcapEH
std::unique_ptr< TF1 > faBarrel
std::unique_ptr< TF1 > faEndcap
std::unique_ptr< TF1 > fbEtaBarrelH
std::unique_ptr< TF1 > faEtaEndcapH
std::unique_ptr< TF1 > fbEndcap
std::unique_ptr< TF1 > fcBarrel
void printFormula(PerformanceResult::ResultType res) const
std::unique_ptr< TF1 > fbEtaEndcapEH
std::unique_ptr< TF1 > fcEndcap
std::unique_ptr< TF1 > fbEtaEndcapH