CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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 
24 // system include files
25 
26 // user include files
29 
32 
33 //
34 // constructors and destructor
35 //
37 {
38  //the following line is needed to tell the framework what
39  // data is being produced
40  map_.prefillMap();
41 
42  barrelfileinpath_=iConfig.getUntrackedParameter<std::string> ("fileNameBarrel","");
43  endcapfileinpath_=iConfig.getUntrackedParameter<std::string> ("fileNameEndcap","");
44 
45  edm::FileInPath barrelfiletmp("CalibCalorimetry/CaloMiscalibTools/data/"+barrelfileinpath_);
46  edm::FileInPath endcapfiletmp("CalibCalorimetry/CaloMiscalibTools/data/"+endcapfileinpath_);
47 
48 
49  barrelfile_=barrelfiletmp.fullPath();
50  endcapfile_=endcapfiletmp.fullPath();
51 
52  std::cout <<"Barrel file is:"<< barrelfile_<<std::endl;
53  std::cout <<"endcap file is:"<< endcapfile_<<std::endl;
54 
55 
56  // added by Zhen (changed since 1_2_0)
58  findingRecord<EcalIntercalibConstantsRcd>();
59  //now do what ever other initialization is needed
60 }
61 
62 
64 {
65 
66  // do anything here that needs to be done at desctruction time
67  // (e.g. close files, deallocate resources etc.)
68 
69 }
70 
71 
72 //
73 // member functions
74 //
75 
76 // ------------ method called to produce the data ------------
79 {
80  map_.prefillMap();
83  if(!barrelfile_.empty()) barrelreader_.parseXMLMiscalibFile(barrelfile_);
84  if(!endcapfile_.empty())endcapreader_.parseXMLMiscalibFile(endcapfile_);
85  map_.print();
86  // Added by Zhen, need a new object so to not be deleted at exit
87  // std::cout<<"about to copy"<<std::endl;
89  // std::cout<<"mydata "<<mydata<<std::endl;
90  return mydata;
91 }
92 
94  edm::ValidityInterval & oValidity)
95  {
97 
98  }
99 
T getUntrackedParameter(std::string const &, T const &) const
static const IOVSyncValue & endOfTime()
Definition: IOVSyncValue.cc:97
bool parseXMLMiscalibFile(std::string configFile)
std::pair< Time_t, Time_t > ValidityInterval
Definition: Time.h:19
void setWhatProduced(T *iThis, const es::Label &iLabel=es::Label())
Definition: ESProducer.h:115
CaloMiscalibMapEcal map_
std::string endcapfileinpath_
const EcalIntercalibConstants & get()
static const IOVSyncValue & beginOfTime()
std::string endcapfile_
CaloMiscalibTools(const edm::ParameterSet &)
std::string barrelfile_
std::string barrelfileinpath_
ReturnType produce(const EcalIntercalibConstantsRcd &)
void setIntervalFor(const edm::eventsetup::EventSetupRecordKey &, const edm::IOVSyncValue &, edm::ValidityInterval &)
EcalIntercalibConstantMap EcalIntercalibConstants
tuple cout
Definition: gather_cfg.py:121
std::string fullPath() const
Definition: FileInPath.cc:171