CMS 3D CMS Logo

Public Member Functions | Private Attributes

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 40 of file HcalDumpConditions.cc.


Constructor & Destructor Documentation

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

Definition at line 43 of file HcalDumpConditions.cc.

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

    {
      front = p.getUntrackedParameter<std::string>("outFilePrefix","Dump");
      mDumpRequest = p.getUntrackedParameter <std::vector <std::string> > ("dump", std::vector<std::string>());
    }
edmtest::HcalDumpConditions::HcalDumpConditions ( int  i) [inline, explicit]

Definition at line 49 of file HcalDumpConditions.cc.

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

Definition at line 51 of file HcalDumpConditions.cc.

{ }

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().

  {
    using namespace edm::eventsetup;
    std::cout <<"HcalDumpConditions::analyze-> I AM IN RUN NUMBER "<<e.id().run() <<std::endl;

    if (mDumpRequest.empty()) return;

    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ElectronicsMap")) != mDumpRequest.end())
      dumpIt(new HcalElectronicsMap, new HcalElectronicsMapRcd, e,context,"ElectronicsMap");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("QIEData")) != mDumpRequest.end())
      dumpIt(new HcalQIEData, new HcalQIEDataRcd, e,context,"QIEData");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Pedestals")) != mDumpRequest.end())
      dumpIt(new HcalPedestals(false), new HcalPedestalsRcd, e,context,"Pedestals");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PedestalWidths")) != mDumpRequest.end())
      dumpIt(new HcalPedestalWidths(false), new HcalPedestalWidthsRcd, e,context,"PedestalWidths");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Gains")) != mDumpRequest.end())
      dumpIt(new HcalGains, new HcalGainsRcd, e,context,"Gains");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("GainWidths")) != mDumpRequest.end())
      dumpIt(new HcalGainWidths, new HcalGainWidthsRcd, e,context,"GainWidths");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ChannelQuality")) != mDumpRequest.end())
      dumpIt(new HcalChannelQuality, new HcalChannelQualityRcd, e,context,"ChannelQuality");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("RespCorrs")) != mDumpRequest.end())
      dumpIt(new HcalRespCorrs, new HcalRespCorrsRcd, e,context,"RespCorrs");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ZSThresholds")) != mDumpRequest.end())
      dumpIt(new HcalZSThresholds, new HcalZSThresholdsRcd, e,context,"ZSThresholds");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("L1TriggerObjects")) != mDumpRequest.end())
      dumpIt(new HcalL1TriggerObjects, new HcalL1TriggerObjectsRcd, e,context,"L1TriggerObjects");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("TimeCorrs")) != mDumpRequest.end())
      dumpIt(new HcalTimeCorrs, new HcalTimeCorrsRcd, e,context,"TimeCorrs");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LUTCorrs")) != mDumpRequest.end())
      dumpIt(new HcalLUTCorrs, new HcalLUTCorrsRcd, e,context,"LUTCorrs");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PFCorrs")) != mDumpRequest.end())
      dumpIt(new HcalPFCorrs, new HcalPFCorrsRcd, e,context,"PFCorrs");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ValidationCorrs")) != mDumpRequest.end())
      dumpIt(new HcalValidationCorrs, new HcalValidationCorrsRcd, e,context,"ValidationCorrs");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LutMetadata")) != mDumpRequest.end())
      dumpIt(new HcalLutMetadata, new HcalLutMetadataRcd, e,context,"LutMetadata");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("DcsValues")) != mDumpRequest.end())
      dumpIt(new HcalDcsValues, new HcalDcsRcd, e,context,"DcsValues");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("DcsMap")) != mDumpRequest.end())
      dumpIt(new HcalDcsMap, new HcalDcsMapRcd, e,context,"DcsMap");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("CholeskyMatrices")) != mDumpRequest.end())
      dumpIt(new HcalCholeskyMatrices, new HcalCholeskyMatricesRcd, e,context,"CholeskyMatrices");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("RecoParams")) != mDumpRequest.end())
      dumpIt(new HcalRecoParams, new HcalRecoParamsRcd, e,context,"RecoParams");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LongRecoParams")) != mDumpRequest.end())
      dumpIt(new HcalLongRecoParams, new HcalLongRecoParamsRcd, e,context,"LongRecoParams");
    if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("MCParams")) != mDumpRequest.end())
      dumpIt(new HcalMCParams, new HcalMCParamsRcd, e,context,"MCParams");
    
  }
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, CastorDbASCIIIO::dumpObject(), mergeVDriftHistosByStation::file, front, edm::EventSetup::get(), edm::EventBase::id(), edm::IOVSyncValue::invalidIOVSyncValue(), L1TEmulatorMonitor_cff::p, edm::ESHandle< T >::product(), edm::EventID::run(), and edm::eventsetup::EventSetupRecord::validityInterval().

Referenced by analyze().

  {
    int myrun = e.id().run();
    edm::ESHandle<S> p;
    context.get<SRcd>().get(p);
    S* myobject = new S(*p.product());
    
    std::ostringstream file;
    file << front << name.c_str() << "_Run" << myrun << ".txt";
    std::ofstream outStream(file.str().c_str() );
    std::cout << "HcalDumpConditions: ---- Dumping " << name.c_str() << " ----" << std::endl;
    HcalDbASCIIIO::dumpObject (outStream, (*myobject) );

    if ( context.get<HcalPedestalsRcd>().validityInterval().first() == edm::IOVSyncValue::invalidIOVSyncValue() )
      std::cout << "error: invalid IOV sync value !" << std::endl;

  }

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().