CMS 3D CMS Logo

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

#include <EcalTPInputAnalyzer.h>

Inheritance diagram for EcalTPInputAnalyzer:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
 EcalTPInputAnalyzer (const edm::ParameterSet &)
 
 ~EcalTPInputAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const final
 
bool wantsGlobalRuns () const final
 
bool wantsInputProcessBlocks () const final
 
bool wantsProcessBlocks () const final
 
- Public Member Functions inherited from edm::one::EDAnalyzerBase
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzerBase ()
 
ModuleDescription const & moduleDescription () const
 
bool wantsStreamLuminosityBlocks () const
 
bool wantsStreamRuns () const
 
 ~EDAnalyzerBase () 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

const std::string ebLabel_
 
const edm::EDGetTokenT< EBDigiCollectionebToken_
 
TH1I * ecal_et_ [2]
 
TH1I * ecal_fgvb_ [2]
 
std::vector< std::string > ecal_parts_
 
TH1I * ecal_tt_ [2]
 
const std::string eeLabel_
 
const edm::EDGetTokenT< EEDigiCollectioneeToken_
 
TH1I * histBar
 
TH1I * histEndc
 
const std::string producer_
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 
- 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

Description: test of the input of EcalTrigPrimProducer

Definition at line 36 of file EcalTPInputAnalyzer.h.

Constructor & Destructor Documentation

◆ EcalTPInputAnalyzer()

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

Definition at line 28 of file EcalTPInputAnalyzer.cc.

References ecal_parts_, compareTotals::fs, histBar, histEndc, and TFileService::kSharedResource.

29  : producer_(iConfig.getParameter<std::string>("Producer")),
30  ebLabel_(iConfig.getParameter<std::string>("EBLabel")),
31  eeLabel_(iConfig.getParameter<std::string>("EELabel")),
32  ebToken_(consumes<EBDigiCollection>(edm::InputTag(producer_, ebLabel_))),
33  eeToken_(consumes<EEDigiCollection>(edm::InputTag(producer_, eeLabel_))) {
34  usesResource(TFileService::kSharedResource);
35 
37  histEndc = fs->make<TH1I>("AdcE", "Adc-s for Endcap", 100, 0., 5000.);
38  histBar = fs->make<TH1I>("AdcB", "Adc-s for Barrel", 100, 0., 5000.);
39  ecal_parts_.push_back("Barrel");
40  ecal_parts_.push_back("Endcap");
41 
42  // for (unsigned int i=0;i<2;++i) {
43  // ecal_et_[i] = fs->make<TH1I>(ecal_parts_[i].c_str(),"Et",255,0,255);
44  // char title[30];
45  // sprintf(title,"%s_ttf",ecal_parts_[i].c_str());
46  // ecal_tt_[i] = fs->make<TH1I>(title,"TTF",10,0,10);
47  // sprintf(title,"%s_fgvb",ecal_parts_[i].c_str());
48  // ecal_fgvb_[i] = fs->make<TH1I>(title,"FGVB",10,0,10);
49  // }
50 }
static const std::string kSharedResource
Definition: TFileService.h:76
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
const std::string eeLabel_
const edm::EDGetTokenT< EBDigiCollection > ebToken_
std::vector< std::string > ecal_parts_
const std::string producer_
const std::string ebLabel_
const edm::EDGetTokenT< EEDigiCollection > eeToken_

◆ ~EcalTPInputAnalyzer()

EcalTPInputAnalyzer::~EcalTPInputAnalyzer ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 57 of file EcalTPInputAnalyzer.cc.

References EcalMGPASample::adc(), Reference_intrackfit_cff::barrel, ebLabel_, ebToken_, SimL1EmulatorDM_cff::eeDigis, eeLabel_, eeToken_, makeMuonMisalignmentScenario::endcap, histBar, histEndc, mps_fire::i, iEvent, edm::HandleBase::isValid(), producer_, edm::Handle< T >::product(), EcalDataFrame::size(), and edm::DataFrameContainer::size().

57  {
58  bool barrel = true;
59  const edm::Handle<EBDigiCollection> &ebDigis = iEvent.getHandle(ebToken_);
60  if (!ebDigis.isValid()) {
61  barrel = false;
62  edm::LogWarning("EcalTPG") << " Couldnt find Barrel dataframes with Producer:" << producer_
63  << " and label: " << ebLabel_;
64  }
65  bool endcap = true;
67  if (!eeDigis.isValid()) {
68  endcap = false;
69  edm::LogWarning("EcalTPG") << " Couldnt find Endcap dataframes with Producer:" << producer_
70  << " and label: " << eeLabel_;
71  }
72  // barrel
73  if (barrel) {
74  const EBDigiCollection *ebdb = ebDigis.product();
75  for (unsigned int i = 0; i < ebDigis->size(); ++i) {
76  EBDataFrame ebdf = (*ebdb)[i];
77  int nrSamples = ebdf.size();
78  // unsigned int nrSamples=(ebDigis.product())[i].size();
79  for (int is = 0; is < nrSamples; ++is) {
80  // EcalMGPASample sam=((ebDigis.product())[i])[is];
81  EcalMGPASample sam = ebdf[is];
82  histBar->Fill(sam.adc());
83  }
84  }
85  }
86  // endcap
87  if (endcap) {
88  const EEDigiCollection *eedb = eeDigis.product();
89  for (unsigned int i = 0; i < eeDigis->size(); ++i) {
90  EEDataFrame eedf = (*eedb)[i];
91  int nrSamples = eedf.size();
92  for (int is = 0; is < nrSamples; ++is) {
93  EcalMGPASample sam = eedf[is];
94  histEndc->Fill(sam.adc());
95  }
96  }
97  }
98  // // Get input
99  // const edm::Handle<EcalTrigPrimDigiCollection>& tp = iEvent.getHandle(tpToken_);
100  // for (unsigned int i=0;i<tp.product()->size();i++) {
101  // EcalTriggerPrimitiveDigi d=(*(tp.product()))[i];
102  // int subdet=d.id().subDet()-1;
103  // ecal_et_[subdet]->Fill(d.compressedEt());
104  // ecal_tt_[subdet]->Fill(d.ttFlag());
105  // ecal_fgvb_[subdet]->Fill(d.fineGrain());
106  // }
107 }
T const * product() const
Definition: Handle.h:70
const std::string eeLabel_
const edm::EDGetTokenT< EBDigiCollection > ebToken_
int size() const
Definition: EcalDataFrame.h:26
int iEvent
Definition: GenABIO.cc:224
const std::string producer_
bool isValid() const
Definition: HandleBase.h:70
int adc() const
get the ADC sample (12 bits)
const std::string ebLabel_
Log< level::Warning, false > LogWarning
const edm::EDGetTokenT< EEDigiCollection > eeToken_

Member Data Documentation

◆ ebLabel_

const std::string EcalTPInputAnalyzer::ebLabel_
private

Definition at line 52 of file EcalTPInputAnalyzer.h.

Referenced by analyze().

◆ ebToken_

const edm::EDGetTokenT<EBDigiCollection> EcalTPInputAnalyzer::ebToken_
private

Definition at line 54 of file EcalTPInputAnalyzer.h.

Referenced by analyze().

◆ 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.

Referenced by EcalTPInputAnalyzer().

◆ ecal_tt_

TH1I* EcalTPInputAnalyzer::ecal_tt_[2]
private

Definition at line 47 of file EcalTPInputAnalyzer.h.

◆ eeLabel_

const std::string EcalTPInputAnalyzer::eeLabel_
private

Definition at line 53 of file EcalTPInputAnalyzer.h.

Referenced by analyze().

◆ eeToken_

const edm::EDGetTokenT<EEDigiCollection> EcalTPInputAnalyzer::eeToken_
private

Definition at line 55 of file EcalTPInputAnalyzer.h.

Referenced by analyze().

◆ histBar

TH1I * EcalTPInputAnalyzer::histBar
private

Definition at line 49 of file EcalTPInputAnalyzer.h.

Referenced by analyze(), and EcalTPInputAnalyzer().

◆ histEndc

TH1I* EcalTPInputAnalyzer::histEndc
private

Definition at line 49 of file EcalTPInputAnalyzer.h.

Referenced by analyze(), and EcalTPInputAnalyzer().

◆ producer_

const std::string EcalTPInputAnalyzer::producer_
private

Definition at line 51 of file EcalTPInputAnalyzer.h.

Referenced by analyze().