CMS 3D CMS Logo

List of all members | Public Member Functions | Static Public Member Functions | Private Member Functions | Private Attributes | Static Private Attributes
l1t::L1TZDCAnalyzer Class Reference
Inheritance diagram for l1t::L1TZDCAnalyzer:
edm::one::EDAnalyzer< edm::one::SharedResources > edm::one::EDAnalyzerBase edm::EDConsumerBase

Public Member Functions

 L1TZDCAnalyzer (const edm::ParameterSet &)
 
 ~L1TZDCAnalyzer () override=default
 
- Public Member Functions inherited from edm::one::EDAnalyzer< edm::one::SharedResources >
 EDAnalyzer ()=default
 
 EDAnalyzer (const EDAnalyzer &)=delete
 
SerialTaskQueueglobalLuminosityBlocksQueue () final
 
SerialTaskQueueglobalRunsQueue () final
 
const EDAnalyzeroperator= (const EDAnalyzer &)=delete
 
bool wantsGlobalLuminosityBlocks () const noexcept final
 
bool wantsGlobalRuns () const noexcept final
 
bool wantsInputProcessBlocks () const noexcept final
 
bool wantsProcessBlocks () const noexcept 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 noexcept
 
bool wantsStreamRuns () const noexcept
 
 ~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
 
ESResolverIndex const * esGetTokenIndices (edm::Transition iTrans) const
 
std::vector< ESResolverIndex > 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
 
void selectInputProcessBlocks (ProductRegistry const &productRegistry, ProcessBlockHelperBase const &processBlockHelperBase)
 
ProductResolverIndexAndSkipBit uncheckedIndexFrom (EDGetToken) const
 
void updateLookup (BranchType iBranchType, ProductResolverIndexHelper const &, bool iPrefetchMayGet)
 
void updateLookup (eventsetup::ESRecordsToProductResolverIndices const &)
 
virtual ~EDConsumerBase () noexcept(false)
 

Static Public Member Functions

static void fillDescriptions (edm::ConfigurationDescriptions &descriptions)
 
- Static Public Member Functions inherited from edm::one::EDAnalyzerBase
static const std::string & baseType ()
 
static void fillDescriptions (ConfigurationDescriptions &descriptions)
 
static void prevalidate (ConfigurationDescriptions &descriptions)
 

Private Member Functions

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

Private Attributes

bool doHistos_
 
float etSumZdcM_ [maxBPX_]
 
float etSumZdcP_ [maxBPX_]
 
TTree * etSumZdcTree_
 
TFileDirectory evtDispDir_
 
edm::Service< TFileServicefs_
 
edm::EDGetToken sumToken_
 

Static Private Attributes

static const int maxBPX_ = 5
 

Additional Inherited Members

- Public Types inherited from edm::one::EDAnalyzerBase
typedef EDAnalyzerBase ModuleType
 
- Public Types inherited from edm::EDConsumerBase
typedef ProductLabels Labels
 
- 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 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

Definition at line 35 of file L1TZDCAnalyzer.cc.

Constructor & Destructor Documentation

◆ L1TZDCAnalyzer()

l1t::L1TZDCAnalyzer::L1TZDCAnalyzer ( const edm::ParameterSet iConfig)
explicit

Definition at line 76 of file L1TZDCAnalyzer.cc.

References edm::ParameterSet::getParameter(), TFileService::kSharedResource, edm::InputTag::label(), and sumToken_.

77  : doHistos_(iConfig.getUntrackedParameter<bool>("doHistos", true)) {
78  usesResource(TFileService::kSharedResource);
79  //now do what ever initialization is needed
80 
81  // register what you consume and keep token for later access:
82  edm::InputTag nullTag("None");
83 
84  edm::InputTag sumTag = iConfig.getParameter<edm::InputTag>("etSumTag");
85  sumToken_ = consumes<l1t::EtSumBxCollection>(sumTag);
86 
87  edm::LogInfo("L1TZDCAnalyzer") << "Processing " << sumTag.label() << std::endl;
88  }
static const std::string kSharedResource
Definition: TFileService.h:76
T getParameter(std::string const &) const
Definition: ParameterSet.h:307
edm::EDGetToken sumToken_
std::string const & label() const
Definition: InputTag.h:36
T getUntrackedParameter(std::string const &, T const &) const
Log< level::Info, false > LogInfo

◆ ~L1TZDCAnalyzer()

l1t::L1TZDCAnalyzer::~L1TZDCAnalyzer ( )
overridedefault

Member Function Documentation

◆ analyze()

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

Implements edm::one::EDAnalyzerBase.

Definition at line 95 of file L1TZDCAnalyzer.cc.

References etSumZdcM_, etSumZdcP_, etSumZdcTree_, iEvent, L1Analysis::kZDCM, L1Analysis::kZDCP, and sumToken_.

95  {
96  using namespace edm;
97 
98  // Handle<EtSumBxCollection> sums;
100  iEvent.getByToken(sumToken_, sums);
101 
102  int startBX = sums->getFirstBX();
103 
104  for (int ibx = startBX; ibx <= sums->getLastBX(); ++ibx) {
105  for (auto itr = sums->begin(ibx); itr != sums->end(ibx); ++itr) {
106  if (itr->getType() == l1t::EtSum::EtSumType::kZDCP)
107  etSumZdcP_[ibx - startBX] = itr->hwPt();
108  if (itr->getType() == l1t::EtSum::EtSumType::kZDCM)
109  etSumZdcM_[ibx - startBX] = itr->hwPt();
110  }
111  }
112 
113  etSumZdcTree_->Fill();
114  }
float etSumZdcM_[maxBPX_]
edm::EDGetToken sumToken_
int iEvent
Definition: GenABIO.cc:224
float etSumZdcP_[maxBPX_]
HLT enums.

◆ beginJob()

void l1t::L1TZDCAnalyzer::beginJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 117 of file L1TZDCAnalyzer.cc.

References etSumZdcM_, etSumZdcP_, etSumZdcTree_, fs_, TFileService::make(), maxBPX_, and to_string().

117  {
118  etSumZdcTree_ = fs_->make<TTree>("etSumZdcTree", "");
119  etSumZdcTree_->Branch("etSumZdcP", etSumZdcP_, ("etSumZdcP[" + std::to_string(maxBPX_) + "]/F").c_str());
120  etSumZdcTree_->Branch("etSumZdcM", etSumZdcM_, ("etSumZdcM[" + std::to_string(maxBPX_) + "]/F").c_str());
121  }
static const int maxBPX_
edm::Service< TFileService > fs_
float etSumZdcM_[maxBPX_]
static std::string to_string(const XMLCh *ch)
float etSumZdcP_[maxBPX_]
T * make(const Args &...args) const
make new ROOT object
Definition: TFileService.h:64

◆ endJob()

void l1t::L1TZDCAnalyzer::endJob ( void  )
overrideprivatevirtual

Reimplemented from edm::one::EDAnalyzerBase.

Definition at line 124 of file L1TZDCAnalyzer.cc.

124 {}

◆ fillDescriptions()

void l1t::L1TZDCAnalyzer::fillDescriptions ( edm::ConfigurationDescriptions descriptions)
static

Definition at line 127 of file L1TZDCAnalyzer.cc.

References edm::ConfigurationDescriptions::add(), submitPVResolutionJobs::desc, and ProducerED_cfi::InputTag.

127  {
129 
130  desc.add<edm::InputTag>("etSumTag", edm::InputTag("l1tZDCEtSums", ""));
131  descriptions.add("l1tZDCAnalyzer", desc);
132  }
void add(std::string const &label, ParameterSetDescription const &psetDescription)

Member Data Documentation

◆ doHistos_

bool l1t::L1TZDCAnalyzer::doHistos_
private

Definition at line 60 of file L1TZDCAnalyzer.cc.

◆ etSumZdcM_

float l1t::L1TZDCAnalyzer::etSumZdcM_[maxBPX_]
private

Definition at line 55 of file L1TZDCAnalyzer.cc.

Referenced by analyze(), and beginJob().

◆ etSumZdcP_

float l1t::L1TZDCAnalyzer::etSumZdcP_[maxBPX_]
private

Definition at line 54 of file L1TZDCAnalyzer.cc.

Referenced by analyze(), and beginJob().

◆ etSumZdcTree_

TTree* l1t::L1TZDCAnalyzer::etSumZdcTree_
private

Definition at line 50 of file L1TZDCAnalyzer.cc.

Referenced by analyze(), and beginJob().

◆ evtDispDir_

TFileDirectory l1t::L1TZDCAnalyzer::evtDispDir_
private

Definition at line 62 of file L1TZDCAnalyzer.cc.

◆ fs_

edm::Service<TFileService> l1t::L1TZDCAnalyzer::fs_
private

Definition at line 48 of file L1TZDCAnalyzer.cc.

Referenced by beginJob().

◆ maxBPX_

const int l1t::L1TZDCAnalyzer::maxBPX_ = 5
staticprivate

Definition at line 53 of file L1TZDCAnalyzer.cc.

Referenced by beginJob().

◆ sumToken_

edm::EDGetToken l1t::L1TZDCAnalyzer::sumToken_
private

Definition at line 58 of file L1TZDCAnalyzer.cc.

Referenced by analyze(), and L1TZDCAnalyzer().