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 // $Id: CaloMiscalibTools.cc,v 1.4 2008/03/26 14:07:42 fra Exp $
17 //
18 // Modified : Luca Malgeri
19 // Date: : 11/09/2006
20 // Reason : split class definition (.h) from source code (.cc)
21 //
22 //
23 
24 
25 // system include files
26 
27 // user include files
30 
33 
34 //
35 // constructors and destructor
36 //
38 {
39  //the following line is needed to tell the framework what
40  // data is being produced
41  map_.prefillMap();
42 
43  barrelfileinpath_=iConfig.getUntrackedParameter<std::string> ("fileNameBarrel","");
44  endcapfileinpath_=iConfig.getUntrackedParameter<std::string> ("fileNameEndcap","");
45 
46  edm::FileInPath barrelfiletmp("CalibCalorimetry/CaloMiscalibTools/data/"+barrelfileinpath_);
47  edm::FileInPath endcapfiletmp("CalibCalorimetry/CaloMiscalibTools/data/"+endcapfileinpath_);
48 
49 
50  barrelfile_=barrelfiletmp.fullPath();
51  endcapfile_=endcapfiletmp.fullPath();
52 
53  std::cout <<"Barrel file is:"<< barrelfile_<<std::endl;
54  std::cout <<"endcap file is:"<< endcapfile_<<std::endl;
55 
56 
57  // added by Zhen (changed since 1_2_0)
59  findingRecord<EcalIntercalibConstantsRcd>();
60  //now do what ever other initialization is needed
61 }
62 
63 
65 {
66 
67  // do anything here that needs to be done at desctruction time
68  // (e.g. close files, deallocate resources etc.)
69 
70 }
71 
72 
73 //
74 // member functions
75 //
76 
77 // ------------ method called to produce the data ------------
80 {
81  map_.prefillMap();
84  if(!barrelfile_.empty()) barrelreader_.parseXMLMiscalibFile(barrelfile_);
85  if(!endcapfile_.empty())endcapreader_.parseXMLMiscalibFile(endcapfile_);
86  map_.print();
87  // Added by Zhen, need a new object so to not be deleted at exit
88  // std::cout<<"about to copy"<<std::endl;
90  // std::cout<<"mydata "<<mydata<<std::endl;
91  return mydata;
92 }
93 
95  edm::ValidityInterval & oValidity)
96  {
98 
99  }
100 
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