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 &&)=default
 
 EDConsumerBase (EDConsumerBase const &)=delete
 
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
 
EDConsumerBaseoperator= (EDConsumerBase &&)=default
 
EDConsumerBase const & operator= (EDConsumerBase const &)=delete
 
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::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 wantsInputProcessBlocks ()
 
static bool wantsProcessBlocks ()
 
static bool wantsStreamLuminosityBlocks ()
 
static bool wantsStreamRuns ()
 
- Protected Member Functions inherited from edm::EDConsumerBase
EDGetToken consumes (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > consumes (edm::InputTag const &tag)
 
template<BranchType B = InEvent>
EDConsumerBaseAdaptor< B > consumes (edm::InputTag tag) noexcept
 
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<Transition Tr = Transition::Event>
constexpr auto esConsumes () noexcept
 
template<typename ESProduct , typename ESRecord , Transition Tr = Transition::Event>
auto esConsumes (ESInputTag const &tag)
 
template<Transition Tr = Transition::Event>
auto esConsumes (ESInputTag tag) noexcept
 
template<Transition Tr = Transition::Event>
ESGetTokenGeneric esConsumes (eventsetup::EventSetupRecordKey const &iRecord, eventsetup::DataKey const &iKey)
 Used with EventSetupRecord::doGet. More...
 
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<BranchType B>
EDGetToken mayConsume (const TypeToGet &id, edm::InputTag const &tag)
 
template<typename ProductType , BranchType B = InEvent>
EDGetTokenT< ProductType > mayConsume (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::TPGCheck ( const edm::ParameterSet iConfig)
explicit

Definition at line 70 of file TPGCheck.cc.

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 }

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

◆ ~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 }

Member Function Documentation

◆ analyze()

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

Implements edm::EDAnalyzer.

Definition at line 112 of file TPGCheck.cc.

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 }

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

◆ beginJob()

void TPGCheck::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 137 of file TPGCheck.cc.

137 {}

◆ endJob()

void TPGCheck::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::EDAnalyzer.

Definition at line 141 of file TPGCheck.cc.

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 }

References mps_fire::i.

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.

mps_fire.i
i
Definition: mps_fire.py:428
TPGCheck::ecal_tp_token_
edm::EDGetTokenT< EcalTrigPrimDigiCollection > ecal_tp_token_
Definition: TPGCheck.cc:64
edm::Handle
Definition: AssociativeIterator.h:50
cmsswSequenceInfo.tp
tp
Definition: cmsswSequenceInfo.py:17
TPGCheck::ecal_et_
TH1I * ecal_et_[2]
Definition: TPGCheck.cc:55
TPGCheck::ecal_parts_
std::vector< std::string > ecal_parts_
Definition: TPGCheck.cc:62
iEvent
int iEvent
Definition: GenABIO.cc:224
TPGCheck::producer_
std::string producer_
Definition: TPGCheck.cc:61
AlCaHLTBitMon_QueryRunRegistry.string
string string
Definition: AlCaHLTBitMon_QueryRunRegistry.py:256
TPGCheck::ecal_fgvb_
TH1I * ecal_fgvb_[2]
Definition: TPGCheck.cc:57
EcalTriggerPrimitiveDigi
Definition: EcalTriggerPrimitiveDigi.h:16
TPGCheck::ecal_tt_
TH1I * ecal_tt_[2]
Definition: TPGCheck.cc:56
edm::ParameterSet::getParameter
T getParameter(std::string const &) const
Definition: ParameterSet.h:303
ztail.d
d
Definition: ztail.py:151
TPGCheck::histFile_
TFile * histFile_
Definition: TPGCheck.cc:59
submitPVValidationJobs.t
string t
Definition: submitPVValidationJobs.py:644
edm::InputTag
Definition: InputTag.h:15
TPGCheck::label_
std::string label_
Definition: TPGCheck.cc:60