CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
List of all members | Public Member Functions | Private Attributes
edmtest::HcalDumpConditions Class Reference
Inheritance diagram for edmtest::HcalDumpConditions:
edm::EDAnalyzer

Public Member Functions

virtual void analyze (const edm::Event &e, const edm::EventSetup &c)
 
template<class S , class SRcd >
void dumpIt (S *myS, SRcd *mySRcd, const edm::Event &e, const edm::EventSetup &context, std::string name)
 
 HcalDumpConditions (edm::ParameterSet const &p)
 
 HcalDumpConditions (int i)
 
virtual ~HcalDumpConditions ()
 
- Public Member Functions inherited from edm::EDAnalyzer
 EDAnalyzer ()
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 

Private Attributes

std::string front
 
std::vector< std::string > mDumpRequest
 

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
typedef WorkerT< EDAnalyzerWorkerType
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
- Protected Member Functions inherited from edm::EDAnalyzer
CurrentProcessingContext const * currentContext () const
 

Detailed Description

Definition at line 40 of file HcalDumpConditions.cc.

Constructor & Destructor Documentation

edmtest::HcalDumpConditions::HcalDumpConditions ( edm::ParameterSet const &  p)
inlineexplicit

Definition at line 43 of file HcalDumpConditions.cc.

References front, edm::ParameterSet::getUntrackedParameter(), and mDumpRequest.

44  {
45  front = p.getUntrackedParameter<std::string>("outFilePrefix","Dump");
46  mDumpRequest = p.getUntrackedParameter <std::vector <std::string> > ("dump", std::vector<std::string>());
47  }
std::vector< std::string > mDumpRequest
edmtest::HcalDumpConditions::HcalDumpConditions ( int  i)
inlineexplicit

Definition at line 49 of file HcalDumpConditions.cc.

50  { }
virtual edmtest::HcalDumpConditions::~HcalDumpConditions ( )
inlinevirtual

Definition at line 51 of file HcalDumpConditions.cc.

51 { }

Member Function Documentation

void edmtest::HcalDumpConditions::analyze ( const edm::Event e,
const edm::EventSetup c 
)
virtual

Implements edm::EDAnalyzer.

Definition at line 83 of file HcalDumpConditions.cc.

References gather_cfg::cout, dumpIt(), spr::find(), edm::EventBase::id(), mDumpRequest, and edm::EventID::run().

84  {
85  using namespace edm::eventsetup;
86  std::cout <<"HcalDumpConditions::analyze-> I AM IN RUN NUMBER "<<e.id().run() <<std::endl;
87 
88  if (mDumpRequest.empty()) return;
89 
90  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ElectronicsMap")) != mDumpRequest.end())
91  dumpIt(new HcalElectronicsMap, new HcalElectronicsMapRcd, e,context,"ElectronicsMap");
92  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("QIEData")) != mDumpRequest.end())
93  dumpIt(new HcalQIEData, new HcalQIEDataRcd, e,context,"QIEData");
94  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Pedestals")) != mDumpRequest.end())
95  dumpIt(new HcalPedestals(false), new HcalPedestalsRcd, e,context,"Pedestals");
96  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PedestalWidths")) != mDumpRequest.end())
97  dumpIt(new HcalPedestalWidths(false), new HcalPedestalWidthsRcd, e,context,"PedestalWidths");
98  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Gains")) != mDumpRequest.end())
99  dumpIt(new HcalGains, new HcalGainsRcd, e,context,"Gains");
100  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("GainWidths")) != mDumpRequest.end())
101  dumpIt(new HcalGainWidths, new HcalGainWidthsRcd, e,context,"GainWidths");
102  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ChannelQuality")) != mDumpRequest.end())
103  dumpIt(new HcalChannelQuality, new HcalChannelQualityRcd, e,context,"ChannelQuality");
104  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("RespCorrs")) != mDumpRequest.end())
105  dumpIt(new HcalRespCorrs, new HcalRespCorrsRcd, e,context,"RespCorrs");
106  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ZSThresholds")) != mDumpRequest.end())
107  dumpIt(new HcalZSThresholds, new HcalZSThresholdsRcd, e,context,"ZSThresholds");
108  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("L1TriggerObjects")) != mDumpRequest.end())
109  dumpIt(new HcalL1TriggerObjects, new HcalL1TriggerObjectsRcd, e,context,"L1TriggerObjects");
110  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("TimeCorrs")) != mDumpRequest.end())
111  dumpIt(new HcalTimeCorrs, new HcalTimeCorrsRcd, e,context,"TimeCorrs");
112  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LUTCorrs")) != mDumpRequest.end())
113  dumpIt(new HcalLUTCorrs, new HcalLUTCorrsRcd, e,context,"LUTCorrs");
114  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PFCorrs")) != mDumpRequest.end())
115  dumpIt(new HcalPFCorrs, new HcalPFCorrsRcd, e,context,"PFCorrs");
116  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ValidationCorrs")) != mDumpRequest.end())
117  dumpIt(new HcalValidationCorrs, new HcalValidationCorrsRcd, e,context,"ValidationCorrs");
118  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LutMetadata")) != mDumpRequest.end())
119  dumpIt(new HcalLutMetadata, new HcalLutMetadataRcd, e,context,"LutMetadata");
120  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("DcsValues")) != mDumpRequest.end())
121  dumpIt(new HcalDcsValues, new HcalDcsRcd, e,context,"DcsValues");
122  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("DcsMap")) != mDumpRequest.end())
123  dumpIt(new HcalDcsMap, new HcalDcsMapRcd, e,context,"DcsMap");
124  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("CholeskyMatrices")) != mDumpRequest.end())
125  dumpIt(new HcalCholeskyMatrices, new HcalCholeskyMatricesRcd, e,context,"CholeskyMatrices");
126  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("RecoParams")) != mDumpRequest.end())
127  dumpIt(new HcalRecoParams, new HcalRecoParamsRcd, e,context,"RecoParams");
128  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LongRecoParams")) != mDumpRequest.end())
129  dumpIt(new HcalLongRecoParams, new HcalLongRecoParamsRcd, e,context,"LongRecoParams");
130  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("MCParams")) != mDumpRequest.end())
131  dumpIt(new HcalMCParams, new HcalMCParamsRcd, e,context,"MCParams");
132 
133  }
RunNumber_t run() const
Definition: EventID.h:42
void dumpIt(S *myS, SRcd *mySRcd, const edm::Event &e, const edm::EventSetup &context, std::string name)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:7
std::vector< std::string > mDumpRequest
edm::EventID id() const
Definition: EventBase.h:56
tuple cout
Definition: gather_cfg.py:41
template<class S , class SRcd >
void edmtest::HcalDumpConditions::dumpIt ( S *  myS,
SRcd *  mySRcd,
const edm::Event e,
const edm::EventSetup context,
std::string  name 
)

Definition at line 63 of file HcalDumpConditions.cc.

References gather_cfg::cout, HcalDbASCIIIO::dumpObject(), mergeVDriftHistosByStation::file, edm::ValidityInterval::first(), front, edm::EventSetup::get(), edm::EventBase::id(), edm::IOVSyncValue::invalidIOVSyncValue(), L1TEmulatorMonitor_cff::p, edm::ESHandle< class >::product(), edm::EventID::run(), and edm::eventsetup::EventSetupRecord::validityInterval().

Referenced by analyze().

64  {
65  int myrun = e.id().run();
67  context.get<SRcd>().get(p);
68  S* myobject = new S(*p.product());
69 
70  std::ostringstream file;
71  file << front << name.c_str() << "_Run" << myrun << ".txt";
72  std::ofstream outStream(file.str().c_str() );
73  std::cout << "HcalDumpConditions: ---- Dumping " << name.c_str() << " ----" << std::endl;
74  HcalDbASCIIIO::dumpObject (outStream, (*myobject) );
75 
77  std::cout << "error: invalid IOV sync value !" << std::endl;
78 
79  }
RunNumber_t run() const
Definition: EventID.h:42
const T & get() const
Definition: EventSetup.h:55
T const * product() const
Definition: ESHandle.h:62
edm::EventID id() const
Definition: EventBase.h:56
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)
tuple cout
Definition: gather_cfg.py:41
const IOVSyncValue & first() const
ValidityInterval const & validityInterval() const
static const IOVSyncValue & invalidIOVSyncValue()
Definition: IOVSyncValue.cc:92

Member Data Documentation

std::string edmtest::HcalDumpConditions::front
private

Definition at line 57 of file HcalDumpConditions.cc.

Referenced by dumpIt(), and HcalDumpConditions().

std::vector<std::string> edmtest::HcalDumpConditions::mDumpRequest
private

Definition at line 58 of file HcalDumpConditions.cc.

Referenced by analyze(), and HcalDumpConditions().