CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Groups Pages
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 const &)=delete
 
 EDConsumerBase (EDConsumerBase &&)=default
 
ESProxyIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESProxyIndex > const & esGetTokenIndicesVector (edm::Transition iTrans) const
 
std::vector< ESRecordIndex >
const & 
esGetTokenRecordIndicesVector (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::array< std::vector< ModuleDescription const * > *, NumBranchTypes > &modulesAll, std::vector< ModuleProcessName > &modulesInPreviousProcesses, 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 selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
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)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< Bconsumes (edm::InputTag tag) noexcept
 
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
constexpr auto esConsumes ()
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag)
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
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)
 
void resetItemsToGetFrom (BranchType iType)
 

Detailed Description

Definition at line 17 of file EcalTBHodoscopeRawInfoDumper.h.

Constructor & Destructor Documentation

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

Definition at line 18 of file EcalTBHodoscopeRawInfoDumper.cc.

18 {}

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 55 of file EcalTBHodoscopeRawInfoDumper.cc.

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

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 }
Log< level::Error, false > LogError
bool isValid() const
Definition: HandleBase.h:70
bool getByLabel(InputTag const &tag, Handle< PROD > &result) const
Definition: Event.h:500
T const * product() const
Definition: Handle.h:70
#define str(s)
#define LogDebug(id)
void EcalTBHodoscopeRawInfoDumper::beginJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 21 of file EcalTBHodoscopeRawInfoDumper.cc.

References h_firedHits_, h_numberOfFiredHits_, and mps_fire::i.

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 }
void EcalTBHodoscopeRawInfoDumper::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 41 of file EcalTBHodoscopeRawInfoDumper.cc.

References validate-o2o-wbm::f, h_firedHits_, h_numberOfFiredHits_, mps_fire::i, and rootfile_.

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 }

Member Data Documentation

TH1F* EcalTBHodoscopeRawInfoDumper::h_firedHits_[4]
private

Definition at line 30 of file EcalTBHodoscopeRawInfoDumper.h.

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

TH1F* EcalTBHodoscopeRawInfoDumper::h_numberOfFiredHits_[4]
private

Definition at line 29 of file EcalTBHodoscopeRawInfoDumper.h.

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

std::string EcalTBHodoscopeRawInfoDumper::rawInfoCollection_
private

Definition at line 27 of file EcalTBHodoscopeRawInfoDumper.h.

Referenced by analyze(), and EcalTBHodoscopeRawInfoDumper().

std::string EcalTBHodoscopeRawInfoDumper::rawInfoProducer_
private

Definition at line 26 of file EcalTBHodoscopeRawInfoDumper.h.

Referenced by analyze(), and EcalTBHodoscopeRawInfoDumper().

std::string EcalTBHodoscopeRawInfoDumper::rootfile_
private

Definition at line 28 of file EcalTBHodoscopeRawInfoDumper.h.

Referenced by EcalTBHodoscopeRawInfoDumper(), and endJob().