CMS 3D CMS Logo

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

CaloMiscalibToolsMC Class Reference

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

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

List of all members.

Public Types

typedef const
EcalIntercalibConstantsMC
ReturnType

Public Member Functions

 CaloMiscalibToolsMC (const edm::ParameterSet &)
ReturnType produce (const EcalIntercalibConstantsMCRcd &)
 ~CaloMiscalibToolsMC ()

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 CaloMiscalibToolsMC

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

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

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

Definition at line 51 of file CaloMiscalibToolsMC.h.


Member Typedef Documentation

Definition at line 56 of file CaloMiscalibToolsMC.h.


Constructor & Destructor Documentation

CaloMiscalibToolsMC::CaloMiscalibToolsMC ( const edm::ParameterSet iConfig)

Definition at line 37 of file CaloMiscalibToolsMC.cc.

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

{
   //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,&CaloMiscalibToolsMC::produce);
   findingRecord<EcalIntercalibConstantsMCRcd>();
   //now do what ever other initialization is needed
}
CaloMiscalibToolsMC::~CaloMiscalibToolsMC ( )

Definition at line 64 of file CaloMiscalibToolsMC.cc.

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

}

Member Function Documentation

CaloMiscalibToolsMC::ReturnType CaloMiscalibToolsMC::produce ( const EcalIntercalibConstantsMCRcd iRecord)

Definition at line 79 of file CaloMiscalibToolsMC.cc.

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

Referenced by CaloMiscalibToolsMC().

{
    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;
    EcalIntercalibConstantsMC* mydata=new EcalIntercalibConstantsMC(map_.get());
    //    std::cout<<"mydata "<<mydata<<std::endl;
    return mydata;
}
void CaloMiscalibToolsMC::setIntervalFor ( const edm::eventsetup::EventSetupRecordKey ,
const edm::IOVSyncValue ,
edm::ValidityInterval oValidity 
) [private, virtual]

Member Data Documentation

std::string CaloMiscalibToolsMC::barrelfile_ [private]

Definition at line 64 of file CaloMiscalibToolsMC.h.

Referenced by CaloMiscalibToolsMC(), and produce().

Definition at line 66 of file CaloMiscalibToolsMC.h.

Referenced by CaloMiscalibToolsMC().

std::string CaloMiscalibToolsMC::endcapfile_ [private]

Definition at line 65 of file CaloMiscalibToolsMC.h.

Referenced by CaloMiscalibToolsMC(), and produce().

Definition at line 67 of file CaloMiscalibToolsMC.h.

Referenced by CaloMiscalibToolsMC().

Definition at line 63 of file CaloMiscalibToolsMC.h.

Referenced by CaloMiscalibToolsMC(), and produce().