CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
edmtest::HcalDumpConditions Class Reference
Inheritance diagram for edmtest::HcalDumpConditions:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
template<class S , class SRcd >
void dumpIt (const std::vector< std::string > &mDumpRequest, const edm::Event &e, const edm::EventSetup &context, const std::string name, const HcalTopology *topo, const std::string label="")
 
template<class S , class SRcd >
void dumpIt (const std::vector< std::string > &mDumpRequest, const edm::Event &e, const edm::EventSetup &context, const std::string name)
 
 HcalDumpConditions (edm::ParameterSet const &p)
 
 HcalDumpConditions (int i)
 
template<class S >
void writeToFile (const S &myS, const edm::Event &e, const std::string name)
 
 ~HcalDumpConditions () override
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
SerialTaskQueueglobalLuminosityBlocksQueue ()
 
SerialTaskQueueglobalRunsQueue ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
 ~EDAnalyzer () override
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
void convertCurrentProcessAlias (std::string const &processName)
 Convert "@currentProcess" in InputTag process names to the actual current process name. More...
 
 EDConsumerBase ()
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ProductResolverIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductResolverIndexAndSkipBit > &) const
 
std::vector< ProductResolverIndexAndSkipBit > const & itemsToGetFrom (BranchType iType) const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::EDAnalyzer
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &)
 
static bool wantsGlobalLuminosityBlocks ()
 
static bool wantsGlobalRuns ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken consumes (TypeToGet const &id, edm::InputTag const &tag)
 
ConsumesCollector consumesCollector ()
 Use a ConsumesCollector to gather consumes information from helper functions. More...
 
template<typename ProductType , BranchType B = InEvent>
void consumesMany ()
 
void consumesMany (const TypeToGet &id)
 
template<BranchType B>
void consumesMany (const TypeToGet &id)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 

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(), mDumpRequest, and AlCaHLTBitMon_QueryRunRegistry::string.

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  { }
edmtest::HcalDumpConditions::~HcalDumpConditions ( )
inlineoverride

Member Function Documentation

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

Definition at line 125 of file HcalDumpConditions.cc.

References gather_cfg::cout, DEFINE_FWK_MODULE, MillePedeFileConverter_cfg::e, spr::find(), edm::EventSetup::get(), edm::EventBase::id(), mDumpRequest, edm::EventID::run(), AlCaHLTBitMon_QueryRunRegistry::string, ecaldqm::topology(), and writeToFile().

Referenced by ~HcalDumpConditions().

126  {
128  context.get<HcalRecNumberingRecord>().get( topology );
129  const HcalTopology* topo=&(*topology);
130 
131  using namespace edm::eventsetup;
132  std::cout <<"HcalDumpConditions::analyze-> I AM IN RUN NUMBER "<<e.id().run() <<std::endl;
133 
134  if (mDumpRequest.empty()) return;
135 
136  // dumpIt called for all possible ValueMaps. The function checks if the dump is actually requested.
137  dumpIt<HcalElectronicsMap, HcalElectronicsMapRcd> (mDumpRequest, e, context,"ElectronicsMap" );
138  dumpIt<HcalFrontEndMap, HcalFrontEndMapRcd> (mDumpRequest, e, context,"FrontEndMap" );
139  dumpIt<HcalQIEData, HcalQIEDataRcd> (mDumpRequest, e, context,"QIEData", topo);
140  dumpIt<HcalQIETypes, HcalQIETypesRcd> (mDumpRequest, e, context,"QIETypes", topo);
141  dumpIt<HcalPedestals, HcalPedestalsRcd> (mDumpRequest, e, context,"Pedestals", topo);
142  dumpIt<HcalPedestalWidths, HcalPedestalWidthsRcd> (mDumpRequest, e, context,"PedestalWidths", topo);
143  dumpIt<HcalPedestals, HcalPedestalsRcd> (mDumpRequest, e, context,"EffectivePedestals", topo, "effective");
144  dumpIt<HcalPedestalWidths, HcalPedestalWidthsRcd> (mDumpRequest, e, context,"EffectivePedestalWidths", topo, "effective");
145  dumpIt<HcalGains, HcalGainsRcd> (mDumpRequest, e, context,"Gains", topo);
146  dumpIt<HcalGainWidths, HcalGainWidthsRcd> (mDumpRequest, e, context,"GainWidths", topo);
147  dumpIt<HcalChannelQuality, HcalChannelQualityRcd> (mDumpRequest, e, context,"ChannelQuality", topo, "withTopo" );
148  dumpIt<HcalRespCorrs, HcalRespCorrsRcd> (mDumpRequest, e, context,"RespCorrs", topo);
149  dumpIt<HcalZSThresholds, HcalZSThresholdsRcd> (mDumpRequest, e, context,"ZSThresholds", topo);
150  dumpIt<HcalL1TriggerObjects, HcalL1TriggerObjectsRcd> (mDumpRequest, e, context,"L1TriggerObjects", topo);
151  dumpIt<HcalTimeCorrs, HcalTimeCorrsRcd> (mDumpRequest, e, context,"TimeCorrs", topo);
152  dumpIt<HcalLUTCorrs, HcalLUTCorrsRcd> (mDumpRequest, e, context,"LUTCorrs", topo);
153  dumpIt<HcalPFCorrs, HcalPFCorrsRcd> (mDumpRequest, e, context,"PFCorrs", topo);
154  dumpIt<HcalValidationCorrs, HcalValidationCorrsRcd> (mDumpRequest, e, context,"ValidationCorrs", topo);
155  dumpIt<HcalLutMetadata, HcalLutMetadataRcd> (mDumpRequest, e, context,"LutMetadata", topo);
156  dumpIt<HcalDcsValues, HcalDcsRcd> (mDumpRequest, e, context,"DcsValues" );
157  dumpIt<HcalDcsMap, HcalDcsMapRcd> (mDumpRequest, e, context,"DcsMap" );
158  dumpIt<HcalRecoParams, HcalRecoParamsRcd> (mDumpRequest, e, context,"RecoParams", topo);
159  dumpIt<HcalTimingParams, HcalTimingParamsRcd> (mDumpRequest, e, context,"TimingParams", topo);
160  dumpIt<HcalLongRecoParams, HcalLongRecoParamsRcd> (mDumpRequest, e, context,"LongRecoParams", topo);
161  dumpIt<HcalZDCLowGainFractions, HcalZDCLowGainFractionsRcd> (mDumpRequest, e, context,"ZDCLowGainFractions", topo);
162  dumpIt<HcalMCParams, HcalMCParamsRcd> (mDumpRequest, e, context,"MCParams", topo);
163  dumpIt<HcalFlagHFDigiTimeParams, HcalFlagHFDigiTimeParamsRcd>(mDumpRequest, e, context,"FlagHFDigiTimeParams", topo);
164  dumpIt<HcalSiPMParameters, HcalSiPMParametersRcd> (mDumpRequest, e, context,"SiPMParameters", topo);
165  dumpIt<HcalSiPMCharacteristics, HcalSiPMCharacteristicsRcd> (mDumpRequest, e, context,"SiPMCharacteristics" );
166  dumpIt<HcalTPChannelParameters, HcalTPChannelParametersRcd> (mDumpRequest, e, context,"TPChannelParameters", topo);
167  dumpIt<HcalTPParameters, HcalTPParametersRcd> (mDumpRequest, e, context,"TPParameters" );
168 
170  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("CalibrationsSet")) != mDumpRequest.end()
171  || std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("CalibrationWidthsSet")) != mDumpRequest.end())
172  {
173  context.get<HcalDbRecord>().get( pSetup );
174  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("CalibrationsSet")) != mDumpRequest.end()){
175  writeToFile(*pSetup->getHcalCalibrationsSet(),e,"CalibrationsSet");
176  }
177  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("CalibrationWidthsSet")) != mDumpRequest.end()){
178  writeToFile(*pSetup->getHcalCalibrationWidthsSet(),e,"CalibrationWidthsSet");
179  }
180  }
181  }
RunNumber_t run() const
Definition: EventID.h:39
CaloTopology const * topology(0)
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< std::string > mDumpRequest
edm::EventID id() const
Definition: EventBase.h:60
void writeToFile(const S &myS, const edm::Event &e, const std::string name)
template<class S , class SRcd >
void edmtest::HcalDumpConditions::dumpIt ( const std::vector< std::string > &  mDumpRequest,
const edm::Event e,
const edm::EventSetup context,
const std::string  name,
const HcalTopology topo,
const std::string  label = "" 
)

Definition at line 73 of file HcalDumpConditions.cc.

References gather_cfg::cout, spr::find(), edm::EventSetup::get(), edm::IOVSyncValue::invalidIOVSyncValue(), dataset::name, AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< T >::product(), and writeToFile().

Referenced by ~HcalDumpConditions().

79  {
80  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), name) != mDumpRequest.end())
81  {
83  if(!label.empty()) context.get<SRcd>().get(label, p);
84  else context.get<SRcd>().get(p);
85  S myobject(*p.product());
86  if( topo ) myobject.setTopo(topo);
87 
88  writeToFile(myobject, e, name);
89 
90  if ( context.get<SRcd>().validityInterval().first() == edm::IOVSyncValue::invalidIOVSyncValue() )
91  std::cout << "error: invalid IOV sync value !" << std::endl;
92  }
93  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< std::string > mDumpRequest
T get() const
Definition: EventSetup.h:62
T const * product() const
Definition: ESHandle.h:86
static const IOVSyncValue & invalidIOVSyncValue()
Definition: IOVSyncValue.cc:92
void writeToFile(const S &myS, const edm::Event &e, const std::string name)
template<class S , class SRcd >
void edmtest::HcalDumpConditions::dumpIt ( const std::vector< std::string > &  mDumpRequest,
const edm::Event e,
const edm::EventSetup context,
const std::string  name 
)

Definition at line 97 of file HcalDumpConditions.cc.

References gather_cfg::cout, spr::find(), edm::EventSetup::get(), edm::IOVSyncValue::invalidIOVSyncValue(), dataset::name, AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< T >::product(), and writeToFile().

101  {
102  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), name) != mDumpRequest.end())
103  {
105  context.get<SRcd>().get(p);
106  S myobject(*p.product());
107 
108  writeToFile(myobject, e, name);
109 
110  if ( context.get<SRcd>().validityInterval().first() == edm::IOVSyncValue::invalidIOVSyncValue() )
111  std::cout << "error: invalid IOV sync value !" << std::endl;
112  }
113  }
void find(edm::Handle< EcalRecHitCollection > &hits, DetId thisDet, std::vector< EcalRecHitCollection::const_iterator > &hit, bool debug=false)
Definition: FindCaloHit.cc:20
std::vector< std::string > mDumpRequest
T get() const
Definition: EventSetup.h:62
T const * product() const
Definition: ESHandle.h:86
static const IOVSyncValue & invalidIOVSyncValue()
Definition: IOVSyncValue.cc:92
void writeToFile(const S &myS, const edm::Event &e, const std::string name)
template<class S >
void edmtest::HcalDumpConditions::writeToFile ( const S myS,
const edm::Event e,
const std::string  name 
)

Definition at line 115 of file HcalDumpConditions.cc.

References gather_cfg::cout, HcalDbASCIIIO::dumpObject(), FrontierConditions_GlobalTag_cff::file, front, edm::EventBase::id(), and edm::EventID::run().

Referenced by analyze(), dumpIt(), and ~HcalDumpConditions().

115  {
116  int myrun = e.id().run();
117  std::ostringstream file;
118  file << front << name.c_str() << "_Run" << myrun << ".txt";
119  std::ofstream outStream(file.str().c_str() );
120  std::cout << "HcalDumpConditions: ---- Dumping " << name << " ----" << std::endl;
121  HcalDbASCIIIO::dumpObject (outStream, myS );
122  }
RunNumber_t run() const
Definition: EventID.h:39
edm::EventID id() const
Definition: EventBase.h:60
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)

Member Data Documentation

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

Definition at line 67 of file HcalDumpConditions.cc.

Referenced by HcalDumpConditions(), and writeToFile().

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

Definition at line 68 of file HcalDumpConditions.cc.

Referenced by analyze(), HcalDumpConditions(), and ~HcalDumpConditions().