CMS 3D CMS Logo

CaloMiscalibTools.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CaloMiscalibTools
4 // Class: CaloMiscalibTools
5 //
13 //
14 // Original Author: Lorenzo AGOSTINO
15 // Created: Wed May 31 10:37:45 CEST 2006
16 //
17 // Modified : Luca Malgeri
18 // Date: : 11/09/2006
19 // Reason : split class definition (.h) from source code (.cc)
20 //
21 //
22 
23 // system include files
24 
25 // user include files
28 
31 
32 //
33 // constructors and destructor
34 //
36  //the following line is needed to tell the framework what
37  // data is being produced
38 
39  barrelfileinpath_ = iConfig.getUntrackedParameter<std::string>("fileNameBarrel", "");
40  endcapfileinpath_ = iConfig.getUntrackedParameter<std::string>("fileNameEndcap", "");
41 
42  edm::FileInPath barrelfiletmp("CalibCalorimetry/CaloMiscalibTools/data/" + barrelfileinpath_);
43  edm::FileInPath endcapfiletmp("CalibCalorimetry/CaloMiscalibTools/data/" + endcapfileinpath_);
44 
45  barrelfile_ = barrelfiletmp.fullPath();
46  endcapfile_ = endcapfiletmp.fullPath();
47 
48  std::cout << "Barrel file is:" << barrelfile_ << std::endl;
49  std::cout << "endcap file is:" << endcapfile_ << std::endl;
50 
51  // added by Zhen (changed since 1_2_0)
53  findingRecord<EcalIntercalibConstantsRcd>();
54  //now do what ever other initialization is needed
55 }
56 
58  // do anything here that needs to be done at desctruction time
59  // (e.g. close files, deallocate resources etc.)
60 }
61 
62 //
63 // member functions
64 //
65 
66 // ------------ method called to produce the data ------------
69  map.prefillMap();
70  MiscalibReaderFromXMLEcalBarrel barrelreader_(map);
71  MiscalibReaderFromXMLEcalEndcap endcapreader_(map);
72  if (!barrelfile_.empty())
73  barrelreader_.parseXMLMiscalibFile(barrelfile_);
74  if (!endcapfile_.empty())
75  endcapreader_.parseXMLMiscalibFile(endcapfile_);
76  map.print();
77  // Added by Zhen, need a new object so to not be deleted at exit
78  // std::cout<<"about to copy"<<std::endl;
79  CaloMiscalibTools::ReturnType mydata = std::make_unique<EcalIntercalibConstants>(map.get());
80  // std::cout<<"mydata "<<mydata<<std::endl;
81  return mydata;
82 }
83 
85  const edm::IOVSyncValue&,
86  edm::ValidityInterval& oValidity) {
88 }
CaloMiscalibTools::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
Definition: CaloMiscalibTools.cc:84
MiscalibReaderFromXMLEcalBarrel.h
gather_cfg.cout
cout
Definition: gather_cfg.py:144
edm::ESProducer::setWhatProduced
auto setWhatProduced(T *iThis, const es::Label &iLabel={})
Definition: ESProducer.h:138
edm::ValidityInterval
Definition: ValidityInterval.h:28
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
MiscalibReaderFromXMLEcalEndcap.h
FileInPath.h
CaloMiscalibTools.h
edm::FileInPath
Definition: FileInPath.h:64
CaloMiscalibTools::CaloMiscalibTools
CaloMiscalibTools(const edm::ParameterSet &)
Definition: CaloMiscalibTools.cc:35
CaloMiscalibTools::endcapfileinpath_
std::string endcapfileinpath_
Definition: CaloMiscalibTools.h:67
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
MiscalibReaderFromXMLEcalBarrel
Definition: MiscalibReaderFromXMLEcalBarrel.h:8
CaloMiscalibTools::ReturnType
std::unique_ptr< EcalIntercalibConstants > ReturnType
Definition: CaloMiscalibTools.h:54
CaloMiscalibTools::endcapfile_
std::string endcapfile_
Definition: CaloMiscalibTools.h:65
CaloMiscalibMapEcal
Definition: CaloMiscalibMapEcal.h:16
edm::ParameterSet
Definition: ParameterSet.h:36
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
CaloMiscalibTools::barrelfileinpath_
std::string barrelfileinpath_
Definition: CaloMiscalibTools.h:66
MiscalibReaderFromXMLEcalEndcap
Definition: MiscalibReaderFromXMLEcalEndcap.h:8
cond::ValidityInterval
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
CaloMiscalibTools::barrelfile_
std::string barrelfile_
Definition: CaloMiscalibTools.h:64
CaloMiscalibTools::produce
ReturnType produce(const EcalIntercalibConstantsRcd &)
Definition: CaloMiscalibTools.cc:67
edm::IOVSyncValue::beginOfTime
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
CaloMiscalibTools::~CaloMiscalibTools
~CaloMiscalibTools() override
Definition: CaloMiscalibTools.cc:57
MiscalibReaderFromXML::parseXMLMiscalibFile
bool parseXMLMiscalibFile(std::string configFile)
Definition: MiscalibReaderXML.cc:69
genParticles_cff.map
map
Definition: genParticles_cff.py:11
EcalIntercalibConstantsRcd
Definition: EcalIntercalibConstantsRcd.h:5
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:163