CMS 3D CMS Logo

Public Types | Public Member Functions | Private Member Functions | Private Attributes

CaloMiscalibTools Class Reference

#include <CalibCalorimetry/CaloMiscalibTools/interface/CaloMiscalibTools.h>

Inheritance diagram for CaloMiscalibTools:
edm::ESProducer edm::EventSetupRecordIntervalFinder edm::ESProxyFactoryProducer edm::eventsetup::DataProxyProvider

List of all members.

Public Types

typedef const
EcalIntercalibConstants
ReturnType

Public Member Functions

 CaloMiscalibTools (const edm::ParameterSet &)
ReturnType produce (const EcalIntercalibConstantsRcd &)
 ~CaloMiscalibTools ()

Private Member Functions

void setIntervalFor (const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)

Private Attributes

std::string barrelfile_
std::string barrelfileinpath_
std::string endcapfile_
std::string endcapfileinpath_
CaloMiscalibMapEcal map_

Detailed Description

Description: Definition of CaloMiscalibTools

Implementation: <Notes on="" implementation>="">

Description: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 51 of file CaloMiscalibTools.h.


Member Typedef Documentation

Definition at line 56 of file CaloMiscalibTools.h.


Constructor & Destructor Documentation

CaloMiscalibTools::CaloMiscalibTools ( const edm::ParameterSet iConfig)

Definition at line 37 of file CaloMiscalibTools.cc.

References barrelfile_, barrelfileinpath_, gather_cfg::cout, endcapfile_, endcapfileinpath_, edm::FileInPath::fullPath(), edm::ParameterSet::getUntrackedParameter(), map_, CaloMiscalibMapEcal::prefillMap(), produce(), edm::ESProducer::setWhatProduced(), and AlCaHLTBitMon_QueryRunRegistry::string.

{
   //the following line is needed to tell the framework what
   // data is being produced
  map_.prefillMap();

  barrelfileinpath_=iConfig.getUntrackedParameter<std::string> ("fileNameBarrel","");
  endcapfileinpath_=iConfig.getUntrackedParameter<std::string> ("fileNameEndcap","");

  edm::FileInPath barrelfiletmp("CalibCalorimetry/CaloMiscalibTools/data/"+barrelfileinpath_);
  edm::FileInPath endcapfiletmp("CalibCalorimetry/CaloMiscalibTools/data/"+endcapfileinpath_);
  
  
  barrelfile_=barrelfiletmp.fullPath();
  endcapfile_=endcapfiletmp.fullPath();

  std::cout <<"Barrel file is:"<< barrelfile_<<std::endl;
  std::cout <<"endcap file is:"<< endcapfile_<<std::endl;


   // added by Zhen (changed since 1_2_0)
   setWhatProduced(this,&CaloMiscalibTools::produce);
   findingRecord<EcalIntercalibConstantsRcd>();
   //now do what ever other initialization is needed
}
CaloMiscalibTools::~CaloMiscalibTools ( )

Definition at line 64 of file CaloMiscalibTools.cc.

{
 
   // do anything here that needs to be done at desctruction time
   // (e.g. close files, deallocate resources etc.)

}

Member Function Documentation

CaloMiscalibTools::ReturnType CaloMiscalibTools::produce ( const EcalIntercalibConstantsRcd iRecord)

Definition at line 79 of file CaloMiscalibTools.cc.

References barrelfile_, endcapfile_, CaloMiscalibMapEcal::get(), map_, MiscalibReaderFromXML::parseXMLMiscalibFile(), CaloMiscalibMapEcal::prefillMap(), and CaloMiscalibMapEcal::print().

Referenced by CaloMiscalibTools().

{
    map_.prefillMap();
    MiscalibReaderFromXMLEcalBarrel barrelreader_(map_);
    MiscalibReaderFromXMLEcalEndcap endcapreader_(map_);
    if(!barrelfile_.empty()) barrelreader_.parseXMLMiscalibFile(barrelfile_);
    if(!endcapfile_.empty())endcapreader_.parseXMLMiscalibFile(endcapfile_);
    map_.print();
    // Added by Zhen, need a new object so to not be deleted at exit
    //    std::cout<<"about to copy"<<std::endl;
    EcalIntercalibConstants* mydata=new EcalIntercalibConstants(map_.get());
    //    std::cout<<"mydata "<<mydata<<std::endl;
    return mydata;
}
void CaloMiscalibTools::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue ,
edm::ValidityInterval oValidity 
) [private, virtual]

Member Data Documentation

std::string CaloMiscalibTools::barrelfile_ [private]

Definition at line 64 of file CaloMiscalibTools.h.

Referenced by CaloMiscalibTools(), and produce().

std::string CaloMiscalibTools::barrelfileinpath_ [private]

Definition at line 66 of file CaloMiscalibTools.h.

Referenced by CaloMiscalibTools().

std::string CaloMiscalibTools::endcapfile_ [private]

Definition at line 65 of file CaloMiscalibTools.h.

Referenced by CaloMiscalibTools(), and produce().

std::string CaloMiscalibTools::endcapfileinpath_ [private]

Definition at line 67 of file CaloMiscalibTools.h.

Referenced by CaloMiscalibTools().

Definition at line 63 of file CaloMiscalibTools.h.

Referenced by CaloMiscalibTools(), and produce().