CMS 3D CMS Logo

 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Friends Macros Pages
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

virtual void analyze (const edm::Event &, const edm::EventSetup &) override
 
 EcalTPInputAnalyzer (const edm::ParameterSet &)
 
void endJob ()
 
 ~EcalTPInputAnalyzer ()
 
- Public Member Functions inherited from edm::EDAnalyzer
void callWhenNewProductsRegistered (std::function< void(BranchDescription const &)> const &func)
 
 EDAnalyzer ()
 
ModuleDescription const & moduleDescription () const
 
std::string workerType () const
 
virtual ~EDAnalyzer ()
 
- Public Member Functions inherited from edm::EDConsumerBase
std::vector< ConsumesInfoconsumesInfo () const
 
 EDConsumerBase ()
 
ProductHolderIndexAndSkipBit indexFrom (EDGetToken, BranchType, TypeID const &) const
 
void itemsMayGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
void itemsToGet (BranchType, std::vector< ProductHolderIndexAndSkipBit > &) const
 
std::vector
< ProductHolderIndexAndSkipBit >
const & 
itemsToGetFromEvent () const
 
void labelsForToken (EDGetToken iToken, Labels &oLabels) const
 
void modulesDependentUpon (const std::string &iProcessName, std::vector< const char * > &oModuleLabels) const
 
void modulesWhoseProductsAreConsumed (std::vector< ModuleDescription const * > &modules, ProductRegistry const &preg, std::map< std::string, ModuleDescription const * > const &labelsToDesc, std::string const &processName) const
 
bool registeredToConsume (ProductHolderIndex, bool, BranchType) const
 
bool registeredToConsumeMany (TypeID const &, BranchType) const
 
void updateLookup (BranchType iBranchType, ProductHolderIndexHelper const &)
 
virtual ~EDConsumerBase ()
 

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 &)
 
- Protected Member Functions inherited from edm::EDConsumerBase
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
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 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)
 

Detailed Description

Description: test of the input of EcalTrigPrimProducer

Definition at line 37 of file EcalTPInputAnalyzer.h.

Constructor & Destructor Documentation

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

Definition at line 38 of file EcalTPInputAnalyzer.cc.

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

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

Definition at line 61 of file EcalTPInputAnalyzer.cc.

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

Member Function Documentation

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

Implements edm::EDAnalyzer.

Definition at line 79 of file EcalTPInputAnalyzer.cc.

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

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

Reimplemented from edm::EDAnalyzer.

Definition at line 135 of file EcalTPInputAnalyzer.cc.

135  {
136  histEndc ->Write();
137  histBar ->Write();
138 }

Member Data Documentation

std::string EcalTPInputAnalyzer::ebLabel_
private

Definition at line 55 of file EcalTPInputAnalyzer.h.

TH1I* EcalTPInputAnalyzer::ecal_et_[2]
private

Definition at line 49 of file EcalTPInputAnalyzer.h.

TH1I* EcalTPInputAnalyzer::ecal_fgvb_[2]
private

Definition at line 51 of file EcalTPInputAnalyzer.h.

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

Definition at line 48 of file EcalTPInputAnalyzer.h.

TH1I* EcalTPInputAnalyzer::ecal_tt_[2]
private

Definition at line 50 of file EcalTPInputAnalyzer.h.

std::string EcalTPInputAnalyzer::eeLabel_
private

Definition at line 56 of file EcalTPInputAnalyzer.h.

TH1I * EcalTPInputAnalyzer::histBar
private

Definition at line 52 of file EcalTPInputAnalyzer.h.

TH1I* EcalTPInputAnalyzer::histEndc
private

Definition at line 52 of file EcalTPInputAnalyzer.h.

TFile* EcalTPInputAnalyzer::histfile_
private

Definition at line 53 of file EcalTPInputAnalyzer.h.

std::string EcalTPInputAnalyzer::producer_
private

Definition at line 57 of file EcalTPInputAnalyzer.h.