CMS 3D CMS Logo

edmtest::HcalDumpConditions Class Reference

Inheritance diagram for edmtest::HcalDumpConditions:

edm::EDAnalyzer

List of all members.

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 (int i)
 HcalDumpConditions (edm::ParameterSet const &p)
virtual ~HcalDumpConditions ()

Private Attributes

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


Detailed Description

Definition at line 42 of file HcalDumpConditions.cc.


Constructor & Destructor Documentation

edmtest::HcalDumpConditions::HcalDumpConditions ( edm::ParameterSet const &  p  )  [inline, explicit]

Definition at line 45 of file HcalDumpConditions.cc.

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

00046     {
00047       front = p.getUntrackedParameter<std::string>("outFilePrefix","Dump");
00048       mDumpRequest = p.getUntrackedParameter <std::vector <std::string> > ("dump", std::vector<std::string>());
00049     }

edmtest::HcalDumpConditions::HcalDumpConditions ( int  i  )  [inline, explicit]

Definition at line 51 of file HcalDumpConditions.cc.

00052     { }

virtual edmtest::HcalDumpConditions::~HcalDumpConditions (  )  [inline, virtual]

Definition at line 53 of file HcalDumpConditions.cc.

00053 { }


Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 85 of file HcalDumpConditions.cc.

References GenMuonPlsPt100GeV_cfg::cout, dumpIt(), lat::endl(), find(), edm::Event::id(), and mDumpRequest.

00086   {
00087     using namespace edm::eventsetup;
00088     std::cout <<"HcalDumpConditions::analyze-> I AM IN RUN NUMBER "<<e.id().run() <<std::endl;
00089 
00090     if (mDumpRequest.empty()) return;
00091 
00092     if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ElectronicsMap")) != mDumpRequest.end())
00093       dumpIt(new HcalElectronicsMap, new HcalElectronicsMapRcd, e,context,"ElectronicsMap");
00094     if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("QIEData")) != mDumpRequest.end())
00095       dumpIt(new HcalQIEData, new HcalQIEDataRcd, e,context,"QIEData");
00096     if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Pedestals")) != mDumpRequest.end())
00097       dumpIt(new HcalPedestals, new HcalPedestalsRcd, e,context,"Pedestals");
00098     if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PedestalWidths")) != mDumpRequest.end())
00099       dumpIt(new HcalPedestalWidths, new HcalPedestalWidthsRcd, e,context,"PedestalWidths");
00100     if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Gains")) != mDumpRequest.end())
00101       dumpIt(new HcalGains, new HcalGainsRcd, e,context,"Gains");
00102     if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("GainWidths")) != mDumpRequest.end())
00103       dumpIt(new HcalGainWidths, new HcalGainWidthsRcd, e,context,"GainWidths");
00104     if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ChannelQuality")) != mDumpRequest.end())
00105       dumpIt(new HcalChannelQuality, new HcalChannelQualityRcd, e,context,"ChannelQuality");
00106     if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("RespCorrs")) != mDumpRequest.end())
00107       dumpIt(new HcalRespCorrs, new HcalRespCorrsRcd, e,context,"RespCorrs");
00108     if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ZSThresholds")) != mDumpRequest.end())
00109       dumpIt(new HcalZSThresholds, new HcalZSThresholdsRcd, e,context,"ZSThresholds");
00110     
00111   }

template<class S, class SRcd>
void edmtest::HcalDumpConditions::dumpIt ( S *  myS,
SRcd *  mySRcd,
const edm::Event e,
const edm::EventSetup context,
std::string  name 
) [inline]

Definition at line 65 of file HcalDumpConditions.cc.

References GenMuonPlsPt100GeV_cfg::cout, HcalDbASCIIIO::dumpObject(), lat::endl(), file, front, edm::EventSetup::get(), edm::Event::id(), edm::IOVSyncValue::invalidIOVSyncValue(), p, and edm::ESHandle< T >::product().

Referenced by analyze().

00066   {
00067     int myrun = e.id().run();
00068     edm::ESHandle<S> p;
00069     context.get<SRcd>().get(p);
00070     S* myobject = new S(*p.product());
00071     
00072     std::ostringstream file;
00073     file << front << name.c_str() << "_Run" << myrun << ".txt";
00074     std::ofstream outStream(file.str().c_str() );
00075     std::cout << "HcalDumpConditions: ---- Dumping " << name.c_str() << " ----" << std::endl;
00076     HcalDbASCIIIO::dumpObject (outStream, (*myobject) );
00077 
00078     if ( context.get<HcalPedestalsRcd>().validityInterval().first() == edm::IOVSyncValue::invalidIOVSyncValue() )
00079       std::cout << "error: invalid IOV sync value !" << std::endl;
00080 
00081   }


Member Data Documentation

std::string edmtest::HcalDumpConditions::front [private]

Definition at line 59 of file HcalDumpConditions.cc.

Referenced by dumpIt(), and HcalDumpConditions().

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

Definition at line 60 of file HcalDumpConditions.cc.

Referenced by analyze(), and HcalDumpConditions().


The documentation for this class was generated from the following file:
Generated on Tue Jun 9 18:46:41 2009 for CMSSW by  doxygen 1.5.4