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
EcalTPInputAnalyzer Class Reference

#include <EcalTPInputAnalyzer.h>

Inheritance diagram for EcalTPInputAnalyzer:
edm::one::EDAnalyzer<> edm::one::EDAnalyzerBase 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::one::EDAnalyzer<>
 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

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::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 35 of file EcalTPInputAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 36 of file EcalTPInputAnalyzer.cc.

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

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

Definition at line 58 of file EcalTPInputAnalyzer.cc.

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

Member Function Documentation

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

Implements edm::one::EDAnalyzerBase.

Definition at line 71 of file EcalTPInputAnalyzer.cc.

References EcalMGPASample::adc(), Reference_intrackfit_cff::barrel, HGCalRawToDigi_cfi::eeDigis, Reference_intrackfit_cff::endcap, edm::Event::getByLabel(), mps_fire::i, and EcalDataFrame::size().

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

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 127 of file EcalTPInputAnalyzer.cc.

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

Member Data Documentation

std::string EcalTPInputAnalyzer::ebLabel_
private

Definition at line 52 of file EcalTPInputAnalyzer.h.

TH1I* EcalTPInputAnalyzer::ecal_et_[2]
private

Definition at line 46 of file EcalTPInputAnalyzer.h.

TH1I* EcalTPInputAnalyzer::ecal_fgvb_[2]
private

Definition at line 48 of file EcalTPInputAnalyzer.h.

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

Definition at line 45 of file EcalTPInputAnalyzer.h.

TH1I* EcalTPInputAnalyzer::ecal_tt_[2]
private

Definition at line 47 of file EcalTPInputAnalyzer.h.

std::string EcalTPInputAnalyzer::eeLabel_
private

Definition at line 53 of file EcalTPInputAnalyzer.h.

TH1I * EcalTPInputAnalyzer::histBar
private

Definition at line 49 of file EcalTPInputAnalyzer.h.

TH1I* EcalTPInputAnalyzer::histEndc
private

Definition at line 49 of file EcalTPInputAnalyzer.h.

TFile* EcalTPInputAnalyzer::histfile_
private

Definition at line 50 of file EcalTPInputAnalyzer.h.

std::string EcalTPInputAnalyzer::producer_
private

Definition at line 54 of file EcalTPInputAnalyzer.h.