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 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)
 
 HcalDumpConditions (edm::ParameterSet const &p)
 
 HcalDumpConditions (int i)
 
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
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

Private Attributes

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

Additional Inherited Members

- Public Types inherited from edm::EDAnalyzer
typedef EDAnalyzer ModuleType
 
- 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

Definition at line 52 of file HcalDumpConditions.cc.

52 { }

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 84 of file HcalDumpConditions.cc.

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

85  {
87  context.get<IdealGeometryRecord>().get( topology );
88 
89  using namespace edm::eventsetup;
90  std::cout <<"HcalDumpConditions::analyze-> I AM IN RUN NUMBER "<<e.id().run() <<std::endl;
91 
92  if (mDumpRequest.empty()) return;
93  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ElectronicsMap")) != mDumpRequest.end())
94  dumpIt(new HcalElectronicsMap, new HcalElectronicsMapRcd, e,context,"ElectronicsMap");
95  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("QIEData")) != mDumpRequest.end())
96  dumpIt(new HcalQIEData(&(*topology)), new HcalQIEDataRcd, e,context,"QIEData");
97  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Pedestals")) != mDumpRequest.end())
98  dumpIt(new HcalPedestals(&(*topology)), new HcalPedestalsRcd, e,context,"Pedestals");
99  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PedestalWidths")) != mDumpRequest.end())
100  dumpIt(new HcalPedestalWidths(&(*topology)), new HcalPedestalWidthsRcd, e,context,"PedestalWidths");
101  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("Gains")) != mDumpRequest.end())
102  dumpIt(new HcalGains(&(*topology)), new HcalGainsRcd, e,context,"Gains");
103  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("GainWidths")) != mDumpRequest.end())
104  dumpIt(new HcalGainWidths(&(*topology)), new HcalGainWidthsRcd, e,context,"GainWidths");
105  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ChannelQuality")) != mDumpRequest.end())
106  dumpIt(new HcalChannelQuality(&(*topology)), new HcalChannelQualityRcd, e,context,"ChannelQuality");
107  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("RespCorrs")) != mDumpRequest.end())
108  dumpIt(new HcalRespCorrs(&(*topology)), new HcalRespCorrsRcd, e,context,"RespCorrs");
109  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ZSThresholds")) != mDumpRequest.end())
110  dumpIt(new HcalZSThresholds(&(*topology)), new HcalZSThresholdsRcd, e,context,"ZSThresholds");
111  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("L1TriggerObjects")) != mDumpRequest.end())
112  dumpIt(new HcalL1TriggerObjects(&(*topology)), new HcalL1TriggerObjectsRcd, e,context,"L1TriggerObjects");
113  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("TimeCorrs")) != mDumpRequest.end())
114  dumpIt(new HcalTimeCorrs(&(*topology)), new HcalTimeCorrsRcd, e,context,"TimeCorrs");
115  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LUTCorrs")) != mDumpRequest.end())
116  dumpIt(new HcalLUTCorrs(&(*topology)), new HcalLUTCorrsRcd, e,context,"LUTCorrs");
117  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("PFCorrs")) != mDumpRequest.end())
118  dumpIt(new HcalPFCorrs(&(*topology)), new HcalPFCorrsRcd, e,context,"PFCorrs");
119  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("ValidationCorrs")) != mDumpRequest.end())
120  dumpIt(new HcalValidationCorrs(&(*topology)), new HcalValidationCorrsRcd, e,context,"ValidationCorrs");
121  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LutMetadata")) != mDumpRequest.end())
122  dumpIt(new HcalLutMetadata(&(*topology)), new HcalLutMetadataRcd, e,context,"LutMetadata");
123  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("DcsValues")) != mDumpRequest.end())
124  dumpIt(new HcalDcsValues, new HcalDcsRcd, e,context,"DcsValues");
125  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("DcsMap")) != mDumpRequest.end())
126  dumpIt(new HcalDcsMap, new HcalDcsMapRcd, e,context,"DcsMap");
127  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("CholeskyMatrices")) != mDumpRequest.end())
128  dumpIt(new HcalCholeskyMatrices(&(*topology)), new HcalCholeskyMatricesRcd, e,context,"CholeskyMatrices");
129  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("RecoParams")) != mDumpRequest.end())
130  dumpIt(new HcalRecoParams(&(*topology)), new HcalRecoParamsRcd, e,context,"RecoParams");
131  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("TimingParams")) != mDumpRequest.end())
132  dumpIt(new HcalTimingParams(&(*topology)), new HcalTimingParamsRcd, e,context,"TimingParams");
133  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("LongRecoParams")) != mDumpRequest.end())
134  dumpIt(new HcalLongRecoParams(&(*topology)), new HcalLongRecoParamsRcd, e,context,"LongRecoParams");
135  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("MCParams")) != mDumpRequest.end())
136  dumpIt(new HcalMCParams(&(*topology)), new HcalMCParamsRcd, e,context,"MCParams");
137  if (std::find (mDumpRequest.begin(), mDumpRequest.end(), std::string ("FlagHFDigiTimeParams")) != mDumpRequest.end())
138  dumpIt(new HcalFlagHFDigiTimeParams(&(*topology)), new HcalFlagHFDigiTimeParamsRcd, e,context,"FlagHFDigiTimeParams");
139 
140 
141  }
RunNumber_t run() const
Definition: EventID.h:42
CaloTopology const * topology(0)
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:121
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 64 of file HcalDumpConditions.cc.

References gather_cfg::cout, HcalDbASCIIIO::dumpObject(), mergeVDriftHistosByStation::file, front, edm::EventSetup::get(), edm::EventBase::id(), edm::IOVSyncValue::invalidIOVSyncValue(), AlCaHLTBitMon_ParallelJobs::p, edm::ESHandle< class >::product(), edm::EventID::run(), and S().

Referenced by analyze().

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

Member Data Documentation

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

Definition at line 58 of file HcalDumpConditions.cc.

Referenced by dumpIt(), and HcalDumpConditions().

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

Definition at line 59 of file HcalDumpConditions.cc.

Referenced by analyze(), and HcalDumpConditions().