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::one::EDAnalyzer<> edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 TPGCheck (const edm::ParameterSet &)
 
 ~TPGCheck () 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 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::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: <one line="" class="" summary>="">

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

Definition at line 44 of file TPGCheck.cc.

Constructor & Destructor Documentation

◆ TPGCheck()

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

Definition at line 70 of file TPGCheck.cc.

References edm::ParameterSet::getParameter(), mps_fire::i, HLT_2022v15_cff::InputTag, AlCaHLTBitMon_QueryRunRegistry::string, and submitPVValidationJobs::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");
96  ecal_tp_token_ = consumes<EcalTrigPrimDigiCollection>(edm::InputTag(label_, producer_));
97 }
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
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::~TPGCheck ( )
override

Definition at line 99 of file TPGCheck.cc.

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

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 112 of file TPGCheck.cc.

References ztail::d, mps_fire::i, iEvent, and cmsswSequenceInfo::tp.

112  {
113  // Get input
115  iEvent.getByToken(ecal_tp_token_, tp);
116  for (unsigned int i = 0; i < tp.product()->size(); i++) {
117  EcalTriggerPrimitiveDigi d = (*(tp.product()))[i];
118  int subdet = d.id().subDet() - 1;
119  // for endcap, regroup double TP-s that are generated for the 2 interior
120  // rings
121  if (subdet == 0) {
122  ecal_et_[subdet]->Fill(d.compressedEt());
123  } else {
124  if (d.id().ietaAbs() == 27 || d.id().ietaAbs() == 28) {
125  if (i % 2)
126  ecal_et_[subdet]->Fill(d.compressedEt() * 2.);
127  } else
128  ecal_et_[subdet]->Fill(d.compressedEt());
129  }
130  ecal_tt_[subdet]->Fill(d.ttFlag());
131  ecal_fgvb_[subdet]->Fill(d.fineGrain());
132  }
133 }
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
int iEvent
Definition: GenABIO.cc:224
d
Definition: ztail.py:151
TH1I * ecal_et_[2]
Definition: TPGCheck.cc:55

◆ beginJob()

void TPGCheck::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 137 of file TPGCheck.cc.

137 {}

◆ endJob()

void TPGCheck::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 141 of file TPGCheck.cc.

References mps_fire::i.

141  {
142  for (unsigned int i = 0; i < 2; ++i) {
143  ecal_et_[i]->Write();
144  ecal_tt_[i]->Write();
145  ecal_fgvb_[i]->Write();
146  }
147 }
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

◆ ecal_et_

TH1I* TPGCheck::ecal_et_[2]
private

Definition at line 55 of file TPGCheck.cc.

◆ ecal_fgvb_

TH1I* TPGCheck::ecal_fgvb_[2]
private

Definition at line 57 of file TPGCheck.cc.

◆ ecal_parts_

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

Definition at line 62 of file TPGCheck.cc.

◆ ecal_tp_token_

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

Definition at line 64 of file TPGCheck.cc.

◆ ecal_tt_

TH1I* TPGCheck::ecal_tt_[2]
private

Definition at line 56 of file TPGCheck.cc.

◆ histFile_

TFile* TPGCheck::histFile_
private

Definition at line 59 of file TPGCheck.cc.

◆ label_

std::string TPGCheck::label_
private

◆ producer_

std::string TPGCheck::producer_
private

Definition at line 61 of file TPGCheck.cc.