CMS 3D CMS Logo

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

#include <EcalTPInputAnalyzer.h>

Inheritance diagram for EcalTPInputAnalyzer:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 EcalTPInputAnalyzer (const edm::ParameterSet &)
 
void endJob () override
 
 ~EcalTPInputAnalyzer () 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

std::string ebLabel_
 
TH1I * ecal_et_ [2]
 
TH1I * ecal_fgvb_ [2]
 
std::vector< std::string > ecal_parts_
 
TH1I * ecal_tt_ [2]
 
std::string eeLabel_
 
TH1I * histBar
 
TH1I * histEndc
 
TFile * histfile_
 
std::string producer_
 

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

Description: test of the input of EcalTrigPrimProducer

Definition at line 35 of file EcalTPInputAnalyzer.h.

Constructor & Destructor Documentation

◆ EcalTPInputAnalyzer()

EcalTPInputAnalyzer::EcalTPInputAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 37 of file EcalTPInputAnalyzer.cc.

39 {
40  histfile_ = new TFile("histos.root", "UPDATE");
41  histEndc = new TH1I("AdcE", "Adc-s for Endcap", 100, 0., 5000.);
42  histBar = new TH1I("AdcB", "Adc-s for Barrel", 100, 0., 5000.);
43  ecal_parts_.push_back("Barrel");
44  ecal_parts_.push_back("Endcap");
45 
46  // for (unsigned int i=0;i<2;++i) {
47  // ecal_et_[i]=new TH1I(ecal_parts_[i].c_str(),"Et",255,0,255);
48  // char title[30];
49  // sprintf(title,"%s_ttf",ecal_parts_[i].c_str());
50  // ecal_tt_[i]=new TH1I(title,"TTF",10,0,10);
51  // sprintf(title,"%s_fgvb",ecal_parts_[i].c_str());
52  // ecal_fgvb_[i]=new TH1I(title,"FGVB",10,0,10);
53  // }
54  producer_ = iConfig.getParameter<std::string>("Producer");
55  ebLabel_ = iConfig.getParameter<std::string>("EBLabel");
56  eeLabel_ = iConfig.getParameter<std::string>("EELabel");
57 }

References edm::ParameterSet::getParameter(), and AlCaHLTBitMon_QueryRunRegistry::string.

◆ ~EcalTPInputAnalyzer()

EcalTPInputAnalyzer::~EcalTPInputAnalyzer ( )
override

Definition at line 59 of file EcalTPInputAnalyzer.cc.

59  {
60  // do anything here that needs to be done at desctruction time
61  // (e.g. close files, deallocate resources etc.)
62 
63  histfile_->Write();
64  histfile_->Close();
65 }

Member Function Documentation

◆ analyze()

void EcalTPInputAnalyzer::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overridevirtual

Implements edm::EDAnalyzer.

Definition at line 72 of file EcalTPInputAnalyzer.cc.

72  {
73  using namespace edm;
74  using namespace std;
75 
76  bool barrel = true;
79  if (!iEvent.getByLabel(producer_, ebLabel_, ebDigis)) {
80  barrel = false;
81  edm::LogWarning("EcalTPG") << " Couldnt find Barrel dataframes with Producer:" << producer_
82  << " and label: " << ebLabel_;
83  }
84  bool endcap = true;
85  if (!iEvent.getByLabel(producer_, eeLabel_, eeDigis)) {
86  endcap = false;
87  edm::LogWarning("EcalTPG") << " Couldnt find Endcap dataframes with Producer:" << producer_
88  << " and label: " << eeLabel_;
89  }
90  // barrel
91  if (barrel) {
92  const EBDigiCollection *ebdb = ebDigis.product();
93  for (unsigned int i = 0; i < ebDigis->size(); ++i) {
94  EBDataFrame ebdf = (*ebdb)[i];
95  int nrSamples = ebdf.size();
96  // unsigned int nrSamples=(ebDigis.product())[i].size();
97  for (int is = 0; is < nrSamples; ++is) {
98  // EcalMGPASample sam=((ebDigis.product())[i])[is];
99  EcalMGPASample sam = ebdf[is];
100  histBar->Fill(sam.adc());
101  }
102  }
103  }
104  // endcap
105  if (endcap) {
106  const EEDigiCollection *eedb = eeDigis.product();
107  for (unsigned int i = 0; i < eeDigis->size(); ++i) {
108  EEDataFrame eedf = (*eedb)[i];
109  int nrSamples = eedf.size();
110  for (int is = 0; is < nrSamples; ++is) {
111  EcalMGPASample sam = eedf[is];
112  histEndc->Fill(sam.adc());
113  }
114  }
115  }
116  // // Get input
117  // edm::Handle<EcalTrigPrimDigiCollection> tp;
118  // iEvent.getByLabel(label_,producer_,tp);
119  // for (unsigned int i=0;i<tp.product()->size();i++) {
120  // EcalTriggerPrimitiveDigi d=(*(tp.product()))[i];
121  // int subdet=d.id().subDet()-1;
122  // ecal_et_[subdet]->Fill(d.compressedEt());
123  // ecal_tt_[subdet]->Fill(d.ttFlag());
124  // ecal_fgvb_[subdet]->Fill(d.fineGrain());
125  // }
126 }

References EcalMGPASample::adc(), Reference_intrackfit_cff::barrel, SimL1EmulatorDM_cff::eeDigis, makeMuonMisalignmentScenario::endcap, mps_fire::i, iEvent, edm::Handle< T >::product(), EcalDataFrame::size(), and edm::DataFrameContainer::size().

◆ endJob()

void EcalTPInputAnalyzer::endJob ( void  )
overridevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 128 of file EcalTPInputAnalyzer.cc.

128  {
129  histEndc->Write();
130  histBar->Write();
131 }

Member Data Documentation

◆ ebLabel_

std::string EcalTPInputAnalyzer::ebLabel_
private

Definition at line 52 of file EcalTPInputAnalyzer.h.

◆ ecal_et_

TH1I* EcalTPInputAnalyzer::ecal_et_[2]
private

Definition at line 46 of file EcalTPInputAnalyzer.h.

◆ ecal_fgvb_

TH1I* EcalTPInputAnalyzer::ecal_fgvb_[2]
private

Definition at line 48 of file EcalTPInputAnalyzer.h.

◆ ecal_parts_

std::vector<std::string> EcalTPInputAnalyzer::ecal_parts_
private

Definition at line 45 of file EcalTPInputAnalyzer.h.

◆ ecal_tt_

TH1I* EcalTPInputAnalyzer::ecal_tt_[2]
private

Definition at line 47 of file EcalTPInputAnalyzer.h.

◆ eeLabel_

std::string EcalTPInputAnalyzer::eeLabel_
private

Definition at line 53 of file EcalTPInputAnalyzer.h.

◆ histBar

TH1I * EcalTPInputAnalyzer::histBar
private

Definition at line 49 of file EcalTPInputAnalyzer.h.

◆ histEndc

TH1I* EcalTPInputAnalyzer::histEndc
private

Definition at line 49 of file EcalTPInputAnalyzer.h.

◆ histfile_

TFile* EcalTPInputAnalyzer::histfile_
private

Definition at line 50 of file EcalTPInputAnalyzer.h.

◆ producer_

std::string EcalTPInputAnalyzer::producer_
private

Definition at line 54 of file EcalTPInputAnalyzer.h.

mps_fire.i
i
Definition: mps_fire.py:355
Reference_intrackfit_cff.barrel
list barrel
Definition: Reference_intrackfit_cff.py:37
edm::Handle::product
T const * product() const
Definition: Handle.h:70
edm
HLT enums.
Definition: AlignableModifier.h:19
EBDataFrame
Definition: EBDataFrame.h:11
EcalTPInputAnalyzer::ecal_parts_
std::vector< std::string > ecal_parts_
Definition: EcalTPInputAnalyzer.h:45
makeMuonMisalignmentScenario.endcap
endcap
Definition: makeMuonMisalignmentScenario.py:320
edm::Handle< EBDigiCollection >
EcalMGPASample::adc
int adc() const
get the ADC sample (12 bits)
Definition: EcalMGPASample.h:31
EcalTPInputAnalyzer::histEndc
TH1I * histEndc
Definition: EcalTPInputAnalyzer.h:49
EcalTPInputAnalyzer::histBar
TH1I * histBar
Definition: EcalTPInputAnalyzer.h:49
AlCaHLTBitMon_QueryRunRegistry.string
string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
EcalTPInputAnalyzer::producer_
std::string producer_
Definition: EcalTPInputAnalyzer.h:54
EcalTPInputAnalyzer::eeLabel_
std::string eeLabel_
Definition: EcalTPInputAnalyzer.h:53
edm::LogWarning
Definition: MessageLogger.h:141
EBDigiCollection
Definition: EcalDigiCollections.h:32
EEDigiCollection
Definition: EcalDigiCollections.h:45
iEvent
int iEvent
Definition: GenABIO.cc:224
EcalMGPASample
Definition: EcalMGPASample.h:22
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
EcalTPInputAnalyzer::histfile_
TFile * histfile_
Definition: EcalTPInputAnalyzer.h:50
std
Definition: JetResolutionObject.h:76
EcalDataFrame::size
int size() const
Definition: EcalDataFrame.h:26
EEDataFrame
Definition: EEDataFrame.h:12
SimL1EmulatorDM_cff.eeDigis
eeDigis
Definition: SimL1EmulatorDM_cff.py:18
edm::DataFrameContainer::size
size_type size() const
Definition: DataFrameContainer.h:162
EcalTPInputAnalyzer::ebLabel_
std::string ebLabel_
Definition: EcalTPInputAnalyzer.h:52