CMS 3D CMS Logo

CaloMiscalibToolsMC.cc
Go to the documentation of this file.
1 // -*- C++ -*-
2 //
3 // Package: CaloMiscalibToolsMC
4 // Class: CaloMiscalibToolsMC
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<EcalIntercalibConstantsMCRcd>();
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  CaloMiscalibToolsMC::ReturnType mydata = std::make_unique<EcalIntercalibConstantsMC>(map.get());
80  // std::cout<<"mydata "<<mydata<<std::endl;
81  return mydata;
82 }
83 
85  const edm::IOVSyncValue&,
86  edm::ValidityInterval& oValidity) {
88 }
CaloMiscalibToolsMC::barrelfileinpath_
std::string barrelfileinpath_
Definition: CaloMiscalibToolsMC.h:66
CaloMiscalibToolsMC::endcapfileinpath_
std::string endcapfileinpath_
Definition: CaloMiscalibToolsMC.h:67
CaloMiscalibToolsMC.h
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:163
edm::ValidityInterval
Definition: ValidityInterval.h:28
CaloMiscalibToolsMC::barrelfile_
std::string barrelfile_
Definition: CaloMiscalibToolsMC.h:64
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
CaloMiscalibToolsMC::CaloMiscalibToolsMC
CaloMiscalibToolsMC(const edm::ParameterSet &)
Definition: CaloMiscalibToolsMC.cc:35
edm::eventsetup::EventSetupRecordKey
Definition: EventSetupRecordKey.h:30
MiscalibReaderFromXMLEcalEndcap.h
edm::FileInPath
Definition: FileInPath.h:61
CaloMiscalibToolsMC::ReturnType
std::unique_ptr< EcalIntercalibConstantsMC > ReturnType
Definition: CaloMiscalibToolsMC.h:54
edm::IOVSyncValue
Definition: IOVSyncValue.h:31
FileInPath.h
MiscalibReaderFromXMLEcalBarrel
Definition: MiscalibReaderFromXMLEcalBarrel.h:8
CaloMiscalibToolsMC::~CaloMiscalibToolsMC
~CaloMiscalibToolsMC() override
Definition: CaloMiscalibToolsMC.cc:57
EcalIntercalibConstantsMCRcd
Definition: EcalIntercalibConstantsMCRcd.h:5
CaloMiscalibMapEcal
Definition: CaloMiscalibMapEcal.h:16
edm::ParameterSet
Definition: ParameterSet.h:47
edm::IOVSyncValue::endOfTime
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:82
CaloMiscalibToolsMC::endcapfile_
std::string endcapfile_
Definition: CaloMiscalibToolsMC.h:65
CaloMiscalibToolsMC::produce
ReturnType produce(const EcalIntercalibConstantsMCRcd &)
Definition: CaloMiscalibToolsMC.cc:67
MiscalibReaderFromXMLEcalEndcap
Definition: MiscalibReaderFromXMLEcalEndcap.h:8
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
cond::ValidityInterval
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:17
edm::IOVSyncValue::beginOfTime
static const IOVSyncValue & beginOfTime()
Definition: IOVSyncValue.cc:88
CaloMiscalibToolsMC::setIntervalFor
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &) override
Definition: CaloMiscalibToolsMC.cc:84
MiscalibReaderFromXML::parseXMLMiscalibFile
bool parseXMLMiscalibFile(std::string configFile)
Definition: MiscalibReaderXML.cc:69
genParticles_cff.map
map
Definition: genParticles_cff.py:11
edm::FileInPath::fullPath
std::string fullPath() const
Definition: FileInPath.cc:161