CMS 3D CMS Logo

List of all members | Public Member Functions | Private Attributes
EcalTBHodoscopeRawInfoDumper Class Reference

#include <EcalTBHodoscopeRawInfoDumper.h>

Inheritance diagram for EcalTBHodoscopeRawInfoDumper:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
 EcalTBHodoscopeRawInfoDumper (const edm::ParameterSet &ps)
 
void endJob () override
 
 ~EcalTBHodoscopeRawInfoDumper () 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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
bool registeredToConsume (ProductResolverIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProxyIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Private Attributes

TH1F * h_firedHits_ [4]
 
TH1F * h_numberOfFiredHits_ [4]
 
std::string rawInfoCollection_
 
std::string rawInfoProducer_
 
std::string rootfile_
 

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
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (edm::InputTag const &tag)
 

Detailed Description

Definition at line 17 of file EcalTBHodoscopeRawInfoDumper.h.

Constructor & Destructor Documentation

◆ EcalTBHodoscopeRawInfoDumper()

EcalTBHodoscopeRawInfoDumper::EcalTBHodoscopeRawInfoDumper ( const edm::ParameterSet ps)
explicit

◆ ~EcalTBHodoscopeRawInfoDumper()

EcalTBHodoscopeRawInfoDumper::~EcalTBHodoscopeRawInfoDumper ( )
override

Definition at line 18 of file EcalTBHodoscopeRawInfoDumper.cc.

18 {}

Member Function Documentation

◆ analyze()

void EcalTBHodoscopeRawInfoDumper::analyze ( const edm::Event e,
const edm::EventSetup es 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 55 of file EcalTBHodoscopeRawInfoDumper.cc.

55  {
56  // Get input
57  edm::Handle<EcalTBHodoscopeRawInfo> ecalRawHodoscope;
58  const EcalTBHodoscopeRawInfo* hodoscopeRawInfo = nullptr;
59  //evt.getByLabel( digiProducer_, digiCollection_, pDigis);
60  e.getByLabel(rawInfoProducer_, ecalRawHodoscope);
61  if (!ecalRawHodoscope.isValid()) {
62  edm::LogError("EcalTBHodoscopeRecInfoError") << "Error! can't get the product " << rawInfoCollection_.c_str();
63  } else {
64  hodoscopeRawInfo = ecalRawHodoscope.product();
65  }
66 
67  if (hodoscopeRawInfo)
68  for (int i = 0; i < 4; i++) {
69  std::ostringstream str;
70  str << " Hits ";
71  std::vector<int> firedHits;
72  h_numberOfFiredHits_[i]->Fill((*hodoscopeRawInfo)[i].numberOfFiredHits());
73  for (int j = 0; j < 64; j++)
74  if ((*hodoscopeRawInfo)[i][j]) {
75  h_firedHits_[i]->Fill(j);
76  firedHits.push_back(j);
77  str << j << " ";
78  }
79  LogDebug("EcalTBHodoscope") << "Looking plane " << i << " number of hits "
80  << (*hodoscopeRawInfo)[i].numberOfFiredHits() << str.str();
81  }
82  // Create empty output
83 }

References MillePedeFileConverter_cfg::e, h_firedHits_, h_numberOfFiredHits_, mps_fire::i, edm::HandleBase::isValid(), dqmiolumiharvest::j, LogDebug, edm::Handle< T >::product(), rawInfoCollection_, rawInfoProducer_, and str.

◆ beginJob()

void EcalTBHodoscopeRawInfoDumper::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 21 of file EcalTBHodoscopeRawInfoDumper.cc.

21  {
22  //========================================================================
23 
24  char histoName[100];
25  char histoTitle[100];
26 
27  for (int i = 0; i < 4; i++) {
28  sprintf(histoName, "h_numberOfFiredHits_%d", i);
29  sprintf(histoTitle, "NumberOfFiredHits Plane %d", i);
30  h_numberOfFiredHits_[i] = new TH1F(histoName, histoTitle, 10, 0., 10.);
31  }
32 
33  for (int i = 0; i < 4; i++) {
34  sprintf(histoName, "h_firedHits_%d", i);
35  sprintf(histoTitle, "firedHits Plane %d", i);
36  h_firedHits_[i] = new TH1F(histoName, histoTitle, 64, -0.5, 63.5);
37  }
38 }

References h_firedHits_, h_numberOfFiredHits_, HltBtagPostValidation_cff::histoName, and mps_fire::i.

◆ endJob()

void EcalTBHodoscopeRawInfoDumper::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 41 of file EcalTBHodoscopeRawInfoDumper.cc.

41  {
42  //========================================================================
43 
44  TFile f(rootfile_.c_str(), "RECREATE");
45 
46  for (int i = 0; i < 4; i++)
47  h_numberOfFiredHits_[i]->Write();
48 
49  for (int i = 0; i < 4; i++)
50  h_firedHits_[i]->Write();
51 
52  f.Close();
53 }

References f, h_firedHits_, h_numberOfFiredHits_, mps_fire::i, and rootfile_.

Member Data Documentation

◆ h_firedHits_

TH1F* EcalTBHodoscopeRawInfoDumper::h_firedHits_[4]
private

Definition at line 30 of file EcalTBHodoscopeRawInfoDumper.h.

Referenced by analyze(), beginJob(), and endJob().

◆ h_numberOfFiredHits_

TH1F* EcalTBHodoscopeRawInfoDumper::h_numberOfFiredHits_[4]
private

Definition at line 29 of file EcalTBHodoscopeRawInfoDumper.h.

Referenced by analyze(), beginJob(), and endJob().

◆ rawInfoCollection_

std::string EcalTBHodoscopeRawInfoDumper::rawInfoCollection_
private

Definition at line 27 of file EcalTBHodoscopeRawInfoDumper.h.

Referenced by analyze(), and EcalTBHodoscopeRawInfoDumper().

◆ rawInfoProducer_

std::string EcalTBHodoscopeRawInfoDumper::rawInfoProducer_
private

Definition at line 26 of file EcalTBHodoscopeRawInfoDumper.h.

Referenced by analyze(), and EcalTBHodoscopeRawInfoDumper().

◆ rootfile_

std::string EcalTBHodoscopeRawInfoDumper::rootfile_
private

Definition at line 28 of file EcalTBHodoscopeRawInfoDumper.h.

Referenced by EcalTBHodoscopeRawInfoDumper(), and endJob().

EcalTBHodoscopeRawInfoDumper::h_numberOfFiredHits_
TH1F * h_numberOfFiredHits_[4]
Definition: EcalTBHodoscopeRawInfoDumper.h:29
mps_fire.i
i
Definition: mps_fire.py:355
edm::Handle::product
T const * product() const
Definition: Handle.h:70
f
double f[11][100]
Definition: MuScleFitUtils.cc:78
EcalTBHodoscopeRawInfoDumper::rootfile_
std::string rootfile_
Definition: EcalTBHodoscopeRawInfoDumper.h:28
edm::ParameterSet::getUntrackedParameter
T getUntrackedParameter(std::string const &, T const &) const
edm::Handle
Definition: AssociativeIterator.h:50
str
#define str(s)
Definition: TestProcessor.cc:48
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalTBHodoscopeRawInfoDumper::rawInfoProducer_
std::string rawInfoProducer_
Definition: EcalTBHodoscopeRawInfoDumper.h:26
LogDebug
#define LogDebug(id)
Definition: MessageLogger.h:670
edm::LogError
Definition: MessageLogger.h:183
EcalTBHodoscopeRawInfo
Definition: EcalTBHodoscopeRawInfo.h:13
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
EcalTBHodoscopeRawInfoDumper::h_firedHits_
TH1F * h_firedHits_[4]
Definition: EcalTBHodoscopeRawInfoDumper.h:30
HltBtagPostValidation_cff.histoName
histoName
Definition: HltBtagPostValidation_cff.py:17
EcalTBHodoscopeRawInfoDumper::rawInfoCollection_
std::string rawInfoCollection_
Definition: EcalTBHodoscopeRawInfoDumper.h:27
dqmiolumiharvest.j
j
Definition: dqmiolumiharvest.py:66
edm::HandleBase::isValid
bool isValid() const
Definition: HandleBase.h:70
MillePedeFileConverter_cfg.e
e
Definition: MillePedeFileConverter_cfg.py:37