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

virtual void analyze (const edm::Event &e, const edm::EventSetup &c) override
 
template<class S , class SRcd >
void dumpIt (S *myS, SRcd *mySRcd, const edm::Event &e, const edm::EventSetup &context, std::string name, const HcalTopology *topo)
 
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)
 
template<class S >
void writeToFile (S *myS, const edm::Event &e, std::string name)
 
virtual ~HcalDumpConditions ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 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 & itemsToGetFromEvent () 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
 
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 &)
 
- 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 41 of file HcalDumpConditions.cc.

Constructor & Destructor Documentation

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

Definition at line 44 of file HcalDumpConditions.cc.

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

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

Definition at line 50 of file HcalDumpConditions.cc.

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

Member Function Documentation

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

Definition at line 106 of file HcalDumpConditions.cc.

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

Referenced by ~HcalDumpConditions().

107  {
109  context.get<HcalRecNumberingRecord>().get( topology );
110  const HcalTopology* topo=&(*topology);
111 
113  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("CalibrationsSet")) != mDumpRequest.end()
114  || std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("CalibrationWidthsSet")) != mDumpRequest.end())
115  {
116  context.get<HcalDbRecord>().get( pSetup );
117  }
118 
119  using namespace edm::eventsetup;
120  std::cout <<"HcalDumpConditions::analyze-> I AM IN RUN NUMBER "<<e.id().run() <<std::endl;
121 
122  if (mDumpRequest.empty()) return;
123  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ElectronicsMap")) != mDumpRequest.end())
124  dumpIt(new HcalElectronicsMap, new HcalElectronicsMapRcd, e,context,"ElectronicsMap");
125  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("FrontEndMap")) != mDumpRequest.end())
126  dumpIt(new HcalFrontEndMap, new HcalFrontEndMapRcd, e,context,"FrontEndMap");
127  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("QIEData")) != mDumpRequest.end())
128  dumpIt(new HcalQIEData(&(*topology)), new HcalQIEDataRcd, e,context,"QIEData", topo);
129  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("QIETypes")) != mDumpRequest.end())
130  dumpIt(new HcalQIETypes(&(*topology)), new HcalQIETypesRcd, e,context,"QIETypes", topo);
131  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Pedestals")) != mDumpRequest.end())
132  dumpIt(new HcalPedestals(&(*topology)), new HcalPedestalsRcd, e,context,"Pedestals", topo);
133  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PedestalWidths")) != mDumpRequest.end())
134  dumpIt(new HcalPedestalWidths(&(*topology)), new HcalPedestalWidthsRcd, e,context,"PedestalWidths", topo);
135  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Gains")) != mDumpRequest.end())
136  dumpIt(new HcalGains(&(*topology)), new HcalGainsRcd, e,context,"Gains", topo);
137  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("GainWidths")) != mDumpRequest.end())
138  dumpIt(new HcalGainWidths(&(*topology)), new HcalGainWidthsRcd, e,context,"GainWidths", topo);
139  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ChannelQuality")) != mDumpRequest.end())
140  dumpIt(new HcalChannelQuality(&(*topology)), new HcalChannelQualityRcd, e,context,"ChannelQuality", topo);
141  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("RespCorrs")) != mDumpRequest.end())
142  dumpIt(new HcalRespCorrs(&(*topology)), new HcalRespCorrsRcd, e,context,"RespCorrs", topo);
143  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ZSThresholds")) != mDumpRequest.end())
144  dumpIt(new HcalZSThresholds(&(*topology)), new HcalZSThresholdsRcd, e,context,"ZSThresholds", topo);
145  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("L1TriggerObjects")) != mDumpRequest.end())
146  dumpIt(new HcalL1TriggerObjects(&(*topology)), new HcalL1TriggerObjectsRcd, e,context,"L1TriggerObjects", topo);
147  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("TimeCorrs")) != mDumpRequest.end())
148  dumpIt(new HcalTimeCorrs(&(*topology)), new HcalTimeCorrsRcd, e,context,"TimeCorrs", topo);
149  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LUTCorrs")) != mDumpRequest.end())
150  dumpIt(new HcalLUTCorrs(&(*topology)), new HcalLUTCorrsRcd, e,context,"LUTCorrs", topo);
151  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PFCorrs")) != mDumpRequest.end())
152  dumpIt(new HcalPFCorrs(&(*topology)), new HcalPFCorrsRcd, e,context,"PFCorrs", topo);
153  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ValidationCorrs")) != mDumpRequest.end())
154  dumpIt(new HcalValidationCorrs(&(*topology)), new HcalValidationCorrsRcd, e,context,"ValidationCorrs", topo);
155  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LutMetadata")) != mDumpRequest.end())
156  dumpIt(new HcalLutMetadata(&(*topology)), new HcalLutMetadataRcd, e,context,"LutMetadata", topo);
157  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("DcsValues")) != mDumpRequest.end())
158  dumpIt(new HcalDcsValues, new HcalDcsRcd, e,context,"DcsValues");
159  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("DcsMap")) != mDumpRequest.end())
160  dumpIt(new HcalDcsMap, new HcalDcsMapRcd, e,context,"DcsMap");
161  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("RecoParams")) != mDumpRequest.end())
162  dumpIt(new HcalRecoParams(&(*topology)), new HcalRecoParamsRcd, e,context,"RecoParams", topo);
163  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("TimingParams")) != mDumpRequest.end())
164  dumpIt(new HcalTimingParams(&(*topology)), new HcalTimingParamsRcd, e,context,"TimingParams", topo);
165  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LongRecoParams")) != mDumpRequest.end())
166  dumpIt(new HcalLongRecoParams(&(*topology)), new HcalLongRecoParamsRcd, e,context,"LongRecoParams", topo);
167  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ZDCLowGainFractions")) != mDumpRequest.end())
168  dumpIt(new HcalZDCLowGainFractions(&(*topology)), new HcalZDCLowGainFractionsRcd, e,context,"ZDCLowGainFractions", topo);
169  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("MCParams")) != mDumpRequest.end())
170  dumpIt(new HcalMCParams(&(*topology)), new HcalMCParamsRcd, e,context,"MCParams", topo);
171  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("FlagHFDigiTimeParams")) != mDumpRequest.end())
172  dumpIt(new HcalFlagHFDigiTimeParams(&(*topology)), new HcalFlagHFDigiTimeParamsRcd, e,context,"FlagHFDigiTimeParams", topo);
173  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("SiPMParameters")) != mDumpRequest.end())
174  dumpIt(new HcalSiPMParameters(&(*topology)), new HcalSiPMParametersRcd, e,context,"SiPMParameters", topo);
175  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("SiPMCharacteristics")) != mDumpRequest.end())
176  dumpIt(new HcalSiPMCharacteristics, new HcalSiPMCharacteristicsRcd, e,context,"SiPMCharacteristics");
177  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("TPChannelParameters")) != mDumpRequest.end())
178  dumpIt(new HcalTPChannelParameters(&(*topology)), new HcalTPChannelParametersRcd, e,context,"TPChannelParameters", topo);
179  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("TPParameters")) != mDumpRequest.end())
180  dumpIt(new HcalTPParameters, new HcalTPParametersRcd, e,context,"TPParameters");
181  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("CalibrationsSet")) != mDumpRequest.end()){
183  writeToFile(tmp,e,"CalibrationsSet");
184  }
185  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("CalibrationWidthsSet")) != mDumpRequest.end()){
187  writeToFile(tmp,e,"CalibrationWidthsSet");
188  }
189 
190  }
RunNumber_t run() const
Definition: EventID.h:39
void writeToFile(S *myS, const edm::Event &e, std::string name)
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
const HcalCalibrationsSet * getHcalCalibrationsSet() const
void dumpIt(S *myS, SRcd *mySRcd, const edm::Event &e, const edm::EventSetup &context, std::string name, const HcalTopology *topo)
std::vector< std::string > mDumpRequest
std::vector< std::vector< double > > tmp
Definition: MVATrainer.cc:100
edm::EventID id() const
Definition: EventBase.h:58
const HcalCalibrationWidthsSet * getHcalCalibrationWidthsSet() const
template<class S , class SRcd >
void edmtest::HcalDumpConditions::dumpIt ( S myS,
SRcd *  mySRcd,
const edm::Event e,
const edm::EventSetup context,
std::string  name,
const HcalTopology topo 
)

Definition at line 66 of file HcalDumpConditions.cc.

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

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

67  {
69  if( name == "ChannelQuality") context.get<SRcd>().get("withTopo", p);
70  else context.get<SRcd>().get(p);
71  S* myobject = new S(*p.product());
72  if( topo ) myobject->setTopo(topo);
73 
74  writeToFile(myobject, e, name);
75 
76  if ( context.get<SRcd>().validityInterval().first() == edm::IOVSyncValue::invalidIOVSyncValue() )
77  std::cout << "error: invalid IOV sync value !" << std::endl;
78 
79  }
void writeToFile(S *myS, const edm::Event &e, std::string name)
const T & get() const
Definition: EventSetup.h:56
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
T const * product() const
Definition: ESHandle.h:86
static const IOVSyncValue & invalidIOVSyncValue()
Definition: IOVSyncValue.cc:92
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 83 of file HcalDumpConditions.cc.

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

84  {
86  context.get<SRcd>().get(p);
87  S* myobject = new S(*p.product());
88 
89  writeToFile(myobject, e, name);
90 
91  if ( context.get<SRcd>().validityInterval().first() == edm::IOVSyncValue::invalidIOVSyncValue() )
92  std::cout << "error: invalid IOV sync value !" << std::endl;
93 
94  }
void writeToFile(S *myS, const edm::Event &e, std::string name)
const T & get() const
Definition: EventSetup.h:56
double S(const TLorentzVector &, const TLorentzVector &)
Definition: Particle.cc:99
T const * product() const
Definition: ESHandle.h:86
static const IOVSyncValue & invalidIOVSyncValue()
Definition: IOVSyncValue.cc:92
template<class S >
void edmtest::HcalDumpConditions::writeToFile ( S myS,
const edm::Event e,
std::string  name 
)

Definition at line 96 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().

96  {
97  int myrun = e.id().run();
98  std::ostringstream file;
99  file << front << name.c_str() << "_Run" << myrun << ".txt";
100  std::ofstream outStream(file.str().c_str() );
101  std::cout << "HcalDumpConditions: ---- Dumping " << name.c_str() << " ----" << std::endl;
102  HcalDbASCIIIO::dumpObject (outStream, (*myS) );
103  }
RunNumber_t run() const
Definition: EventID.h:39
edm::EventID id() const
Definition: EventBase.h:58
bool dumpObject(std::ostream &fOutput, const HcalPedestals &fObject)

Member Data Documentation

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

Definition at line 60 of file HcalDumpConditions.cc.

Referenced by HcalDumpConditions(), and writeToFile().

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

Definition at line 61 of file HcalDumpConditions.cc.

Referenced by analyze(), and HcalDumpConditions().