CMS 3D CMS Logo

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

#include <Validation/TPGSimulation/src/TPGCheck.cc>

Inheritance diagram for TPGCheck:
edm::EDAnalyzer edm::EDConsumerBase

Public Member Functions

 TPGCheck (const edm::ParameterSet &)
 
 ~TPGCheck () 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
 
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
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
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 Member Functions

void analyze (const edm::Event &, const edm::EventSetup &) override
 
void beginJob () override
 
void endJob () override
 

Private Attributes

TH1I * ecal_et_ [2]
 
TH1I * ecal_fgvb_ [2]
 
std::vector< std::string > ecal_parts_
 
edm::EDGetTokenT< EcalTrigPrimDigiCollectionecal_tp_token_
 
TH1I * ecal_tt_ [2]
 
TFile * histFile_
 
std::string label_
 
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
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 ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes ()
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
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: <one line="" class="" summary>="">

Implementation: <Notes on="" implementation>="">

Definition at line 44 of file TPGCheck.cc.

Constructor & Destructor Documentation

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

Definition at line 70 of file TPGCheck.cc.

References edm::ParameterSet::getParameter(), mps_fire::i, AlCaHLTBitMon_QueryRunRegistry::string, and lumiQTWidget::t.

70  {
71  // now do what ever initialization is needed
72 
73  ecal_parts_.push_back("Barrel");
74  ecal_parts_.push_back("Endcap");
75 
76  histFile_ = new TFile("histos.root", "RECREATE");
77  for (unsigned int i = 0; i < 2; ++i) {
78  // Energy
79  char t[30];
80  sprintf(t, "%s_energy", ecal_parts_[i].c_str());
81  ecal_et_[i] = new TH1I(t, "Et", 255, 0, 255);
82 
83  // Trigger Tower flag
84  char titleTTF[30];
85  sprintf(titleTTF, "%s_ttf", ecal_parts_[i].c_str());
86  ecal_tt_[i] = new TH1I(titleTTF, "TTF", 10, 0, 10);
87 
88  // Fain Grain
89  char titleFG[30];
90  sprintf(titleFG, "%s_fgvb", ecal_parts_[i].c_str());
91  ecal_fgvb_[i] = new TH1I(titleFG, "FGVB", 10, 0, 10);
92  }
93 
94  label_ = iConfig.getParameter<std::string>("Label");
95  producer_ = iConfig.getParameter<std::string>("Producer");
97  consumes<EcalTrigPrimDigiCollection>(edm::InputTag(label_, producer_));
98 }
T getParameter(std::string const &) const
std::string label_
Definition: TPGCheck.cc:60
TFile * histFile_
Definition: TPGCheck.cc:59
TH1I * ecal_tt_[2]
Definition: TPGCheck.cc:56
TH1I * ecal_fgvb_[2]
Definition: TPGCheck.cc:57
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecal_tp_token_
Definition: TPGCheck.cc:64
TH1I * ecal_et_[2]
Definition: TPGCheck.cc:55
std::vector< std::string > ecal_parts_
Definition: TPGCheck.cc:62
std::string producer_
Definition: TPGCheck.cc:61
TPGCheck::~TPGCheck ( )
override

Definition at line 100 of file TPGCheck.cc.

100  {
101 
102  // do anything here that needs to be done at desctruction time
103  // (e.g. close files, deallocate resources etc.)
104 
105  histFile_->Write();
106  histFile_->Close();
107 }
TFile * histFile_
Definition: TPGCheck.cc:59

Member Function Documentation

void TPGCheck::analyze ( const edm::Event iEvent,
const edm::EventSetup iSetup 
)
overrideprivate

Definition at line 114 of file TPGCheck.cc.

References EcalTriggerPrimitiveDigi::compressedEt(), edmIntegrityCheck::d, EcalTriggerPrimitiveDigi::fineGrain(), edm::Event::getByToken(), mps_fire::i, EcalTriggerPrimitiveDigi::id(), EcalTrigTowerDetId::ietaAbs(), edm::Handle< T >::product(), edm::SortedCollection< T, SORT >::size(), EcalTrigTowerDetId::subDet(), and EcalTriggerPrimitiveDigi::ttFlag().

115  {
116 
117  // Get input
119  iEvent.getByToken(ecal_tp_token_, tp);
120  for (unsigned int i = 0; i < tp.product()->size(); i++) {
121  EcalTriggerPrimitiveDigi d = (*(tp.product()))[i];
122  int subdet = d.id().subDet() - 1;
123  // for endcap, regroup double TP-s that are generated for the 2 interior
124  // rings
125  if (subdet == 0) {
126  ecal_et_[subdet]->Fill(d.compressedEt());
127  } else {
128  if (d.id().ietaAbs() == 27 || d.id().ietaAbs() == 28) {
129  if (i % 2)
130  ecal_et_[subdet]->Fill(d.compressedEt() * 2.);
131  } else
132  ecal_et_[subdet]->Fill(d.compressedEt());
133  }
134  ecal_tt_[subdet]->Fill(d.ttFlag());
135  ecal_fgvb_[subdet]->Fill(d.fineGrain());
136  }
137 }
TH1I * ecal_tt_[2]
Definition: TPGCheck.cc:56
bool getByToken(EDGetToken token, Handle< PROD > &result) const
Definition: Event.h:517
TH1I * ecal_fgvb_[2]
Definition: TPGCheck.cc:57
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecal_tp_token_
Definition: TPGCheck.cc:64
int compressedEt() const
get the encoded/compressed Et of interesting sample
int ietaAbs() const
get the absolute value of the tower ieta
const EcalTrigTowerDetId & id() const
T const * product() const
Definition: Handle.h:74
EcalSubdetector subDet() const
get the subDetector associated to the Trigger Tower
size_type size() const
TH1I * ecal_et_[2]
Definition: TPGCheck.cc:55
bool fineGrain() const
get the fine-grain bit of interesting sample
int ttFlag() const
get the Trigger tower Flag of interesting sample
void TPGCheck::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 141 of file TPGCheck.cc.

141 {}
void TPGCheck::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 145 of file TPGCheck.cc.

References DEFINE_FWK_MODULE, and mps_fire::i.

145  {
146  for (unsigned int i = 0; i < 2; ++i) {
147  ecal_et_[i]->Write();
148  ecal_tt_[i]->Write();
149  ecal_fgvb_[i]->Write();
150  }
151 }
TH1I * ecal_tt_[2]
Definition: TPGCheck.cc:56
TH1I * ecal_fgvb_[2]
Definition: TPGCheck.cc:57
TH1I * ecal_et_[2]
Definition: TPGCheck.cc:55

Member Data Documentation

TH1I* TPGCheck::ecal_et_[2]
private

Definition at line 55 of file TPGCheck.cc.

TH1I* TPGCheck::ecal_fgvb_[2]
private

Definition at line 57 of file TPGCheck.cc.

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

Definition at line 62 of file TPGCheck.cc.

edm::EDGetTokenT<EcalTrigPrimDigiCollection> TPGCheck::ecal_tp_token_
private

Definition at line 64 of file TPGCheck.cc.

TH1I* TPGCheck::ecal_tt_[2]
private

Definition at line 56 of file TPGCheck.cc.

TFile* TPGCheck::histFile_
private

Definition at line 59 of file TPGCheck.cc.

std::string TPGCheck::label_
private
std::string TPGCheck::producer_
private

Definition at line 61 of file TPGCheck.cc.